diff --git a/.changeset/deprecate-clerk-types.md b/.changeset/deprecate-clerk-types.md new file mode 100644 index 00000000000..bafff5d708a --- /dev/null +++ b/.changeset/deprecate-clerk-types.md @@ -0,0 +1,44 @@ +--- +'@clerk/types': minor +'@clerk/shared': minor +'@clerk/astro': patch +'@clerk/backend': patch +'@clerk/chrome-extension': patch +'@clerk/clerk-js': patch +'@clerk/elements': patch +'@clerk/themes': patch +'@clerk/vue': patch +--- + +Deprecate `@clerk/types` in favor of `@clerk/shared/types` + +The `@clerk/types` package is now deprecated. All type definitions have been consolidated and moved to `@clerk/shared/types` to improve consistency across the Clerk ecosystem. + +**Backward Compatibility:** + +The `@clerk/types` package will remain available and will continue to re-export all types from `@clerk/shared/types` to ensure backward compatibility. Existing applications will continue to work without any immediate breaking changes. However, we strongly recommend migrating to `@clerk/shared/types` as new type definitions and updates will only be added to `@clerk/shared/types` starting with the next major release. + +**Migration Steps:** + +Please update your imports from `@clerk/types` to `@clerk/shared/types`: + +```typescript +// Before +import type { ClerkResource, UserResource } from '@clerk/types'; + +// After +import type { ClerkResource, UserResource } from '@clerk/shared/types'; +``` + +**What Changed:** + +All type definitions including: +- Resource types (User, Organization, Session, etc.) +- API response types +- Configuration types +- Authentication types +- Error types +- And all other shared types + +Have been moved from `packages/types/src` to `packages/shared/src/types` and are now exported via `@clerk/shared/types`. + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b14d83bd02..d3328576cb1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ concurrency: jobs: # Check triggering actor permissions to prevent PRs from forks accessing secrets by default, preventing them from exfiltrating secrets for malicious purposes check-permissions: - runs-on: 'blacksmith-8vcpu-ubuntu-2204' + runs-on: "blacksmith-8vcpu-ubuntu-2204" defaults: run: shell: bash @@ -48,7 +48,7 @@ jobs: needs: [check-permissions] if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: Formatting | Dedupe | Changeset - runs-on: 'blacksmith-8vcpu-ubuntu-2204' + runs-on: "blacksmith-8vcpu-ubuntu-2204" defaults: run: shell: bash @@ -89,7 +89,7 @@ jobs: needs: [check-permissions] if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} name: Build Packages - runs-on: 'blacksmith-8vcpu-ubuntu-2204' + runs-on: "blacksmith-8vcpu-ubuntu-2204" permissions: contents: read defaults: @@ -135,7 +135,7 @@ jobs: permissions: contents: read actions: write # needed for actions/upload-artifact - runs-on: 'blacksmith-8vcpu-ubuntu-2204' + runs-on: "blacksmith-8vcpu-ubuntu-2204" defaults: run: shell: bash @@ -195,7 +195,7 @@ jobs: permissions: contents: read actions: write # needed for actions/upload-artifact - runs-on: 'blacksmith-8vcpu-ubuntu-2204' + runs-on: "blacksmith-8vcpu-ubuntu-2204" defaults: run: shell: bash @@ -208,10 +208,8 @@ jobs: fail-fast: true matrix: include: - - node-version: 18 - test-filter: '--filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@clerk/nextjs --filter=@clerk/clerk-react --filter=@clerk/shared --filter=@clerk/remix --filter=@clerk/tanstack-react-start --filter=@clerk/elements --filter=@clerk/vue --filter=@clerk/nuxt --filter=@clerk/clerk-expo' - node-version: 22 - test-filter: '**' + test-filter: "**" steps: - name: Checkout Repo @@ -268,7 +266,7 @@ jobs: permissions: contents: read actions: write # needed for actions/upload-artifact - runs-on: 'blacksmith-8vcpu-ubuntu-2204' + runs-on: "blacksmith-8vcpu-ubuntu-2204" defaults: run: shell: bash @@ -277,37 +275,36 @@ jobs: strategy: fail-fast: false matrix: - test-name: - [ - 'generic', - 'express', - 'quickstart', - 'ap-flows', - 'elements', - 'localhost', - 'sessions', - 'sessions:staging', - 'handshake', - 'handshake:staging', - 'astro', - 'expo-web', - 'tanstack-react-start', + test-name: [ + "generic", + "express", + "quickstart", + "ap-flows", + "elements", + "localhost", + "sessions", + "sessions:staging", + "handshake", + "handshake:staging", + "astro", + "expo-web", + "tanstack-react-start", # 'tanstack-react-router', - 'vue', - 'nuxt', - 'react-router', - 'billing', - 'machine', - 'custom', + "vue", + "nuxt", + "react-router", + "billing", + "machine", + "custom", ] - test-project: ['chrome'] + test-project: ["chrome"] include: - - test-name: 'nextjs' - test-project: 'chrome' - next-version: '14' - - test-name: 'nextjs' - test-project: 'chrome' - next-version: '15' + - test-name: "nextjs" + test-project: "chrome" + next-version: "14" + - test-name: "nextjs" + test-project: "chrome" + next-version: "15" steps: - name: Checkout Repo @@ -329,7 +326,7 @@ jobs: id: task-status env: E2E_APP_CLERK_JS_DIR: ${{runner.temp}} - E2E_CLERK_VERSION: 'latest' + E2E_CLERK_VERSION: "latest" E2E_NEXTJS_VERSION: ${{ matrix.next-version }} E2E_PROJECT: ${{ matrix.test-project }} INTEGRATION_INSTANCE_KEYS: ${{ secrets.INTEGRATION_INSTANCE_KEYS }} @@ -374,8 +371,8 @@ jobs: if: ${{ steps.task-status.outputs.affected == '1' }} uses: actions/github-script@v7 env: - INTEGRATION_CERTS: '${{secrets.INTEGRATION_CERTS}}' - INTEGRATION_ROOT_CA: '${{secrets.INTEGRATION_ROOT_CA}}' + INTEGRATION_CERTS: "${{secrets.INTEGRATION_CERTS}}" + INTEGRATION_ROOT_CA: "${{secrets.INTEGRATION_ROOT_CA}}" with: script: | const fs = require('fs'); @@ -400,7 +397,7 @@ jobs: run: pnpm turbo test:integration:${{ matrix.test-name }} $TURBO_ARGS env: E2E_APP_CLERK_JS_DIR: ${{runner.temp}} - E2E_CLERK_VERSION: 'latest' + E2E_CLERK_VERSION: "latest" E2E_NEXTJS_VERSION: ${{ matrix.next-version }} E2E_PROJECT: ${{ matrix.test-project }} E2E_CLERK_ENCRYPTION_KEY: ${{ matrix.clerk-encryption-key }} @@ -420,7 +417,7 @@ jobs: name: Publish with pkg-pr-new if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }} needs: [check-permissions, build-packages] - runs-on: 'blacksmith-8vcpu-ubuntu-2204' + runs-on: "blacksmith-8vcpu-ubuntu-2204" defaults: run: shell: bash diff --git a/.typedoc/__tests__/file-structure.test.ts b/.typedoc/__tests__/file-structure.test.ts index bb658123bc3..a85c13fc087 100644 --- a/.typedoc/__tests__/file-structure.test.ts +++ b/.typedoc/__tests__/file-structure.test.ts @@ -36,7 +36,6 @@ describe('Typedoc output', () => { "clerk-react", "nextjs", "shared", - "types", ] `); }); diff --git a/eslint.config.mjs b/eslint.config.mjs index 8ad097edd9e..a311e9e2ca6 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -120,6 +120,7 @@ export default tseslint.config([ 'packages/backend/src/runtime/**/*', 'packages/clerk-js/rspack.config.js', 'packages/shared/src/compiled/path-to-regexp/index.js', + 'packages/shared/tsdown.config.mjs', ], }, { diff --git a/integration/README.md b/integration/README.md index aa92167377d..e6165c54dd8 100644 --- a/integration/README.md +++ b/integration/README.md @@ -368,7 +368,6 @@ Assuming you have a `react-parcel` template defined in `integration/templates`, ``` Here's what each thing is doing: - - `setName`: Set internal name - `useTemplate`: Define which template inside `integration/templates` to use - `setEnvFormatter`: Define how environment variables should be formatted. The first argument accepts `'public'` and `'private'`. Inside [`envs.ts`](./presets/envs.ts) the environment variables you can use through [`withEnv`](#environment-configs) are defined. Since different frameworks require environment variables to be in different formats (e.g. Next.js wants public env vars to be prefixed with `NEXT_PUBLIC_`) you can use this formatter to change that. diff --git a/integration/templates/expo-web/metro.config.js b/integration/templates/expo-web/metro.config.js index 3c9f25a2d98..f1f3a8a25aa 100644 --- a/integration/templates/expo-web/metro.config.js +++ b/integration/templates/expo-web/metro.config.js @@ -19,6 +19,10 @@ const getClerkExpoPath = () => { return clerkExpoPath.replace('file:', ''); } + if (clerkExpoPath?.startsWith('link:')) { + return clerkExpoPath.replace('link:', ''); + } + return undefined; }; diff --git a/integration/tests/custom-flows/sign-in.test.ts b/integration/tests/custom-flows/sign-in.test.ts index bc14d123e36..c8fe5851790 100644 --- a/integration/tests/custom-flows/sign-in.test.ts +++ b/integration/tests/custom-flows/sign-in.test.ts @@ -1,10 +1,11 @@ -import { expect, test } from '@playwright/test'; import { parsePublishableKey } from '@clerk/shared/keys'; import { clerkSetup } from '@clerk/testing/playwright'; +import { expect, test } from '@playwright/test'; import type { Application } from '../../models/application'; import { appConfigs } from '../../presets'; -import { createTestUtils, FakeUser } from '../../testUtils'; +import type { FakeUser } from '../../testUtils'; +import { createTestUtils } from '../../testUtils'; test.describe('Custom Flows Sign In @custom', () => { test.describe.configure({ mode: 'parallel' }); diff --git a/integration/tests/custom-flows/sign-up.test.ts b/integration/tests/custom-flows/sign-up.test.ts index 55e224121dd..02e16f02051 100644 --- a/integration/tests/custom-flows/sign-up.test.ts +++ b/integration/tests/custom-flows/sign-up.test.ts @@ -1,10 +1,11 @@ -import { expect, test } from '@playwright/test'; import { parsePublishableKey } from '@clerk/shared/keys'; import { clerkSetup } from '@clerk/testing/playwright'; +import { expect, test } from '@playwright/test'; import type { Application } from '../../models/application'; import { appConfigs } from '../../presets'; -import { createTestUtils, FakeUser } from '../../testUtils'; +import type { FakeUser } from '../../testUtils'; +import { createTestUtils } from '../../testUtils'; test.describe('Custom Flows Sign Up @custom', () => { test.describe.configure({ mode: 'parallel' }); diff --git a/package.json b/package.json index 158d0ed4a27..2ef27895ea2 100644 --- a/package.json +++ b/package.json @@ -135,9 +135,11 @@ "react": "catalog:react", "react-dom": "catalog:react", "rimraf": "6.0.1", + "rolldown": "catalog:repo", "statuses": "^1.5.0", "tree-kill": "^1.2.2", "ts-jest": "29.2.5", + "tsdown": "catalog:repo", "tsup": "catalog:repo", "turbo": "^2.5.4", "turbo-ignore": "^2.5.4", @@ -164,10 +166,9 @@ ], "overrides": { "jest": "29.7.0", - "jest-snapshot-prettier": "npm:prettier@^3.5.3" - }, - "patchedDependencies": { - "yalc@1.0.0-pre.53": "patches/yalc@1.0.0-pre.53.patch" + "jest-snapshot-prettier": "npm:prettier@^3.5.3", + "react": "catalog:react", + "react-dom": "catalog:react" } } } diff --git a/packages/agent-toolkit/src/langchain/adapter.ts b/packages/agent-toolkit/src/langchain/adapter.ts index fe4c5ed0bb0..59e1e2192bd 100644 --- a/packages/agent-toolkit/src/langchain/adapter.ts +++ b/packages/agent-toolkit/src/langchain/adapter.ts @@ -8,9 +8,11 @@ import type { SdkAdapter } from '../lib/types'; * For more details, take a look at the LangChain docs https://js.langchain.com/docs/how_to/custom_tools */ export const adapter: SdkAdapter = (clerkClient, context, clerkTool) => { - return tool(clerkTool.bindExecute(clerkClient, context), { + const executeFn = clerkTool.bindExecute(clerkClient, context as any) as any; + const toolConfig = { name: clerkTool.name, description: clerkTool.description, schema: clerkTool.parameters, - }); + } as any; + return tool(executeFn, toolConfig) as StructuredTool; }; diff --git a/packages/astro/src/stores/external.ts b/packages/astro/src/stores/external.ts index 5805088f0c9..c5516fd5da1 100644 --- a/packages/astro/src/stores/external.ts +++ b/packages/astro/src/stores/external.ts @@ -1,5 +1,6 @@ import { deriveState } from '@clerk/shared/deriveState'; import { eventMethodCalled } from '@clerk/shared/telemetry'; +import type { SignedInSessionResource } from '@clerk/types'; import { batched, computed, onMount, type Store } from 'nanostores'; import { $clerk, $csrState, $initialState } from './internal'; @@ -51,7 +52,7 @@ export const $userStore = computed([$authStore], auth => auth.user); * @example * $sessionStore.subscribe((session) => console.log(session.id)) */ -export const $sessionStore = computed([$authStore], auth => auth.session); +export const $sessionStore = computed([$authStore], auth => auth.session as SignedInSessionResource | null | undefined); /** * A client side store that is populated after clerk-js has loaded. diff --git a/packages/backend/src/util/shared.ts b/packages/backend/src/util/shared.ts index f588a1d57fa..6df64247a52 100644 --- a/packages/backend/src/util/shared.ts +++ b/packages/backend/src/util/shared.ts @@ -1,13 +1,13 @@ -export { addClerkPrefix, getScriptUrl, getClerkJsMajorVersionOrTag } from '@clerk/shared/url'; -export { retry } from '@clerk/shared/retry'; +export { deprecated, deprecatedProperty } from '@clerk/shared/deprecated'; export { + getCookieSuffix, + getSuffixedCookieName, isDevelopmentFromSecretKey, isProductionFromSecretKey, parsePublishableKey, - getCookieSuffix, - getSuffixedCookieName, } from '@clerk/shared/keys'; -export { deprecated, deprecatedProperty } from '@clerk/shared/deprecated'; +export { retry } from '@clerk/shared/retry'; +export { addClerkPrefix, getClerkJsMajorVersionOrTag, getScriptUrl } from '@clerk/shared/url'; import { buildErrorThrower } from '@clerk/shared/error'; import { createDevOrStagingUrlCache } from '@clerk/shared/keys'; diff --git a/packages/chrome-extension/README.md b/packages/chrome-extension/README.md index b714a13fefc..6eb1010e31a 100644 --- a/packages/chrome-extension/README.md +++ b/packages/chrome-extension/README.md @@ -69,7 +69,6 @@ Please see the latest extension [authentication support matrix](https://clerk.co 1. [**Base configuration**:](/packages/chrome-extension/docs/manifest.md#base-configuration) Use this if you plan to only use Clerk in the context of the extension. 2. [**Session sync configuration**:](/packages/chrome-extension/docs/manifest.md#sync-host-configuration) Use this if you plan to share authentication with a website in the same browser. 6. **Add Clerk to your app:** Though not required, we generally suggest using Plasmo for browser extension development. This will enforce common standards across your extension as well as allow for easier integration with other browsers in the future. - 1. [**Via `ClerkProvider`:**](/packages/chrome-extension/docs/clerk-provider.md) This is the general approach to all extensions. From here you'll be able to support extension-only authentication as well as sharing authentication with a website in the same browser. 2. [**Via service workers**:](/packages/chrome-extension/docs/service-workers.md) If you also require the use of background service workers, this will allow you to access the Clerk client from the extension context. diff --git a/packages/chrome-extension/tsconfig.json b/packages/chrome-extension/tsconfig.json index 35a77fee5e1..904ccc83d88 100644 --- a/packages/chrome-extension/tsconfig.json +++ b/packages/chrome-extension/tsconfig.json @@ -9,8 +9,8 @@ "strict": true, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, - "module": "esnext", - "moduleResolution": "node", + "module": "nodenext", + "moduleResolution": "nodenext", "resolveJsonModule": true, "isolatedModules": true, "jsx": "react-jsx", diff --git a/packages/clerk-js/bundlewatch.config.json b/packages/clerk-js/bundlewatch.config.json index 86aed3c552c..5ce16e56d81 100644 --- a/packages/clerk-js/bundlewatch.config.json +++ b/packages/clerk-js/bundlewatch.config.json @@ -1,13 +1,13 @@ { "files": [ - { "path": "./dist/clerk.js", "maxSize": "821KB" }, + { "path": "./dist/clerk.js", "maxSize": "840KB" }, { "path": "./dist/clerk.browser.js", "maxSize": "81KB" }, { "path": "./dist/clerk.channel.browser.js", "maxSize": "81KB" }, { "path": "./dist/clerk.legacy.browser.js", "maxSize": "123KB" }, { "path": "./dist/clerk.headless*.js", "maxSize": "63KB" }, { "path": "./dist/ui-common*.js", "maxSize": "117.1KB" }, { "path": "./dist/ui-common*.legacy.*.js", "maxSize": "120KB" }, - { "path": "./dist/vendors*.js", "maxSize": "45KB" }, + { "path": "./dist/vendors*.js", "maxSize": "47KB" }, { "path": "./dist/coinbase*.js", "maxSize": "38KB" }, { "path": "./dist/stripe-vendors*.js", "maxSize": "1KB" }, { "path": "./dist/createorganization*.js", "maxSize": "5KB" }, diff --git a/packages/clerk-js/package.json b/packages/clerk-js/package.json index 04977694c18..391a8aabdb9 100644 --- a/packages/clerk-js/package.json +++ b/packages/clerk-js/package.json @@ -63,7 +63,6 @@ "@base-org/account": "2.0.1", "@clerk/localizations": "workspace:^", "@clerk/shared": "workspace:^", - "@clerk/types": "workspace:^", "@coinbase/wallet-sdk": "4.3.0", "@emotion/cache": "11.11.0", "@emotion/react": "11.11.1", diff --git a/packages/clerk-js/src/core/__tests__/clerk.test.ts b/packages/clerk-js/src/core/__tests__/clerk.test.ts index 3e848d8d07a..1cccffbbcd8 100644 --- a/packages/clerk-js/src/core/__tests__/clerk.test.ts +++ b/packages/clerk-js/src/core/__tests__/clerk.test.ts @@ -6,7 +6,7 @@ import type { SignInJSON, SignUpJSON, TokenResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { waitFor } from '@testing-library/react'; import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, test, vi } from 'vitest'; diff --git a/packages/clerk-js/src/core/__tests__/fapiClient.test.ts b/packages/clerk-js/src/core/__tests__/fapiClient.test.ts index cb9f6d59717..5de3432bdd5 100644 --- a/packages/clerk-js/src/core/__tests__/fapiClient.test.ts +++ b/packages/clerk-js/src/core/__tests__/fapiClient.test.ts @@ -1,4 +1,4 @@ -import type { InstanceType } from '@clerk/types'; +import type { InstanceType } from '@clerk/shared/types'; import { afterAll, beforeAll, beforeEach, describe, expect, it, type Mock, vi } from 'vitest'; import { SUPPORTED_FAPI_VERSION } from '../constants'; diff --git a/packages/clerk-js/src/core/__tests__/tokenCache.test.ts b/packages/clerk-js/src/core/__tests__/tokenCache.test.ts index 87525e8ee04..accf272dc66 100644 --- a/packages/clerk-js/src/core/__tests__/tokenCache.test.ts +++ b/packages/clerk-js/src/core/__tests__/tokenCache.test.ts @@ -1,4 +1,4 @@ -import type { TokenResource } from '@clerk/types'; +import type { TokenResource } from '@clerk/shared/types'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { mockJwt } from '@/test/core-fixtures'; diff --git a/packages/clerk-js/src/core/auth/AuthCookieService.ts b/packages/clerk-js/src/core/auth/AuthCookieService.ts index 932b639b1ba..7237c61c45d 100644 --- a/packages/clerk-js/src/core/auth/AuthCookieService.ts +++ b/packages/clerk-js/src/core/auth/AuthCookieService.ts @@ -3,8 +3,8 @@ import { clerkEvents } from '@clerk/shared/clerkEventBus'; import type { createCookieHandler } from '@clerk/shared/cookie'; import { setDevBrowserJWTInURL } from '@clerk/shared/devBrowser'; import { is4xxError, isClerkAPIResponseError, isClerkRuntimeError, isNetworkError } from '@clerk/shared/error'; +import type { Clerk, InstanceType } from '@clerk/shared/types'; import { noop } from '@clerk/shared/utils'; -import type { Clerk, InstanceType } from '@clerk/types'; import { clerkMissingDevBrowserJwt } from '../errors'; import { eventBus, events } from '../events'; diff --git a/packages/clerk-js/src/core/auth/cookies/clientUat.ts b/packages/clerk-js/src/core/auth/cookies/clientUat.ts index 9ffec6e1456..a6d11bdd5a7 100644 --- a/packages/clerk-js/src/core/auth/cookies/clientUat.ts +++ b/packages/clerk-js/src/core/auth/cookies/clientUat.ts @@ -1,7 +1,7 @@ import { createCookieHandler } from '@clerk/shared/cookie'; import { addYears } from '@clerk/shared/date'; import { getSuffixedCookieName } from '@clerk/shared/keys'; -import type { ClientResource } from '@clerk/types'; +import type { ClientResource } from '@clerk/shared/types'; import { inCrossOriginIframe } from '../../../utils'; import { getCookieDomain } from '../getCookieDomain'; diff --git a/packages/clerk-js/src/core/auth/devBrowser.ts b/packages/clerk-js/src/core/auth/devBrowser.ts index 2d5e3cb644e..c8a498f599d 100644 --- a/packages/clerk-js/src/core/auth/devBrowser.ts +++ b/packages/clerk-js/src/core/auth/devBrowser.ts @@ -1,6 +1,6 @@ import { DEV_BROWSER_JWT_HEADER, extractDevBrowserJWTFromURL, setDevBrowserJWTInURL } from '@clerk/shared/devBrowser'; import { parseErrors } from '@clerk/shared/error'; -import type { ClerkAPIErrorJSON } from '@clerk/types'; +import type { ClerkAPIErrorJSON } from '@clerk/shared/types'; import { isDevOrStagingUrl } from '../../utils'; import { clerkErrorDevInitFailed } from '../errors'; diff --git a/packages/clerk-js/src/core/clerk.ts b/packages/clerk-js/src/core/clerk.ts index 10cfbc6eec0..e68823116c3 100644 --- a/packages/clerk-js/src/core/clerk.ts +++ b/packages/clerk-js/src/core/clerk.ts @@ -19,8 +19,6 @@ import { eventThemeUsage, TelemetryCollector, } from '@clerk/shared/telemetry'; -import { addClerkPrefix, isAbsoluteUrl, stripScheme } from '@clerk/shared/url'; -import { allSettled, handleValueOrFn, noop } from '@clerk/shared/utils'; import type { __experimental_CheckoutInstance, __experimental_CheckoutOptions, @@ -93,7 +91,9 @@ import type { WaitlistProps, WaitlistResource, Web3Provider, -} from '@clerk/types'; +} from '@clerk/shared/types'; +import { addClerkPrefix, isAbsoluteUrl, stripScheme } from '@clerk/shared/url'; +import { allSettled, handleValueOrFn, noop } from '@clerk/shared/utils'; import { debugLogger, initDebugLogger } from '@/utils/debug'; diff --git a/packages/clerk-js/src/core/constants.ts b/packages/clerk-js/src/core/constants.ts index dac4f71a494..98cd6bdcce9 100644 --- a/packages/clerk-js/src/core/constants.ts +++ b/packages/clerk-js/src/core/constants.ts @@ -1,4 +1,4 @@ -import type { SignUpModes } from '@clerk/types'; +import type { SignUpModes } from '@clerk/shared/types'; // TODO: Do we still have a use for this or can we simply preserve all params? export const PRESERVED_QUERYSTRING_PARAMS = [ diff --git a/packages/clerk-js/src/core/events.ts b/packages/clerk-js/src/core/events.ts index 6fb12dc2fa1..a4071653504 100644 --- a/packages/clerk-js/src/core/events.ts +++ b/packages/clerk-js/src/core/events.ts @@ -1,5 +1,5 @@ import { createEventBus } from '@clerk/shared/eventBus'; -import type { TokenResource } from '@clerk/types'; +import type { TokenResource } from '@clerk/shared/types'; import type { BaseResource } from './resources/Base'; diff --git a/packages/clerk-js/src/core/fapiClient.ts b/packages/clerk-js/src/core/fapiClient.ts index 26f268a12f7..7d03e620c27 100644 --- a/packages/clerk-js/src/core/fapiClient.ts +++ b/packages/clerk-js/src/core/fapiClient.ts @@ -1,7 +1,7 @@ import { isBrowserOnline } from '@clerk/shared/browser'; import { retry } from '@clerk/shared/retry'; +import type { ClerkAPIErrorJSON, ClientJSON, InstanceType } from '@clerk/shared/types'; import { camelToSnake } from '@clerk/shared/underscore'; -import type { ClerkAPIErrorJSON, ClientJSON, InstanceType } from '@clerk/types'; import { debugLogger } from '@/utils/debug'; diff --git a/packages/clerk-js/src/core/jwt-client.ts b/packages/clerk-js/src/core/jwt-client.ts index 7de4e84f84f..1eb19a24b63 100644 --- a/packages/clerk-js/src/core/jwt-client.ts +++ b/packages/clerk-js/src/core/jwt-client.ts @@ -7,7 +7,7 @@ import type { SessionJSON, TokenJSON, UserJSON, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { Token } from './resources'; import { Client } from './resources/Client'; diff --git a/packages/clerk-js/src/core/modules/apiKeys/index.ts b/packages/clerk-js/src/core/modules/apiKeys/index.ts index 09849c78fc2..fcf2b20497e 100644 --- a/packages/clerk-js/src/core/modules/apiKeys/index.ts +++ b/packages/clerk-js/src/core/modules/apiKeys/index.ts @@ -6,7 +6,7 @@ import type { CreateAPIKeyParams, GetAPIKeysParams, RevokeAPIKeyParams, -} from '@clerk/types'; +} from '@clerk/shared/types'; import type { FapiRequestInit } from '@/core/fapiClient'; diff --git a/packages/clerk-js/src/core/modules/billing/namespace.ts b/packages/clerk-js/src/core/modules/billing/namespace.ts index cb61eef0f88..a9bb9c307de 100644 --- a/packages/clerk-js/src/core/modules/billing/namespace.ts +++ b/packages/clerk-js/src/core/modules/billing/namespace.ts @@ -15,7 +15,7 @@ import type { GetPlansParams, GetStatementsParams, GetSubscriptionParams, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { convertPageToOffsetSearchParams } from '../../../utils/convertPageToOffsetSearchParams'; import { diff --git a/packages/clerk-js/src/core/modules/billing/payment-source-methods.ts b/packages/clerk-js/src/core/modules/billing/payment-source-methods.ts index ec8b065347d..e57eac794d7 100644 --- a/packages/clerk-js/src/core/modules/billing/payment-source-methods.ts +++ b/packages/clerk-js/src/core/modules/billing/payment-source-methods.ts @@ -5,7 +5,7 @@ import type { ClerkPaginatedResponse, GetPaymentMethodsParams, InitializePaymentMethodParams, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { convertPageToOffsetSearchParams } from '../../../utils/convertPageToOffsetSearchParams'; import { BaseResource, BillingInitializedPaymentMethod, BillingPaymentMethod } from '../../resources/internal'; diff --git a/packages/clerk-js/src/core/modules/checkout/__tests__/manager.test.ts b/packages/clerk-js/src/core/modules/checkout/__tests__/manager.test.ts index 9c0b0a101a1..f6b667ea0b7 100644 --- a/packages/clerk-js/src/core/modules/checkout/__tests__/manager.test.ts +++ b/packages/clerk-js/src/core/modules/checkout/__tests__/manager.test.ts @@ -1,4 +1,4 @@ -import type { BillingCheckoutResource, ClerkAPIResponseError } from '@clerk/types'; +import type { BillingCheckoutResource, ClerkAPIResponseError } from '@clerk/shared/types'; import type { MockedFunction } from 'vitest'; import { beforeEach, describe, expect, it, vi } from 'vitest'; diff --git a/packages/clerk-js/src/core/modules/checkout/instance.ts b/packages/clerk-js/src/core/modules/checkout/instance.ts index cd8ad389a34..8b28b694f10 100644 --- a/packages/clerk-js/src/core/modules/checkout/instance.ts +++ b/packages/clerk-js/src/core/modules/checkout/instance.ts @@ -3,7 +3,7 @@ import type { __experimental_CheckoutInstance, __experimental_CheckoutOptions, SetActiveNavigate, -} from '@clerk/types'; +} from '@clerk/shared/types'; import type { Clerk } from '../../clerk'; import { type CheckoutKey, createCheckoutManager } from './manager'; diff --git a/packages/clerk-js/src/core/modules/checkout/manager.ts b/packages/clerk-js/src/core/modules/checkout/manager.ts index d41dc497de5..e0b5960038b 100644 --- a/packages/clerk-js/src/core/modules/checkout/manager.ts +++ b/packages/clerk-js/src/core/modules/checkout/manager.ts @@ -3,7 +3,7 @@ import type { __experimental_CheckoutInstance, BillingCheckoutResource, ClerkAPIResponseError, -} from '@clerk/types'; +} from '@clerk/shared/types'; type CheckoutKey = string & { readonly __tag: 'CheckoutKey' }; diff --git a/packages/clerk-js/src/core/modules/debug/transports/telemetry.ts b/packages/clerk-js/src/core/modules/debug/transports/telemetry.ts index 487eb57e32b..68ba9d10ffa 100644 --- a/packages/clerk-js/src/core/modules/debug/transports/telemetry.ts +++ b/packages/clerk-js/src/core/modules/debug/transports/telemetry.ts @@ -1,4 +1,4 @@ -import type { TelemetryCollector } from '@clerk/types'; +import type { TelemetryCollector } from '@clerk/shared/types'; import type { DebugLogEntry, DebugLogLevel, DebugTransport } from '../types'; diff --git a/packages/clerk-js/src/core/resources/APIKey.ts b/packages/clerk-js/src/core/resources/APIKey.ts index 502eeb098b2..240708b6710 100644 --- a/packages/clerk-js/src/core/resources/APIKey.ts +++ b/packages/clerk-js/src/core/resources/APIKey.ts @@ -1,4 +1,4 @@ -import type { ApiKeyJSON, APIKeyResource } from '@clerk/types'; +import type { ApiKeyJSON, APIKeyResource } from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/APIKeySettings.ts b/packages/clerk-js/src/core/resources/APIKeySettings.ts index d21ff5fe84f..59997864544 100644 --- a/packages/clerk-js/src/core/resources/APIKeySettings.ts +++ b/packages/clerk-js/src/core/resources/APIKeySettings.ts @@ -1,4 +1,4 @@ -import type { APIKeysSettingsJSON, APIKeysSettingsJSONSnapshot, APIKeysSettingsResource } from '@clerk/types'; +import type { APIKeysSettingsJSON, APIKeysSettingsJSONSnapshot, APIKeysSettingsResource } from '@clerk/shared/types'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/AuthConfig.ts b/packages/clerk-js/src/core/resources/AuthConfig.ts index 3c12311acf6..b95dfaf5ba2 100644 --- a/packages/clerk-js/src/core/resources/AuthConfig.ts +++ b/packages/clerk-js/src/core/resources/AuthConfig.ts @@ -1,4 +1,4 @@ -import type { AuthConfigJSON, AuthConfigJSONSnapshot, AuthConfigResource, PhoneCodeChannel } from '@clerk/types'; +import type { AuthConfigJSON, AuthConfigJSONSnapshot, AuthConfigResource, PhoneCodeChannel } from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/BackupCode.ts b/packages/clerk-js/src/core/resources/BackupCode.ts index a861a8b69ce..47584573192 100644 --- a/packages/clerk-js/src/core/resources/BackupCode.ts +++ b/packages/clerk-js/src/core/resources/BackupCode.ts @@ -1,4 +1,4 @@ -import type { BackupCodeJSON, BackupCodeResource } from '@clerk/types'; +import type { BackupCodeJSON, BackupCodeResource } from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/Base.ts b/packages/clerk-js/src/core/resources/Base.ts index 89b85e53864..a7d1461aa10 100644 --- a/packages/clerk-js/src/core/resources/Base.ts +++ b/packages/clerk-js/src/core/resources/Base.ts @@ -1,7 +1,12 @@ import { isValidBrowserOnline } from '@clerk/shared/browser'; import { ClerkAPIResponseError, ClerkRuntimeError } from '@clerk/shared/error'; import { isProductionFromPublishableKey } from '@clerk/shared/keys'; -import type { ClerkAPIErrorJSON, ClerkResourceJSON, ClerkResourceReloadParams, DeletedObjectJSON } from '@clerk/types'; +import type { + ClerkAPIErrorJSON, + ClerkResourceJSON, + ClerkResourceReloadParams, + DeletedObjectJSON, +} from '@clerk/shared/types'; import { clerkMissingFapiClientInResources } from '../errors'; import type { FapiClient, FapiRequestInit, FapiResponse, FapiResponseJSON, HTTPMethod } from '../fapiClient'; diff --git a/packages/clerk-js/src/core/resources/BillingCheckout.ts b/packages/clerk-js/src/core/resources/BillingCheckout.ts index 81b052a5d1f..0885e346e44 100644 --- a/packages/clerk-js/src/core/resources/BillingCheckout.ts +++ b/packages/clerk-js/src/core/resources/BillingCheckout.ts @@ -8,7 +8,7 @@ import type { BillingPaymentMethodResource, BillingSubscriptionPlanPeriod, ConfirmCheckoutParams, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { unixEpochToDate } from '@/utils/date'; diff --git a/packages/clerk-js/src/core/resources/BillingPayer.ts b/packages/clerk-js/src/core/resources/BillingPayer.ts index 67eafb0588a..2fc855a13f5 100644 --- a/packages/clerk-js/src/core/resources/BillingPayer.ts +++ b/packages/clerk-js/src/core/resources/BillingPayer.ts @@ -1,4 +1,4 @@ -import type { BillingPayerJSON, BillingPayerResource } from '@clerk/types'; +import type { BillingPayerJSON, BillingPayerResource } from '@clerk/shared/types'; import { unixEpochToDate } from '@/utils/date'; diff --git a/packages/clerk-js/src/core/resources/BillingPayment.ts b/packages/clerk-js/src/core/resources/BillingPayment.ts index a38c4825e02..23eacd2ac29 100644 --- a/packages/clerk-js/src/core/resources/BillingPayment.ts +++ b/packages/clerk-js/src/core/resources/BillingPayment.ts @@ -6,7 +6,7 @@ import type { BillingPaymentResource, BillingPaymentStatus, BillingSubscriptionItemResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { billingMoneyAmountFromJSON } from '../../utils'; import { unixEpochToDate } from '../../utils/date'; diff --git a/packages/clerk-js/src/core/resources/BillingPaymentMethod.ts b/packages/clerk-js/src/core/resources/BillingPaymentMethod.ts index 7d2cc33843b..74e0c4a047e 100644 --- a/packages/clerk-js/src/core/resources/BillingPaymentMethod.ts +++ b/packages/clerk-js/src/core/resources/BillingPaymentMethod.ts @@ -7,7 +7,7 @@ import type { DeletedObjectJSON, MakeDefaultPaymentMethodParams, RemovePaymentMethodParams, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { Billing } from '@/core/modules/billing'; diff --git a/packages/clerk-js/src/core/resources/BillingPlan.ts b/packages/clerk-js/src/core/resources/BillingPlan.ts index dfd5f96da9d..875f7146771 100644 --- a/packages/clerk-js/src/core/resources/BillingPlan.ts +++ b/packages/clerk-js/src/core/resources/BillingPlan.ts @@ -1,4 +1,9 @@ -import type { BillingMoneyAmount, BillingPayerResourceType, BillingPlanJSON, BillingPlanResource } from '@clerk/types'; +import type { + BillingMoneyAmount, + BillingPayerResourceType, + BillingPlanJSON, + BillingPlanResource, +} from '@clerk/shared/types'; import { billingMoneyAmountFromJSON } from '@/utils/billing'; diff --git a/packages/clerk-js/src/core/resources/BillingStatement.ts b/packages/clerk-js/src/core/resources/BillingStatement.ts index aa52c6aea1e..7126987beef 100644 --- a/packages/clerk-js/src/core/resources/BillingStatement.ts +++ b/packages/clerk-js/src/core/resources/BillingStatement.ts @@ -4,7 +4,7 @@ import type { BillingStatementResource, BillingStatementStatus, BillingStatementTotals, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { billingTotalsFromJSON } from '../../utils'; import { unixEpochToDate } from '../../utils/date'; diff --git a/packages/clerk-js/src/core/resources/BillingSubscription.ts b/packages/clerk-js/src/core/resources/BillingSubscription.ts index 3c9e973336f..5a8c44e0987 100644 --- a/packages/clerk-js/src/core/resources/BillingSubscription.ts +++ b/packages/clerk-js/src/core/resources/BillingSubscription.ts @@ -8,7 +8,7 @@ import type { BillingSubscriptionStatus, CancelSubscriptionParams, DeletedObjectJSON, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { unixEpochToDate } from '@/utils/date'; @@ -60,6 +60,7 @@ export class BillingSubscription extends BaseResource implements BillingSubscrip export class BillingSubscriptionItem extends BaseResource implements BillingSubscriptionItemResource { id!: string; + paymentMethodId!: string; plan!: BillingPlan; planPeriod!: BillingSubscriptionPlanPeriod; status!: BillingSubscriptionStatus; @@ -86,6 +87,7 @@ export class BillingSubscriptionItem extends BaseResource implements BillingSubs } this.id = data.id; + this.paymentMethodId = data.payment_method_id; this.plan = new BillingPlan(data.plan); this.planPeriod = data.plan_period; this.status = data.status; diff --git a/packages/clerk-js/src/core/resources/Client.ts b/packages/clerk-js/src/core/resources/Client.ts index 4615e4b85fe..3371b8435c0 100644 --- a/packages/clerk-js/src/core/resources/Client.ts +++ b/packages/clerk-js/src/core/resources/Client.ts @@ -7,7 +7,7 @@ import type { SignedInSessionResource, SignInResource, SignUpResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { SessionTokenCache } from '../tokenCache'; diff --git a/packages/clerk-js/src/core/resources/CommerceSettings.ts b/packages/clerk-js/src/core/resources/CommerceSettings.ts index 4a543ec9ea3..9c95b836bfe 100644 --- a/packages/clerk-js/src/core/resources/CommerceSettings.ts +++ b/packages/clerk-js/src/core/resources/CommerceSettings.ts @@ -1,4 +1,4 @@ -import type { CommerceSettingsJSON, CommerceSettingsJSONSnapshot, CommerceSettingsResource } from '@clerk/types'; +import type { CommerceSettingsJSON, CommerceSettingsJSONSnapshot, CommerceSettingsResource } from '@clerk/shared/types'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/DeletedObject.ts b/packages/clerk-js/src/core/resources/DeletedObject.ts index e58161a0a8b..aeafa67d478 100644 --- a/packages/clerk-js/src/core/resources/DeletedObject.ts +++ b/packages/clerk-js/src/core/resources/DeletedObject.ts @@ -1,4 +1,4 @@ -import type { DeletedObjectJSON, DeletedObjectResource } from '@clerk/types'; +import type { DeletedObjectJSON, DeletedObjectResource } from '@clerk/shared/types'; export class DeletedObject implements DeletedObjectResource { object = ''; diff --git a/packages/clerk-js/src/core/resources/DisplayConfig.ts b/packages/clerk-js/src/core/resources/DisplayConfig.ts index 453a2bf90de..3ff481c5111 100644 --- a/packages/clerk-js/src/core/resources/DisplayConfig.ts +++ b/packages/clerk-js/src/core/resources/DisplayConfig.ts @@ -7,7 +7,7 @@ import type { DisplayThemeJSON, OAuthStrategy, PreferredSignInStrategy, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/EmailAddress.ts b/packages/clerk-js/src/core/resources/EmailAddress.ts index 5bc5a8fb1f3..796bfe37e16 100644 --- a/packages/clerk-js/src/core/resources/EmailAddress.ts +++ b/packages/clerk-js/src/core/resources/EmailAddress.ts @@ -11,7 +11,7 @@ import type { StartEmailLinkFlowParams, StartEnterpriseSSOLinkFlowParams, VerificationResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { BaseResource, IdentificationLink, Verification } from './internal'; diff --git a/packages/clerk-js/src/core/resources/EnterpriseAccount.ts b/packages/clerk-js/src/core/resources/EnterpriseAccount.ts index 8d258a89d01..e41f63ffb1f 100644 --- a/packages/clerk-js/src/core/resources/EnterpriseAccount.ts +++ b/packages/clerk-js/src/core/resources/EnterpriseAccount.ts @@ -6,7 +6,7 @@ import type { EnterpriseAccountJSONSnapshot, EnterpriseAccountResource, VerificationResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { BaseResource } from './Base'; diff --git a/packages/clerk-js/src/core/resources/Environment.ts b/packages/clerk-js/src/core/resources/Environment.ts index 8ea58a5f0b5..bb8322de994 100644 --- a/packages/clerk-js/src/core/resources/Environment.ts +++ b/packages/clerk-js/src/core/resources/Environment.ts @@ -7,7 +7,7 @@ import type { EnvironmentResource, OrganizationSettingsResource, UserSettingsResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { eventBus, events } from '../../core/events'; import { APIKeySettings } from './APIKeySettings'; diff --git a/packages/clerk-js/src/core/resources/ExternalAccount.ts b/packages/clerk-js/src/core/resources/ExternalAccount.ts index 22d3d1a8a2c..9f7d0dc90e1 100644 --- a/packages/clerk-js/src/core/resources/ExternalAccount.ts +++ b/packages/clerk-js/src/core/resources/ExternalAccount.ts @@ -1,4 +1,3 @@ -import { titleize } from '@clerk/shared/underscore'; import type { ExternalAccountJSON, ExternalAccountJSONSnapshot, @@ -6,7 +5,8 @@ import type { OAuthProvider, ReauthorizeExternalAccountParams, VerificationResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; +import { titleize } from '@clerk/shared/underscore'; import { BaseResource } from './Base'; import { Verification } from './Verification'; diff --git a/packages/clerk-js/src/core/resources/Feature.ts b/packages/clerk-js/src/core/resources/Feature.ts index 6b46c351b85..727931fc979 100644 --- a/packages/clerk-js/src/core/resources/Feature.ts +++ b/packages/clerk-js/src/core/resources/Feature.ts @@ -1,4 +1,4 @@ -import type { FeatureJSON, FeatureResource } from '@clerk/types'; +import type { FeatureJSON, FeatureResource } from '@clerk/shared/types'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/IdentificationLink.ts b/packages/clerk-js/src/core/resources/IdentificationLink.ts index 72c497906a6..1b5384b121e 100644 --- a/packages/clerk-js/src/core/resources/IdentificationLink.ts +++ b/packages/clerk-js/src/core/resources/IdentificationLink.ts @@ -1,4 +1,8 @@ -import type { IdentificationLinkJSON, IdentificationLinkJSONSnapshot, IdentificationLinkResource } from '@clerk/types'; +import type { + IdentificationLinkJSON, + IdentificationLinkJSONSnapshot, + IdentificationLinkResource, +} from '@clerk/shared/types'; import { BaseResource } from './Base'; diff --git a/packages/clerk-js/src/core/resources/Image.ts b/packages/clerk-js/src/core/resources/Image.ts index 19c07e0a070..c6e7bf661a1 100644 --- a/packages/clerk-js/src/core/resources/Image.ts +++ b/packages/clerk-js/src/core/resources/Image.ts @@ -1,4 +1,4 @@ -import type { ImageJSON, ImageResource } from '@clerk/types'; +import type { ImageJSON, ImageResource } from '@clerk/shared/types'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/Organization.ts b/packages/clerk-js/src/core/resources/Organization.ts index 87893f2da61..ac2568191bf 100644 --- a/packages/clerk-js/src/core/resources/Organization.ts +++ b/packages/clerk-js/src/core/resources/Organization.ts @@ -24,7 +24,7 @@ import type { SetOrganizationLogoParams, UpdateMembershipParams, UpdateOrganizationParams, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { convertPageToOffsetSearchParams } from '../../utils/convertPageToOffsetSearchParams'; import { unixEpochToDate } from '../../utils/date'; diff --git a/packages/clerk-js/src/core/resources/OrganizationDomain.ts b/packages/clerk-js/src/core/resources/OrganizationDomain.ts index 420349002f2..9200f31388e 100644 --- a/packages/clerk-js/src/core/resources/OrganizationDomain.ts +++ b/packages/clerk-js/src/core/resources/OrganizationDomain.ts @@ -6,7 +6,7 @@ import type { OrganizationEnrollmentMode, PrepareAffiliationVerificationParams, UpdateEnrollmentModeParams, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { BaseResource } from './Base'; diff --git a/packages/clerk-js/src/core/resources/OrganizationInvitation.ts b/packages/clerk-js/src/core/resources/OrganizationInvitation.ts index 5f862548734..d229a64bec0 100644 --- a/packages/clerk-js/src/core/resources/OrganizationInvitation.ts +++ b/packages/clerk-js/src/core/resources/OrganizationInvitation.ts @@ -5,7 +5,7 @@ import type { OrganizationInvitationJSON, OrganizationInvitationResource, OrganizationInvitationStatus, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/OrganizationMembership.ts b/packages/clerk-js/src/core/resources/OrganizationMembership.ts index 489c9baa0f8..a4ec4299114 100644 --- a/packages/clerk-js/src/core/resources/OrganizationMembership.ts +++ b/packages/clerk-js/src/core/resources/OrganizationMembership.ts @@ -7,7 +7,7 @@ import type { OrganizationMembershipJSONSnapshot, OrganizationMembershipResource, OrganizationPermissionKey, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { convertPageToOffsetSearchParams } from '../../utils/convertPageToOffsetSearchParams'; import { unixEpochToDate } from '../../utils/date'; diff --git a/packages/clerk-js/src/core/resources/OrganizationMembershipRequest.ts b/packages/clerk-js/src/core/resources/OrganizationMembershipRequest.ts index 1933c1232ed..5bcf4b1a430 100644 --- a/packages/clerk-js/src/core/resources/OrganizationMembershipRequest.ts +++ b/packages/clerk-js/src/core/resources/OrganizationMembershipRequest.ts @@ -2,7 +2,7 @@ import type { OrganizationInvitationStatus, OrganizationMembershipRequestJSON, OrganizationMembershipRequestResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { BaseResource, PublicUserData } from './internal'; diff --git a/packages/clerk-js/src/core/resources/OrganizationSettings.ts b/packages/clerk-js/src/core/resources/OrganizationSettings.ts index 6c8dfa4d814..8960b347d62 100644 --- a/packages/clerk-js/src/core/resources/OrganizationSettings.ts +++ b/packages/clerk-js/src/core/resources/OrganizationSettings.ts @@ -3,7 +3,7 @@ import type { OrganizationSettingsJSON, OrganizationSettingsJSONSnapshot, OrganizationSettingsResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/OrganizationSuggestion.ts b/packages/clerk-js/src/core/resources/OrganizationSuggestion.ts index 2f6d42bd7ed..afd96207339 100644 --- a/packages/clerk-js/src/core/resources/OrganizationSuggestion.ts +++ b/packages/clerk-js/src/core/resources/OrganizationSuggestion.ts @@ -5,7 +5,7 @@ import type { OrganizationSuggestionResource, OrganizationSuggestionStatus, UserOrganizationInvitationResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { convertPageToOffsetSearchParams } from '../../utils/convertPageToOffsetSearchParams'; import { unixEpochToDate } from '../../utils/date'; diff --git a/packages/clerk-js/src/core/resources/Passkey.ts b/packages/clerk-js/src/core/resources/Passkey.ts index 34cb80868b5..ea415f635c5 100644 --- a/packages/clerk-js/src/core/resources/Passkey.ts +++ b/packages/clerk-js/src/core/resources/Passkey.ts @@ -1,8 +1,4 @@ import { ClerkWebAuthnError } from '@clerk/shared/error'; -import { - isWebAuthnPlatformAuthenticatorSupported as isWebAuthnPlatformAuthenticatorSupportedOnWindow, - isWebAuthnSupported as isWebAuthnSupportedOnWindow, -} from '@clerk/shared/webauthn'; import type { DeletedObjectJSON, DeletedObjectResource, @@ -12,7 +8,11 @@ import type { PasskeyVerificationResource, PublicKeyCredentialWithAuthenticatorAttestationResponse, UpdatePasskeyParams, -} from '@clerk/types'; +} from '@clerk/shared/types'; +import { + isWebAuthnPlatformAuthenticatorSupported as isWebAuthnPlatformAuthenticatorSupportedOnWindow, + isWebAuthnSupported as isWebAuthnSupportedOnWindow, +} from '@clerk/shared/webauthn'; import { unixEpochToDate } from '../../utils/date'; import { diff --git a/packages/clerk-js/src/core/resources/Permission.ts b/packages/clerk-js/src/core/resources/Permission.ts index b89c62c1ef2..5c0671d22dc 100644 --- a/packages/clerk-js/src/core/resources/Permission.ts +++ b/packages/clerk-js/src/core/resources/Permission.ts @@ -1,4 +1,4 @@ -import type { PermissionJSON, PermissionResource } from '@clerk/types'; +import type { PermissionJSON, PermissionResource } from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/PhoneNumber.ts b/packages/clerk-js/src/core/resources/PhoneNumber.ts index 2d10ff8ba2f..809cf27c807 100644 --- a/packages/clerk-js/src/core/resources/PhoneNumber.ts +++ b/packages/clerk-js/src/core/resources/PhoneNumber.ts @@ -6,7 +6,7 @@ import type { PhoneNumberResource, SetReservedForSecondFactorParams, VerificationResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { BaseResource, IdentificationLink, Verification } from './internal'; diff --git a/packages/clerk-js/src/core/resources/PublicUserData.ts b/packages/clerk-js/src/core/resources/PublicUserData.ts index d552dfba32e..b1e740b2a51 100644 --- a/packages/clerk-js/src/core/resources/PublicUserData.ts +++ b/packages/clerk-js/src/core/resources/PublicUserData.ts @@ -1,4 +1,8 @@ -import type { PublicUserData as IPublicUserData, PublicUserDataJSON, PublicUserDataJSONSnapshot } from '@clerk/types'; +import type { + PublicUserData as IPublicUserData, + PublicUserDataJSON, + PublicUserDataJSONSnapshot, +} from '@clerk/shared/types'; export class PublicUserData implements IPublicUserData { firstName!: string | null; diff --git a/packages/clerk-js/src/core/resources/Role.ts b/packages/clerk-js/src/core/resources/Role.ts index 425855d1d3a..39bace9e2b3 100644 --- a/packages/clerk-js/src/core/resources/Role.ts +++ b/packages/clerk-js/src/core/resources/Role.ts @@ -1,4 +1,4 @@ -import type { RoleJSON, RoleResource } from '@clerk/types'; +import type { RoleJSON, RoleResource } from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/SamlAccount.ts b/packages/clerk-js/src/core/resources/SamlAccount.ts index f4bf7210a93..173ea50e848 100644 --- a/packages/clerk-js/src/core/resources/SamlAccount.ts +++ b/packages/clerk-js/src/core/resources/SamlAccount.ts @@ -7,7 +7,7 @@ import type { SamlAccountResource, SamlIdpSlug, VerificationResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { BaseResource } from './Base'; diff --git a/packages/clerk-js/src/core/resources/Session.ts b/packages/clerk-js/src/core/resources/Session.ts index 7128832ccaf..c2b5760fd58 100644 --- a/packages/clerk-js/src/core/resources/Session.ts +++ b/packages/clerk-js/src/core/resources/Session.ts @@ -1,7 +1,6 @@ import { createCheckAuthorization } from '@clerk/shared/authorization'; import { ClerkWebAuthnError, is4xxError } from '@clerk/shared/error'; import { retry } from '@clerk/shared/retry'; -import { isWebAuthnSupported as isWebAuthnSupportedOnWindow } from '@clerk/shared/webauthn'; import type { ActClaim, CheckAuthorization, @@ -24,7 +23,8 @@ import type { SessionVerifyPrepareSecondFactorParams, TokenResource, UserResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; +import { isWebAuthnSupported as isWebAuthnSupportedOnWindow } from '@clerk/shared/webauthn'; import { unixEpochToDate } from '@/utils/date'; import { debugLogger } from '@/utils/debug'; diff --git a/packages/clerk-js/src/core/resources/SessionVerification.ts b/packages/clerk-js/src/core/resources/SessionVerification.ts index 34e703b25a2..579db9ac82c 100644 --- a/packages/clerk-js/src/core/resources/SessionVerification.ts +++ b/packages/clerk-js/src/core/resources/SessionVerification.ts @@ -1,4 +1,3 @@ -import { deepSnakeToCamel } from '@clerk/shared/underscore'; import type { SessionResource, SessionVerificationFirstFactor, @@ -8,7 +7,8 @@ import type { SessionVerificationSecondFactor, SessionVerificationStatus, VerificationResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; +import { deepSnakeToCamel } from '@clerk/shared/underscore'; import { BaseResource, Session, Verification } from './internal'; diff --git a/packages/clerk-js/src/core/resources/SessionWithActivities.ts b/packages/clerk-js/src/core/resources/SessionWithActivities.ts index 6832ae8aa41..23c8ababed2 100644 --- a/packages/clerk-js/src/core/resources/SessionWithActivities.ts +++ b/packages/clerk-js/src/core/resources/SessionWithActivities.ts @@ -4,7 +4,7 @@ import type { SessionActivityJSON, SessionWithActivitiesJSON, SessionWithActivitiesResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/SignIn.ts b/packages/clerk-js/src/core/resources/SignIn.ts index d2bb1dee2fb..5f9e53b58c2 100644 --- a/packages/clerk-js/src/core/resources/SignIn.ts +++ b/packages/clerk-js/src/core/resources/SignIn.ts @@ -1,11 +1,6 @@ import { inBrowser } from '@clerk/shared/browser'; import { ClerkWebAuthnError } from '@clerk/shared/error'; import { Poller } from '@clerk/shared/poller'; -import { deepCamelToSnake, deepSnakeToCamel } from '@clerk/shared/underscore'; -import { - isWebAuthnAutofillSupported as isWebAuthnAutofillSupportedOnWindow, - isWebAuthnSupported as isWebAuthnSupportedOnWindow, -} from '@clerk/shared/webauthn'; import type { AttemptFirstFactorParams, AttemptSecondFactorParams, @@ -59,7 +54,12 @@ import type { Web3Provider, Web3SignatureConfig, Web3SignatureFactor, -} from '@clerk/types'; +} from '@clerk/shared/types'; +import { deepCamelToSnake, deepSnakeToCamel } from '@clerk/shared/underscore'; +import { + isWebAuthnAutofillSupported as isWebAuthnAutofillSupportedOnWindow, + isWebAuthnSupported as isWebAuthnSupportedOnWindow, +} from '@clerk/shared/webauthn'; import { debugLogger } from '@/utils/debug'; diff --git a/packages/clerk-js/src/core/resources/SignUp.ts b/packages/clerk-js/src/core/resources/SignUp.ts index fbc697a210f..9b01c5d406b 100644 --- a/packages/clerk-js/src/core/resources/SignUp.ts +++ b/packages/clerk-js/src/core/resources/SignUp.ts @@ -38,7 +38,7 @@ import type { SignUpUpdateParams, StartEmailLinkFlowParams, Web3Provider, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { debugLogger } from '@/utils/debug'; diff --git a/packages/clerk-js/src/core/resources/TOTP.ts b/packages/clerk-js/src/core/resources/TOTP.ts index f73abcadf64..3061aecdb31 100644 --- a/packages/clerk-js/src/core/resources/TOTP.ts +++ b/packages/clerk-js/src/core/resources/TOTP.ts @@ -1,4 +1,4 @@ -import type { TOTPJSON, TOTPResource } from '@clerk/types'; +import type { TOTPJSON, TOTPResource } from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/Token.ts b/packages/clerk-js/src/core/resources/Token.ts index 80df33dc793..56f3581b51c 100644 --- a/packages/clerk-js/src/core/resources/Token.ts +++ b/packages/clerk-js/src/core/resources/Token.ts @@ -1,4 +1,4 @@ -import type { JWT, TokenJSON, TokenJSONSnapshot, TokenResource } from '@clerk/types'; +import type { JWT, TokenJSON, TokenJSONSnapshot, TokenResource } from '@clerk/shared/types'; import { decode } from '../../utils'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/User.ts b/packages/clerk-js/src/core/resources/User.ts index 61fa366324c..8f61851b1c5 100644 --- a/packages/clerk-js/src/core/resources/User.ts +++ b/packages/clerk-js/src/core/resources/User.ts @@ -30,7 +30,7 @@ import type { UserResource, VerifyTOTPParams, Web3WalletResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { normalizeUnsafeMetadata } from '../../utils/resourceParams'; diff --git a/packages/clerk-js/src/core/resources/UserData.ts b/packages/clerk-js/src/core/resources/UserData.ts index cbe36289451..ee58ee858a5 100644 --- a/packages/clerk-js/src/core/resources/UserData.ts +++ b/packages/clerk-js/src/core/resources/UserData.ts @@ -1,4 +1,4 @@ -import type { UserData as IUserData, UserDataJSON, UserDataJSONSnapshot } from '@clerk/types'; +import type { UserData as IUserData, UserDataJSON, UserDataJSONSnapshot } from '@clerk/shared/types'; export class UserData implements IUserData { firstName?: string; diff --git a/packages/clerk-js/src/core/resources/UserOrganizationInvitation.ts b/packages/clerk-js/src/core/resources/UserOrganizationInvitation.ts index 37c86d0076d..e5ca0f90a18 100644 --- a/packages/clerk-js/src/core/resources/UserOrganizationInvitation.ts +++ b/packages/clerk-js/src/core/resources/UserOrganizationInvitation.ts @@ -5,7 +5,7 @@ import type { OrganizationInvitationStatus, UserOrganizationInvitationJSON, UserOrganizationInvitationResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { convertPageToOffsetSearchParams } from '../../utils/convertPageToOffsetSearchParams'; import { unixEpochToDate } from '../../utils/date'; diff --git a/packages/clerk-js/src/core/resources/UserSettings.ts b/packages/clerk-js/src/core/resources/UserSettings.ts index 358f73756c9..8af85ab38c8 100644 --- a/packages/clerk-js/src/core/resources/UserSettings.ts +++ b/packages/clerk-js/src/core/resources/UserSettings.ts @@ -14,7 +14,7 @@ import type { UserSettingsJSONSnapshot, UserSettingsResource, Web3Strategy, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/Verification.ts b/packages/clerk-js/src/core/resources/Verification.ts index 606ee10718c..d9f739d2565 100644 --- a/packages/clerk-js/src/core/resources/Verification.ts +++ b/packages/clerk-js/src/core/resources/Verification.ts @@ -14,7 +14,7 @@ import type { VerificationJSONSnapshot, VerificationResource, VerificationStatus, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { convertJSONToPublicKeyCreateOptions } from '../../utils/passkeys'; diff --git a/packages/clerk-js/src/core/resources/Waitlist.ts b/packages/clerk-js/src/core/resources/Waitlist.ts index dffce0a8977..3dd13ebbbc8 100644 --- a/packages/clerk-js/src/core/resources/Waitlist.ts +++ b/packages/clerk-js/src/core/resources/Waitlist.ts @@ -1,4 +1,4 @@ -import type { JoinWaitlistParams, WaitlistJSON, WaitlistResource } from '@clerk/types'; +import type { JoinWaitlistParams, WaitlistJSON, WaitlistResource } from '@clerk/shared/types'; import { unixEpochToDate } from '../../utils/date'; import { BaseResource } from './internal'; diff --git a/packages/clerk-js/src/core/resources/Web3Wallet.ts b/packages/clerk-js/src/core/resources/Web3Wallet.ts index 210f879554a..1ee299bde20 100644 --- a/packages/clerk-js/src/core/resources/Web3Wallet.ts +++ b/packages/clerk-js/src/core/resources/Web3Wallet.ts @@ -5,7 +5,7 @@ import type { Web3WalletJSON, Web3WalletJSONSnapshot, Web3WalletResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { BaseResource, Verification } from './internal'; diff --git a/packages/clerk-js/src/core/resources/__tests__/Client.test.ts b/packages/clerk-js/src/core/resources/__tests__/Client.test.ts index 6d72b0c3b9b..dd024d128ea 100644 --- a/packages/clerk-js/src/core/resources/__tests__/Client.test.ts +++ b/packages/clerk-js/src/core/resources/__tests__/Client.test.ts @@ -1,4 +1,4 @@ -import type { ClientJSON, ClientJSONSnapshot } from '@clerk/types'; +import type { ClientJSON, ClientJSONSnapshot } from '@clerk/shared/types'; import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest'; import { createSession, createSignIn, createSignUp, createUser } from '@/test/core-fixtures'; diff --git a/packages/clerk-js/src/core/resources/__tests__/Environment.test.ts b/packages/clerk-js/src/core/resources/__tests__/Environment.test.ts index 37c035a531a..c1587669887 100644 --- a/packages/clerk-js/src/core/resources/__tests__/Environment.test.ts +++ b/packages/clerk-js/src/core/resources/__tests__/Environment.test.ts @@ -1,4 +1,4 @@ -import type { EnvironmentJSONSnapshot } from '@clerk/types'; +import type { EnvironmentJSONSnapshot } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { Environment } from '../internal'; diff --git a/packages/clerk-js/src/core/resources/__tests__/Session.test.ts b/packages/clerk-js/src/core/resources/__tests__/Session.test.ts index 8edd1261296..59569d0b207 100644 --- a/packages/clerk-js/src/core/resources/__tests__/Session.test.ts +++ b/packages/clerk-js/src/core/resources/__tests__/Session.test.ts @@ -1,4 +1,4 @@ -import type { InstanceType, OrganizationJSON, SessionJSON } from '@clerk/types'; +import type { InstanceType, OrganizationJSON, SessionJSON } from '@clerk/shared/types'; import { afterEach, beforeEach, describe, expect, it, type Mock, vi } from 'vitest'; import { clerkMock, createUser, mockJwt, mockNetworkFailedFetch } from '@/test/core-fixtures'; diff --git a/packages/clerk-js/src/core/resources/__tests__/Token.test.ts b/packages/clerk-js/src/core/resources/__tests__/Token.test.ts index 6b87bb77a44..066f10b907f 100644 --- a/packages/clerk-js/src/core/resources/__tests__/Token.test.ts +++ b/packages/clerk-js/src/core/resources/__tests__/Token.test.ts @@ -1,4 +1,4 @@ -import type { InstanceType } from '@clerk/types'; +import type { InstanceType } from '@clerk/shared/types'; import { afterEach, beforeEach, describe, expect, it, type Mock, vi } from 'vitest'; import { mockFetch, mockNetworkFailedFetch } from '@/test/core-fixtures'; diff --git a/packages/clerk-js/src/core/resources/__tests__/User.test.ts b/packages/clerk-js/src/core/resources/__tests__/User.test.ts index 04eda1aa6d4..60eaccf4dcf 100644 --- a/packages/clerk-js/src/core/resources/__tests__/User.test.ts +++ b/packages/clerk-js/src/core/resources/__tests__/User.test.ts @@ -1,4 +1,4 @@ -import type { UserJSON } from '@clerk/types'; +import type { UserJSON } from '@clerk/shared/types'; import { describe, expect, it, vi } from 'vitest'; import { BaseResource } from '../internal'; diff --git a/packages/clerk-js/src/core/resources/__tests__/UserSettings.test.ts b/packages/clerk-js/src/core/resources/__tests__/UserSettings.test.ts index 86a215c8589..e3ec7d04cca 100644 --- a/packages/clerk-js/src/core/resources/__tests__/UserSettings.test.ts +++ b/packages/clerk-js/src/core/resources/__tests__/UserSettings.test.ts @@ -1,4 +1,4 @@ -import type { UserSettingsJSON } from '@clerk/types'; +import type { UserSettingsJSON } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { UserSettings } from '../internal'; diff --git a/packages/clerk-js/src/core/resources/__tests__/Web3Wallet.test.ts b/packages/clerk-js/src/core/resources/__tests__/Web3Wallet.test.ts index 9848dbe4561..bb29fde3ad8 100644 --- a/packages/clerk-js/src/core/resources/__tests__/Web3Wallet.test.ts +++ b/packages/clerk-js/src/core/resources/__tests__/Web3Wallet.test.ts @@ -1,4 +1,4 @@ -import type { Web3WalletJSON } from '@clerk/types'; +import type { Web3WalletJSON } from '@clerk/shared/types'; import { describe, expect, it, vi } from 'vitest'; import { BaseResource, Web3Wallet } from '../internal'; diff --git a/packages/clerk-js/src/core/sessionTasks.ts b/packages/clerk-js/src/core/sessionTasks.ts index 0ecfdce3fd7..7713ee53eb3 100644 --- a/packages/clerk-js/src/core/sessionTasks.ts +++ b/packages/clerk-js/src/core/sessionTasks.ts @@ -1,5 +1,5 @@ import { logger } from '@clerk/shared/logger'; -import type { ClerkOptions, SessionResource, SessionTask, SetActiveParams } from '@clerk/types'; +import type { ClerkOptions, SessionResource, SessionTask, SetActiveParams } from '@clerk/shared/types'; import { buildURL, forwardClerkQueryParams } from '../utils'; diff --git a/packages/clerk-js/src/core/signals.ts b/packages/clerk-js/src/core/signals.ts index 815cfb7acff..1228e105fe2 100644 --- a/packages/clerk-js/src/core/signals.ts +++ b/packages/clerk-js/src/core/signals.ts @@ -1,6 +1,6 @@ import { isClerkAPIResponseError } from '@clerk/shared/error'; +import type { Errors, SignInSignal, SignUpSignal } from '@clerk/shared/types'; import { snakeToCamel } from '@clerk/shared/underscore'; -import type { Errors, SignInSignal, SignUpSignal } from '@clerk/types'; import { computed, signal } from 'alien-signals'; import type { SignIn } from './resources/SignIn'; diff --git a/packages/clerk-js/src/core/state.ts b/packages/clerk-js/src/core/state.ts index 5746ed17d98..82fed3485ac 100644 --- a/packages/clerk-js/src/core/state.ts +++ b/packages/clerk-js/src/core/state.ts @@ -1,4 +1,4 @@ -import type { State as StateInterface } from '@clerk/types'; +import type { State as StateInterface } from '@clerk/shared/types'; import { computed, effect } from 'alien-signals'; import { eventBus } from './events'; diff --git a/packages/clerk-js/src/core/tokenCache.ts b/packages/clerk-js/src/core/tokenCache.ts index 0241ab3e265..f2003d7f9a2 100644 --- a/packages/clerk-js/src/core/tokenCache.ts +++ b/packages/clerk-js/src/core/tokenCache.ts @@ -1,4 +1,4 @@ -import type { TokenResource } from '@clerk/types'; +import type { TokenResource } from '@clerk/shared/types'; import { debugLogger } from '@/utils/debug'; import { TokenId } from '@/utils/tokenId'; diff --git a/packages/clerk-js/src/core/warnings.ts b/packages/clerk-js/src/core/warnings.ts index 113ba5a1718..1d001112280 100644 --- a/packages/clerk-js/src/core/warnings.ts +++ b/packages/clerk-js/src/core/warnings.ts @@ -1,4 +1,4 @@ -import type { Serializable } from '@clerk/types'; +import type { Serializable } from '@clerk/shared/types'; const formatWarning = (msg: string) => { return `🔒 Clerk:\n${msg.trim()}\n(This notice only appears in development)`; diff --git a/packages/clerk-js/src/test/core-fixtures.ts b/packages/clerk-js/src/test/core-fixtures.ts index 4f7b5ad90d8..4520dccdf3c 100644 --- a/packages/clerk-js/src/test/core-fixtures.ts +++ b/packages/clerk-js/src/test/core-fixtures.ts @@ -12,7 +12,7 @@ import type { SignInJSON, SignUpJSON, UserJSON, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { vi } from 'vitest'; export const mockJwt = diff --git a/packages/clerk-js/src/test/create-fixtures.tsx b/packages/clerk-js/src/test/create-fixtures.tsx index 5ad2fa1a10e..9b5168055bd 100644 --- a/packages/clerk-js/src/test/create-fixtures.tsx +++ b/packages/clerk-js/src/test/create-fixtures.tsx @@ -1,4 +1,4 @@ -import type { ClerkOptions, ClientJSON, EnvironmentJSON, LoadedClerk } from '@clerk/types'; +import type { ClerkOptions, ClientJSON, EnvironmentJSON, LoadedClerk } from '@clerk/shared/types'; import { vi } from 'vitest'; import { Clerk as ClerkCtor } from '@/core/clerk'; diff --git a/packages/clerk-js/src/test/fixture-helpers.ts b/packages/clerk-js/src/test/fixture-helpers.ts index 143e7e6a7c3..57e10db0a5c 100644 --- a/packages/clerk-js/src/test/fixture-helpers.ts +++ b/packages/clerk-js/src/test/fixture-helpers.ts @@ -15,7 +15,7 @@ import type { UserJSON, UserSettingsJSON, VerificationJSON, -} from '@clerk/types'; +} from '@clerk/shared/types'; import type { OrgParams } from '@/test/core-fixtures'; import { createUser, getOrganizationId } from '@/test/core-fixtures'; diff --git a/packages/clerk-js/src/test/fixtures.ts b/packages/clerk-js/src/test/fixtures.ts index 8fd8c659558..9b3403f0b57 100644 --- a/packages/clerk-js/src/test/fixtures.ts +++ b/packages/clerk-js/src/test/fixtures.ts @@ -7,7 +7,7 @@ import type { OrganizationSettingsJSON, UserJSON, UserSettingsJSON, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { containsAllOfType } from '../ui/utils/containsAllOf'; diff --git a/packages/clerk-js/src/test/mock-helpers.ts b/packages/clerk-js/src/test/mock-helpers.ts index 64a6939cc24..0489976266b 100644 --- a/packages/clerk-js/src/test/mock-helpers.ts +++ b/packages/clerk-js/src/test/mock-helpers.ts @@ -1,4 +1,4 @@ -import type { ActiveSessionResource, LoadedClerk } from '@clerk/types'; +import type { ActiveSessionResource, LoadedClerk } from '@clerk/shared/types'; import { type Mocked, vi } from 'vitest'; import type { RouteContextValue } from '../ui/router'; diff --git a/packages/clerk-js/src/ui/Components.tsx b/packages/clerk-js/src/ui/Components.tsx index 90f6952d847..148736665ce 100644 --- a/packages/clerk-js/src/ui/Components.tsx +++ b/packages/clerk-js/src/ui/Components.tsx @@ -1,4 +1,3 @@ -import { createDeferredPromise } from '@clerk/shared/utils'; import type { __internal_CheckoutProps, __internal_PlanDetailsProps, @@ -15,7 +14,8 @@ import type { SignUpProps, UserProfileProps, WaitlistProps, -} from '@clerk/types'; +} from '@clerk/shared/types'; +import { createDeferredPromise } from '@clerk/shared/utils'; import React, { Suspense } from 'react'; import { clerkUIErrorDOMElementNotFound } from '../core/errors'; diff --git a/packages/clerk-js/src/ui/baseTheme.ts b/packages/clerk-js/src/ui/baseTheme.ts index ce2b7a47fb2..42883ac5763 100644 --- a/packages/clerk-js/src/ui/baseTheme.ts +++ b/packages/clerk-js/src/ui/baseTheme.ts @@ -1,4 +1,4 @@ -import type { Appearance, Elements } from '@clerk/types'; +import type { Appearance, Elements } from '@clerk/shared/types'; import type { InternalTheme } from './foundations'; diff --git a/packages/clerk-js/src/ui/common/Gate.tsx b/packages/clerk-js/src/ui/common/Gate.tsx index 01eeccf83cf..ea6475c4330 100644 --- a/packages/clerk-js/src/ui/common/Gate.tsx +++ b/packages/clerk-js/src/ui/common/Gate.tsx @@ -1,5 +1,5 @@ import { useSession } from '@clerk/shared/react'; -import type { CheckAuthorization, OrganizationCustomRoleKey, OrganizationPermissionKey } from '@clerk/types'; +import type { CheckAuthorization, OrganizationCustomRoleKey, OrganizationPermissionKey } from '@clerk/shared/types'; import type { ComponentType, PropsWithChildren, ReactNode } from 'react'; import React, { useEffect } from 'react'; diff --git a/packages/clerk-js/src/ui/common/ProviderInitialIcon.tsx b/packages/clerk-js/src/ui/common/ProviderInitialIcon.tsx index c179a6b0d66..a6249ce48fe 100644 --- a/packages/clerk-js/src/ui/common/ProviderInitialIcon.tsx +++ b/packages/clerk-js/src/ui/common/ProviderInitialIcon.tsx @@ -1,4 +1,4 @@ -import type { OAuthProvider, PhoneCodeProvider, Web3Provider } from '@clerk/types'; +import type { OAuthProvider, PhoneCodeProvider, Web3Provider } from '@clerk/shared/types'; import { Box, descriptors, Text } from '../customizables'; import type { PropsOfComponent } from '../styledSystem'; diff --git a/packages/clerk-js/src/ui/common/SSOCallback.tsx b/packages/clerk-js/src/ui/common/SSOCallback.tsx index 5dc908bdfb3..374de774e37 100644 --- a/packages/clerk-js/src/ui/common/SSOCallback.tsx +++ b/packages/clerk-js/src/ui/common/SSOCallback.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { HandleOAuthCallbackParams, HandleSamlCallbackParams } from '@clerk/types'; +import type { HandleOAuthCallbackParams, HandleSamlCallbackParams } from '@clerk/shared/types'; import React from 'react'; import { Flow } from '../customizables'; diff --git a/packages/clerk-js/src/ui/common/constants.ts b/packages/clerk-js/src/ui/common/constants.ts index 547f5dc6bfa..4b291268a1e 100644 --- a/packages/clerk-js/src/ui/common/constants.ts +++ b/packages/clerk-js/src/ui/common/constants.ts @@ -1,4 +1,4 @@ -import type { Attribute, LastAuthenticationStrategy } from '@clerk/types'; +import type { Attribute, LastAuthenticationStrategy } from '@clerk/shared/types'; import type { LocalizationKey } from '../localization/localizationKeys'; import { localizationKeys } from '../localization/localizationKeys'; diff --git a/packages/clerk-js/src/ui/common/organizations/OrganizationPreview.tsx b/packages/clerk-js/src/ui/common/organizations/OrganizationPreview.tsx index ef949abd917..7078c2d3d62 100644 --- a/packages/clerk-js/src/ui/common/organizations/OrganizationPreview.tsx +++ b/packages/clerk-js/src/ui/common/organizations/OrganizationPreview.tsx @@ -1,4 +1,4 @@ -import type { UserOrganizationInvitationResource } from '@clerk/types'; +import type { UserOrganizationInvitationResource } from '@clerk/shared/types'; import type { PropsWithChildren } from 'react'; import { forwardRef } from 'react'; diff --git a/packages/clerk-js/src/ui/common/verification.ts b/packages/clerk-js/src/ui/common/verification.ts index 5a0446e7a07..ec0001b14bb 100644 --- a/packages/clerk-js/src/ui/common/verification.ts +++ b/packages/clerk-js/src/ui/common/verification.ts @@ -1,4 +1,4 @@ -import type { ClerkAPIError } from '@clerk/types'; +import type { ClerkAPIError } from '@clerk/shared/types'; import { getClerkAPIErrorMessage, getGlobalError } from '../utils/errorHandler'; diff --git a/packages/clerk-js/src/ui/common/withRedirect.tsx b/packages/clerk-js/src/ui/common/withRedirect.tsx index fc98311d958..84b40c60ec0 100644 --- a/packages/clerk-js/src/ui/common/withRedirect.tsx +++ b/packages/clerk-js/src/ui/common/withRedirect.tsx @@ -1,6 +1,6 @@ import { isDevelopmentFromPublishableKey } from '@clerk/shared/keys'; import { useClerk } from '@clerk/shared/react'; -import type { Clerk, ClerkOptions, EnvironmentResource } from '@clerk/types'; +import type { Clerk, ClerkOptions, EnvironmentResource } from '@clerk/shared/types'; import type { ComponentType } from 'react'; import React from 'react'; diff --git a/packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx b/packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx index 37b25301659..e555672c241 100644 --- a/packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx +++ b/packages/clerk-js/src/ui/components/ApiKeys/ApiKeys.tsx @@ -1,6 +1,6 @@ import { isClerkAPIResponseError } from '@clerk/shared/error'; import { useClerk, useOrganization, useUser } from '@clerk/shared/react'; -import type { CreateAPIKeyParams } from '@clerk/types'; +import type { CreateAPIKeyParams } from '@clerk/shared/types'; import { lazy, useState } from 'react'; import useSWRMutation from 'swr/mutation'; diff --git a/packages/clerk-js/src/ui/components/ApiKeys/ApiKeysTable.tsx b/packages/clerk-js/src/ui/components/ApiKeys/ApiKeysTable.tsx index e26e3e3c563..8b33691291e 100644 --- a/packages/clerk-js/src/ui/components/ApiKeys/ApiKeysTable.tsx +++ b/packages/clerk-js/src/ui/components/ApiKeys/ApiKeysTable.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { APIKeyResource } from '@clerk/types'; +import type { APIKeyResource } from '@clerk/shared/types'; import { useEffect, useState } from 'react'; import useSWR from 'swr'; diff --git a/packages/clerk-js/src/ui/components/Checkout/CheckoutForm.tsx b/packages/clerk-js/src/ui/components/Checkout/CheckoutForm.tsx index acfaf86c7ae..cbeba6a379e 100644 --- a/packages/clerk-js/src/ui/components/Checkout/CheckoutForm.tsx +++ b/packages/clerk-js/src/ui/components/Checkout/CheckoutForm.tsx @@ -1,5 +1,5 @@ import { __experimental_useCheckout as useCheckout } from '@clerk/shared/react'; -import type { BillingMoneyAmount, BillingPaymentMethodResource, ConfirmCheckoutParams } from '@clerk/types'; +import type { BillingMoneyAmount, BillingPaymentMethodResource, ConfirmCheckoutParams } from '@clerk/shared/types'; import { useMemo, useState } from 'react'; import { Card } from '@/ui/elements/Card'; diff --git a/packages/clerk-js/src/ui/components/Checkout/index.tsx b/packages/clerk-js/src/ui/components/Checkout/index.tsx index 83ae433d62e..5a2b8ac03c4 100644 --- a/packages/clerk-js/src/ui/components/Checkout/index.tsx +++ b/packages/clerk-js/src/ui/components/Checkout/index.tsx @@ -1,4 +1,4 @@ -import type { __internal_CheckoutProps } from '@clerk/types'; +import type { __internal_CheckoutProps } from '@clerk/shared/types'; import { Drawer } from '@/ui/elements/Drawer'; diff --git a/packages/clerk-js/src/ui/components/CreateOrganization/CreateOrganization.tsx b/packages/clerk-js/src/ui/components/CreateOrganization/CreateOrganization.tsx index 15edd95f567..70f0f41d577 100644 --- a/packages/clerk-js/src/ui/components/CreateOrganization/CreateOrganization.tsx +++ b/packages/clerk-js/src/ui/components/CreateOrganization/CreateOrganization.tsx @@ -1,4 +1,4 @@ -import type { CreateOrganizationModalProps } from '@clerk/types'; +import type { CreateOrganizationModalProps } from '@clerk/shared/types'; import { withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/CreateOrganization/CreateOrganizationForm.tsx b/packages/clerk-js/src/ui/components/CreateOrganization/CreateOrganizationForm.tsx index bed14d233f8..2be4066ea4d 100644 --- a/packages/clerk-js/src/ui/components/CreateOrganization/CreateOrganizationForm.tsx +++ b/packages/clerk-js/src/ui/components/CreateOrganization/CreateOrganizationForm.tsx @@ -1,5 +1,5 @@ import { useOrganization, useOrganizationList } from '@clerk/shared/react'; -import type { CreateOrganizationParams, OrganizationResource } from '@clerk/types'; +import type { CreateOrganizationParams, OrganizationResource } from '@clerk/shared/types'; import React from 'react'; import { useEnvironment } from '@/ui/contexts'; diff --git a/packages/clerk-js/src/ui/components/CreateOrganization/__tests__/CreateOrganization.test.tsx b/packages/clerk-js/src/ui/components/CreateOrganization/__tests__/CreateOrganization.test.tsx index 4c038efb9f5..0173b0837b9 100644 --- a/packages/clerk-js/src/ui/components/CreateOrganization/__tests__/CreateOrganization.test.tsx +++ b/packages/clerk-js/src/ui/components/CreateOrganization/__tests__/CreateOrganization.test.tsx @@ -1,4 +1,4 @@ -import type { OrganizationResource } from '@clerk/types'; +import type { OrganizationResource } from '@clerk/shared/types'; import { waitFor } from '@testing-library/react'; import { describe, expect, it, vi } from 'vitest'; diff --git a/packages/clerk-js/src/ui/components/GoogleOneTap/index.tsx b/packages/clerk-js/src/ui/components/GoogleOneTap/index.tsx index 3a755535db8..72f11ad1ff7 100644 --- a/packages/clerk-js/src/ui/components/GoogleOneTap/index.tsx +++ b/packages/clerk-js/src/ui/components/GoogleOneTap/index.tsx @@ -1,4 +1,4 @@ -import type { GoogleOneTapProps } from '@clerk/types'; +import type { GoogleOneTapProps } from '@clerk/shared/types'; import React from 'react'; import { withCoreSessionSwitchGuard } from '../../contexts'; diff --git a/packages/clerk-js/src/ui/components/ImpersonationFab/index.tsx b/packages/clerk-js/src/ui/components/ImpersonationFab/index.tsx index 42d1226a924..7596010d4e4 100644 --- a/packages/clerk-js/src/ui/components/ImpersonationFab/index.tsx +++ b/packages/clerk-js/src/ui/components/ImpersonationFab/index.tsx @@ -1,5 +1,5 @@ import { useClerk, useSession, useUser } from '@clerk/shared/react'; -import type { SignedInSessionResource } from '@clerk/types'; +import type { SignedInSessionResource } from '@clerk/shared/types'; import type { PointerEventHandler } from 'react'; import React, { useEffect, useRef } from 'react'; diff --git a/packages/clerk-js/src/ui/components/OrganizationList/UserInvitationList.tsx b/packages/clerk-js/src/ui/components/OrganizationList/UserInvitationList.tsx index d969c9b47b6..569e2671887 100644 --- a/packages/clerk-js/src/ui/components/OrganizationList/UserInvitationList.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationList/UserInvitationList.tsx @@ -1,5 +1,5 @@ import { useClerk, useOrganizationList } from '@clerk/shared/react'; -import type { OrganizationResource, UserOrganizationInvitationResource } from '@clerk/types'; +import type { OrganizationResource, UserOrganizationInvitationResource } from '@clerk/shared/types'; import { useState } from 'react'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/OrganizationList/UserMembershipList.tsx b/packages/clerk-js/src/ui/components/OrganizationList/UserMembershipList.tsx index 303a85f7ce6..58d204c43fe 100644 --- a/packages/clerk-js/src/ui/components/OrganizationList/UserMembershipList.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationList/UserMembershipList.tsx @@ -1,5 +1,5 @@ import { useOrganizationList, useUser } from '@clerk/shared/react'; -import type { OrganizationResource } from '@clerk/types'; +import type { OrganizationResource } from '@clerk/shared/types'; import { isClerkAPIResponseError } from '@/index.headless'; import { sharedMainIdentifierSx } from '@/ui/common/organizations/OrganizationPreview'; diff --git a/packages/clerk-js/src/ui/components/OrganizationList/UserSuggestionList.tsx b/packages/clerk-js/src/ui/components/OrganizationList/UserSuggestionList.tsx index 878a130fc2c..5d9cd30c198 100644 --- a/packages/clerk-js/src/ui/components/OrganizationList/UserSuggestionList.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationList/UserSuggestionList.tsx @@ -1,5 +1,5 @@ import { useOrganizationList } from '@clerk/shared/react'; -import type { OrganizationSuggestionResource } from '@clerk/types'; +import type { OrganizationSuggestionResource } from '@clerk/shared/types'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; import { handleError } from '@/ui/utils/errorHandler'; diff --git a/packages/clerk-js/src/ui/components/OrganizationList/shared.tsx b/packages/clerk-js/src/ui/components/OrganizationList/shared.tsx index b4ee6abd2a2..5eaa8f3d0b8 100644 --- a/packages/clerk-js/src/ui/components/OrganizationList/shared.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationList/shared.tsx @@ -1,4 +1,4 @@ -import type { UserOrganizationInvitationResource } from '@clerk/types'; +import type { UserOrganizationInvitationResource } from '@clerk/shared/types'; import type { PropsWithChildren } from 'react'; import { diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/ActiveMembersList.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/ActiveMembersList.tsx index b5f5ffc62c1..f4badb83534 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/ActiveMembersList.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/ActiveMembersList.tsx @@ -1,5 +1,5 @@ import { useOrganization, useUser } from '@clerk/shared/react'; -import type { OrganizationMembershipResource } from '@clerk/types'; +import type { OrganizationMembershipResource } from '@clerk/shared/types'; import { useCardState } from '@/ui/elements/contexts'; import { ThreeDotsMenu } from '@/ui/elements/ThreeDotsMenu'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/DomainList.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/DomainList.tsx index 7fc1d8c2b09..a6c72ef4bc4 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/DomainList.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/DomainList.tsx @@ -4,7 +4,7 @@ import type { OrganizationDomainResource, OrganizationDomainVerificationStatus, OrganizationEnrollmentMode, -} from '@clerk/types'; +} from '@clerk/shared/types'; import React, { useMemo } from 'react'; import { ProfileSection } from '@/ui/elements/Section'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/EnrollmentBadge.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/EnrollmentBadge.tsx index 8d59a6c766e..0b71ba2f1e1 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/EnrollmentBadge.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/EnrollmentBadge.tsx @@ -1,4 +1,4 @@ -import type { OrganizationDomainResource } from '@clerk/types'; +import type { OrganizationDomainResource } from '@clerk/shared/types'; import type { LocalizationKey } from '../../customizables'; import { Badge, localizationKeys } from '../../customizables'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/InviteMembersForm.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/InviteMembersForm.tsx index 0155e0ce428..2a1d0dad1a5 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/InviteMembersForm.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/InviteMembersForm.tsx @@ -1,6 +1,6 @@ import { isClerkAPIResponseError } from '@clerk/shared/error'; import { useOrganization } from '@clerk/shared/react'; -import type { ClerkAPIError } from '@clerk/types'; +import type { ClerkAPIError } from '@clerk/shared/types'; import type { FormEvent } from 'react'; import { useEffect, useState } from 'react'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/InvitedMembersList.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/InvitedMembersList.tsx index 3eada9469b9..2578af1ceb9 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/InvitedMembersList.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/InvitedMembersList.tsx @@ -1,5 +1,5 @@ import { useOrganization } from '@clerk/shared/react'; -import type { OrganizationInvitationResource } from '@clerk/types'; +import type { OrganizationInvitationResource } from '@clerk/shared/types'; import { useCardState } from '@/ui/elements/contexts'; import { ThreeDotsMenu } from '@/ui/elements/ThreeDotsMenu'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/MembersSearch.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/MembersSearch.tsx index 4b838b1dfb8..845c521e693 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/MembersSearch.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/MembersSearch.tsx @@ -1,5 +1,5 @@ import type { useOrganization } from '@clerk/shared/react'; -import type { GetMembersParams } from '@clerk/types'; +import type { GetMembersParams } from '@clerk/shared/types'; import { useEffect, useRef } from 'react'; import { Animated } from '@/ui/elements/Animated'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx index ca5dcc04067..6c146a20312 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx @@ -1,4 +1,4 @@ -import type { OrganizationResource } from '@clerk/types'; +import type { OrganizationResource } from '@clerk/shared/types'; import type { AvatarUploaderProps } from '@/ui/elements/AvatarUploader'; import { AvatarUploader } from '@/ui/elements/AvatarUploader'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileForm.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileForm.tsx index 03f94ae7bf1..495e7addf26 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileForm.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/ProfileForm.tsx @@ -1,5 +1,5 @@ import { useOrganization } from '@clerk/shared/react'; -import type { UpdateOrganizationParams } from '@clerk/types'; +import type { UpdateOrganizationParams } from '@clerk/shared/types'; import React from 'react'; import { useEnvironment } from '@/ui/contexts'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/RemoveDomainForm.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/RemoveDomainForm.tsx index 45870552be3..b1cb25ef660 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/RemoveDomainForm.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/RemoveDomainForm.tsx @@ -1,5 +1,5 @@ import { useOrganization } from '@clerk/shared/react'; -import type { OrganizationDomainResource } from '@clerk/types'; +import type { OrganizationDomainResource } from '@clerk/shared/types'; import React from 'react'; import type { FormProps } from '@/ui/elements/FormContainer'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/RequestToJoinList.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/RequestToJoinList.tsx index 368a9672647..331b636d3f1 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/RequestToJoinList.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/RequestToJoinList.tsx @@ -1,5 +1,5 @@ import { useOrganization } from '@clerk/shared/react'; -import type { OrganizationMembershipRequestResource } from '@clerk/types'; +import type { OrganizationMembershipRequestResource } from '@clerk/shared/types'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; import { UserPreview } from '@/ui/elements/UserPreview'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/VerifiedDomainForm.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/VerifiedDomainForm.tsx index f411d45ab98..89c3d76bc78 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/VerifiedDomainForm.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/VerifiedDomainForm.tsx @@ -3,7 +3,7 @@ import type { OrganizationDomainResource, OrganizationEnrollmentMode, OrganizationSettingsResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { useEffect } from 'react'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/InviteMembersPage.test.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/InviteMembersPage.test.tsx index 1f14545bb17..2a996f95154 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/InviteMembersPage.test.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/InviteMembersPage.test.tsx @@ -1,5 +1,5 @@ import { ClerkAPIResponseError } from '@clerk/shared/error'; -import type { OrganizationInvitationResource } from '@clerk/types'; +import type { OrganizationInvitationResource } from '@clerk/shared/types'; import { waitFor } from '@testing-library/react'; import React from 'react'; import { beforeEach, describe, expect, it, vi } from 'vitest'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/LeaveOrganizationPage.test.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/LeaveOrganizationPage.test.tsx index 54d0527b282..4185e9897a3 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/LeaveOrganizationPage.test.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/LeaveOrganizationPage.test.tsx @@ -1,4 +1,4 @@ -import type { DeletedObjectResource } from '@clerk/types'; +import type { DeletedObjectResource } from '@clerk/shared/types'; import { waitFor } from '@testing-library/react'; import { describe, expect, it, vi } from 'vitest'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationGeneralPage.test.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationGeneralPage.test.tsx index cd83d4b271b..d4f8767ff5c 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationGeneralPage.test.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationGeneralPage.test.tsx @@ -1,4 +1,8 @@ -import type { ClerkPaginatedResponse, OrganizationDomainResource, OrganizationMembershipResource } from '@clerk/types'; +import type { + ClerkPaginatedResponse, + OrganizationDomainResource, + OrganizationMembershipResource, +} from '@clerk/shared/types'; import userEvent from '@testing-library/user-event'; import { describe, expect, it } from 'vitest'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationMembers.test.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationMembers.test.tsx index bf6c837552a..b56949687a3 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationMembers.test.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationMembers.test.tsx @@ -1,4 +1,4 @@ -import type { OrganizationInvitationResource, OrganizationMembershipResource } from '@clerk/types'; +import type { OrganizationInvitationResource, OrganizationMembershipResource } from '@clerk/shared/types'; import { screen, waitFor, waitForElementToBeRemoved } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { beforeEach, describe, expect, it, vi } from 'vitest'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationProfile.test.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationProfile.test.tsx index fd2f2b34292..028cd9bebfd 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationProfile.test.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/OrganizationProfile.test.tsx @@ -1,4 +1,4 @@ -import type { CustomPage } from '@clerk/types'; +import type { CustomPage } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { bindCreateFixtures } from '@/test/create-fixtures'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/ProfileSettingsPage.test.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/ProfileSettingsPage.test.tsx index 62d1568fbe3..bff5f26a2e7 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/ProfileSettingsPage.test.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/ProfileSettingsPage.test.tsx @@ -1,4 +1,4 @@ -import type { OrganizationResource } from '@clerk/types'; +import type { OrganizationResource } from '@clerk/shared/types'; import { describe, expect, it, vi } from 'vitest'; import { bindCreateFixtures } from '@/test/create-fixtures'; diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/utils.ts b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/utils.ts index 02a26ea3dc6..55e4a33d29b 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/utils.ts +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/__tests__/utils.ts @@ -9,7 +9,7 @@ import type { OrganizationMembershipResource, OrganizationResource, PublicUserData, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { vi } from 'vitest'; type FakeMemberParams = { diff --git a/packages/clerk-js/src/ui/components/OrganizationProfile/index.tsx b/packages/clerk-js/src/ui/components/OrganizationProfile/index.tsx index 5413c2c27b3..0e81413cba8 100644 --- a/packages/clerk-js/src/ui/components/OrganizationProfile/index.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationProfile/index.tsx @@ -1,5 +1,5 @@ import { useOrganization } from '@clerk/shared/react'; -import type { OrganizationProfileModalProps, OrganizationProfileProps } from '@clerk/types'; +import type { OrganizationProfileModalProps, OrganizationProfileProps } from '@clerk/shared/types'; import React from 'react'; import { withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherPopover.tsx b/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherPopover.tsx index 10e5df31ca7..567e03c42bf 100644 --- a/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherPopover.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherPopover.tsx @@ -1,5 +1,5 @@ import { useClerk, useOrganization, useOrganizationList, useUser } from '@clerk/shared/react'; -import type { OrganizationResource } from '@clerk/types'; +import type { OrganizationResource } from '@clerk/shared/types'; import React from 'react'; import { Actions, SmallAction } from '@/ui/elements/Actions'; diff --git a/packages/clerk-js/src/ui/components/OrganizationSwitcher/UserInvitationSuggestionList.tsx b/packages/clerk-js/src/ui/components/OrganizationSwitcher/UserInvitationSuggestionList.tsx index 171866d20ca..a817d041ff0 100644 --- a/packages/clerk-js/src/ui/components/OrganizationSwitcher/UserInvitationSuggestionList.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationSwitcher/UserInvitationSuggestionList.tsx @@ -3,7 +3,7 @@ import type { OrganizationResource, OrganizationSuggestionResource, UserOrganizationInvitationResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import type { PropsWithChildren } from 'react'; import { Actions } from '@/ui/elements/Actions'; diff --git a/packages/clerk-js/src/ui/components/OrganizationSwitcher/UserMembershipList.tsx b/packages/clerk-js/src/ui/components/OrganizationSwitcher/UserMembershipList.tsx index fd347bedc05..141e241c153 100644 --- a/packages/clerk-js/src/ui/components/OrganizationSwitcher/UserMembershipList.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationSwitcher/UserMembershipList.tsx @@ -1,5 +1,5 @@ import { useOrganization, useOrganizationList, useUser } from '@clerk/shared/react'; -import type { OrganizationResource } from '@clerk/types'; +import type { OrganizationResource } from '@clerk/shared/types'; import React from 'react'; import { OrganizationPreview } from '@/ui/elements/OrganizationPreview'; diff --git a/packages/clerk-js/src/ui/components/OrganizationSwitcher/__tests__/OrganizationSwitcher.test.tsx b/packages/clerk-js/src/ui/components/OrganizationSwitcher/__tests__/OrganizationSwitcher.test.tsx index c854f15f702..1f0894e16c5 100644 --- a/packages/clerk-js/src/ui/components/OrganizationSwitcher/__tests__/OrganizationSwitcher.test.tsx +++ b/packages/clerk-js/src/ui/components/OrganizationSwitcher/__tests__/OrganizationSwitcher.test.tsx @@ -1,4 +1,4 @@ -import type { MembershipRole } from '@clerk/types'; +import type { MembershipRole } from '@clerk/shared/types'; import { waitFor } from '@testing-library/react'; import { describe, expect, it } from 'vitest'; diff --git a/packages/clerk-js/src/ui/components/OrganizationSwitcher/__tests__/test-utils.ts b/packages/clerk-js/src/ui/components/OrganizationSwitcher/__tests__/test-utils.ts index b99be7ff39e..3c41f6f5220 100644 --- a/packages/clerk-js/src/ui/components/OrganizationSwitcher/__tests__/test-utils.ts +++ b/packages/clerk-js/src/ui/components/OrganizationSwitcher/__tests__/test-utils.ts @@ -6,7 +6,7 @@ import type { OrganizationSuggestionResource, OrganizationSuggestionStatus, UserOrganizationInvitationResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { vi } from 'vitest'; export type FakeOrganizationParams = { diff --git a/packages/clerk-js/src/ui/components/OrganizationSwitcher/utils.ts b/packages/clerk-js/src/ui/components/OrganizationSwitcher/utils.ts index e2275aa1032..ae44e9c7353 100644 --- a/packages/clerk-js/src/ui/components/OrganizationSwitcher/utils.ts +++ b/packages/clerk-js/src/ui/components/OrganizationSwitcher/utils.ts @@ -1,5 +1,5 @@ import type { useOrganizationList } from '@clerk/shared/react'; -import type { ClerkPaginatedResponse } from '@clerk/types'; +import type { ClerkPaginatedResponse } from '@clerk/shared/types'; export const organizationListParams = { userMemberships: { diff --git a/packages/clerk-js/src/ui/components/PaymentAttempts/PaymentAttemptPage.tsx b/packages/clerk-js/src/ui/components/PaymentAttempts/PaymentAttemptPage.tsx index 1721aae96f7..d603469da4b 100644 --- a/packages/clerk-js/src/ui/components/PaymentAttempts/PaymentAttemptPage.tsx +++ b/packages/clerk-js/src/ui/components/PaymentAttempts/PaymentAttemptPage.tsx @@ -1,5 +1,5 @@ import { useClerk, useOrganization } from '@clerk/shared/react'; -import type { BillingSubscriptionItemResource } from '@clerk/types'; +import type { BillingSubscriptionItemResource } from '@clerk/shared/types'; import useSWR from 'swr'; import { Alert } from '@/ui/elements/Alert'; diff --git a/packages/clerk-js/src/ui/components/PaymentAttempts/PaymentAttemptsList.tsx b/packages/clerk-js/src/ui/components/PaymentAttempts/PaymentAttemptsList.tsx index f9cbc3b1baf..2a358454ed8 100644 --- a/packages/clerk-js/src/ui/components/PaymentAttempts/PaymentAttemptsList.tsx +++ b/packages/clerk-js/src/ui/components/PaymentAttempts/PaymentAttemptsList.tsx @@ -1,4 +1,4 @@ -import type { BillingPaymentResource } from '@clerk/types'; +import type { BillingPaymentResource } from '@clerk/shared/types'; import { DataTable, DataTableRow } from '@/ui/elements/DataTable'; import { formatDate } from '@/ui/utils/formatDate'; diff --git a/packages/clerk-js/src/ui/components/PaymentMethods/PaymentMethodRow.tsx b/packages/clerk-js/src/ui/components/PaymentMethods/PaymentMethodRow.tsx index e576f960407..3fb6c23cac7 100644 --- a/packages/clerk-js/src/ui/components/PaymentMethods/PaymentMethodRow.tsx +++ b/packages/clerk-js/src/ui/components/PaymentMethods/PaymentMethodRow.tsx @@ -1,4 +1,4 @@ -import type { BillingPaymentMethodResource } from '@clerk/types'; +import type { BillingPaymentMethodResource } from '@clerk/shared/types'; import { Badge, descriptors, Flex, Icon, localizationKeys, Text } from '../../customizables'; import { CreditCard, GenericPayment } from '../../icons'; diff --git a/packages/clerk-js/src/ui/components/PaymentMethods/PaymentMethods.tsx b/packages/clerk-js/src/ui/components/PaymentMethods/PaymentMethods.tsx index 476c25b5743..7b53795ce9d 100644 --- a/packages/clerk-js/src/ui/components/PaymentMethods/PaymentMethods.tsx +++ b/packages/clerk-js/src/ui/components/PaymentMethods/PaymentMethods.tsx @@ -1,5 +1,5 @@ import { useClerk, useOrganization } from '@clerk/shared/react'; -import type { BillingPaymentMethodResource } from '@clerk/types'; +import type { BillingPaymentMethodResource } from '@clerk/shared/types'; import { Fragment, useMemo, useRef } from 'react'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/Plans/PlanDetails.tsx b/packages/clerk-js/src/ui/components/Plans/PlanDetails.tsx index 38476c74849..0c73ae5bef3 100644 --- a/packages/clerk-js/src/ui/components/Plans/PlanDetails.tsx +++ b/packages/clerk-js/src/ui/components/Plans/PlanDetails.tsx @@ -4,7 +4,7 @@ import type { BillingPlanResource, BillingSubscriptionPlanPeriod, ClerkAPIResponseError, -} from '@clerk/types'; +} from '@clerk/shared/types'; import * as React from 'react'; import { useMemo, useState } from 'react'; import useSWR from 'swr'; diff --git a/packages/clerk-js/src/ui/components/PricingTable/PricingTable.tsx b/packages/clerk-js/src/ui/components/PricingTable/PricingTable.tsx index 1d71da6bbca..be84d597b71 100644 --- a/packages/clerk-js/src/ui/components/PricingTable/PricingTable.tsx +++ b/packages/clerk-js/src/ui/components/PricingTable/PricingTable.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { BillingPlanResource, BillingSubscriptionPlanPeriod, PricingTableProps } from '@clerk/types'; +import type { BillingPlanResource, BillingSubscriptionPlanPeriod, PricingTableProps } from '@clerk/shared/types'; import { useEffect, useMemo, useState } from 'react'; import { Flow } from '@/ui/customizables/Flow'; diff --git a/packages/clerk-js/src/ui/components/PricingTable/PricingTableDefault.tsx b/packages/clerk-js/src/ui/components/PricingTable/PricingTableDefault.tsx index 84317a3ca3d..657685db5e5 100644 --- a/packages/clerk-js/src/ui/components/PricingTable/PricingTableDefault.tsx +++ b/packages/clerk-js/src/ui/components/PricingTable/PricingTableDefault.tsx @@ -1,5 +1,5 @@ import { useClerk, useOrganization, useSession } from '@clerk/shared/react'; -import type { BillingPlanResource, BillingSubscriptionPlanPeriod, PricingTableProps } from '@clerk/types'; +import type { BillingPlanResource, BillingSubscriptionPlanPeriod, PricingTableProps } from '@clerk/shared/types'; import * as React from 'react'; import { Switch } from '@/ui/elements/Switch'; diff --git a/packages/clerk-js/src/ui/components/PricingTable/PricingTableMatrix.tsx b/packages/clerk-js/src/ui/components/PricingTable/PricingTableMatrix.tsx index 0ec8b725f05..c7dc8659e5d 100644 --- a/packages/clerk-js/src/ui/components/PricingTable/PricingTableMatrix.tsx +++ b/packages/clerk-js/src/ui/components/PricingTable/PricingTableMatrix.tsx @@ -1,4 +1,4 @@ -import type { BillingPlanResource, BillingSubscriptionPlanPeriod } from '@clerk/types'; +import type { BillingPlanResource, BillingSubscriptionPlanPeriod } from '@clerk/shared/types'; import * as React from 'react'; import { Avatar } from '@/ui/elements/Avatar'; diff --git a/packages/clerk-js/src/ui/components/PricingTable/utils/pricing-footer-state.spec.ts b/packages/clerk-js/src/ui/components/PricingTable/utils/pricing-footer-state.spec.ts index 16fec2236be..897b15e27b1 100644 --- a/packages/clerk-js/src/ui/components/PricingTable/utils/pricing-footer-state.spec.ts +++ b/packages/clerk-js/src/ui/components/PricingTable/utils/pricing-footer-state.spec.ts @@ -1,4 +1,8 @@ -import type { BillingPlanResource, BillingSubscriptionItemResource, BillingSubscriptionPlanPeriod } from '@clerk/types'; +import type { + BillingPlanResource, + BillingSubscriptionItemResource, + BillingSubscriptionPlanPeriod, +} from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { getPricingFooterState } from './pricing-footer-state'; diff --git a/packages/clerk-js/src/ui/components/PricingTable/utils/pricing-footer-state.ts b/packages/clerk-js/src/ui/components/PricingTable/utils/pricing-footer-state.ts index 5e94b75c046..8a54ffa0389 100644 --- a/packages/clerk-js/src/ui/components/PricingTable/utils/pricing-footer-state.ts +++ b/packages/clerk-js/src/ui/components/PricingTable/utils/pricing-footer-state.ts @@ -1,4 +1,8 @@ -import type { BillingPlanResource, BillingSubscriptionItemResource, BillingSubscriptionPlanPeriod } from '@clerk/types'; +import type { + BillingPlanResource, + BillingSubscriptionItemResource, + BillingSubscriptionPlanPeriod, +} from '@clerk/shared/types'; type UsePricingFooterStateParams = { subscription: BillingSubscriptionItemResource | undefined; diff --git a/packages/clerk-js/src/ui/components/SessionTasks/index.tsx b/packages/clerk-js/src/ui/components/SessionTasks/index.tsx index 2083eaf03e5..a5c8ca20ebb 100644 --- a/packages/clerk-js/src/ui/components/SessionTasks/index.tsx +++ b/packages/clerk-js/src/ui/components/SessionTasks/index.tsx @@ -1,6 +1,6 @@ import { useClerk } from '@clerk/shared/react'; import { eventComponentMounted } from '@clerk/shared/telemetry'; -import type { SessionResource } from '@clerk/types'; +import type { SessionResource } from '@clerk/shared/types'; import { useEffect, useRef } from 'react'; import { Flow } from '@/ui/customizables'; diff --git a/packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/ChooseOrganizationScreen.tsx b/packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/ChooseOrganizationScreen.tsx index 1b5e1f35d53..94340b62856 100644 --- a/packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/ChooseOrganizationScreen.tsx +++ b/packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/ChooseOrganizationScreen.tsx @@ -4,7 +4,7 @@ import type { OrganizationResource, OrganizationSuggestionResource, UserOrganizationInvitationResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import React, { useState } from 'react'; import { diff --git a/packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx b/packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx index 55019e6a966..130f057a75c 100644 --- a/packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx +++ b/packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx @@ -1,5 +1,5 @@ import { useOrganizationList } from '@clerk/shared/react'; -import type { CreateOrganizationParams } from '@clerk/types'; +import type { CreateOrganizationParams } from '@clerk/shared/types'; import { useEnvironment } from '@/ui/contexts'; import { useTaskChooseOrganizationContext } from '@/ui/contexts/components/SessionTasks'; diff --git a/packages/clerk-js/src/ui/components/SignIn/AlternativeMethods.tsx b/packages/clerk-js/src/ui/components/SignIn/AlternativeMethods.tsx index 68e42ad67db..8ca576bdab1 100644 --- a/packages/clerk-js/src/ui/components/SignIn/AlternativeMethods.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/AlternativeMethods.tsx @@ -1,4 +1,4 @@ -import type { SignInFactor } from '@clerk/types'; +import type { SignInFactor } from '@clerk/shared/types'; import React from 'react'; import { ArrowBlockButton } from '@/ui/elements/ArrowBlockButton'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInAlternativePhoneCodePhoneNumberCard.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInAlternativePhoneCodePhoneNumberCard.tsx index 8103db1178c..f8c3ec42d34 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInAlternativePhoneCodePhoneNumberCard.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInAlternativePhoneCodePhoneNumberCard.tsx @@ -1,4 +1,4 @@ -import type { PhoneCodeChannelData } from '@clerk/types'; +import type { PhoneCodeChannelData } from '@clerk/shared/types'; import { Card } from '@/ui/elements/Card'; import { useCardState } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOne.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOne.tsx index e238c5d585e..e318345e719 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOne.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOne.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { SignInFactor } from '@clerk/types'; +import type { SignInFactor } from '@clerk/shared/types'; import React from 'react'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneAlternativeChannelCodeForm.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneAlternativeChannelCodeForm.tsx index 58ebe4f71c4..c0a1aaaab02 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneAlternativeChannelCodeForm.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneAlternativeChannelCodeForm.tsx @@ -1,6 +1,6 @@ import { isUserLockedError } from '@clerk/shared/error'; import { useClerk } from '@clerk/shared/react'; -import type { PhoneCodeFactor, SignInFactor } from '@clerk/types'; +import type { PhoneCodeFactor, SignInFactor } from '@clerk/shared/types'; import { useCardState } from '@/ui/elements/contexts'; import type { VerificationCodeCardProps } from '@/ui/elements/VerificationCodeCard'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneAlternativePhoneCodeCard.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneAlternativePhoneCodeCard.tsx index 77953489ea2..fb32abcb142 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneAlternativePhoneCodeCard.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneAlternativePhoneCodeCard.tsx @@ -1,5 +1,5 @@ import { getAlternativePhoneCodeProviderData } from '@clerk/shared/alternativePhoneCode'; -import type { PhoneCodeFactor } from '@clerk/types'; +import type { PhoneCodeFactor } from '@clerk/shared/types'; import { Flow, localizationKeys } from '../../customizables'; import type { SignInFactorOneAlternativeChannelCodeCard } from './SignInFactorOneAlternativeChannelCodeForm'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneCodeForm.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneCodeForm.tsx index 67c20e17360..350b618862a 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneCodeForm.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneCodeForm.tsx @@ -1,6 +1,6 @@ import { isUserLockedError } from '@clerk/shared/error'; import { useClerk } from '@clerk/shared/react'; -import type { EmailCodeFactor, PhoneCodeFactor, ResetPasswordCodeFactor } from '@clerk/types'; +import type { EmailCodeFactor, PhoneCodeFactor, ResetPasswordCodeFactor } from '@clerk/shared/types'; import { useMemo } from 'react'; import { useCardState } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneEmailCodeCard.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneEmailCodeCard.tsx index 8abb162a285..5dfc628ffc6 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneEmailCodeCard.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneEmailCodeCard.tsx @@ -1,4 +1,4 @@ -import type { EmailCodeFactor } from '@clerk/types'; +import type { EmailCodeFactor } from '@clerk/shared/types'; import { Flow, localizationKeys } from '../../customizables'; import type { SignInFactorOneCodeCard } from './SignInFactorOneCodeForm'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneEmailLinkCard.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneEmailLinkCard.tsx index 843b6528ed0..25a158a5044 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneEmailLinkCard.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneEmailLinkCard.tsx @@ -1,6 +1,6 @@ import { isUserLockedError } from '@clerk/shared/error'; import { useClerk } from '@clerk/shared/react'; -import type { EmailLinkFactor, SignInResource } from '@clerk/types'; +import type { EmailLinkFactor, SignInResource } from '@clerk/shared/types'; import React from 'react'; import type { VerificationCodeCardProps } from '@/ui/elements/VerificationCodeCard'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneForgotPasswordCard.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneForgotPasswordCard.tsx index ecf8b34880d..62b593cc415 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneForgotPasswordCard.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOneForgotPasswordCard.tsx @@ -1,4 +1,4 @@ -import type { ResetPasswordCodeFactor } from '@clerk/types'; +import type { ResetPasswordCodeFactor } from '@clerk/shared/types'; import { Flow, localizationKeys } from '../../customizables'; import type { SignInFactorOneCodeCard, SignInFactorOneCodeFormProps } from './SignInFactorOneCodeForm'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOnePasskey.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOnePasskey.tsx index 4296ab48b01..3fe4e637e5c 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOnePasskey.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOnePasskey.tsx @@ -1,4 +1,4 @@ -import type { ResetPasswordCodeFactor } from '@clerk/types'; +import type { ResetPasswordCodeFactor } from '@clerk/shared/types'; import React from 'react'; import { Card } from '@/ui/elements/Card'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOnePhoneCodeCard.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOnePhoneCodeCard.tsx index 5d7b08fbc49..3a2783176f3 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorOnePhoneCodeCard.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorOnePhoneCodeCard.tsx @@ -1,4 +1,4 @@ -import type { PhoneCodeFactor } from '@clerk/types'; +import type { PhoneCodeFactor } from '@clerk/shared/types'; import { Flow, localizationKeys } from '../../customizables'; import type { SignInFactorOneCodeCard } from './SignInFactorOneCodeForm'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwo.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwo.tsx index 522e687dcb6..1ae4d348717 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwo.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwo.tsx @@ -1,4 +1,4 @@ -import type { SignInFactor } from '@clerk/types'; +import type { SignInFactor } from '@clerk/shared/types'; import React from 'react'; import { withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoAlternativeMethods.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoAlternativeMethods.tsx index be9084d8622..b49deeb8522 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoAlternativeMethods.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoAlternativeMethods.tsx @@ -1,4 +1,4 @@ -import type { SignInFactor } from '@clerk/types'; +import type { SignInFactor } from '@clerk/shared/types'; import React from 'react'; import { ArrowBlockButton } from '@/ui/elements/ArrowBlockButton'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoBackupCodeCard.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoBackupCodeCard.tsx index e198bf90d0b..c98810d163a 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoBackupCodeCard.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoBackupCodeCard.tsx @@ -1,6 +1,6 @@ import { isUserLockedError } from '@clerk/shared/error'; import { useClerk } from '@clerk/shared/react'; -import type { SignInResource } from '@clerk/types'; +import type { SignInResource } from '@clerk/shared/types'; import React from 'react'; import { Card } from '@/ui/elements/Card'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoCodeForm.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoCodeForm.tsx index 4b06c83ed75..314c63cc583 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoCodeForm.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoCodeForm.tsx @@ -1,6 +1,6 @@ import { isUserLockedError } from '@clerk/shared/error'; import { useClerk } from '@clerk/shared/react'; -import type { PhoneCodeFactor, SignInResource, TOTPFactor } from '@clerk/types'; +import type { PhoneCodeFactor, SignInResource, TOTPFactor } from '@clerk/shared/types'; import React from 'react'; import { useCardState } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoPhoneCodeCard.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoPhoneCodeCard.tsx index 8edc79b8fe6..304880aaf20 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoPhoneCodeCard.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoPhoneCodeCard.tsx @@ -1,4 +1,4 @@ -import type { PhoneCodeFactor } from '@clerk/types'; +import type { PhoneCodeFactor } from '@clerk/shared/types'; import { useCoreSignIn } from '../../contexts'; import { Flow, localizationKeys } from '../../customizables'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoTOTPCard.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoTOTPCard.tsx index 5e4278370a3..95e74ad1ef7 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoTOTPCard.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInFactorTwoTOTPCard.tsx @@ -1,4 +1,4 @@ -import type { TOTPFactor } from '@clerk/types'; +import type { TOTPFactor } from '@clerk/shared/types'; import { Flow, localizationKeys } from '../../customizables'; import type { SignInFactorTwoCodeCard } from './SignInFactorTwoCodeForm'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInSocialButtons.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInSocialButtons.tsx index 49459d0d0f2..a8be1ee3f55 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInSocialButtons.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInSocialButtons.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { PhoneCodeChannel } from '@clerk/types'; +import type { PhoneCodeChannel } from '@clerk/shared/types'; import React from 'react'; import { handleError } from '@/ui/utils/errorHandler'; diff --git a/packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx b/packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx index 6b0dd0cc8a9..c12bd76fce9 100644 --- a/packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/SignInStart.tsx @@ -1,13 +1,13 @@ import { getAlternativePhoneCodeProviderData } from '@clerk/shared/alternativePhoneCode'; import { useClerk } from '@clerk/shared/react'; -import { isWebAuthnAutofillSupported, isWebAuthnSupported } from '@clerk/shared/webauthn'; import type { ClerkAPIError, PhoneCodeChannel, PhoneCodeChannelData, SignInCreateParams, SignInResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; +import { isWebAuthnAutofillSupported, isWebAuthnSupported } from '@clerk/shared/webauthn'; import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'; import { Card } from '@/ui/elements/Card'; diff --git a/packages/clerk-js/src/ui/components/SignIn/__tests__/ResetPassword.test.tsx b/packages/clerk-js/src/ui/components/SignIn/__tests__/ResetPassword.test.tsx index eb6bc33fbbb..f5778d8c918 100644 --- a/packages/clerk-js/src/ui/components/SignIn/__tests__/ResetPassword.test.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/__tests__/ResetPassword.test.tsx @@ -1,4 +1,4 @@ -import type { SignInResource } from '@clerk/types'; +import type { SignInResource } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { bindCreateFixtures } from '@/test/create-fixtures'; diff --git a/packages/clerk-js/src/ui/components/SignIn/__tests__/SignInFactorOne.test.tsx b/packages/clerk-js/src/ui/components/SignIn/__tests__/SignInFactorOne.test.tsx index ad7323213e0..d784f16ad3a 100644 --- a/packages/clerk-js/src/ui/components/SignIn/__tests__/SignInFactorOne.test.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/__tests__/SignInFactorOne.test.tsx @@ -1,5 +1,5 @@ import { ClerkAPIResponseError, parseError } from '@clerk/shared/error'; -import type { SignInResource } from '@clerk/types'; +import type { SignInResource } from '@clerk/shared/types'; import { waitFor } from '@testing-library/react'; import { describe, expect, it, vi } from 'vitest'; diff --git a/packages/clerk-js/src/ui/components/SignIn/__tests__/SignInFactorTwo.test.tsx b/packages/clerk-js/src/ui/components/SignIn/__tests__/SignInFactorTwo.test.tsx index 1e6db3df0bf..019e6324047 100644 --- a/packages/clerk-js/src/ui/components/SignIn/__tests__/SignInFactorTwo.test.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/__tests__/SignInFactorTwo.test.tsx @@ -1,5 +1,5 @@ import { ClerkAPIResponseError, parseError } from '@clerk/shared/error'; -import type { SignInResource } from '@clerk/types'; +import type { SignInResource } from '@clerk/shared/types'; import { describe, expect, it, vi } from 'vitest'; import { bindCreateFixtures } from '@/test/create-fixtures'; diff --git a/packages/clerk-js/src/ui/components/SignIn/__tests__/SignInStart.test.tsx b/packages/clerk-js/src/ui/components/SignIn/__tests__/SignInStart.test.tsx index 5d6aad7857f..e5f4bf4e64f 100644 --- a/packages/clerk-js/src/ui/components/SignIn/__tests__/SignInStart.test.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/__tests__/SignInStart.test.tsx @@ -1,6 +1,6 @@ import { ClerkAPIResponseError } from '@clerk/shared/error'; import { OAUTH_PROVIDERS } from '@clerk/shared/oauth'; -import type { SignInResource } from '@clerk/types'; +import type { SignInResource } from '@clerk/shared/types'; import { waitFor } from '@testing-library/react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; diff --git a/packages/clerk-js/src/ui/components/SignIn/__tests__/handleCombinedFlowTransfer.test.ts b/packages/clerk-js/src/ui/components/SignIn/__tests__/handleCombinedFlowTransfer.test.ts index df58a36daa8..26e8cc5e819 100644 --- a/packages/clerk-js/src/ui/components/SignIn/__tests__/handleCombinedFlowTransfer.test.ts +++ b/packages/clerk-js/src/ui/components/SignIn/__tests__/handleCombinedFlowTransfer.test.ts @@ -1,4 +1,4 @@ -import type { LoadedClerk, SignUpResource } from '@clerk/types'; +import type { LoadedClerk, SignUpResource } from '@clerk/shared/types'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { handleCombinedFlowTransfer, hasOptionalFields } from '../handleCombinedFlowTransfer'; diff --git a/packages/clerk-js/src/ui/components/SignIn/__tests__/utils.test.ts b/packages/clerk-js/src/ui/components/SignIn/__tests__/utils.test.ts index 1a380cb231e..bde4ce8afcb 100644 --- a/packages/clerk-js/src/ui/components/SignIn/__tests__/utils.test.ts +++ b/packages/clerk-js/src/ui/components/SignIn/__tests__/utils.test.ts @@ -1,4 +1,4 @@ -import type { SignInResource } from '@clerk/types'; +import type { SignInResource } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import type { FormControlState } from '@/ui/utils/useFormControl'; diff --git a/packages/clerk-js/src/ui/components/SignIn/handleCombinedFlowTransfer.ts b/packages/clerk-js/src/ui/components/SignIn/handleCombinedFlowTransfer.ts index 9021501868f..4528af4d064 100644 --- a/packages/clerk-js/src/ui/components/SignIn/handleCombinedFlowTransfer.ts +++ b/packages/clerk-js/src/ui/components/SignIn/handleCombinedFlowTransfer.ts @@ -5,7 +5,7 @@ import type { SessionResource, SignUpModes, SignUpResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { SIGN_UP_MODES } from '../../../core/constants'; import type { RouteContextValue } from '../../router/RouteContext'; diff --git a/packages/clerk-js/src/ui/components/SignIn/index.tsx b/packages/clerk-js/src/ui/components/SignIn/index.tsx index 29ec373b367..7cdea9e8d30 100644 --- a/packages/clerk-js/src/ui/components/SignIn/index.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/index.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { SignInModalProps, SignInProps } from '@clerk/types'; +import type { SignInModalProps, SignInProps } from '@clerk/shared/types'; import React from 'react'; import { SignInEmailLinkFlowComplete, SignUpEmailLinkFlowComplete } from '@/ui/common/EmailLinkCompleteFlowCard'; diff --git a/packages/clerk-js/src/ui/components/SignIn/shared.ts b/packages/clerk-js/src/ui/components/SignIn/shared.ts index cb9fdde7d6b..e4939eec64d 100644 --- a/packages/clerk-js/src/ui/components/SignIn/shared.ts +++ b/packages/clerk-js/src/ui/components/SignIn/shared.ts @@ -1,6 +1,6 @@ import { isClerkRuntimeError, isUserLockedError } from '@clerk/shared/error'; import { useClerk } from '@clerk/shared/react'; -import type { EnterpriseSSOFactor, SignInFirstFactor } from '@clerk/types'; +import type { EnterpriseSSOFactor, SignInFirstFactor } from '@clerk/shared/types'; import { useCallback, useEffect } from 'react'; import { useCardState } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/SignIn/useResetPasswordFactor.tsx b/packages/clerk-js/src/ui/components/SignIn/useResetPasswordFactor.tsx index 3674dec86f7..6d6403c1455 100644 --- a/packages/clerk-js/src/ui/components/SignIn/useResetPasswordFactor.tsx +++ b/packages/clerk-js/src/ui/components/SignIn/useResetPasswordFactor.tsx @@ -1,4 +1,4 @@ -import type { ResetPasswordCodeFactor } from '@clerk/types'; +import type { ResetPasswordCodeFactor } from '@clerk/shared/types'; import { useCoreSignIn } from '../../contexts'; import { isResetPasswordStrategy } from './utils'; diff --git a/packages/clerk-js/src/ui/components/SignIn/utils.ts b/packages/clerk-js/src/ui/components/SignIn/utils.ts index c811038a46f..0f8873d0094 100644 --- a/packages/clerk-js/src/ui/components/SignIn/utils.ts +++ b/packages/clerk-js/src/ui/components/SignIn/utils.ts @@ -1,12 +1,12 @@ -import { titleize } from '@clerk/shared/underscore'; -import { isWebAuthnSupported } from '@clerk/shared/webauthn'; import type { PhoneCodeChannel, PreferredSignInStrategy, SignInFactor, SignInResource, SignInStrategy, -} from '@clerk/types'; +} from '@clerk/shared/types'; +import { titleize } from '@clerk/shared/underscore'; +import { isWebAuthnSupported } from '@clerk/shared/webauthn'; import { getPreferredPhoneCodeChannelByCountry } from '@/ui/utils/phoneUtils'; import type { FormControlState } from '@/ui/utils/useFormControl'; diff --git a/packages/clerk-js/src/ui/components/SignUp/SignUpEmailLinkCard.tsx b/packages/clerk-js/src/ui/components/SignUp/SignUpEmailLinkCard.tsx index db65dabf68b..4f08cd90a7c 100644 --- a/packages/clerk-js/src/ui/components/SignUp/SignUpEmailLinkCard.tsx +++ b/packages/clerk-js/src/ui/components/SignUp/SignUpEmailLinkCard.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { SignUpResource } from '@clerk/types'; +import type { SignUpResource } from '@clerk/shared/types'; import React from 'react'; import { VerificationLinkCard } from '@/ui/elements/VerificationLinkCard'; diff --git a/packages/clerk-js/src/ui/components/SignUp/SignUpSocialButtons.tsx b/packages/clerk-js/src/ui/components/SignUp/SignUpSocialButtons.tsx index ce8b2c9317f..a5f092f9a6e 100644 --- a/packages/clerk-js/src/ui/components/SignUp/SignUpSocialButtons.tsx +++ b/packages/clerk-js/src/ui/components/SignUp/SignUpSocialButtons.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { OAuthStrategy, PhoneCodeChannel } from '@clerk/types'; +import type { OAuthStrategy, PhoneCodeChannel } from '@clerk/shared/types'; import React from 'react'; import { useCardState } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx b/packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx index a178468d6b2..20f4a4711cd 100644 --- a/packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx +++ b/packages/clerk-js/src/ui/components/SignUp/SignUpStart.tsx @@ -1,6 +1,6 @@ import { getAlternativePhoneCodeProviderData } from '@clerk/shared/alternativePhoneCode'; import { useClerk } from '@clerk/shared/react'; -import type { PhoneCodeChannel, PhoneCodeChannelData, SignUpResource } from '@clerk/types'; +import type { PhoneCodeChannel, PhoneCodeChannelData, SignUpResource } from '@clerk/shared/types'; import React from 'react'; import { isClerkAPIResponseError } from '@/index.headless'; diff --git a/packages/clerk-js/src/ui/components/SignUp/SignUpStartAlternativePhoneCodePhoneNumberCard.tsx b/packages/clerk-js/src/ui/components/SignUp/SignUpStartAlternativePhoneCodePhoneNumberCard.tsx index bf92868f7c4..0c4a52a4368 100644 --- a/packages/clerk-js/src/ui/components/SignUp/SignUpStartAlternativePhoneCodePhoneNumberCard.tsx +++ b/packages/clerk-js/src/ui/components/SignUp/SignUpStartAlternativePhoneCodePhoneNumberCard.tsx @@ -1,4 +1,4 @@ -import type { PhoneCodeChannelData } from '@clerk/types'; +import type { PhoneCodeChannelData } from '@clerk/shared/types'; import { Card } from '@/ui/elements/Card'; import { useCardState } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/SignUp/SignUpVerificationCodeForm.tsx b/packages/clerk-js/src/ui/components/SignUp/SignUpVerificationCodeForm.tsx index d9d00c90a41..2f2d2780476 100644 --- a/packages/clerk-js/src/ui/components/SignUp/SignUpVerificationCodeForm.tsx +++ b/packages/clerk-js/src/ui/components/SignUp/SignUpVerificationCodeForm.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { SignUpResource } from '@clerk/types'; +import type { SignUpResource } from '@clerk/shared/types'; import React from 'react'; import type { VerificationCodeCardProps } from '@/ui/elements/VerificationCodeCard'; diff --git a/packages/clerk-js/src/ui/components/SignUp/__tests__/SignUpStart.test.tsx b/packages/clerk-js/src/ui/components/SignUp/__tests__/SignUpStart.test.tsx index c8b7a4d5ae9..ac433090735 100644 --- a/packages/clerk-js/src/ui/components/SignUp/__tests__/SignUpStart.test.tsx +++ b/packages/clerk-js/src/ui/components/SignUp/__tests__/SignUpStart.test.tsx @@ -1,5 +1,5 @@ import { OAUTH_PROVIDERS } from '@clerk/shared/oauth'; -import type { SignUpResource } from '@clerk/types'; +import type { SignUpResource } from '@clerk/shared/types'; import { describe, expect, it, vi } from 'vitest'; import { bindCreateFixtures } from '@/test/create-fixtures'; diff --git a/packages/clerk-js/src/ui/components/SignUp/__tests__/signUpFormHelpers.test.ts b/packages/clerk-js/src/ui/components/SignUp/__tests__/signUpFormHelpers.test.ts index 39e2ca27ddd..5472b9b3fd9 100644 --- a/packages/clerk-js/src/ui/components/SignUp/__tests__/signUpFormHelpers.test.ts +++ b/packages/clerk-js/src/ui/components/SignUp/__tests__/signUpFormHelpers.test.ts @@ -1,4 +1,4 @@ -import type { Attribute } from '@clerk/types'; +import type { Attribute } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { determineActiveFields, determineRequiredIdentifier, getInitialActiveIdentifier } from '../signUpFormHelpers'; diff --git a/packages/clerk-js/src/ui/components/SignUp/index.tsx b/packages/clerk-js/src/ui/components/SignUp/index.tsx index e5167b6743e..3ba8a39b6be 100644 --- a/packages/clerk-js/src/ui/components/SignUp/index.tsx +++ b/packages/clerk-js/src/ui/components/SignUp/index.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { SignUpModalProps, SignUpProps } from '@clerk/types'; +import type { SignUpModalProps, SignUpProps } from '@clerk/shared/types'; import React from 'react'; import { usePreloadTasks } from '@/ui/hooks/usePreloadTasks'; diff --git a/packages/clerk-js/src/ui/components/SignUp/signUpFormHelpers.ts b/packages/clerk-js/src/ui/components/SignUp/signUpFormHelpers.ts index dba5807f168..c2fc0c9ce3f 100644 --- a/packages/clerk-js/src/ui/components/SignUp/signUpFormHelpers.ts +++ b/packages/clerk-js/src/ui/components/SignUp/signUpFormHelpers.ts @@ -1,5 +1,5 @@ +import type { Attributes, SignUpResource, UserSettingsResource } from '@clerk/shared/types'; import { camelToSnake } from '@clerk/shared/underscore'; -import type { Attributes, SignUpResource, UserSettingsResource } from '@clerk/types'; import type { FieldState } from '../../common'; diff --git a/packages/clerk-js/src/ui/components/Statements/StatementsList.tsx b/packages/clerk-js/src/ui/components/Statements/StatementsList.tsx index 408bfeb3284..5b3c852176a 100644 --- a/packages/clerk-js/src/ui/components/Statements/StatementsList.tsx +++ b/packages/clerk-js/src/ui/components/Statements/StatementsList.tsx @@ -1,4 +1,4 @@ -import type { BillingStatementResource } from '@clerk/types'; +import type { BillingStatementResource } from '@clerk/shared/types'; import { DataTable, DataTableRow } from '@/ui/elements/DataTable'; import { formatDate } from '@/ui/utils/formatDate'; diff --git a/packages/clerk-js/src/ui/components/SubscriptionDetails/index.tsx b/packages/clerk-js/src/ui/components/SubscriptionDetails/index.tsx index a8828713205..ea4d929c2a0 100644 --- a/packages/clerk-js/src/ui/components/SubscriptionDetails/index.tsx +++ b/packages/clerk-js/src/ui/components/SubscriptionDetails/index.tsx @@ -4,7 +4,7 @@ import type { __internal_SubscriptionDetailsProps, BillingPlanResource, BillingSubscriptionItemResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import * as React from 'react'; import { useCallback, useContext, useState } from 'react'; diff --git a/packages/clerk-js/src/ui/components/Subscriptions/SubscriptionsList.tsx b/packages/clerk-js/src/ui/components/Subscriptions/SubscriptionsList.tsx index 92def451c1b..df24ecb9b06 100644 --- a/packages/clerk-js/src/ui/components/Subscriptions/SubscriptionsList.tsx +++ b/packages/clerk-js/src/ui/components/Subscriptions/SubscriptionsList.tsx @@ -1,4 +1,4 @@ -import type { BillingPlanResource, BillingSubscriptionItemResource } from '@clerk/types'; +import type { BillingPlanResource, BillingSubscriptionItemResource } from '@clerk/shared/types'; import { useMemo } from 'react'; import { useProtect } from '@/ui/common/Gate'; diff --git a/packages/clerk-js/src/ui/components/Subscriptions/__tests__/SubscriptionsList.test.tsx b/packages/clerk-js/src/ui/components/Subscriptions/__tests__/SubscriptionsList.test.tsx index 75940db1673..05e0a873412 100644 --- a/packages/clerk-js/src/ui/components/Subscriptions/__tests__/SubscriptionsList.test.tsx +++ b/packages/clerk-js/src/ui/components/Subscriptions/__tests__/SubscriptionsList.test.tsx @@ -1,4 +1,4 @@ -import type { BillingPayerResourceType } from '@clerk/types'; +import type { BillingPayerResourceType } from '@clerk/shared/types'; import { describe, expect, it, vi } from 'vitest'; import { bindCreateFixtures } from '@/test/create-fixtures'; diff --git a/packages/clerk-js/src/ui/components/Subscriptions/badge.tsx b/packages/clerk-js/src/ui/components/Subscriptions/badge.tsx index 87249075782..6ccb804d659 100644 --- a/packages/clerk-js/src/ui/components/Subscriptions/badge.tsx +++ b/packages/clerk-js/src/ui/components/Subscriptions/badge.tsx @@ -1,4 +1,4 @@ -import type { BillingSubscriptionItemResource } from '@clerk/types'; +import type { BillingSubscriptionItemResource } from '@clerk/shared/types'; import { Badge, localizationKeys } from '@/ui/customizables'; import type { ElementDescriptor } from '@/ui/customizables/elementDescriptors'; diff --git a/packages/clerk-js/src/ui/components/UserAvatar/index.tsx b/packages/clerk-js/src/ui/components/UserAvatar/index.tsx index 0894ffca0cb..5fdcab971b0 100644 --- a/packages/clerk-js/src/ui/components/UserAvatar/index.tsx +++ b/packages/clerk-js/src/ui/components/UserAvatar/index.tsx @@ -1,5 +1,5 @@ import { useUser } from '@clerk/shared/react/index'; -import type { UserAvatarProps } from '@clerk/types'; +import type { UserAvatarProps } from '@clerk/shared/types'; import { useUserAvatarContext, withCoreUserGuard } from '@/ui/contexts'; import { descriptors } from '@/ui/customizables'; diff --git a/packages/clerk-js/src/ui/components/UserButton/SessionActions.tsx b/packages/clerk-js/src/ui/components/UserButton/SessionActions.tsx index c7780d5b78f..7b09f4f38eb 100644 --- a/packages/clerk-js/src/ui/components/UserButton/SessionActions.tsx +++ b/packages/clerk-js/src/ui/components/UserButton/SessionActions.tsx @@ -1,4 +1,4 @@ -import type { SignedInSessionResource } from '@clerk/types'; +import type { SignedInSessionResource } from '@clerk/shared/types'; import { Action, Actions, SmallAction, SmallActions } from '@/ui/elements/Actions'; import { PreviewButton } from '@/ui/elements/PreviewButton'; diff --git a/packages/clerk-js/src/ui/components/UserButton/UserButtonPopover.tsx b/packages/clerk-js/src/ui/components/UserButton/UserButtonPopover.tsx index 7ee5facb770..28aca51b525 100644 --- a/packages/clerk-js/src/ui/components/UserButton/UserButtonPopover.tsx +++ b/packages/clerk-js/src/ui/components/UserButton/UserButtonPopover.tsx @@ -1,5 +1,5 @@ import { useSession, useUser } from '@clerk/shared/react'; -import type { SignedInSessionResource } from '@clerk/types'; +import type { SignedInSessionResource } from '@clerk/shared/types'; import React from 'react'; import { PopoverCard } from '@/ui/elements/PopoverCard'; diff --git a/packages/clerk-js/src/ui/components/UserButton/useMultisessionActions.tsx b/packages/clerk-js/src/ui/components/UserButton/useMultisessionActions.tsx index dd3d37e9c1f..cb6e110363c 100644 --- a/packages/clerk-js/src/ui/components/UserButton/useMultisessionActions.tsx +++ b/packages/clerk-js/src/ui/components/UserButton/useMultisessionActions.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { SignedInSessionResource, UserButtonProps, UserResource } from '@clerk/types'; +import type { SignedInSessionResource, UserButtonProps, UserResource } from '@clerk/shared/types'; import { navigateIfTaskExists } from '@/core/sessionTasks'; import { useEnvironment } from '@/ui/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/ActiveDevicesSection.tsx b/packages/clerk-js/src/ui/components/UserProfile/ActiveDevicesSection.tsx index cd711b3bc6d..a268c3aa22f 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/ActiveDevicesSection.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/ActiveDevicesSection.tsx @@ -1,5 +1,5 @@ import { useReverification, useSession, useUser } from '@clerk/shared/react'; -import type { SessionWithActivitiesResource, SignedInSessionResource } from '@clerk/types'; +import type { SessionWithActivitiesResource, SignedInSessionResource } from '@clerk/shared/types'; import { FullHeightLoader } from '@/ui/elements/FullHeightLoader'; import { ProfileSection } from '@/ui/elements/Section'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/AddAuthenticatorApp.tsx b/packages/clerk-js/src/ui/components/UserProfile/AddAuthenticatorApp.tsx index 156e48b5ff4..e41ae5f6567 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/AddAuthenticatorApp.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/AddAuthenticatorApp.tsx @@ -1,6 +1,6 @@ import { isClerkRuntimeError } from '@clerk/shared/error'; import { useReverification, useUser } from '@clerk/shared/react'; -import type { TOTPResource } from '@clerk/types'; +import type { TOTPResource } from '@clerk/shared/types'; import React from 'react'; import { ClipboardInput } from '@/ui/elements/ClipboardInput'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsMenu.tsx b/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsMenu.tsx index e7e7220f649..c5f1fa8c65e 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsMenu.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsMenu.tsx @@ -1,5 +1,5 @@ import { useReverification, useUser } from '@clerk/shared/react'; -import type { OAuthProvider, OAuthStrategy } from '@clerk/types'; +import type { OAuthProvider, OAuthStrategy } from '@clerk/shared/types'; import { useCardState } from '@/ui/elements/contexts'; import { ProfileSection } from '@/ui/elements/Section'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsSection.tsx b/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsSection.tsx index 0ea07127ba6..b26c7e2787d 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsSection.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/ConnectedAccountsSection.tsx @@ -1,5 +1,5 @@ import { useReverification, useUser } from '@clerk/shared/react'; -import type { ExternalAccountResource, OAuthProvider, OAuthScope, OAuthStrategy } from '@clerk/types'; +import type { ExternalAccountResource, OAuthProvider, OAuthScope, OAuthStrategy } from '@clerk/shared/types'; import { Fragment, useState } from 'react'; import { Card } from '@/ui/elements/Card'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/EmailForm.tsx b/packages/clerk-js/src/ui/components/UserProfile/EmailForm.tsx index 42dbcfc93a1..6f7a0ee6d8c 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/EmailForm.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/EmailForm.tsx @@ -1,5 +1,9 @@ import { useReverification, useUser } from '@clerk/shared/react'; -import type { EmailAddressResource, EnvironmentResource, PrepareEmailAddressVerificationParams } from '@clerk/types'; +import type { + EmailAddressResource, + EnvironmentResource, + PrepareEmailAddressVerificationParams, +} from '@clerk/shared/types'; import React from 'react'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/EmailsSection.tsx b/packages/clerk-js/src/ui/components/UserProfile/EmailsSection.tsx index d560ee42be4..cbc75f77292 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/EmailsSection.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/EmailsSection.tsx @@ -1,5 +1,5 @@ import { useReverification, useUser } from '@clerk/shared/react'; -import type { EmailAddressResource } from '@clerk/types'; +import type { EmailAddressResource } from '@clerk/shared/types'; import { Fragment } from 'react'; import { useCardState } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/EnterpriseAccountsSection.tsx b/packages/clerk-js/src/ui/components/UserProfile/EnterpriseAccountsSection.tsx index 14bdd216e11..b50311e9875 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/EnterpriseAccountsSection.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/EnterpriseAccountsSection.tsx @@ -1,5 +1,5 @@ import { useUser } from '@clerk/shared/react'; -import type { EnterpriseAccountResource, OAuthProvider } from '@clerk/types'; +import type { EnterpriseAccountResource, OAuthProvider } from '@clerk/shared/types'; import { ProfileSection } from '@/ui/elements/Section'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/MfaBackupCodeCreateForm.tsx b/packages/clerk-js/src/ui/components/UserProfile/MfaBackupCodeCreateForm.tsx index 8731f3502f1..ed4dc9c668b 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/MfaBackupCodeCreateForm.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/MfaBackupCodeCreateForm.tsx @@ -1,6 +1,6 @@ import { isReverificationCancelledError } from '@clerk/shared/error'; import { useReverification, useUser } from '@clerk/shared/react'; -import type { BackupCodeResource } from '@clerk/types'; +import type { BackupCodeResource } from '@clerk/shared/types'; import React from 'react'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/MfaForm.tsx b/packages/clerk-js/src/ui/components/UserProfile/MfaForm.tsx index c25563aad48..3e917f9acb4 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/MfaForm.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/MfaForm.tsx @@ -1,5 +1,5 @@ import { useUser } from '@clerk/shared/react'; -import type { VerificationStrategy } from '@clerk/types'; +import type { VerificationStrategy } from '@clerk/shared/types'; import React from 'react'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/MfaPhoneCodeScreen.tsx b/packages/clerk-js/src/ui/components/UserProfile/MfaPhoneCodeScreen.tsx index 7cdc6960681..adeb6c4b607 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/MfaPhoneCodeScreen.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/MfaPhoneCodeScreen.tsx @@ -1,5 +1,5 @@ import { useReverification, useUser } from '@clerk/shared/react'; -import type { PhoneNumberResource } from '@clerk/types'; +import type { PhoneNumberResource } from '@clerk/shared/types'; import React from 'react'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/MfaScreens.tsx b/packages/clerk-js/src/ui/components/UserProfile/MfaScreens.tsx index a4fd4082ba7..d3b11ad3dc8 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/MfaScreens.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/MfaScreens.tsx @@ -1,4 +1,4 @@ -import type { VerificationStrategy } from '@clerk/types'; +import type { VerificationStrategy } from '@clerk/shared/types'; import { useActionContext } from '../../elements/Action/ActionRoot'; import { MfaBackupCodeCreateForm } from './MfaBackupCodeCreateForm'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/MfaSection.tsx b/packages/clerk-js/src/ui/components/UserProfile/MfaSection.tsx index 8744c0506a8..d1a7d9e787d 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/MfaSection.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/MfaSection.tsx @@ -1,5 +1,5 @@ import { useUser } from '@clerk/shared/react'; -import type { PhoneNumberResource, VerificationStrategy } from '@clerk/types'; +import type { PhoneNumberResource, VerificationStrategy } from '@clerk/shared/types'; import React, { Fragment, useState } from 'react'; import { useCardState } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/MfaTOTPScreen.tsx b/packages/clerk-js/src/ui/components/UserProfile/MfaTOTPScreen.tsx index f318ee39707..6793997b06c 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/MfaTOTPScreen.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/MfaTOTPScreen.tsx @@ -1,4 +1,4 @@ -import type { TOTPResource } from '@clerk/types'; +import type { TOTPResource } from '@clerk/shared/types'; import React from 'react'; import { withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/PasskeySection.tsx b/packages/clerk-js/src/ui/components/UserProfile/PasskeySection.tsx index 846aa2a1314..90d49f34563 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/PasskeySection.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/PasskeySection.tsx @@ -1,5 +1,5 @@ import { useClerk, useReverification, useUser } from '@clerk/shared/react'; -import type { PasskeyResource } from '@clerk/types'; +import type { PasskeyResource } from '@clerk/shared/types'; import React, { Fragment, useState } from 'react'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/PasswordForm.tsx b/packages/clerk-js/src/ui/components/UserProfile/PasswordForm.tsx index fea72613ca6..b788afb405f 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/PasswordForm.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/PasswordForm.tsx @@ -1,5 +1,5 @@ import { useReverification, useSession, useUser } from '@clerk/shared/react'; -import type { UserResource } from '@clerk/types'; +import type { UserResource } from '@clerk/shared/types'; import { useRef } from 'react'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/PhoneForm.tsx b/packages/clerk-js/src/ui/components/UserProfile/PhoneForm.tsx index 4c43cf3440c..29d822897e8 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/PhoneForm.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/PhoneForm.tsx @@ -1,5 +1,5 @@ import { useReverification, useUser } from '@clerk/shared/react'; -import type { PhoneNumberResource, UserResource } from '@clerk/types'; +import type { PhoneNumberResource, UserResource } from '@clerk/shared/types'; import React from 'react'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/PhoneSection.tsx b/packages/clerk-js/src/ui/components/UserProfile/PhoneSection.tsx index 584d2b31aae..4f6b3585ea5 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/PhoneSection.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/PhoneSection.tsx @@ -1,5 +1,5 @@ import { useReverification, useUser } from '@clerk/shared/react'; -import type { PhoneNumberResource, UserResource } from '@clerk/types'; +import type { PhoneNumberResource, UserResource } from '@clerk/shared/types'; import { Fragment } from 'react'; import { useCardState } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/RemoveResourceForm.tsx b/packages/clerk-js/src/ui/components/UserProfile/RemoveResourceForm.tsx index 755efbb3e0c..5832d485b39 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/RemoveResourceForm.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/RemoveResourceForm.tsx @@ -1,5 +1,5 @@ import { useUser } from '@clerk/shared/react'; -import type { PasskeyResource } from '@clerk/types'; +import type { PasskeyResource } from '@clerk/shared/types'; import React from 'react'; import type { FormProps } from '@/ui/elements/FormContainer'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/UserProfileAvatarUploader.tsx b/packages/clerk-js/src/ui/components/UserProfile/UserProfileAvatarUploader.tsx index 2fa16283ee1..adf9a917433 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/UserProfileAvatarUploader.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/UserProfileAvatarUploader.tsx @@ -1,4 +1,4 @@ -import type { UserResource } from '@clerk/types'; +import type { UserResource } from '@clerk/shared/types'; import type { AvatarUploaderProps } from '@/ui/elements/AvatarUploader'; import { AvatarUploader } from '@/ui/elements/AvatarUploader'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/VerifyTOTP.tsx b/packages/clerk-js/src/ui/components/UserProfile/VerifyTOTP.tsx index 2d635abeae4..7aad031dccf 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/VerifyTOTP.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/VerifyTOTP.tsx @@ -1,5 +1,5 @@ import { useUser } from '@clerk/shared/react'; -import type { TOTPResource } from '@clerk/types'; +import type { TOTPResource } from '@clerk/shared/types'; import React from 'react'; import { useFieldOTP } from '@/ui/elements/CodeControl'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/VerifyWithCode.tsx b/packages/clerk-js/src/ui/components/UserProfile/VerifyWithCode.tsx index a0326f800a1..2dfbf022c45 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/VerifyWithCode.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/VerifyWithCode.tsx @@ -1,4 +1,4 @@ -import type { EmailAddressResource, PhoneNumberResource } from '@clerk/types'; +import type { EmailAddressResource, PhoneNumberResource } from '@clerk/shared/types'; import React from 'react'; import { useFieldOTP } from '@/ui/elements/CodeControl'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/VerifyWithEnterpriseConnection.tsx b/packages/clerk-js/src/ui/components/UserProfile/VerifyWithEnterpriseConnection.tsx index 3dacc8d9760..cd5223f4a68 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/VerifyWithEnterpriseConnection.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/VerifyWithEnterpriseConnection.tsx @@ -1,4 +1,4 @@ -import type { EmailAddressResource } from '@clerk/types'; +import type { EmailAddressResource } from '@clerk/shared/types'; import React from 'react'; import { useCardState } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/VerifyWithLink.tsx b/packages/clerk-js/src/ui/components/UserProfile/VerifyWithLink.tsx index 557caea1a9d..c5fdf96e5c2 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/VerifyWithLink.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/VerifyWithLink.tsx @@ -1,4 +1,4 @@ -import type { EmailAddressResource } from '@clerk/types'; +import type { EmailAddressResource } from '@clerk/shared/types'; import React from 'react'; import { useCardState } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/Web3Form.tsx b/packages/clerk-js/src/ui/components/UserProfile/Web3Form.tsx index 7cd060f4b69..8ebea04501d 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/Web3Form.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/Web3Form.tsx @@ -1,5 +1,5 @@ import { useReverification, useUser } from '@clerk/shared/react'; -import type { Web3Provider, Web3Strategy } from '@clerk/types'; +import type { Web3Provider, Web3Strategy } from '@clerk/shared/types'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; import { ProfileSection } from '@/ui/elements/Section'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/__tests__/AccountPage.test.tsx b/packages/clerk-js/src/ui/components/UserProfile/__tests__/AccountPage.test.tsx index 9af87e7234a..3af7b0b0f56 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/__tests__/AccountPage.test.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/__tests__/AccountPage.test.tsx @@ -1,4 +1,4 @@ -import type { EnterpriseAccountJSON } from '@clerk/types'; +import type { EnterpriseAccountJSON } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { bindCreateFixtures } from '@/test/create-fixtures'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/__tests__/ConnectedAccountsSection.test.tsx b/packages/clerk-js/src/ui/components/UserProfile/__tests__/ConnectedAccountsSection.test.tsx index 6ecc6dbc4bd..4ad555d8874 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/__tests__/ConnectedAccountsSection.test.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/__tests__/ConnectedAccountsSection.test.tsx @@ -1,4 +1,4 @@ -import type { ExternalAccountResource } from '@clerk/types'; +import type { ExternalAccountResource } from '@clerk/shared/types'; import { act, waitFor } from '@testing-library/react'; import { describe, expect, it } from 'vitest'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/__tests__/MfaPage.test.tsx b/packages/clerk-js/src/ui/components/UserProfile/__tests__/MfaPage.test.tsx index 992a7a6affe..3fa7152f9e2 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/__tests__/MfaPage.test.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/__tests__/MfaPage.test.tsx @@ -4,7 +4,7 @@ import type { PhoneNumberResource, TOTPResource, VerificationJSON, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { act, waitFor } from '@testing-library/react'; import { afterEach, describe, expect, it, vi } from 'vitest'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/__tests__/PasskeysSection.test.tsx b/packages/clerk-js/src/ui/components/UserProfile/__tests__/PasskeysSection.test.tsx index f39fc17deb7..ca388374504 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/__tests__/PasskeysSection.test.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/__tests__/PasskeysSection.test.tsx @@ -1,4 +1,4 @@ -import type { PasskeyJSON, PasskeyResource } from '@clerk/types'; +import type { PasskeyJSON, PasskeyResource } from '@clerk/shared/types'; import { act } from '@testing-library/react'; import { describe, expect, it, vi } from 'vitest'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/__tests__/SecurityPage.test.tsx b/packages/clerk-js/src/ui/components/UserProfile/__tests__/SecurityPage.test.tsx index 3869baf55d6..47f8004c652 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/__tests__/SecurityPage.test.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/__tests__/SecurityPage.test.tsx @@ -1,4 +1,4 @@ -import type { SessionWithActivitiesResource } from '@clerk/types'; +import type { SessionWithActivitiesResource } from '@clerk/shared/types'; import { within } from '@testing-library/react'; import { beforeEach, describe, expect, it, vi } from 'vitest'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/__tests__/UserProfile.test.tsx b/packages/clerk-js/src/ui/components/UserProfile/__tests__/UserProfile.test.tsx index 64d66b97df7..3cb9884bb50 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/__tests__/UserProfile.test.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/__tests__/UserProfile.test.tsx @@ -1,4 +1,4 @@ -import type { CustomPage } from '@clerk/types'; +import type { CustomPage } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { bindCreateFixtures } from '@/test/create-fixtures'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/__tests__/UserProfileSection.test.tsx b/packages/clerk-js/src/ui/components/UserProfile/__tests__/UserProfileSection.test.tsx index 679a68e967b..d0f9cd41e66 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/__tests__/UserProfileSection.test.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/__tests__/UserProfileSection.test.tsx @@ -1,4 +1,4 @@ -import type { ImageResource } from '@clerk/types'; +import type { ImageResource } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { bindCreateFixtures } from '@/test/create-fixtures'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/__tests__/UsernameSection.test.tsx b/packages/clerk-js/src/ui/components/UserProfile/__tests__/UsernameSection.test.tsx index 57232776255..d676368ffde 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/__tests__/UsernameSection.test.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/__tests__/UsernameSection.test.tsx @@ -1,4 +1,4 @@ -import type { UserResource } from '@clerk/types'; +import type { UserResource } from '@clerk/shared/types'; import React from 'react'; import { describe, expect, it } from 'vitest'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/__tests__/utils.test.ts b/packages/clerk-js/src/ui/components/UserProfile/__tests__/utils.test.ts index dc9094a2d88..0bd3c3ec31b 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/__tests__/utils.test.ts +++ b/packages/clerk-js/src/ui/components/UserProfile/__tests__/utils.test.ts @@ -1,4 +1,4 @@ -import type { VerificationJSON } from '@clerk/types'; +import type { VerificationJSON } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { EmailAddress, PhoneNumber } from '../../../../core/resources'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/index.tsx b/packages/clerk-js/src/ui/components/UserProfile/index.tsx index 95749f80b9c..29092fce6d1 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/index.tsx +++ b/packages/clerk-js/src/ui/components/UserProfile/index.tsx @@ -1,4 +1,4 @@ -import type { UserProfileModalProps, UserProfileProps } from '@clerk/types'; +import type { UserProfileModalProps, UserProfileProps } from '@clerk/shared/types'; import React from 'react'; import { withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserProfile/utils.ts b/packages/clerk-js/src/ui/components/UserProfile/utils.ts index 2474b03b404..e10993d2ba2 100644 --- a/packages/clerk-js/src/ui/components/UserProfile/utils.ts +++ b/packages/clerk-js/src/ui/components/UserProfile/utils.ts @@ -4,7 +4,7 @@ import type { PhoneNumberResource, UserResource, Web3WalletResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; type IDable = { id: string }; diff --git a/packages/clerk-js/src/ui/components/UserVerification/AlternativeMethods.tsx b/packages/clerk-js/src/ui/components/UserVerification/AlternativeMethods.tsx index fd0a8102da5..1cf30a7d5c7 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/AlternativeMethods.tsx +++ b/packages/clerk-js/src/ui/components/UserVerification/AlternativeMethods.tsx @@ -1,4 +1,4 @@ -import type { SessionVerificationFirstFactor, SignInFactor } from '@clerk/types'; +import type { SessionVerificationFirstFactor, SignInFactor } from '@clerk/shared/types'; import React from 'react'; import { ArrowBlockButton } from '@/ui/elements/ArrowBlockButton'; diff --git a/packages/clerk-js/src/ui/components/UserVerification/UVFactorOneCodeForm.tsx b/packages/clerk-js/src/ui/components/UserVerification/UVFactorOneCodeForm.tsx index a549189258e..c798cfe26bd 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/UVFactorOneCodeForm.tsx +++ b/packages/clerk-js/src/ui/components/UserVerification/UVFactorOneCodeForm.tsx @@ -1,5 +1,5 @@ import { useSession } from '@clerk/shared/react'; -import type { EmailCodeFactor, PhoneCodeFactor } from '@clerk/types'; +import type { EmailCodeFactor, PhoneCodeFactor } from '@clerk/shared/types'; import React from 'react'; import { useCardState } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserVerification/UVFactorOneEmailCodeCard.tsx b/packages/clerk-js/src/ui/components/UserVerification/UVFactorOneEmailCodeCard.tsx index fb6fc6f7d8d..c91d3fbebf1 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/UVFactorOneEmailCodeCard.tsx +++ b/packages/clerk-js/src/ui/components/UserVerification/UVFactorOneEmailCodeCard.tsx @@ -1,4 +1,4 @@ -import type { EmailCodeFactor } from '@clerk/types'; +import type { EmailCodeFactor } from '@clerk/shared/types'; import { Flow, localizationKeys } from '../../customizables'; import type { UVFactorOneCodeCard } from './UVFactorOneCodeForm'; diff --git a/packages/clerk-js/src/ui/components/UserVerification/UVFactorOnePhoneCodeCard.tsx b/packages/clerk-js/src/ui/components/UserVerification/UVFactorOnePhoneCodeCard.tsx index 8d264993871..5f942fadb9b 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/UVFactorOnePhoneCodeCard.tsx +++ b/packages/clerk-js/src/ui/components/UserVerification/UVFactorOnePhoneCodeCard.tsx @@ -1,4 +1,4 @@ -import type { PhoneCodeFactor } from '@clerk/types'; +import type { PhoneCodeFactor } from '@clerk/shared/types'; import { Flow, localizationKeys } from '../../customizables'; import type { UVFactorOneCodeCard } from './UVFactorOneCodeForm'; diff --git a/packages/clerk-js/src/ui/components/UserVerification/UVFactorTwoAlternativeMethods.tsx b/packages/clerk-js/src/ui/components/UserVerification/UVFactorTwoAlternativeMethods.tsx index 67c1d641447..a014a462451 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/UVFactorTwoAlternativeMethods.tsx +++ b/packages/clerk-js/src/ui/components/UserVerification/UVFactorTwoAlternativeMethods.tsx @@ -1,4 +1,4 @@ -import type { SessionVerificationSecondFactor } from '@clerk/types'; +import type { SessionVerificationSecondFactor } from '@clerk/shared/types'; import React from 'react'; import { ArrowBlockButton } from '@/ui/elements/ArrowBlockButton'; diff --git a/packages/clerk-js/src/ui/components/UserVerification/UVFactorTwoCodeForm.tsx b/packages/clerk-js/src/ui/components/UserVerification/UVFactorTwoCodeForm.tsx index c4ab166b6a1..d37a48d80eb 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/UVFactorTwoCodeForm.tsx +++ b/packages/clerk-js/src/ui/components/UserVerification/UVFactorTwoCodeForm.tsx @@ -1,5 +1,5 @@ import { useSession } from '@clerk/shared/react'; -import type { PhoneCodeFactor, SessionVerificationResource, TOTPFactor } from '@clerk/types'; +import type { PhoneCodeFactor, SessionVerificationResource, TOTPFactor } from '@clerk/shared/types'; import React from 'react'; import { useCardState } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserVerification/UVFactorTwoPhoneCodeCard.tsx b/packages/clerk-js/src/ui/components/UserVerification/UVFactorTwoPhoneCodeCard.tsx index 2358839d07d..122cd2ec3c6 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/UVFactorTwoPhoneCodeCard.tsx +++ b/packages/clerk-js/src/ui/components/UserVerification/UVFactorTwoPhoneCodeCard.tsx @@ -1,5 +1,5 @@ import { useSession } from '@clerk/shared/react'; -import type { PhoneCodeFactor } from '@clerk/types'; +import type { PhoneCodeFactor } from '@clerk/shared/types'; import { Flow, localizationKeys } from '../../customizables'; import type { UVFactorTwoCodeCard } from './UVFactorTwoCodeForm'; diff --git a/packages/clerk-js/src/ui/components/UserVerification/UserVerificationFactorOne.tsx b/packages/clerk-js/src/ui/components/UserVerification/UserVerificationFactorOne.tsx index 46d50883426..14bc9867c0e 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/UserVerificationFactorOne.tsx +++ b/packages/clerk-js/src/ui/components/UserVerification/UserVerificationFactorOne.tsx @@ -1,4 +1,4 @@ -import type { SessionVerificationFirstFactor, SignInFactor } from '@clerk/types'; +import type { SessionVerificationFirstFactor, SignInFactor } from '@clerk/shared/types'; import React, { useEffect, useMemo } from 'react'; import { useCardState, withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserVerification/UserVerificationFactorTwo.tsx b/packages/clerk-js/src/ui/components/UserVerification/UserVerificationFactorTwo.tsx index d9d9a2b123b..b8518578031 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/UserVerificationFactorTwo.tsx +++ b/packages/clerk-js/src/ui/components/UserVerification/UserVerificationFactorTwo.tsx @@ -1,4 +1,4 @@ -import type { SessionVerificationResource, SessionVerificationSecondFactor, SignInFactor } from '@clerk/types'; +import type { SessionVerificationResource, SessionVerificationSecondFactor, SignInFactor } from '@clerk/shared/types'; import React, { useEffect, useMemo } from 'react'; import { withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/UserVerification/UserVerificationFactorTwoTOTP.tsx b/packages/clerk-js/src/ui/components/UserVerification/UserVerificationFactorTwoTOTP.tsx index 6385f2f6c7a..b5ccaa1dfd1 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/UserVerificationFactorTwoTOTP.tsx +++ b/packages/clerk-js/src/ui/components/UserVerification/UserVerificationFactorTwoTOTP.tsx @@ -1,4 +1,4 @@ -import type { TOTPFactor } from '@clerk/types'; +import type { TOTPFactor } from '@clerk/shared/types'; import { Flow, localizationKeys } from '../../customizables'; import type { UVFactorTwoCodeCard } from './UVFactorTwoCodeForm'; diff --git a/packages/clerk-js/src/ui/components/UserVerification/index.tsx b/packages/clerk-js/src/ui/components/UserVerification/index.tsx index f00cd57fae9..2958b8aa585 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/index.tsx +++ b/packages/clerk-js/src/ui/components/UserVerification/index.tsx @@ -1,4 +1,4 @@ -import type { __internal_UserVerificationModalProps, __internal_UserVerificationProps } from '@clerk/types'; +import type { __internal_UserVerificationModalProps, __internal_UserVerificationProps } from '@clerk/shared/types'; import React, { useEffect } from 'react'; import { UserVerificationContext, withCoreSessionSwitchGuard } from '../../contexts'; diff --git a/packages/clerk-js/src/ui/components/UserVerification/use-after-verification.ts b/packages/clerk-js/src/ui/components/UserVerification/use-after-verification.ts index c3c8a7e0447..27b4fb3e875 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/use-after-verification.ts +++ b/packages/clerk-js/src/ui/components/UserVerification/use-after-verification.ts @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { SessionVerificationResource } from '@clerk/types'; +import type { SessionVerificationResource } from '@clerk/shared/types'; import { useCallback } from 'react'; import { clerkInvalidFAPIResponse } from '../../../core/errors'; diff --git a/packages/clerk-js/src/ui/components/UserVerification/useReverificationAlternativeStrategies.ts b/packages/clerk-js/src/ui/components/UserVerification/useReverificationAlternativeStrategies.ts index e25cd84d083..439cde2a8b3 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/useReverificationAlternativeStrategies.ts +++ b/packages/clerk-js/src/ui/components/UserVerification/useReverificationAlternativeStrategies.ts @@ -1,5 +1,5 @@ +import type { SignInFactor, SignInFirstFactor, SignInSecondFactor } from '@clerk/shared/types'; import { isWebAuthnSupported } from '@clerk/shared/webauthn'; -import type { SignInFactor, SignInFirstFactor, SignInSecondFactor } from '@clerk/types'; import { useMemo } from 'react'; import { allStrategiesButtonsComparator } from '@/ui/utils/factorSorting'; diff --git a/packages/clerk-js/src/ui/components/UserVerification/useUserVerificationSession.tsx b/packages/clerk-js/src/ui/components/UserVerification/useUserVerificationSession.tsx index 78c7dbdf590..11091f7e393 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/useUserVerificationSession.tsx +++ b/packages/clerk-js/src/ui/components/UserVerification/useUserVerificationSession.tsx @@ -1,5 +1,5 @@ import { useSession } from '@clerk/shared/react'; -import type { SessionVerificationLevel } from '@clerk/types'; +import type { SessionVerificationLevel } from '@clerk/shared/types'; import { useMemo } from 'react'; import { LoadingCard } from '@/ui/elements/LoadingCard'; diff --git a/packages/clerk-js/src/ui/components/UserVerification/utils.ts b/packages/clerk-js/src/ui/components/UserVerification/utils.ts index d3f4a919e81..71d0521f2c5 100644 --- a/packages/clerk-js/src/ui/components/UserVerification/utils.ts +++ b/packages/clerk-js/src/ui/components/UserVerification/utils.ts @@ -1,4 +1,4 @@ -import type { SignInFactor } from '@clerk/types'; +import type { SignInFactor } from '@clerk/shared/types'; export function sortByPrimaryFactor(a: SignInFactor, b: SignInFactor) { if ('primary' in a && a.primary && !('primary' in b && b.primary)) { diff --git a/packages/clerk-js/src/ui/components/Waitlist/WaitlistForm.tsx b/packages/clerk-js/src/ui/components/Waitlist/WaitlistForm.tsx index 3439cde5729..32a7cf2d4d0 100644 --- a/packages/clerk-js/src/ui/components/Waitlist/WaitlistForm.tsx +++ b/packages/clerk-js/src/ui/components/Waitlist/WaitlistForm.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { JoinWaitlistParams } from '@clerk/types'; +import type { JoinWaitlistParams } from '@clerk/shared/types'; import { Card } from '@/ui/elements/Card'; import { useCardState } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/components/Waitlist/__tests__/Waitlist.test.tsx b/packages/clerk-js/src/ui/components/Waitlist/__tests__/Waitlist.test.tsx index fbb5f5460d8..eeb3c193e9b 100644 --- a/packages/clerk-js/src/ui/components/Waitlist/__tests__/Waitlist.test.tsx +++ b/packages/clerk-js/src/ui/components/Waitlist/__tests__/Waitlist.test.tsx @@ -1,4 +1,4 @@ -import type { WaitlistResource } from '@clerk/types'; +import type { WaitlistResource } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { bindCreateFixtures } from '@/test/create-fixtures'; diff --git a/packages/clerk-js/src/ui/components/Waitlist/index.tsx b/packages/clerk-js/src/ui/components/Waitlist/index.tsx index a57b4edc776..5b69098a434 100644 --- a/packages/clerk-js/src/ui/components/Waitlist/index.tsx +++ b/packages/clerk-js/src/ui/components/Waitlist/index.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { WaitlistModalProps } from '@clerk/types'; +import type { WaitlistModalProps } from '@clerk/shared/types'; import { Card } from '@/ui/elements/Card'; import { withCardStateProvider } from '@/ui/elements/contexts'; diff --git a/packages/clerk-js/src/ui/contexts/AcceptedUserInvitations.tsx b/packages/clerk-js/src/ui/contexts/AcceptedUserInvitations.tsx index d1049fabdea..30d15af685b 100644 --- a/packages/clerk-js/src/ui/contexts/AcceptedUserInvitations.tsx +++ b/packages/clerk-js/src/ui/contexts/AcceptedUserInvitations.tsx @@ -1,4 +1,4 @@ -import type { OrganizationResource, UserOrganizationInvitationResource } from '@clerk/types'; +import type { OrganizationResource, UserOrganizationInvitationResource } from '@clerk/shared/types'; import type { Dispatch, ReactNode, SetStateAction } from 'react'; import { createContext, useContext, useState } from 'react'; diff --git a/packages/clerk-js/src/ui/contexts/ClerkUIComponentsContext.tsx b/packages/clerk-js/src/ui/contexts/ClerkUIComponentsContext.tsx index 08fbecdc7f6..88e37f6c092 100644 --- a/packages/clerk-js/src/ui/contexts/ClerkUIComponentsContext.tsx +++ b/packages/clerk-js/src/ui/contexts/ClerkUIComponentsContext.tsx @@ -5,7 +5,7 @@ import type { TaskChooseOrganizationProps, UserButtonProps, WaitlistProps, -} from '@clerk/types'; +} from '@clerk/shared/types'; import type { ReactNode } from 'react'; import type { AvailableComponentName, AvailableComponentProps } from '../types'; diff --git a/packages/clerk-js/src/ui/contexts/CoreClerkContextWrapper.tsx b/packages/clerk-js/src/ui/contexts/CoreClerkContextWrapper.tsx index b4389dc9363..85e451a784d 100644 --- a/packages/clerk-js/src/ui/contexts/CoreClerkContextWrapper.tsx +++ b/packages/clerk-js/src/ui/contexts/CoreClerkContextWrapper.tsx @@ -6,7 +6,7 @@ import { SessionContext, UserContext, } from '@clerk/shared/react'; -import type { Clerk, LoadedClerk, Resources } from '@clerk/types'; +import type { Clerk, LoadedClerk, Resources } from '@clerk/shared/types'; import React from 'react'; import { assertClerkSingletonExists } from './utils'; diff --git a/packages/clerk-js/src/ui/contexts/CoreClientContext.tsx b/packages/clerk-js/src/ui/contexts/CoreClientContext.tsx index 3212a6f8ac5..5f22e8bc3a9 100644 --- a/packages/clerk-js/src/ui/contexts/CoreClientContext.tsx +++ b/packages/clerk-js/src/ui/contexts/CoreClientContext.tsx @@ -1,5 +1,5 @@ import { assertContextExists, ClientContext, useClientContext } from '@clerk/shared/react'; -import type { SignInResource, SignUpResource } from '@clerk/types'; +import type { SignInResource, SignUpResource } from '@clerk/shared/types'; export function useCoreSignIn(): SignInResource { const ctx = useClientContext(); diff --git a/packages/clerk-js/src/ui/contexts/EnvironmentContext.tsx b/packages/clerk-js/src/ui/contexts/EnvironmentContext.tsx index e903ff5f5bb..8bbb52f7bb3 100644 --- a/packages/clerk-js/src/ui/contexts/EnvironmentContext.tsx +++ b/packages/clerk-js/src/ui/contexts/EnvironmentContext.tsx @@ -1,4 +1,4 @@ -import type { EnvironmentResource } from '@clerk/types'; +import type { EnvironmentResource } from '@clerk/shared/types'; import * as React from 'react'; import { assertContextExists } from './utils'; diff --git a/packages/clerk-js/src/ui/contexts/OptionsContext.tsx b/packages/clerk-js/src/ui/contexts/OptionsContext.tsx index e822bf1847d..a0269b2be6d 100644 --- a/packages/clerk-js/src/ui/contexts/OptionsContext.tsx +++ b/packages/clerk-js/src/ui/contexts/OptionsContext.tsx @@ -1,4 +1,4 @@ -import type { ClerkOptions } from '@clerk/types'; +import type { ClerkOptions } from '@clerk/shared/types'; import React from 'react'; export const OptionsContext = React.createContext({}); diff --git a/packages/clerk-js/src/ui/contexts/components/CreateOrganization.ts b/packages/clerk-js/src/ui/contexts/components/CreateOrganization.ts index 32d4f13c69f..dcc87e59324 100644 --- a/packages/clerk-js/src/ui/contexts/components/CreateOrganization.ts +++ b/packages/clerk-js/src/ui/contexts/components/CreateOrganization.ts @@ -1,4 +1,4 @@ -import type { OrganizationResource } from '@clerk/types'; +import type { OrganizationResource } from '@clerk/shared/types'; import { createContext, useContext } from 'react'; import { useEnvironment } from '../../contexts'; diff --git a/packages/clerk-js/src/ui/contexts/components/GoogleOneTap.ts b/packages/clerk-js/src/ui/contexts/components/GoogleOneTap.ts index 08008e3480c..6f46e2c4760 100644 --- a/packages/clerk-js/src/ui/contexts/components/GoogleOneTap.ts +++ b/packages/clerk-js/src/ui/contexts/components/GoogleOneTap.ts @@ -1,4 +1,4 @@ -import type { HandleOAuthCallbackParams } from '@clerk/types'; +import type { HandleOAuthCallbackParams } from '@clerk/shared/types'; import { createContext, useCallback, useContext } from 'react'; import { buildURL } from '../../../utils'; diff --git a/packages/clerk-js/src/ui/contexts/components/OrganizationList.ts b/packages/clerk-js/src/ui/contexts/components/OrganizationList.ts index 0c07c4161f4..25248247943 100644 --- a/packages/clerk-js/src/ui/contexts/components/OrganizationList.ts +++ b/packages/clerk-js/src/ui/contexts/components/OrganizationList.ts @@ -1,4 +1,4 @@ -import type { OrganizationResource, UserResource } from '@clerk/types'; +import type { OrganizationResource, UserResource } from '@clerk/shared/types'; import { createContext, useContext } from 'react'; import { useEnvironment } from '../../contexts'; diff --git a/packages/clerk-js/src/ui/contexts/components/OrganizationSwitcher.ts b/packages/clerk-js/src/ui/contexts/components/OrganizationSwitcher.ts index b4afacd7bd5..86629b3ff80 100644 --- a/packages/clerk-js/src/ui/contexts/components/OrganizationSwitcher.ts +++ b/packages/clerk-js/src/ui/contexts/components/OrganizationSwitcher.ts @@ -1,4 +1,4 @@ -import type { OrganizationResource, UserResource } from '@clerk/types'; +import type { OrganizationResource, UserResource } from '@clerk/shared/types'; import { createContext, useContext } from 'react'; import { useEnvironment } from '../../contexts'; diff --git a/packages/clerk-js/src/ui/contexts/components/Plans.tsx b/packages/clerk-js/src/ui/contexts/components/Plans.tsx index f76d0d7e0fb..f9aedefc97a 100644 --- a/packages/clerk-js/src/ui/contexts/components/Plans.tsx +++ b/packages/clerk-js/src/ui/contexts/components/Plans.tsx @@ -12,7 +12,7 @@ import type { BillingPlanResource, BillingSubscriptionItemResource, BillingSubscriptionPlanPeriod, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { useCallback, useMemo } from 'react'; import { getClosestProfileScrollBox } from '@/ui/utils/getClosestProfileScrollBox'; diff --git a/packages/clerk-js/src/ui/contexts/components/SignIn.ts b/packages/clerk-js/src/ui/contexts/components/SignIn.ts index 35242867ea6..ef07c2f095f 100644 --- a/packages/clerk-js/src/ui/contexts/components/SignIn.ts +++ b/packages/clerk-js/src/ui/contexts/components/SignIn.ts @@ -1,6 +1,6 @@ import { useClerk } from '@clerk/shared/react'; +import type { SessionResource } from '@clerk/shared/types'; import { isAbsoluteUrl } from '@clerk/shared/url'; -import type { SessionResource } from '@clerk/types'; import { createContext, useContext, useMemo } from 'react'; import { getTaskEndpoint } from '@/core/sessionTasks'; diff --git a/packages/clerk-js/src/ui/contexts/components/SignUp.ts b/packages/clerk-js/src/ui/contexts/components/SignUp.ts index 836ab65f3e8..783b610918b 100644 --- a/packages/clerk-js/src/ui/contexts/components/SignUp.ts +++ b/packages/clerk-js/src/ui/contexts/components/SignUp.ts @@ -1,6 +1,6 @@ import { useClerk } from '@clerk/shared/react'; +import type { SessionResource } from '@clerk/shared/types'; import { isAbsoluteUrl } from '@clerk/shared/url'; -import type { SessionResource } from '@clerk/types'; import { createContext, useContext, useMemo } from 'react'; import { getTaskEndpoint, INTERNAL_SESSION_TASK_ROUTE_BY_KEY } from '@/core/sessionTasks'; diff --git a/packages/clerk-js/src/ui/contexts/components/SubscriberType.ts b/packages/clerk-js/src/ui/contexts/components/SubscriberType.ts index 941f9d25cce..016df6f94e5 100644 --- a/packages/clerk-js/src/ui/contexts/components/SubscriberType.ts +++ b/packages/clerk-js/src/ui/contexts/components/SubscriberType.ts @@ -1,4 +1,4 @@ -import type { ForPayerType } from '@clerk/types'; +import type { ForPayerType } from '@clerk/shared/types'; import { createContext, useContext } from 'react'; const DEFAUlT = 'user'; diff --git a/packages/clerk-js/src/ui/contexts/utils.ts b/packages/clerk-js/src/ui/contexts/utils.ts index 7b5905cdb42..ea944e46928 100644 --- a/packages/clerk-js/src/ui/contexts/utils.ts +++ b/packages/clerk-js/src/ui/contexts/utils.ts @@ -1,5 +1,5 @@ +import type { Clerk } from '@clerk/shared/types'; import { snakeToCamel } from '@clerk/shared/underscore'; -import type { Clerk } from '@clerk/types'; import { clerkCoreErrorContextProviderNotFound, clerkCoreErrorNoClerkSingleton } from '../../core/errors'; import { createDynamicParamParser } from '../../utils'; diff --git a/packages/clerk-js/src/ui/customizables/classGeneration.ts b/packages/clerk-js/src/ui/customizables/classGeneration.ts index f2e9bfa7011..ad1ebf44d46 100644 --- a/packages/clerk-js/src/ui/customizables/classGeneration.ts +++ b/packages/clerk-js/src/ui/customizables/classGeneration.ts @@ -1,4 +1,4 @@ -import type { Elements, ElementState } from '@clerk/types'; +import type { Elements, ElementState } from '@clerk/shared/types'; import type { FlowMetadata } from '../elements/contexts'; import type { ElementDescriptor, ElementId } from './elementDescriptors'; diff --git a/packages/clerk-js/src/ui/customizables/elementDescriptors.ts b/packages/clerk-js/src/ui/customizables/elementDescriptors.ts index c3607ae87a3..30535333dc0 100644 --- a/packages/clerk-js/src/ui/customizables/elementDescriptors.ts +++ b/packages/clerk-js/src/ui/customizables/elementDescriptors.ts @@ -1,4 +1,4 @@ -import type { ElementObjectKey, ElementsConfig, IdSelectors, StateSelectors } from '@clerk/types'; +import type { ElementObjectKey, ElementsConfig, IdSelectors, StateSelectors } from '@clerk/shared/types'; import { containsAllOfType } from '../utils/containsAllOf'; import { fromEntries } from '../utils/fromEntries'; diff --git a/packages/clerk-js/src/ui/customizables/parseAppearance.ts b/packages/clerk-js/src/ui/customizables/parseAppearance.ts index c542f24c0b2..11348a8f29d 100644 --- a/packages/clerk-js/src/ui/customizables/parseAppearance.ts +++ b/packages/clerk-js/src/ui/customizables/parseAppearance.ts @@ -1,5 +1,5 @@ +import type { Appearance, CaptchaAppearanceOptions, DeepPartial, Elements, Layout, Theme } from '@clerk/shared/types'; import { fastDeepMergeAndReplace } from '@clerk/shared/utils'; -import type { Appearance, CaptchaAppearanceOptions, DeepPartial, Elements, Layout, Theme } from '@clerk/types'; import { baseTheme, getBaseTheme } from '../baseTheme'; import { createInternalTheme, defaultInternalTheme } from '../foundations'; diff --git a/packages/clerk-js/src/ui/customizables/parseVariables.ts b/packages/clerk-js/src/ui/customizables/parseVariables.ts index 8bb9b95fd38..56df896df03 100644 --- a/packages/clerk-js/src/ui/customizables/parseVariables.ts +++ b/packages/clerk-js/src/ui/customizables/parseVariables.ts @@ -1,4 +1,4 @@ -import type { Theme } from '@clerk/types'; +import type { Theme } from '@clerk/shared/types'; import { createShadowSet, generateShadow } from '../foundations/shadows'; import { BORDER_RADIUS_SCALE_RATIOS, spaceScaleKeys } from '../foundations/sizes'; diff --git a/packages/clerk-js/src/ui/elements/Card/CardAction.tsx b/packages/clerk-js/src/ui/elements/Card/CardAction.tsx index 08c559409a3..f7664d77b79 100644 --- a/packages/clerk-js/src/ui/elements/Card/CardAction.tsx +++ b/packages/clerk-js/src/ui/elements/Card/CardAction.tsx @@ -1,4 +1,4 @@ -import type { CardActionId } from '@clerk/types'; +import type { CardActionId } from '@clerk/shared/types'; import React from 'react'; import { descriptors, Flex, Text } from '../../customizables'; diff --git a/packages/clerk-js/src/ui/elements/FieldControl.tsx b/packages/clerk-js/src/ui/elements/FieldControl.tsx index f6166cad5ce..e3b6563540e 100644 --- a/packages/clerk-js/src/ui/elements/FieldControl.tsx +++ b/packages/clerk-js/src/ui/elements/FieldControl.tsx @@ -1,4 +1,4 @@ -import type { FieldId } from '@clerk/types'; +import type { FieldId } from '@clerk/shared/types'; import type { PropsWithChildren } from 'react'; import React, { forwardRef } from 'react'; diff --git a/packages/clerk-js/src/ui/elements/Form.tsx b/packages/clerk-js/src/ui/elements/Form.tsx index 4fcee751d18..c8e6a6eabee 100644 --- a/packages/clerk-js/src/ui/elements/Form.tsx +++ b/packages/clerk-js/src/ui/elements/Form.tsx @@ -1,5 +1,5 @@ import { createContextAndHook } from '@clerk/shared/react'; -import type { FieldId } from '@clerk/types'; +import type { FieldId } from '@clerk/shared/types'; import type { PropsWithChildren } from 'react'; import React, { forwardRef, useState } from 'react'; diff --git a/packages/clerk-js/src/ui/elements/FormControl.tsx b/packages/clerk-js/src/ui/elements/FormControl.tsx index 53f0422eb4f..d94887dfddd 100644 --- a/packages/clerk-js/src/ui/elements/FormControl.tsx +++ b/packages/clerk-js/src/ui/elements/FormControl.tsx @@ -1,5 +1,5 @@ +import type { FieldId } from '@clerk/shared/types'; import { titleize } from '@clerk/shared/underscore'; -import type { FieldId } from '@clerk/types'; import { useCallback, useMemo, useRef, useState } from 'react'; import { diff --git a/packages/clerk-js/src/ui/elements/Menu.tsx b/packages/clerk-js/src/ui/elements/Menu.tsx index 483a06495bc..0788ffdda6a 100644 --- a/packages/clerk-js/src/ui/elements/Menu.tsx +++ b/packages/clerk-js/src/ui/elements/Menu.tsx @@ -1,5 +1,5 @@ import { createContextAndHook } from '@clerk/shared/react'; -import type { MenuId } from '@clerk/types'; +import type { MenuId } from '@clerk/shared/types'; import type { Placement } from '@floating-ui/react'; import type { PropsWithChildren } from 'react'; import React, { cloneElement, isValidElement, useLayoutEffect, useRef } from 'react'; diff --git a/packages/clerk-js/src/ui/elements/OrganizationAvatar.tsx b/packages/clerk-js/src/ui/elements/OrganizationAvatar.tsx index e8bb65045b5..7f449455955 100644 --- a/packages/clerk-js/src/ui/elements/OrganizationAvatar.tsx +++ b/packages/clerk-js/src/ui/elements/OrganizationAvatar.tsx @@ -1,4 +1,4 @@ -import type { OrganizationResource } from '@clerk/types'; +import type { OrganizationResource } from '@clerk/shared/types'; import type { PropsOfComponent } from '../styledSystem'; import { Avatar } from './Avatar'; diff --git a/packages/clerk-js/src/ui/elements/OrganizationPreview.tsx b/packages/clerk-js/src/ui/elements/OrganizationPreview.tsx index d0cd9dce4e8..e1727fb75ff 100644 --- a/packages/clerk-js/src/ui/elements/OrganizationPreview.tsx +++ b/packages/clerk-js/src/ui/elements/OrganizationPreview.tsx @@ -1,4 +1,4 @@ -import type { OrganizationPreviewId, UserOrganizationInvitationResource, UserResource } from '@clerk/types'; +import type { OrganizationPreviewId, UserOrganizationInvitationResource, UserResource } from '@clerk/shared/types'; import React from 'react'; import { descriptors, Flex, Text } from '../customizables'; diff --git a/packages/clerk-js/src/ui/elements/PasswordInput.tsx b/packages/clerk-js/src/ui/elements/PasswordInput.tsx index d50ba0d3125..ec85dc5b6e1 100644 --- a/packages/clerk-js/src/ui/elements/PasswordInput.tsx +++ b/packages/clerk-js/src/ui/elements/PasswordInput.tsx @@ -1,4 +1,4 @@ -import type { ClerkAPIError } from '@clerk/types'; +import type { ClerkAPIError } from '@clerk/shared/types'; import type { ChangeEvent } from 'react'; import React, { forwardRef, useRef, useState } from 'react'; diff --git a/packages/clerk-js/src/ui/elements/Section.tsx b/packages/clerk-js/src/ui/elements/Section.tsx index 42a7636cf43..d5cc3846248 100644 --- a/packages/clerk-js/src/ui/elements/Section.tsx +++ b/packages/clerk-js/src/ui/elements/Section.tsx @@ -1,4 +1,4 @@ -import type { ProfileSectionId } from '@clerk/types'; +import type { ProfileSectionId } from '@clerk/shared/types'; import { forwardRef, isValidElement, useLayoutEffect, useRef, useState } from 'react'; import type { LocalizationKey } from '../customizables'; diff --git a/packages/clerk-js/src/ui/elements/Select.tsx b/packages/clerk-js/src/ui/elements/Select.tsx index 80640a16661..77a76187bca 100644 --- a/packages/clerk-js/src/ui/elements/Select.tsx +++ b/packages/clerk-js/src/ui/elements/Select.tsx @@ -1,5 +1,5 @@ import { createContextAndHook } from '@clerk/shared/react'; -import type { SelectId } from '@clerk/types'; +import type { SelectId } from '@clerk/shared/types'; import type { PropsWithChildren, ReactElement, ReactNode } from 'react'; import React, { useState } from 'react'; diff --git a/packages/clerk-js/src/ui/elements/SocialButtons.tsx b/packages/clerk-js/src/ui/elements/SocialButtons.tsx index d565b0b0c58..dd242540af3 100644 --- a/packages/clerk-js/src/ui/elements/SocialButtons.tsx +++ b/packages/clerk-js/src/ui/elements/SocialButtons.tsx @@ -1,6 +1,6 @@ import { getAlternativePhoneCodeProviderData } from '@clerk/shared/alternativePhoneCode'; import { useClerk } from '@clerk/shared/react'; -import type { OAuthProvider, OAuthStrategy, PhoneCodeChannel, Web3Provider, Web3Strategy } from '@clerk/types'; +import type { OAuthProvider, OAuthStrategy, PhoneCodeChannel, Web3Provider, Web3Strategy } from '@clerk/shared/types'; import type { Ref } from 'react'; import React, { forwardRef, isValidElement } from 'react'; diff --git a/packages/clerk-js/src/ui/elements/ThreeDotsMenu.tsx b/packages/clerk-js/src/ui/elements/ThreeDotsMenu.tsx index 9cc826d1114..12e65a8d456 100644 --- a/packages/clerk-js/src/ui/elements/ThreeDotsMenu.tsx +++ b/packages/clerk-js/src/ui/elements/ThreeDotsMenu.tsx @@ -1,4 +1,4 @@ -import type { MenuId } from '@clerk/types'; +import type { MenuId } from '@clerk/shared/types'; import type { LocalizationKey } from '../customizables'; import { Button, descriptors, Icon } from '../customizables'; diff --git a/packages/clerk-js/src/ui/elements/UserAvatar.tsx b/packages/clerk-js/src/ui/elements/UserAvatar.tsx index d59f98cb67e..58137b16683 100644 --- a/packages/clerk-js/src/ui/elements/UserAvatar.tsx +++ b/packages/clerk-js/src/ui/elements/UserAvatar.tsx @@ -1,4 +1,4 @@ -import type { UserResource } from '@clerk/types'; +import type { UserResource } from '@clerk/shared/types'; import { getFullName, getInitials } from '../../utils/user'; import type { PropsOfComponent } from '../styledSystem'; diff --git a/packages/clerk-js/src/ui/elements/UserPreview.tsx b/packages/clerk-js/src/ui/elements/UserPreview.tsx index 73b52fc2ebf..94cb280d73f 100644 --- a/packages/clerk-js/src/ui/elements/UserPreview.tsx +++ b/packages/clerk-js/src/ui/elements/UserPreview.tsx @@ -1,4 +1,4 @@ -import type { ExternalAccountResource, SamlAccountResource, UserPreviewId, UserResource } from '@clerk/types'; +import type { ExternalAccountResource, SamlAccountResource, UserPreviewId, UserResource } from '@clerk/shared/types'; import React from 'react'; import { getFullName, getIdentifier } from '../../utils/user'; diff --git a/packages/clerk-js/src/ui/elements/contexts/index.tsx b/packages/clerk-js/src/ui/elements/contexts/index.tsx index aa6c5227d48..fb158a9e62c 100644 --- a/packages/clerk-js/src/ui/elements/contexts/index.tsx +++ b/packages/clerk-js/src/ui/elements/contexts/index.tsx @@ -1,5 +1,5 @@ import { createContextAndHook } from '@clerk/shared/react'; -import type { ClerkAPIError, ClerkRuntimeError } from '@clerk/types'; +import type { ClerkAPIError, ClerkRuntimeError } from '@clerk/shared/types'; import { FloatingTree, useFloatingParentNodeId } from '@floating-ui/react'; import React from 'react'; diff --git a/packages/clerk-js/src/ui/hooks/__tests__/useDevMode.test.tsx b/packages/clerk-js/src/ui/hooks/__tests__/useDevMode.test.tsx index cf932e78391..d0f972efdd7 100644 --- a/packages/clerk-js/src/ui/hooks/__tests__/useDevMode.test.tsx +++ b/packages/clerk-js/src/ui/hooks/__tests__/useDevMode.test.tsx @@ -1,4 +1,4 @@ -import type { EnvironmentResource } from '@clerk/types'; +import type { EnvironmentResource } from '@clerk/shared/types'; import { renderHook } from '@testing-library/react'; import { describe, expect, test, vi } from 'vitest'; diff --git a/packages/clerk-js/src/ui/hooks/useAlternativeStrategies.ts b/packages/clerk-js/src/ui/hooks/useAlternativeStrategies.ts index 7cb819449f8..23029170e09 100644 --- a/packages/clerk-js/src/ui/hooks/useAlternativeStrategies.ts +++ b/packages/clerk-js/src/ui/hooks/useAlternativeStrategies.ts @@ -1,5 +1,5 @@ +import type { SignInFactor, SignInFirstFactor } from '@clerk/shared/types'; import { isWebAuthnSupported } from '@clerk/shared/webauthn'; -import type { SignInFactor, SignInFirstFactor } from '@clerk/types'; import { factorHasLocalStrategy, isResetPasswordStrategy } from '../components/SignIn/utils'; import { allStrategiesButtonsComparator } from '../utils/factorSorting'; diff --git a/packages/clerk-js/src/ui/hooks/useEmailLink.ts b/packages/clerk-js/src/ui/hooks/useEmailLink.ts index 35dd8f83142..89f3772115f 100644 --- a/packages/clerk-js/src/ui/hooks/useEmailLink.ts +++ b/packages/clerk-js/src/ui/hooks/useEmailLink.ts @@ -5,7 +5,7 @@ import type { SignInStartEmailLinkFlowParams, SignUpResource, StartEmailLinkFlowParams, -} from '@clerk/types'; +} from '@clerk/shared/types'; import React from 'react'; type EmailLinkable = SignUpResource | EmailAddressResource | SignInResource; diff --git a/packages/clerk-js/src/ui/hooks/useEnabledThirdPartyProviders.tsx b/packages/clerk-js/src/ui/hooks/useEnabledThirdPartyProviders.tsx index bd1daa408de..3694a6cba88 100644 --- a/packages/clerk-js/src/ui/hooks/useEnabledThirdPartyProviders.tsx +++ b/packages/clerk-js/src/ui/hooks/useEnabledThirdPartyProviders.tsx @@ -1,7 +1,6 @@ import { ALTERNATIVE_PHONE_CODE_PROVIDERS } from '@clerk/shared/alternativePhoneCode'; import { iconImageUrl } from '@clerk/shared/constants'; import { OAUTH_PROVIDERS } from '@clerk/shared/oauth'; -import { WEB3_PROVIDERS } from '@clerk/shared/web3'; import type { OAuthProvider, OAuthStrategy, @@ -9,7 +8,8 @@ import type { PhoneCodeProvider, Web3Provider, Web3Strategy, -} from '@clerk/types'; +} from '@clerk/shared/types'; +import { WEB3_PROVIDERS } from '@clerk/shared/web3'; import { useEnvironment } from '../contexts/EnvironmentContext'; import { fromEntries } from '../utils/fromEntries'; diff --git a/packages/clerk-js/src/ui/hooks/useEnterpriseSSOLink.ts b/packages/clerk-js/src/ui/hooks/useEnterpriseSSOLink.ts index d25b74ef76b..b77833606cd 100644 --- a/packages/clerk-js/src/ui/hooks/useEnterpriseSSOLink.ts +++ b/packages/clerk-js/src/ui/hooks/useEnterpriseSSOLink.ts @@ -2,7 +2,7 @@ import type { CreateEnterpriseSSOLinkFlowReturn, EmailAddressResource, StartEnterpriseSSOLinkFlowParams, -} from '@clerk/types'; +} from '@clerk/shared/types'; import React from 'react'; type EnterpriseSSOLinkEmailAddressReturn = CreateEnterpriseSSOLinkFlowReturn< diff --git a/packages/clerk-js/src/ui/hooks/useFetchRoles.ts b/packages/clerk-js/src/ui/hooks/useFetchRoles.ts index 42887bc4c90..5e572365840 100644 --- a/packages/clerk-js/src/ui/hooks/useFetchRoles.ts +++ b/packages/clerk-js/src/ui/hooks/useFetchRoles.ts @@ -1,5 +1,5 @@ import { useOrganization } from '@clerk/shared/react'; -import type { GetRolesParams } from '@clerk/types'; +import type { GetRolesParams } from '@clerk/shared/types'; import { useProtect } from '../common'; import { useLocalizations } from '../localization'; diff --git a/packages/clerk-js/src/ui/hooks/useMultipleSessions.ts b/packages/clerk-js/src/ui/hooks/useMultipleSessions.ts index b70217d8b88..a1a510ab585 100644 --- a/packages/clerk-js/src/ui/hooks/useMultipleSessions.ts +++ b/packages/clerk-js/src/ui/hooks/useMultipleSessions.ts @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { UserResource } from '@clerk/types'; +import type { UserResource } from '@clerk/shared/types'; type UseMultipleSessionsParam = { user: UserResource | null | undefined; diff --git a/packages/clerk-js/src/ui/hooks/usePassword.ts b/packages/clerk-js/src/ui/hooks/usePassword.ts index 3e1a1b4c7e8..aee9553081d 100644 --- a/packages/clerk-js/src/ui/hooks/usePassword.ts +++ b/packages/clerk-js/src/ui/hooks/usePassword.ts @@ -1,5 +1,5 @@ +import type { PasswordValidation } from '@clerk/shared/types'; import { noop } from '@clerk/shared/utils'; -import type { PasswordValidation } from '@clerk/types'; import { useCallback, useMemo } from 'react'; import type { UsePasswordCbs, UsePasswordConfig } from '../../utils/passwords/password'; diff --git a/packages/clerk-js/src/ui/lazyModules/MountedCheckoutDrawer.tsx b/packages/clerk-js/src/ui/lazyModules/MountedCheckoutDrawer.tsx index dbaeb3c38ee..aab2f2b8814 100644 --- a/packages/clerk-js/src/ui/lazyModules/MountedCheckoutDrawer.tsx +++ b/packages/clerk-js/src/ui/lazyModules/MountedCheckoutDrawer.tsx @@ -1,5 +1,5 @@ import { useUser } from '@clerk/shared/react'; -import type { __internal_CheckoutProps, Appearance } from '@clerk/types'; +import type { __internal_CheckoutProps, Appearance } from '@clerk/shared/types'; import { Checkout } from './components'; import { LazyDrawerRenderer } from './providers'; diff --git a/packages/clerk-js/src/ui/lazyModules/MountedPlanDetailDrawer.tsx b/packages/clerk-js/src/ui/lazyModules/MountedPlanDetailDrawer.tsx index 3b703f1c4f2..b144468fe16 100644 --- a/packages/clerk-js/src/ui/lazyModules/MountedPlanDetailDrawer.tsx +++ b/packages/clerk-js/src/ui/lazyModules/MountedPlanDetailDrawer.tsx @@ -1,5 +1,5 @@ import { useUser } from '@clerk/shared/react'; -import type { __internal_PlanDetailsProps, Appearance } from '@clerk/types'; +import type { __internal_PlanDetailsProps, Appearance } from '@clerk/shared/types'; import { PlanDetails } from './components'; import { LazyDrawerRenderer } from './providers'; diff --git a/packages/clerk-js/src/ui/lazyModules/MountedSubscriptionDetailDrawer.tsx b/packages/clerk-js/src/ui/lazyModules/MountedSubscriptionDetailDrawer.tsx index 53835c691f7..8ab75ff7ccb 100644 --- a/packages/clerk-js/src/ui/lazyModules/MountedSubscriptionDetailDrawer.tsx +++ b/packages/clerk-js/src/ui/lazyModules/MountedSubscriptionDetailDrawer.tsx @@ -1,5 +1,5 @@ import { useUser } from '@clerk/shared/react'; -import type { __internal_SubscriptionDetailsProps, Appearance } from '@clerk/types'; +import type { __internal_SubscriptionDetailsProps, Appearance } from '@clerk/shared/types'; import { SubscriptionDetails } from '../components/SubscriptionDetails'; import { LazyDrawerRenderer } from './providers'; diff --git a/packages/clerk-js/src/ui/lazyModules/providers.tsx b/packages/clerk-js/src/ui/lazyModules/providers.tsx index c84f5c561df..9e2c871f23d 100644 --- a/packages/clerk-js/src/ui/lazyModules/providers.tsx +++ b/packages/clerk-js/src/ui/lazyModules/providers.tsx @@ -1,5 +1,5 @@ import { deprecated } from '@clerk/shared/deprecated'; -import type { Appearance } from '@clerk/types'; +import type { Appearance } from '@clerk/shared/types'; import React, { lazy, Suspense } from 'react'; import type { FlowMetadata } from '../elements/contexts'; diff --git a/packages/clerk-js/src/ui/localization/defaultEnglishResource.ts b/packages/clerk-js/src/ui/localization/defaultEnglishResource.ts index b59b108a9d1..81219b7f1ef 100644 --- a/packages/clerk-js/src/ui/localization/defaultEnglishResource.ts +++ b/packages/clerk-js/src/ui/localization/defaultEnglishResource.ts @@ -1,4 +1,4 @@ import { enUS } from '@clerk/localizations'; -import type { DeepRequired } from '@clerk/types'; +import type { DeepRequired } from '@clerk/shared/types'; export const defaultResource = enUS as DeepRequired; diff --git a/packages/clerk-js/src/ui/localization/localizationKeys.ts b/packages/clerk-js/src/ui/localization/localizationKeys.ts index 934c97ed583..39ed721db61 100644 --- a/packages/clerk-js/src/ui/localization/localizationKeys.ts +++ b/packages/clerk-js/src/ui/localization/localizationKeys.ts @@ -1,4 +1,4 @@ -import type { __internal_LocalizationResource, PathValue, RecordToPath } from '@clerk/types'; +import type { __internal_LocalizationResource, PathValue, RecordToPath } from '@clerk/shared/types'; type Value = string | number | boolean | Date; type Whitespace = ' ' | '\t' | '\n' | '\r'; diff --git a/packages/clerk-js/src/ui/localization/makeLocalizable.tsx b/packages/clerk-js/src/ui/localization/makeLocalizable.tsx index 8784ceb9fb4..d3dd4506905 100644 --- a/packages/clerk-js/src/ui/localization/makeLocalizable.tsx +++ b/packages/clerk-js/src/ui/localization/makeLocalizable.tsx @@ -1,5 +1,5 @@ import { isClerkRuntimeError } from '@clerk/shared/error'; -import type { ClerkAPIError, ClerkRuntimeError, LocalizationResource } from '@clerk/types'; +import type { ClerkAPIError, ClerkRuntimeError, LocalizationResource } from '@clerk/shared/types'; import React from 'react'; import { useOptions } from '../contexts'; diff --git a/packages/clerk-js/src/ui/localization/parseLocalization.ts b/packages/clerk-js/src/ui/localization/parseLocalization.ts index 5c9616d780a..7bb446f1b7f 100644 --- a/packages/clerk-js/src/ui/localization/parseLocalization.ts +++ b/packages/clerk-js/src/ui/localization/parseLocalization.ts @@ -1,5 +1,5 @@ +import type { DeepPartial, LocalizationResource } from '@clerk/shared/types'; import { fastDeepMergeAndReplace } from '@clerk/shared/utils'; -import type { DeepPartial, LocalizationResource } from '@clerk/types'; import { dequal as deepEqual } from 'dequal'; import { useOptions } from '../contexts'; diff --git a/packages/clerk-js/src/ui/portal/index.tsx b/packages/clerk-js/src/ui/portal/index.tsx index 69850b4a69d..cf64c1155ba 100644 --- a/packages/clerk-js/src/ui/portal/index.tsx +++ b/packages/clerk-js/src/ui/portal/index.tsx @@ -1,4 +1,4 @@ -import type { RoutingOptions } from '@clerk/types'; +import type { RoutingOptions } from '@clerk/shared/types'; import React, { Suspense } from 'react'; import ReactDOM from 'react-dom'; diff --git a/packages/clerk-js/src/ui/primitives/hooks/useFormField.tsx b/packages/clerk-js/src/ui/primitives/hooks/useFormField.tsx index 03856d2473f..c09d161c9bf 100644 --- a/packages/clerk-js/src/ui/primitives/hooks/useFormField.tsx +++ b/packages/clerk-js/src/ui/primitives/hooks/useFormField.tsx @@ -1,5 +1,5 @@ import { createContextAndHook } from '@clerk/shared/react'; -import type { FieldId } from '@clerk/types'; +import type { FieldId } from '@clerk/shared/types'; import React from 'react'; import type { useFormControl as useFormControlUtil } from '../../utils/useFormControl'; diff --git a/packages/clerk-js/src/ui/router/BaseRouter.tsx b/packages/clerk-js/src/ui/router/BaseRouter.tsx index 1874116aa04..734fc138937 100644 --- a/packages/clerk-js/src/ui/router/BaseRouter.tsx +++ b/packages/clerk-js/src/ui/router/BaseRouter.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { NavigateOptions } from '@clerk/types'; +import type { NavigateOptions } from '@clerk/shared/types'; import React from 'react'; import { getQueryParams, stringifyQueryParams, trimTrailingSlash } from '../../utils'; diff --git a/packages/clerk-js/src/ui/router/PathRouter.tsx b/packages/clerk-js/src/ui/router/PathRouter.tsx index 6c1edc35045..c34f5a404b0 100644 --- a/packages/clerk-js/src/ui/router/PathRouter.tsx +++ b/packages/clerk-js/src/ui/router/PathRouter.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { NavigateOptions } from '@clerk/types'; +import type { NavigateOptions } from '@clerk/shared/types'; import React from 'react'; import { hasUrlInFragment, mergeFragmentIntoUrl, stripOrigin } from '../../utils'; diff --git a/packages/clerk-js/src/ui/router/Route.tsx b/packages/clerk-js/src/ui/router/Route.tsx index 1e0e046f75c..c2d7ea16f2f 100644 --- a/packages/clerk-js/src/ui/router/Route.tsx +++ b/packages/clerk-js/src/ui/router/Route.tsx @@ -1,5 +1,5 @@ import { useClerk } from '@clerk/shared/react'; -import type { LoadedClerk } from '@clerk/types'; +import type { LoadedClerk } from '@clerk/shared/types'; import React from 'react'; import { pathFromFullPath, trimTrailingSlash } from '../../utils'; diff --git a/packages/clerk-js/src/ui/types.ts b/packages/clerk-js/src/ui/types.ts index f4cb6238221..3f9fe2a27ef 100644 --- a/packages/clerk-js/src/ui/types.ts +++ b/packages/clerk-js/src/ui/types.ts @@ -24,7 +24,7 @@ import type { UserButtonProps, UserProfileProps, WaitlistProps, -} from '@clerk/types'; +} from '@clerk/shared/types'; export type { __internal_OAuthConsentProps, diff --git a/packages/clerk-js/src/ui/utils/__tests__/createCustomMenuItems.test.ts b/packages/clerk-js/src/ui/utils/__tests__/createCustomMenuItems.test.ts index 19857f840af..b62ad0dd23c 100644 --- a/packages/clerk-js/src/ui/utils/__tests__/createCustomMenuItems.test.ts +++ b/packages/clerk-js/src/ui/utils/__tests__/createCustomMenuItems.test.ts @@ -1,4 +1,4 @@ -import type { CustomMenuItem } from '@clerk/types'; +import type { CustomMenuItem } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { createUserButtonCustomMenuItems as cUBCMI } from '../createCustomMenuItems'; diff --git a/packages/clerk-js/src/ui/utils/__tests__/createCustomPages.test.ts b/packages/clerk-js/src/ui/utils/__tests__/createCustomPages.test.ts index b131af1e770..d22496e5f84 100644 --- a/packages/clerk-js/src/ui/utils/__tests__/createCustomPages.test.ts +++ b/packages/clerk-js/src/ui/utils/__tests__/createCustomPages.test.ts @@ -1,4 +1,4 @@ -import type { CustomPage } from '@clerk/types'; +import type { CustomPage } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { diff --git a/packages/clerk-js/src/ui/utils/__tests__/factorSorting.test.ts b/packages/clerk-js/src/ui/utils/__tests__/factorSorting.test.ts index fe266c1a2cc..15d260b4ad0 100644 --- a/packages/clerk-js/src/ui/utils/__tests__/factorSorting.test.ts +++ b/packages/clerk-js/src/ui/utils/__tests__/factorSorting.test.ts @@ -1,4 +1,4 @@ -import type { SignInFactor, SignInStrategy } from '@clerk/types'; +import type { SignInFactor, SignInStrategy } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { diff --git a/packages/clerk-js/src/ui/utils/__tests__/phoneUtils.test.ts b/packages/clerk-js/src/ui/utils/__tests__/phoneUtils.test.ts index 56b64b1bb57..a2367827821 100644 --- a/packages/clerk-js/src/ui/utils/__tests__/phoneUtils.test.ts +++ b/packages/clerk-js/src/ui/utils/__tests__/phoneUtils.test.ts @@ -1,4 +1,4 @@ -import type { PhoneCodeChannel } from '@clerk/types'; +import type { PhoneCodeChannel } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { diff --git a/packages/clerk-js/src/ui/utils/colors/__tests__/scales.test.ts b/packages/clerk-js/src/ui/utils/colors/__tests__/scales.test.ts index 8df9abee00a..445c3bb505d 100644 --- a/packages/clerk-js/src/ui/utils/colors/__tests__/scales.test.ts +++ b/packages/clerk-js/src/ui/utils/colors/__tests__/scales.test.ts @@ -1,4 +1,4 @@ -import type { ColorScale } from '@clerk/types'; +import type { ColorScale } from '@clerk/shared/types'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { cssSupports } from '../../cssSupports'; diff --git a/packages/clerk-js/src/ui/utils/colors/constants.ts b/packages/clerk-js/src/ui/utils/colors/constants.ts index 3061e100e20..3ed99b0de17 100644 --- a/packages/clerk-js/src/ui/utils/colors/constants.ts +++ b/packages/clerk-js/src/ui/utils/colors/constants.ts @@ -2,7 +2,7 @@ * Shared constants for color utilities */ -import type { ColorScale } from '@clerk/types'; +import type { ColorScale } from '@clerk/shared/types'; // Types export type ColorShade = 25 | 50 | 100 | 150 | 200 | 300 | 400 | 500 | 600 | 700 | 750 | 800 | 850 | 900 | 950; diff --git a/packages/clerk-js/src/ui/utils/colors/index.ts b/packages/clerk-js/src/ui/utils/colors/index.ts index b967318182e..c6384d2961c 100644 --- a/packages/clerk-js/src/ui/utils/colors/index.ts +++ b/packages/clerk-js/src/ui/utils/colors/index.ts @@ -1,4 +1,4 @@ -import type { HslaColor } from '@clerk/types'; +import type { HslaColor } from '@clerk/shared/types'; import { cssSupports } from '../cssSupports'; import { colors as legacyColors } from './legacy'; diff --git a/packages/clerk-js/src/ui/utils/colors/legacy.ts b/packages/clerk-js/src/ui/utils/colors/legacy.ts index 5e59377c60b..b46d4624149 100644 --- a/packages/clerk-js/src/ui/utils/colors/legacy.ts +++ b/packages/clerk-js/src/ui/utils/colors/legacy.ts @@ -8,7 +8,7 @@ * https://github.com/Qix-/color */ -import type { HslaColor, HslaColorString } from '@clerk/types'; +import type { HslaColor, HslaColorString } from '@clerk/shared/types'; import { resolveCSSVariable } from '../cssVariables'; diff --git a/packages/clerk-js/src/ui/utils/colors/scales.ts b/packages/clerk-js/src/ui/utils/colors/scales.ts index 01e2da12a52..29991af5e4d 100644 --- a/packages/clerk-js/src/ui/utils/colors/scales.ts +++ b/packages/clerk-js/src/ui/utils/colors/scales.ts @@ -1,4 +1,4 @@ -import type { ColorScale, CssColorOrAlphaScale, CssColorOrScale, HslaColorString } from '@clerk/types'; +import type { ColorScale, CssColorOrAlphaScale, CssColorOrScale, HslaColorString } from '@clerk/shared/types'; import { cssSupports } from '../cssSupports'; import { ALL_SHADES, ALPHA_VALUES, COLOR_SCALE, DARK_SHADES, LIGHT_SHADES, LIGHTNESS_CONFIG } from './constants'; diff --git a/packages/clerk-js/src/ui/utils/colors/utils.ts b/packages/clerk-js/src/ui/utils/colors/utils.ts index cf9a5d50237..3aea423f31c 100644 --- a/packages/clerk-js/src/ui/utils/colors/utils.ts +++ b/packages/clerk-js/src/ui/utils/colors/utils.ts @@ -1,4 +1,4 @@ -import type { ColorScale } from '@clerk/types'; +import type { ColorScale } from '@clerk/shared/types'; import { cssSupports } from '../cssSupports'; import type { ColorShade } from './constants'; diff --git a/packages/clerk-js/src/ui/utils/createCustomMenuItems.tsx b/packages/clerk-js/src/ui/utils/createCustomMenuItems.tsx index 8221270998b..7d9cdbe7759 100644 --- a/packages/clerk-js/src/ui/utils/createCustomMenuItems.tsx +++ b/packages/clerk-js/src/ui/utils/createCustomMenuItems.tsx @@ -1,4 +1,4 @@ -import type { CustomMenuItem, LoadedClerk } from '@clerk/types'; +import type { CustomMenuItem, LoadedClerk } from '@clerk/shared/types'; import { USER_BUTTON_ITEM_ID } from '../constants'; import type { LocalizationKey } from '../customizables'; diff --git a/packages/clerk-js/src/ui/utils/createCustomPages.tsx b/packages/clerk-js/src/ui/utils/createCustomPages.tsx index eec59a69c57..edb3c58f558 100644 --- a/packages/clerk-js/src/ui/utils/createCustomPages.tsx +++ b/packages/clerk-js/src/ui/utils/createCustomPages.tsx @@ -1,4 +1,4 @@ -import type { CustomPage, EnvironmentResource, LoadedClerk } from '@clerk/types'; +import type { CustomPage, EnvironmentResource, LoadedClerk } from '@clerk/shared/types'; import { canViewOrManageAPIKeys, diff --git a/packages/clerk-js/src/ui/utils/errorHandler.ts b/packages/clerk-js/src/ui/utils/errorHandler.ts index c3987aecb98..7d31438faad 100644 --- a/packages/clerk-js/src/ui/utils/errorHandler.ts +++ b/packages/clerk-js/src/ui/utils/errorHandler.ts @@ -1,6 +1,6 @@ import { isClerkAPIResponseError, isClerkRuntimeError, isKnownError, isMetamaskError } from '@clerk/shared/error'; +import type { ClerkAPIError, ClerkRuntimeError } from '@clerk/shared/types'; import { snakeToCamel } from '@clerk/shared/underscore'; -import type { ClerkAPIError, ClerkRuntimeError } from '@clerk/types'; import type { FormControlState } from './useFormControl'; diff --git a/packages/clerk-js/src/ui/utils/factorSorting.ts b/packages/clerk-js/src/ui/utils/factorSorting.ts index 8c907377e88..eaab6768e6d 100644 --- a/packages/clerk-js/src/ui/utils/factorSorting.ts +++ b/packages/clerk-js/src/ui/utils/factorSorting.ts @@ -1,4 +1,4 @@ -import type { SignInFactor, SignInStrategy } from '@clerk/types'; +import type { SignInFactor, SignInStrategy } from '@clerk/shared/types'; const makeSortingOrderMap = (arr: T[]): Record => arr.reduce( diff --git a/packages/clerk-js/src/ui/utils/passwordUtils.ts b/packages/clerk-js/src/ui/utils/passwordUtils.ts index b5226948638..f1091b5730c 100644 --- a/packages/clerk-js/src/ui/utils/passwordUtils.ts +++ b/packages/clerk-js/src/ui/utils/passwordUtils.ts @@ -1,4 +1,4 @@ -import type { ClerkAPIError, PasswordSettingsData } from '@clerk/types'; +import type { ClerkAPIError, PasswordSettingsData } from '@clerk/shared/types'; import type { LocalizationKey } from '../localization'; import { localizationKeys } from '../localization/localizationKeys'; diff --git a/packages/clerk-js/src/ui/utils/phoneUtils.ts b/packages/clerk-js/src/ui/utils/phoneUtils.ts index 20bd57f2606..17e8ee4185c 100644 --- a/packages/clerk-js/src/ui/utils/phoneUtils.ts +++ b/packages/clerk-js/src/ui/utils/phoneUtils.ts @@ -1,4 +1,4 @@ -import type { PhoneCodeChannel } from '@clerk/types'; +import type { PhoneCodeChannel } from '@clerk/shared/types'; import type { CountryEntry, CountryIso } from '../elements/PhoneInput/countryCodeData'; import { CodeToCountriesMap, IsoToCountryMap, SubAreaCodeSets } from '../elements/PhoneInput/countryCodeData'; diff --git a/packages/clerk-js/src/ui/utils/runtimeEnvironment.ts b/packages/clerk-js/src/ui/utils/runtimeEnvironment.ts index 66586a31ed0..31e41b5bca9 100644 --- a/packages/clerk-js/src/ui/utils/runtimeEnvironment.ts +++ b/packages/clerk-js/src/ui/utils/runtimeEnvironment.ts @@ -1,5 +1,5 @@ +import type { LoadedClerk } from '@clerk/shared/types'; import { isDevelopmentEnvironment } from '@clerk/shared/utils'; -import type { LoadedClerk } from '@clerk/types'; export const isDevelopmentSDK = (clerk: LoadedClerk) => isDevelopmentEnvironment() || clerk.sdkMetadata?.environment === 'development'; diff --git a/packages/clerk-js/src/ui/utils/useFormControl.ts b/packages/clerk-js/src/ui/utils/useFormControl.ts index 9317783c014..c0f324245be 100644 --- a/packages/clerk-js/src/ui/utils/useFormControl.ts +++ b/packages/clerk-js/src/ui/utils/useFormControl.ts @@ -1,4 +1,4 @@ -import type { ClerkAPIError } from '@clerk/types'; +import type { ClerkAPIError } from '@clerk/shared/types'; import type { HTMLInputTypeAttribute } from 'react'; import { useState } from 'react'; diff --git a/packages/clerk-js/src/ui/utils/usernameUtils.ts b/packages/clerk-js/src/ui/utils/usernameUtils.ts index b1989987939..a6ba80e9871 100644 --- a/packages/clerk-js/src/ui/utils/usernameUtils.ts +++ b/packages/clerk-js/src/ui/utils/usernameUtils.ts @@ -1,4 +1,4 @@ -import type { ClerkAPIError, UsernameSettingsData } from '@clerk/types'; +import type { ClerkAPIError, UsernameSettingsData } from '@clerk/shared/types'; import { type LocalizationKey, localizationKeys } from '../localization'; diff --git a/packages/clerk-js/src/ui/utils/web3CallbackErrorHandler.ts b/packages/clerk-js/src/ui/utils/web3CallbackErrorHandler.ts index a292aaf0ff7..62fd98dcfe8 100644 --- a/packages/clerk-js/src/ui/utils/web3CallbackErrorHandler.ts +++ b/packages/clerk-js/src/ui/utils/web3CallbackErrorHandler.ts @@ -1,5 +1,5 @@ import { ClerkRuntimeError, isClerkAPIResponseError } from '@clerk/shared/error'; -import type { ClerkAPIError, ClerkRuntimeError as ClerkRuntimeErrorType } from '@clerk/types'; +import type { ClerkAPIError, ClerkRuntimeError as ClerkRuntimeErrorType } from '@clerk/shared/types'; import { handleError } from './errorHandler'; diff --git a/packages/clerk-js/src/utils/__tests__/appearance.test.ts b/packages/clerk-js/src/utils/__tests__/appearance.test.ts index ff120ed96b7..a79e1f9ab36 100644 --- a/packages/clerk-js/src/utils/__tests__/appearance.test.ts +++ b/packages/clerk-js/src/utils/__tests__/appearance.test.ts @@ -1,4 +1,4 @@ -import type { Appearance, BaseTheme } from '@clerk/types'; +import type { Appearance, BaseTheme } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { processCssLayerNameExtraction } from '../appearance'; diff --git a/packages/clerk-js/src/utils/__tests__/completeSignUpFlow.test.ts b/packages/clerk-js/src/utils/__tests__/completeSignUpFlow.test.ts index 032e1f33416..b548b1abff4 100644 --- a/packages/clerk-js/src/utils/__tests__/completeSignUpFlow.test.ts +++ b/packages/clerk-js/src/utils/__tests__/completeSignUpFlow.test.ts @@ -1,4 +1,4 @@ -import type { SignUpField, SignUpResource } from '@clerk/types'; +import type { SignUpField, SignUpResource } from '@clerk/shared/types'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { completeSignUpFlow } from '../completeSignUpFlow'; diff --git a/packages/clerk-js/src/utils/__tests__/memoizeStateListenerCallback.test.ts b/packages/clerk-js/src/utils/__tests__/memoizeStateListenerCallback.test.ts index 1be794dde9f..a3af6124a73 100644 --- a/packages/clerk-js/src/utils/__tests__/memoizeStateListenerCallback.test.ts +++ b/packages/clerk-js/src/utils/__tests__/memoizeStateListenerCallback.test.ts @@ -8,7 +8,7 @@ describe.skip('memoizeStateListenerCallback', () => { }); }); -// import { Resources, UserJSON } from '@clerk/types'; +// import { Resources, UserJSON } from '@clerk/shared/types'; // // const frontEndApi = ''; // const path = ''; diff --git a/packages/clerk-js/src/utils/__tests__/passkeys.test.ts b/packages/clerk-js/src/utils/__tests__/passkeys.test.ts index 16516d1e745..3568417c4bf 100644 --- a/packages/clerk-js/src/utils/__tests__/passkeys.test.ts +++ b/packages/clerk-js/src/utils/__tests__/passkeys.test.ts @@ -3,7 +3,7 @@ import type { PublicKeyCredentialRequestOptionsJSON, PublicKeyCredentialWithAuthenticatorAssertionResponse, PublicKeyCredentialWithAuthenticatorAttestationResponse, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { diff --git a/packages/clerk-js/src/utils/__tests__/redirectUrls.test.ts b/packages/clerk-js/src/utils/__tests__/redirectUrls.test.ts index 16cd00075d9..7b6aec18700 100644 --- a/packages/clerk-js/src/utils/__tests__/redirectUrls.test.ts +++ b/packages/clerk-js/src/utils/__tests__/redirectUrls.test.ts @@ -1,5 +1,5 @@ +import type { RedirectOptions } from '@clerk/shared/types'; import { snakeToCamel } from '@clerk/shared/underscore'; -import type { RedirectOptions } from '@clerk/types'; import { afterAll, beforeEach, describe, expect, it } from 'vitest'; import { RedirectUrls } from '../redirectUrls'; diff --git a/packages/clerk-js/src/utils/__tests__/resourceParams.test.ts b/packages/clerk-js/src/utils/__tests__/resourceParams.test.ts index a15b9253808..d10b5aa2c0f 100644 --- a/packages/clerk-js/src/utils/__tests__/resourceParams.test.ts +++ b/packages/clerk-js/src/utils/__tests__/resourceParams.test.ts @@ -1,4 +1,4 @@ -import type { UpdateUserParams } from '@clerk/types'; +import type { UpdateUserParams } from '@clerk/shared/types'; import { describe, expect, it } from 'vitest'; import { normalizeUnsafeMetadata } from '../resourceParams'; diff --git a/packages/clerk-js/src/utils/__tests__/url.test.ts b/packages/clerk-js/src/utils/__tests__/url.test.ts index 122ebe007fe..2b42513b076 100644 --- a/packages/clerk-js/src/utils/__tests__/url.test.ts +++ b/packages/clerk-js/src/utils/__tests__/url.test.ts @@ -1,5 +1,5 @@ import { logger } from '@clerk/shared/logger'; -import type { SignUpResource } from '@clerk/types'; +import type { SignUpResource } from '@clerk/shared/types'; import { afterAll, beforeEach, describe, expect, it, test, vi } from 'vitest'; import { diff --git a/packages/clerk-js/src/utils/appearance.ts b/packages/clerk-js/src/utils/appearance.ts index 84144c5f39b..38f3461128e 100644 --- a/packages/clerk-js/src/utils/appearance.ts +++ b/packages/clerk-js/src/utils/appearance.ts @@ -1,4 +1,4 @@ -import type { Appearance, BaseTheme } from '@clerk/types'; +import type { Appearance, BaseTheme } from '@clerk/shared/types'; /** * Extracts cssLayerName from theme/baseTheme and moves it to appearance level. diff --git a/packages/clerk-js/src/utils/authenticateWithPopup.ts b/packages/clerk-js/src/utils/authenticateWithPopup.ts index ce2fba802dc..2242355cbca 100644 --- a/packages/clerk-js/src/utils/authenticateWithPopup.ts +++ b/packages/clerk-js/src/utils/authenticateWithPopup.ts @@ -1,5 +1,5 @@ import { buildAccountsBaseUrl } from '@clerk/shared/buildAccountsBaseUrl'; -import type { AuthenticateWithPopupParams, AuthenticateWithRedirectParams } from '@clerk/types'; +import type { AuthenticateWithPopupParams, AuthenticateWithRedirectParams } from '@clerk/shared/types'; import type { Clerk } from '../core/clerk'; diff --git a/packages/clerk-js/src/utils/billing.ts b/packages/clerk-js/src/utils/billing.ts index 496dd10520b..ffc7efbe301 100644 --- a/packages/clerk-js/src/utils/billing.ts +++ b/packages/clerk-js/src/utils/billing.ts @@ -5,7 +5,7 @@ import type { BillingMoneyAmountJSON, BillingStatementTotals, BillingStatementTotalsJSON, -} from '@clerk/types'; +} from '@clerk/shared/types'; export const billingMoneyAmountFromJSON = (data: BillingMoneyAmountJSON): BillingMoneyAmount => { return { diff --git a/packages/clerk-js/src/utils/captcha/CaptchaChallenge.ts b/packages/clerk-js/src/utils/captcha/CaptchaChallenge.ts index 27cf632bc84..457b1e776ba 100644 --- a/packages/clerk-js/src/utils/captcha/CaptchaChallenge.ts +++ b/packages/clerk-js/src/utils/captcha/CaptchaChallenge.ts @@ -1,4 +1,4 @@ -import type { CaptchaWidgetType } from '@clerk/types'; +import type { CaptchaWidgetType } from '@clerk/shared/types'; import type { Clerk } from '../../core/resources/internal'; import { getCaptchaToken } from './getCaptchaToken'; diff --git a/packages/clerk-js/src/utils/captcha/turnstile.ts b/packages/clerk-js/src/utils/captcha/turnstile.ts index 438bc93603c..1a21f57d1dc 100644 --- a/packages/clerk-js/src/utils/captcha/turnstile.ts +++ b/packages/clerk-js/src/utils/captcha/turnstile.ts @@ -1,6 +1,6 @@ import { waitForElement } from '@clerk/shared/dom'; import { loadScript } from '@clerk/shared/loadScript'; -import type { CaptchaAppearanceOptions, CaptchaWidgetType } from '@clerk/types'; +import type { CaptchaAppearanceOptions, CaptchaWidgetType } from '@clerk/shared/types'; import { CAPTCHA_ELEMENT_ID, CAPTCHA_INVISIBLE_CLASSNAME } from './constants'; import type { CaptchaOptions } from './types'; diff --git a/packages/clerk-js/src/utils/captcha/types.ts b/packages/clerk-js/src/utils/captcha/types.ts index 3740c512be3..37abf1aaca8 100644 --- a/packages/clerk-js/src/utils/captcha/types.ts +++ b/packages/clerk-js/src/utils/captcha/types.ts @@ -1,4 +1,4 @@ -import type { CaptchaProvider, CaptchaWidgetType } from '@clerk/types'; +import type { CaptchaProvider, CaptchaWidgetType } from '@clerk/shared/types'; export type CaptchaOptions = { action?: 'verify' | 'signup' | 'heartbeat'; diff --git a/packages/clerk-js/src/utils/completeSignUpFlow.ts b/packages/clerk-js/src/utils/completeSignUpFlow.ts index 1b27972f235..686a5f9775e 100644 --- a/packages/clerk-js/src/utils/completeSignUpFlow.ts +++ b/packages/clerk-js/src/utils/completeSignUpFlow.ts @@ -1,4 +1,4 @@ -import type { SignUpResource } from '@clerk/types'; +import type { SignUpResource } from '@clerk/shared/types'; import { forwardClerkQueryParams } from './getClerkQueryParam'; diff --git a/packages/clerk-js/src/utils/componentGuards.ts b/packages/clerk-js/src/utils/componentGuards.ts index a6491c1f3b1..e5f6a6fce74 100644 --- a/packages/clerk-js/src/utils/componentGuards.ts +++ b/packages/clerk-js/src/utils/componentGuards.ts @@ -1,4 +1,4 @@ -import type { Clerk, ClerkOptions, EnvironmentResource } from '@clerk/types'; +import type { Clerk, ClerkOptions, EnvironmentResource } from '@clerk/shared/types'; export type ComponentGuard = ( clerk: Clerk, diff --git a/packages/clerk-js/src/utils/convertPageToOffsetSearchParams.ts b/packages/clerk-js/src/utils/convertPageToOffsetSearchParams.ts index 257f1835f1c..3b325c66a8e 100644 --- a/packages/clerk-js/src/utils/convertPageToOffsetSearchParams.ts +++ b/packages/clerk-js/src/utils/convertPageToOffsetSearchParams.ts @@ -1,5 +1,5 @@ +import type { ClerkPaginationParams } from '@clerk/shared/types'; import { getNonUndefinedValues } from '@clerk/shared/underscore'; -import type { ClerkPaginationParams } from '@clerk/types'; export function convertPageToOffsetSearchParams(pageParams: ClerkPaginationParams | undefined) { const { pageSize, initialPage, ...restParams } = pageParams || ({} as ClerkPaginationParams); diff --git a/packages/clerk-js/src/utils/errors.ts b/packages/clerk-js/src/utils/errors.ts index ef842053910..76de64aed56 100644 --- a/packages/clerk-js/src/utils/errors.ts +++ b/packages/clerk-js/src/utils/errors.ts @@ -1,5 +1,5 @@ import type { ClerkAPIResponseError } from '@clerk/shared/error'; -import type { ClerkAPIError } from '@clerk/types'; +import type { ClerkAPIError } from '@clerk/shared/types'; export function isError(err: ClerkAPIResponseError, code = ''): boolean { return err.errors && !!err.errors.find((e: ClerkAPIError) => e.code === code); diff --git a/packages/clerk-js/src/utils/injectedWeb3Providers.ts b/packages/clerk-js/src/utils/injectedWeb3Providers.ts index f61b113d34d..7b6c6557e8e 100644 --- a/packages/clerk-js/src/utils/injectedWeb3Providers.ts +++ b/packages/clerk-js/src/utils/injectedWeb3Providers.ts @@ -1,4 +1,4 @@ -import type { MetamaskWeb3Provider, OKXWalletWeb3Provider } from '@clerk/types'; +import type { MetamaskWeb3Provider, OKXWalletWeb3Provider } from '@clerk/shared/types'; //https://eips.ethereum.org/EIPS/eip-6963 diff --git a/packages/clerk-js/src/utils/jwt.ts b/packages/clerk-js/src/utils/jwt.ts index 10f8f7ce8e9..9bac22a6274 100644 --- a/packages/clerk-js/src/utils/jwt.ts +++ b/packages/clerk-js/src/utils/jwt.ts @@ -1,4 +1,4 @@ -import type { JWT, JwtPayload } from '@clerk/types'; +import type { JWT, JwtPayload } from '@clerk/shared/types'; import { urlDecodeB64 } from './encoders'; diff --git a/packages/clerk-js/src/utils/memoizeStateListenerCallback.ts b/packages/clerk-js/src/utils/memoizeStateListenerCallback.ts index be931447d32..2a0216b9b7b 100644 --- a/packages/clerk-js/src/utils/memoizeStateListenerCallback.ts +++ b/packages/clerk-js/src/utils/memoizeStateListenerCallback.ts @@ -7,7 +7,7 @@ import type { Resources, SessionResource, UserResource, -} from '@clerk/types'; +} from '@clerk/shared/types'; import { Client, Session, User } from '../core/resources/internal'; diff --git a/packages/clerk-js/src/utils/normalizeRoutingOptions.ts b/packages/clerk-js/src/utils/normalizeRoutingOptions.ts index 61ca8ad2600..9d18688b989 100644 --- a/packages/clerk-js/src/utils/normalizeRoutingOptions.ts +++ b/packages/clerk-js/src/utils/normalizeRoutingOptions.ts @@ -1,4 +1,4 @@ -import type { RoutingOptions, RoutingStrategy } from '@clerk/types'; +import type { RoutingOptions, RoutingStrategy } from '@clerk/shared/types'; import { clerkInvalidRoutingStrategy } from '../core/errors'; diff --git a/packages/clerk-js/src/utils/passkeys.ts b/packages/clerk-js/src/utils/passkeys.ts index c62538d6f1e..8697cdedab8 100644 --- a/packages/clerk-js/src/utils/passkeys.ts +++ b/packages/clerk-js/src/utils/passkeys.ts @@ -8,7 +8,7 @@ import type { PublicKeyCredentialRequestOptionsWithoutExtensions, PublicKeyCredentialWithAuthenticatorAssertionResponse, PublicKeyCredentialWithAuthenticatorAttestationResponse, -} from '@clerk/types'; +} from '@clerk/shared/types'; type WebAuthnCreateCredentialReturn = CredentialReturn; type WebAuthnGetCredentialReturn = CredentialReturn; diff --git a/packages/clerk-js/src/utils/passwords/complexity.ts b/packages/clerk-js/src/utils/passwords/complexity.ts index 7786ac17234..eb3b2c013ca 100644 --- a/packages/clerk-js/src/utils/passwords/complexity.ts +++ b/packages/clerk-js/src/utils/passwords/complexity.ts @@ -1,4 +1,4 @@ -import type { PasswordSettingsData } from '@clerk/types'; +import type { PasswordSettingsData } from '@clerk/shared/types'; export type ComplexityErrors = { [key in keyof Partial>]?: boolean; diff --git a/packages/clerk-js/src/utils/passwords/password.ts b/packages/clerk-js/src/utils/passwords/password.ts index afb43b97d12..7e725291460 100644 --- a/packages/clerk-js/src/utils/passwords/password.ts +++ b/packages/clerk-js/src/utils/passwords/password.ts @@ -1,5 +1,5 @@ +import type { PasswordSettingsData, PasswordValidation, ValidatePasswordCallbacks } from '@clerk/shared/types'; import { noop } from '@clerk/shared/utils'; -import type { PasswordSettingsData, PasswordValidation, ValidatePasswordCallbacks } from '@clerk/types'; import { loadZxcvbn } from '../zxcvbn'; import { createValidateComplexity } from './complexity'; diff --git a/packages/clerk-js/src/utils/passwords/strength.ts b/packages/clerk-js/src/utils/passwords/strength.ts index 083a99c022f..0009b1cf9ac 100644 --- a/packages/clerk-js/src/utils/passwords/strength.ts +++ b/packages/clerk-js/src/utils/passwords/strength.ts @@ -1,4 +1,4 @@ -import type { PasswordSettingsData, ZxcvbnResult } from '@clerk/types'; +import type { PasswordSettingsData, ZxcvbnResult } from '@clerk/shared/types'; import type { zxcvbnFN } from '../zxcvbn'; diff --git a/packages/clerk-js/src/utils/redirectUrls.ts b/packages/clerk-js/src/utils/redirectUrls.ts index 0f38695a429..fd7d34a5d9a 100644 --- a/packages/clerk-js/src/utils/redirectUrls.ts +++ b/packages/clerk-js/src/utils/redirectUrls.ts @@ -1,6 +1,6 @@ import { applyFunctionToObj, filterProps, removeUndefined } from '@clerk/shared/object'; +import type { ClerkOptions, RedirectOptions } from '@clerk/shared/types'; import { camelToSnake } from '@clerk/shared/underscore'; -import type { ClerkOptions, RedirectOptions } from '@clerk/types'; import { assertNoLegacyProp, warnForNewPropShadowingLegacyProp } from './assertNoLegacyProp'; import { isAllowedRedirect, relativeToAbsoluteUrl } from './url'; diff --git a/packages/clerk-js/src/utils/url.ts b/packages/clerk-js/src/utils/url.ts index f08d608a131..4cd2e465cbd 100644 --- a/packages/clerk-js/src/utils/url.ts +++ b/packages/clerk-js/src/utils/url.ts @@ -1,9 +1,9 @@ import { globs } from '@clerk/shared/globs'; import { createDevOrStagingUrlCache } from '@clerk/shared/keys'; import { logger } from '@clerk/shared/logger'; +import type { SignUpResource } from '@clerk/shared/types'; import { camelToSnake } from '@clerk/shared/underscore'; import { isCurrentDevAccountPortalOrigin, isLegacyDevAccountPortalOrigin } from '@clerk/shared/url'; -import type { SignUpResource } from '@clerk/types'; import { joinPaths } from './path'; import { getQueryParams } from './querystring'; diff --git a/packages/clerk-js/src/utils/user.ts b/packages/clerk-js/src/utils/user.ts index 8fd92bf6545..75a57ec274a 100644 --- a/packages/clerk-js/src/utils/user.ts +++ b/packages/clerk-js/src/utils/user.ts @@ -10,7 +10,7 @@ export const getFullName = ({ firstName, lastName, name }: NameHelperParams) => export const getInitials = ({ firstName, lastName, name }: NameHelperParams) => [(firstName || '')[0], (lastName || '')[0]].join('').trim() || (name || '')[0]; -import type { UserResource } from '@clerk/types'; +import type { UserResource } from '@clerk/shared/types'; export const getIdentifier = (user: Partial): string => { if (user.username) { diff --git a/packages/clerk-js/src/utils/web3.ts b/packages/clerk-js/src/utils/web3.ts index 9c983060134..fc494876f78 100644 --- a/packages/clerk-js/src/utils/web3.ts +++ b/packages/clerk-js/src/utils/web3.ts @@ -1,4 +1,4 @@ -import type { Web3Provider } from '@clerk/types'; +import type { Web3Provider } from '@clerk/shared/types'; import { clerkUnsupportedEnvironmentWarning } from '@/core/errors'; diff --git a/packages/clerk-js/src/utils/zxcvbn.ts b/packages/clerk-js/src/utils/zxcvbn.ts index 765c342a308..546fb23cf02 100644 --- a/packages/clerk-js/src/utils/zxcvbn.ts +++ b/packages/clerk-js/src/utils/zxcvbn.ts @@ -1,4 +1,4 @@ -import type { ZxcvbnResult } from '@clerk/types'; +import type { ZxcvbnResult } from '@clerk/shared/types'; export type zxcvbnFN = (password: string, userInputs?: (string | number)[]) => ZxcvbnResult; diff --git a/packages/elements/src/react/hooks/use-password.hook.ts b/packages/elements/src/react/hooks/use-password.hook.ts index 01516ae9116..b011e52b05a 100644 --- a/packages/elements/src/react/hooks/use-password.hook.ts +++ b/packages/elements/src/react/hooks/use-password.hook.ts @@ -1,6 +1,6 @@ import { useClerk } from '@clerk/shared/react'; +import type { PasswordSettingsData, PasswordValidation } from '@clerk/shared/types'; import { noop } from '@clerk/shared/utils'; -import type { PasswordSettingsData, PasswordValidation } from '@clerk/types'; import * as React from 'react'; import type { ErrorCodeOrTuple } from '../utils/generate-password-error-text'; @@ -21,6 +21,7 @@ type UsePasswordCallbacks = { export const usePassword = (callbacks?: UsePasswordCallbacks) => { const clerk = useClerk(); + // @ts-expect-error - ignore error for now const passwordSettings = clerk.__unstable__environment?.userSettings.passwordSettings as PasswordSettingsData; const { disable_hibp, min_zxcvbn_strength, show_zxcvbn, ...config } = passwordSettings || {}; diff --git a/packages/elements/src/react/hooks/use-third-party-provider.hook.ts b/packages/elements/src/react/hooks/use-third-party-provider.hook.ts index 5d196cdb963..226243625a6 100644 --- a/packages/elements/src/react/hooks/use-third-party-provider.hook.ts +++ b/packages/elements/src/react/hooks/use-third-party-provider.hook.ts @@ -29,13 +29,18 @@ const useIsProviderEnabled = ( if (provider === 'saml' || provider === 'enterprise_sso') { return ( + // @ts-expect-error - __unstable__environment is not typed clerk.__unstable__environment?.userSettings.saml.enabled ?? + // @ts-expect-error - __unstable__environment is not typed clerk.__unstable__environment?.userSettings.enterpriseSSO.enabled ?? false ); } - const data = getEnabledThirdPartyProviders(clerk.__unstable__environment); + const data = getEnabledThirdPartyProviders( + // @ts-expect-error - __unstable__environment is not typed + clerk.__unstable__environment as EnvironmentResource, + ); return ( isAuthenticatableOauthStrategy(provider, data.authenticatableOauthStrategies) || diff --git a/packages/elements/src/react/sign-in/root.tsx b/packages/elements/src/react/sign-in/root.tsx index 77ad01cd870..5dc45196d48 100644 --- a/packages/elements/src/react/sign-in/root.tsx +++ b/packages/elements/src/react/sign-in/root.tsx @@ -41,6 +41,7 @@ function SignInFlowProvider({ children, exampleMode, fallback, isRootPath }: Sig const cb = () => { const evt: SignInRouterInitEvent = { type: 'INIT', + // @ts-expect-error - ignore error for now clerk, exampleMode, formRef, diff --git a/packages/elements/src/react/sign-up/root.tsx b/packages/elements/src/react/sign-up/root.tsx index dd21232525e..0b0ae38a809 100644 --- a/packages/elements/src/react/sign-up/root.tsx +++ b/packages/elements/src/react/sign-up/root.tsx @@ -41,6 +41,7 @@ function SignUpFlowProvider({ children, exampleMode, fallback, isRootPath }: Sig const cb = () => { const evt: SignUpRouterInitEvent = { type: 'INIT', + // @ts-expect-error - ignore error for now clerk, exampleMode, formRef, diff --git a/packages/localizations/README.md b/packages/localizations/README.md index dcd5092fc6c..560fdb73126 100644 --- a/packages/localizations/README.md +++ b/packages/localizations/README.md @@ -66,7 +66,6 @@ We're open to all community contributions! If you'd like to contribute in any wa 1. Open the [`localizations/src/en-US.ts`](https://github.com/clerk/javascript/blob/main/packages/localizations/src/en-US.ts) file and add your new key to the object. `en-US` is the default language. If you feel comfortable adding your message in another language than English, feel free to also edit other files. 1. Use the new localization key inside the component. There are two ways: - - The string is inside a component like ``: ```diff diff --git a/packages/nuxt/src/runtime/plugin.ts b/packages/nuxt/src/runtime/plugin.ts index 7e125ce4e78..722d1f52af6 100644 --- a/packages/nuxt/src/runtime/plugin.ts +++ b/packages/nuxt/src/runtime/plugin.ts @@ -18,6 +18,7 @@ export default defineNuxtPlugin(nuxtApp => { const runtimeConfig = useRuntimeConfig(); + // @ts-expect-error: Vue plugin type is not properly typed nuxtApp.vueApp.use(clerkPlugin, { ...(runtimeConfig.public.clerk ?? {}), sdkMetadata: { diff --git a/packages/shared/package.json b/packages/shared/package.json index c39fa6217e4..017b2c4e36a 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -12,75 +12,76 @@ "exports": { ".": { "import": { - "types": "./dist/index.d.mts", - "default": "./dist/index.mjs" + "types": "./dist/runtime/index.d.mts", + "default": "./dist/runtime/index.mjs" }, "require": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" + "types": "./dist/runtime/index.d.ts", + "default": "./dist/runtime/index.js" } }, "./*": { "import": { - "types": "./dist/*.d.mts", - "default": "./dist/*.mjs" + "types": "./dist/runtime/*.d.mts", + "default": "./dist/runtime/*.mjs" }, "require": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" + "types": "./dist/runtime/*.d.ts", + "default": "./dist/runtime/*.js" } }, "./react": { "import": { - "types": "./dist/react/index.d.mts", - "default": "./dist/react/index.mjs" + "types": "./dist/runtime/react/index.d.mts", + "default": "./dist/runtime/react/index.mjs" }, "require": { - "types": "./dist/react/index.d.ts", - "default": "./dist/react/index.js" + "types": "./dist/runtime/react/index.d.ts", + "default": "./dist/runtime/react/index.js" } }, "./utils": { "import": { - "types": "./dist/utils/index.d.mts", - "default": "./dist/utils/index.mjs" + "types": "./dist/runtime/utils/index.d.mts", + "default": "./dist/runtime/utils/index.mjs" }, "require": { - "types": "./dist/utils/index.d.ts", - "default": "./dist/utils/index.js" + "types": "./dist/runtime/utils/index.d.ts", + "default": "./dist/runtime/utils/index.js" } }, "./workerTimers": { "import": { - "types": "./dist/workerTimers/index.d.mts", - "default": "./dist/workerTimers/index.mjs" + "types": "./dist/runtime/workerTimers/index.d.mts", + "default": "./dist/runtime/workerTimers/index.mjs" }, "require": { - "types": "./dist/workerTimers/index.d.ts", - "default": "./dist/workerTimers/index.js" + "types": "./dist/runtime/workerTimers/index.d.ts", + "default": "./dist/runtime/workerTimers/index.js" } }, "./dom": { "import": { - "types": "./dist/dom/index.d.mts", - "default": "./dist/dom/index.mjs" + "types": "./dist/runtime/dom/index.d.mts", + "default": "./dist/runtime/dom/index.mjs" }, "require": { - "types": "./dist/dom/index.d.ts", - "default": "./dist/dom/index.js" + "types": "./dist/runtime/dom/index.d.ts", + "default": "./dist/runtime/dom/index.js" } }, "./types": { "import": { - "types": "./dist/types/index.d.mts" + "types": "./dist/types/index.d.mts", + "default": "./dist/types/index.mjs" }, "require": { - "types": "./dist/types/index.d.ts" + "types": "./dist/types/index.d.ts", + "default": "./dist/types/index.js" } }, "./package.json": "./package.json" }, - "main": "./dist/index.js", "files": [ "dist", "scripts", @@ -135,11 +136,10 @@ "types" ], "scripts": { - "build": "tsup", - "postbuild": "node ../../scripts/subpath-workaround.mjs shared", - "build:declarations": "tsc -p tsconfig.declarations.json", + "build": "tsdown", + "postbuild": "node ../../scripts/subpath-workaround.mjs shared dist/runtime", "clean": "rimraf ./dist", - "dev": "tsup --watch", + "dev": "tsdown --watch src", "dev:publish": "pnpm dev -- --env.publish", "format": "node ../../scripts/format-package.mjs", "format:check": "node ../../scripts/format-package.mjs --check", @@ -153,7 +153,7 @@ "test:coverage": "vitest --collectCoverage && open coverage/lcov-report/index.html" }, "dependencies": { - "@clerk/types": "workspace:^", + "csstype": "3.1.3", "dequal": "2.0.3", "glob-to-regexp": "0.4.1", "js-cookie": "3.0.5", @@ -166,7 +166,7 @@ "@types/glob-to-regexp": "0.4.4", "@types/js-cookie": "3.0.6", "cross-fetch": "^4.1.0", - "esbuild": "0.25.0" + "rolldown": "catalog:repo" }, "peerDependencies": { "react": "catalog:peer-react", diff --git a/packages/shared/src/__tests__/color.spec.ts b/packages/shared/src/__tests__/color.spec.ts index 0b54661b9ce..13bf59baebd 100644 --- a/packages/shared/src/__tests__/color.spec.ts +++ b/packages/shared/src/__tests__/color.spec.ts @@ -1,7 +1,7 @@ -import type { Color } from '@clerk/types'; import { describe, expect, it } from 'vitest'; import { colorToSameTypeString, hexStringToRgbaColor, stringToHslaColor, stringToSameTypeColor } from '../color'; +import type { Color } from '../types'; describe('stringToHslaColor(color)', function () { const hsla = { h: 195, s: 1, l: 0.5 }; diff --git a/packages/shared/src/__tests__/color.test.ts.bak b/packages/shared/src/__tests__/color.test.ts.bak index 7dc19e3d8c1..aa0d71b2adb 100644 --- a/packages/shared/src/__tests__/color.test.ts.bak +++ b/packages/shared/src/__tests__/color.test.ts.bak @@ -1,4 +1,4 @@ -import type { Color } from '@clerk/types'; +import type { Color } from '../types'; import { colorToSameTypeString, hexStringToRgbaColor, stringToHslaColor, stringToSameTypeColor } from '../color'; diff --git a/packages/shared/src/__tests__/deriveState.spec.ts b/packages/shared/src/__tests__/deriveState.spec.ts index 2f2dd22ee99..b1445cf9ade 100644 --- a/packages/shared/src/__tests__/deriveState.spec.ts +++ b/packages/shared/src/__tests__/deriveState.spec.ts @@ -1,7 +1,7 @@ -import type { InitialState, Resources } from '@clerk/types'; import { describe, expect, it } from 'vitest'; import { deriveState } from '../deriveState'; +import type { InitialState, Resources } from '../types'; describe('deriveState', () => { const mockInitialState = { diff --git a/packages/shared/src/__tests__/loadClerkJsScript.spec.ts b/packages/shared/src/__tests__/loadClerkJsScript.spec.ts index d7b5d754d58..817fc9bedf1 100644 --- a/packages/shared/src/__tests__/loadClerkJsScript.spec.ts +++ b/packages/shared/src/__tests__/loadClerkJsScript.spec.ts @@ -139,7 +139,7 @@ describe('loadClerkJsScript(options)', () => { try { await loadPromise; - fail('Should have thrown error'); + throw new Error('Should have thrown error'); } catch (error) { expect(error).toBeInstanceOf(ClerkRuntimeError); expect((error as Error).message).toContain('Clerk: Failed to load Clerk'); diff --git a/packages/shared/src/__tests__/organization.spec.ts b/packages/shared/src/__tests__/organization.spec.ts index 6aa1dbba74c..f9f5168365e 100644 --- a/packages/shared/src/__tests__/organization.spec.ts +++ b/packages/shared/src/__tests__/organization.spec.ts @@ -1,7 +1,7 @@ -import type { OrganizationMembershipResource } from '@clerk/types'; import { describe, expect, it } from 'vitest'; import { getCurrentOrganizationMembership } from '../organization'; +import type { OrganizationMembershipResource } from '../types'; describe('getCurrentOrganizationMembership', () => { const mockMemberships: OrganizationMembershipResource[] = [ diff --git a/packages/shared/src/alternativePhoneCode.ts b/packages/shared/src/alternativePhoneCode.ts index 1ad01a913db..afdb1e8b4ac 100644 --- a/packages/shared/src/alternativePhoneCode.ts +++ b/packages/shared/src/alternativePhoneCode.ts @@ -1,4 +1,4 @@ -import type { PhoneCodeChannelData } from '@clerk/types'; +import type { PhoneCodeChannelData } from './types'; export const ALTERNATIVE_PHONE_CODE_PROVIDERS: PhoneCodeChannelData[] = [ { diff --git a/packages/shared/src/authorization-errors.ts b/packages/shared/src/authorization-errors.ts index 9caa20411d2..bf1d754e170 100644 --- a/packages/shared/src/authorization-errors.ts +++ b/packages/shared/src/authorization-errors.ts @@ -1,4 +1,4 @@ -import type { ReverificationConfig } from '@clerk/types'; +import type { ReverificationConfig } from './types'; type ClerkError = { clerk_error: T; @@ -44,4 +44,4 @@ const isReverificationHint = (result: any): result is ReturnType>; type AuthorizationOptions = { @@ -341,4 +341,4 @@ const resolveAuthState = ({ } }; -export { createCheckAuthorization, validateReverificationConfig, resolveAuthState, splitByScope }; +export { createCheckAuthorization, resolveAuthState, splitByScope, validateReverificationConfig }; diff --git a/packages/shared/src/clerkEventBus.ts b/packages/shared/src/clerkEventBus.ts index bdf9bdfa73c..30229f89c4d 100644 --- a/packages/shared/src/clerkEventBus.ts +++ b/packages/shared/src/clerkEventBus.ts @@ -1,6 +1,5 @@ -import type { ClerkEventPayload } from '@clerk/types'; - import { createEventBus } from './eventBus'; +import type { ClerkEventPayload } from './types'; export const clerkEvents = { Status: 'status', diff --git a/packages/shared/src/color.ts b/packages/shared/src/color.ts index 3bb94b6422f..e3c7b733c86 100644 --- a/packages/shared/src/color.ts +++ b/packages/shared/src/color.ts @@ -1,4 +1,4 @@ -import type { Color, HslaColor, RgbaColor, TransparentColor } from '@clerk/types'; +import type { Color, HslaColor, RgbaColor, TransparentColor } from './types'; const IS_HEX_COLOR_REGEX = /^#?([A-F0-9]{6}|[A-F0-9]{3})$/i; diff --git a/packages/shared/src/compiled/path-to-regexp/index.d.ts b/packages/shared/src/compiled/path-to-regexp/index.d.ts deleted file mode 100644 index d05fd814dae..00000000000 --- a/packages/shared/src/compiled/path-to-regexp/index.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -interface ParseOptions { - /** - * Set the default delimiter for repeat parameters. (default: `'/'`) - */ - delimiter?: string; - /** - * List of characters to automatically consider prefixes when parsing. - */ - prefixes?: string; -} -interface RegexpToFunctionOptions { - /** - * Function for decoding strings for params. - */ - decode?: (value: string, token: Key) => string; -} -/** - * A match result contains data about the path match. - */ -interface MatchResult

{ - path: string; - index: number; - params: P; -} -/** - * A match is either `false` (no match) or a match result. - */ -type Match

= false | MatchResult

; -/** - * The match function takes a string and returns whether it matched the path. - */ -type MatchFunction

= (path: string) => Match

; -/** - * Create path match function from `path-to-regexp` spec. - */ -declare function match

( - str: Path, - options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions, -): MatchFunction

; -/** - * Metadata about a key. - */ -interface Key { - name: string | number; - prefix: string; - suffix: string; - pattern: string; - modifier: string; -} -interface TokensToRegexpOptions { - /** - * When `true` the regexp will be case sensitive. (default: `false`) - */ - sensitive?: boolean; - /** - * When `true` the regexp won't allow an optional trailing delimiter to match. (default: `false`) - */ - strict?: boolean; - /** - * When `true` the regexp will match to the end of the string. (default: `true`) - */ - end?: boolean; - /** - * When `true` the regexp will match from the beginning of the string. (default: `true`) - */ - start?: boolean; - /** - * Sets the final character for non-ending optimistic matches. (default: `/`) - */ - delimiter?: string; - /** - * List of characters that can also be "end" characters. - */ - endsWith?: string; - /** - * Encode path tokens for use in the `RegExp`. - */ - encode?: (value: string) => string; -} -/** - * Supported `path-to-regexp` input types. - */ -type Path = string | RegExp | Array; -/** - * Normalize the given path string, returning a regular expression. - * - * An empty array can be passed in for the keys, which will hold the - * placeholder key descriptions. For example, using `/user/:id`, `keys` will - * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. - */ -declare function pathToRegexp(path: Path, keys?: Key[], options?: TokensToRegexpOptions & ParseOptions): RegExp; - -export { - type Match, - type MatchFunction, - type ParseOptions, - type Path, - type RegexpToFunctionOptions, - type TokensToRegexpOptions, - match, - pathToRegexp, -}; diff --git a/packages/shared/src/compiled/path-to-regexp/index.js b/packages/shared/src/compiled/path-to-regexp/index.js index 7112d4ae2b8..7dbeaca3864 100644 --- a/packages/shared/src/compiled/path-to-regexp/index.js +++ b/packages/shared/src/compiled/path-to-regexp/index.js @@ -45,12 +45,12 @@ function _(r) { break; } if (!u) throw new TypeError('Missing parameter name at '.concat(e)); - n.push({ + (n.push({ type: 'NAME', index: e, value: u, }), - (e = t); + (e = t)); continue; } if (a === '(') { @@ -74,12 +74,12 @@ function _(r) { } if (o) throw new TypeError('Unbalanced pattern at '.concat(e)); if (!m) throw new TypeError('Missing pattern at '.concat(e)); - n.push({ + (n.push({ type: 'PATTERN', index: e, value: m, }), - (e = t); + (e = t)); continue; } n.push({ @@ -147,7 +147,7 @@ function F(r, n) { C = f('PATTERN'); if (x || C) { var g = T || ''; - u.indexOf(g) === -1 && ((p += g), (g = '')), + (u.indexOf(g) === -1 && ((p += g), (g = '')), p && (o.push(p), (p = '')), o.push({ name: x || m++, @@ -155,7 +155,7 @@ function F(r, n) { suffix: '', pattern: C || A(g), modifier: f('MODIFIER') || '', - }); + })); continue; } var i = T || f('ESCAPED_CHAR'); @@ -170,14 +170,14 @@ function F(r, n) { y = f('NAME') || '', O = f('PATTERN') || '', b = d(); - w('CLOSE'), + (w('CLOSE'), o.push({ name: y || (O ? m++ : ''), pattern: y && !O ? A(g) : O, prefix: g, suffix: b, modifier: f('MODIFIER') || '', - }); + })); continue; } w('END'); @@ -240,14 +240,14 @@ function D(r) { function $(r, n) { if (!n) return r; for (var e = /\((?:\?<(.*?)>)?(?!\?)/g, a = 0, u = e.exec(r.source); u; ) - n.push({ + (n.push({ name: u[1] || a++, prefix: '', suffix: '', modifier: '', pattern: '', }), - (u = e.exec(r.source)); + (u = e.exec(r.source))); return r; } @@ -316,11 +316,11 @@ function U(r, n, e) { else x += '(?:'.concat(R).concat(y, ')').concat(i.modifier); } } - if (m) u || (x += ''.concat(T, '?')), (x += e.endsWith ? '(?='.concat(A, ')') : '$'); + if (m) (u || (x += ''.concat(T, '?')), (x += e.endsWith ? '(?='.concat(A, ')') : '$')); else { var b = r[r.length - 1], l = typeof b == 'string' ? T.indexOf(b[b.length - 1]) > -1 : b === void 0; - u || (x += '(?:'.concat(T, '(?=').concat(A, '))?')), l || (x += '(?='.concat(T, '|').concat(A, ')')); + (u || (x += '(?:'.concat(T, '(?=').concat(A, '))?')), l || (x += '(?='.concat(T, '|').concat(A, ')'))); } return new RegExp(x, D(e)); } diff --git a/packages/shared/src/deriveState.ts b/packages/shared/src/deriveState.ts index 4508970fd35..7b84fb42d2c 100644 --- a/packages/shared/src/deriveState.ts +++ b/packages/shared/src/deriveState.ts @@ -7,7 +7,7 @@ import type { Resources, SignedInSessionResource, UserResource, -} from '@clerk/types'; +} from './types'; /** * Derives authentication state based on the current rendering context (SSR or client-side). diff --git a/packages/shared/src/errors/clerkApiError.ts b/packages/shared/src/errors/clerkApiError.ts index 6b0b18eaf26..2ec91934187 100644 --- a/packages/shared/src/errors/clerkApiError.ts +++ b/packages/shared/src/errors/clerkApiError.ts @@ -1,5 +1,4 @@ -import type { ClerkAPIError as ClerkAPIErrorInterface, ClerkAPIErrorJSON } from '@clerk/types'; - +import type { ClerkAPIError as ClerkAPIErrorInterface, ClerkAPIErrorJSON } from '../types'; import { createErrorTypeGuard } from './createErrorTypeGuard'; export type ClerkApiErrorMeta = Record; diff --git a/packages/shared/src/errors/clerkApiResponseError.ts b/packages/shared/src/errors/clerkApiResponseError.ts index 149fd68803a..671c41bef5c 100644 --- a/packages/shared/src/errors/clerkApiResponseError.ts +++ b/packages/shared/src/errors/clerkApiResponseError.ts @@ -1,5 +1,4 @@ -import type { ClerkAPIErrorJSON, ClerkAPIResponseError as ClerkAPIResponseErrorInterface } from '@clerk/types'; - +import type { ClerkAPIErrorJSON, ClerkAPIResponseError as ClerkAPIResponseErrorInterface } from '../types'; import { ClerkAPIError } from './clerkApiError'; import type { ClerkErrorParams } from './clerkError'; import { ClerkError } from './clerkError'; diff --git a/packages/shared/src/errors/parseError.ts b/packages/shared/src/errors/parseError.ts index d5803f53b75..4c2f8c98baa 100644 --- a/packages/shared/src/errors/parseError.ts +++ b/packages/shared/src/errors/parseError.ts @@ -1,5 +1,4 @@ -import type { ClerkAPIError as ClerkAPIErrorInterface, ClerkAPIErrorJSON } from '@clerk/types'; - +import type { ClerkAPIError as ClerkAPIErrorInterface, ClerkAPIErrorJSON } from '../types'; import { ClerkAPIError } from './clerkApiError'; /** diff --git a/packages/shared/src/jwtPayloadParser.ts b/packages/shared/src/jwtPayloadParser.ts index f75b8d284d3..0fa7caf35db 100644 --- a/packages/shared/src/jwtPayloadParser.ts +++ b/packages/shared/src/jwtPayloadParser.ts @@ -1,11 +1,10 @@ +import { splitByScope } from './authorization'; import type { JwtPayload, OrganizationCustomPermissionKey, OrganizationCustomRoleKey, SharedSignedInAuthObjectProperties, -} from '@clerk/types'; - -import { splitByScope } from './authorization'; +} from './types'; export const parsePermissions = ({ per, fpm }: { per?: string; fpm?: string }) => { if (!per || !fpm) { @@ -31,6 +30,9 @@ export const parsePermissions = ({ per, fpm }: { per?: string; fpm?: string }) = return { permissions, featurePermissionMap }; }; +/** + * + */ function buildOrgPermissions({ features, permissions, diff --git a/packages/shared/src/keys.ts b/packages/shared/src/keys.ts index c327cc0a96d..9b4ac37a02a 100644 --- a/packages/shared/src/keys.ts +++ b/packages/shared/src/keys.ts @@ -1,8 +1,7 @@ -import type { PublishableKey } from '@clerk/types'; - import { DEV_OR_STAGING_SUFFIXES, LEGACY_DEV_INSTANCE_SUFFIXES } from './constants'; import { isomorphicAtob } from './isomorphicAtob'; import { isomorphicBtoa } from './isomorphicBtoa'; +import type { PublishableKey } from './types'; /** * Configuration options for parsing publishable keys. diff --git a/packages/shared/src/loadClerkJsScript.ts b/packages/shared/src/loadClerkJsScript.ts index 1cb78a1e68c..ff4283d9ad9 100644 --- a/packages/shared/src/loadClerkJsScript.ts +++ b/packages/shared/src/loadClerkJsScript.ts @@ -1,9 +1,8 @@ -import type { ClerkOptions, SDKMetadata, Without } from '@clerk/types'; - import { buildErrorThrower, ClerkRuntimeError } from './error'; import { createDevOrStagingUrlCache, parsePublishableKey } from './keys'; import { loadScript } from './loadScript'; import { isValidProxyUrl, proxyUrlToAbsoluteURL } from './proxy'; +import type { ClerkOptions, SDKMetadata, Without } from './types'; import { addClerkPrefix } from './url'; import { versionSelector } from './versionSelector'; diff --git a/packages/shared/src/oauth.ts b/packages/shared/src/oauth.ts index 7e809b6f0f4..4838b6bcbe9 100644 --- a/packages/shared/src/oauth.ts +++ b/packages/shared/src/oauth.ts @@ -1,4 +1,4 @@ -import type { OAuthProvider, OAuthProviderData, OAuthStrategy } from '@clerk/types'; +import type { OAuthProvider, OAuthProviderData, OAuthStrategy } from './types'; export const OAUTH_PROVIDERS: OAuthProviderData[] = [ { diff --git a/packages/shared/src/organization.ts b/packages/shared/src/organization.ts index 19f9ea8c3e5..12d8ea0689e 100644 --- a/packages/shared/src/organization.ts +++ b/packages/shared/src/organization.ts @@ -1,4 +1,4 @@ -import type { OrganizationMembershipResource } from '@clerk/types'; +import type { OrganizationMembershipResource } from './types'; /** * Finds the organization membership for a given organization ID from a list of memberships diff --git a/packages/shared/src/pathMatcher.ts b/packages/shared/src/pathMatcher.ts index f2f07097e3a..5795de57ee9 100644 --- a/packages/shared/src/pathMatcher.ts +++ b/packages/shared/src/pathMatcher.ts @@ -1,6 +1,5 @@ -import type { Autocomplete } from '@clerk/types'; - import { pathToRegexp } from './pathToRegexp'; +import type { Autocomplete } from './types'; export type WithPathPatternWildcard = `${T & string}(.*)`; export type PathPattern = Autocomplete; diff --git a/packages/shared/src/pathToRegexp.ts b/packages/shared/src/pathToRegexp.ts index fcb11a1e4fe..e0cf5020c35 100644 --- a/packages/shared/src/pathToRegexp.ts +++ b/packages/shared/src/pathToRegexp.ts @@ -1,13 +1,83 @@ -import type { - Match, - MatchFunction, - ParseOptions, - Path, - RegexpToFunctionOptions, - TokensToRegexpOptions, -} from './compiled/path-to-regexp'; import { match as matchBase, pathToRegexp as pathToRegexpBase } from './compiled/path-to-regexp'; +interface ParseOptions { + /** + * Set the default delimiter for repeat parameters. (default: `'/'`) + */ + delimiter?: string; + /** + * List of characters to automatically consider prefixes when parsing. + */ + prefixes?: string; +} +interface RegexpToFunctionOptions { + /** + * Function for decoding strings for params. + */ + decode?: (value: string, token: Key) => string; +} +/** + * A match result contains data about the path match. + */ +interface MatchResult

{ + path: string; + index: number; + params: P; +} +/** + * A match is either `false` (no match) or a match result. + */ +type Match

= false | MatchResult

; +/** + * The match function takes a string and returns whether it matched the path. + */ +type MatchFunction

= (path: string) => Match

; + +/** + * Metadata about a key. + */ +interface Key { + name: string | number; + prefix: string; + suffix: string; + pattern: string; + modifier: string; +} +interface TokensToRegexpOptions { + /** + * When `true` the regexp will be case sensitive. (default: `false`) + */ + sensitive?: boolean; + /** + * When `true` the regexp won't allow an optional trailing delimiter to match. (default: `false`) + */ + strict?: boolean; + /** + * When `true` the regexp will match to the end of the string. (default: `true`) + */ + end?: boolean; + /** + * When `true` the regexp will match from the beginning of the string. (default: `true`) + */ + start?: boolean; + /** + * Sets the final character for non-ending optimistic matches. (default: `/`) + */ + delimiter?: string; + /** + * List of characters that can also be "end" characters. + */ + endsWith?: string; + /** + * Encode path tokens for use in the `RegExp`. + */ + encode?: (value: string) => string; +} +/** + * Supported `path-to-regexp` input types. + */ +type Path = string | RegExp | Array; + export const pathToRegexp = (path: string) => { try { // @ts-ignore no types exists for the pre-compiled package @@ -19,6 +89,9 @@ export const pathToRegexp = (path: string) => { } }; +/** + * + */ export function match

( str: Path, options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions, diff --git a/packages/shared/src/react/commerce.tsx b/packages/shared/src/react/commerce.tsx index f9b7b9335da..336f7449508 100644 --- a/packages/shared/src/react/commerce.tsx +++ b/packages/shared/src/react/commerce.tsx @@ -1,10 +1,10 @@ /* eslint-disable @typescript-eslint/consistent-type-imports */ -import type { BillingCheckoutResource, EnvironmentResource, ForPayerType } from '@clerk/types'; import type { Stripe, StripeElements } from '@stripe/stripe-js'; -import React, { type PropsWithChildren, ReactNode, useCallback, useEffect, useMemo, useState } from 'react'; +import React, { type PropsWithChildren, type ReactNode, useCallback, useEffect, useMemo, useState } from 'react'; import useSWR from 'swr'; import useSWRMutation from 'swr/mutation'; +import type { BillingCheckoutResource, EnvironmentResource, ForPayerType } from '../types'; import { createContextAndHook } from './hooks/createContextAndHook'; import type { useCheckout } from './hooks/useCheckout'; import { useClerk } from './hooks/useClerk'; diff --git a/packages/shared/src/react/contexts.tsx b/packages/shared/src/react/contexts.tsx index c54ea6f7a2a..60c1898bd16 100644 --- a/packages/shared/src/react/contexts.tsx +++ b/packages/shared/src/react/contexts.tsx @@ -1,5 +1,8 @@ 'use client'; +import type { PropsWithChildren } from 'react'; +import React from 'react'; + import type { BillingSubscriptionPlanPeriod, ClerkOptions, @@ -9,10 +12,7 @@ import type { OrganizationResource, SignedInSessionResource, UserResource, -} from '@clerk/types'; -import type { PropsWithChildren } from 'react'; -import React from 'react'; - +} from '../types'; import { SWRConfig } from './clerk-swr'; import { createContextAndHook } from './hooks/createContextAndHook'; @@ -103,19 +103,19 @@ Learn more: https://clerk.com/docs/components/clerk-provider`.trim(), } export { + __experimental_CheckoutProvider, + ClerkInstanceContext, ClientContext, - useClientContext, + OptionsContext, OrganizationProvider, + SessionContext, + useAssertWrappedByClerkProvider, + useCheckoutContext, + useClerkInstanceContext, + useClientContext, + useOptionsContext, useOrganizationContext, UserContext, - OptionsContext, - useOptionsContext, - useUserContext, - SessionContext, useSessionContext, - ClerkInstanceContext, - useClerkInstanceContext, - useCheckoutContext, - __experimental_CheckoutProvider, - useAssertWrappedByClerkProvider, + useUserContext, }; diff --git a/packages/shared/src/react/hooks/__tests__/createBillingPaginatedHook.spec.tsx b/packages/shared/src/react/hooks/__tests__/createBillingPaginatedHook.spec.tsx index da7b556adc0..748b673191e 100644 --- a/packages/shared/src/react/hooks/__tests__/createBillingPaginatedHook.spec.tsx +++ b/packages/shared/src/react/hooks/__tests__/createBillingPaginatedHook.spec.tsx @@ -1,7 +1,7 @@ -import type { ClerkResource } from '@clerk/types'; import { renderHook, waitFor } from '@testing-library/react'; import { beforeEach, describe, expect, it, vi } from 'vitest'; +import type { ClerkResource } from '../../../types'; import { createBillingPaginatedHook } from '../createBillingPaginatedHook'; import { wrapper } from './wrapper'; diff --git a/packages/shared/src/react/hooks/__tests__/useCheckout.type.spec.ts b/packages/shared/src/react/hooks/__tests__/useCheckout.type.spec.ts index 5480591804d..ea64128d37c 100644 --- a/packages/shared/src/react/hooks/__tests__/useCheckout.type.spec.ts +++ b/packages/shared/src/react/hooks/__tests__/useCheckout.type.spec.ts @@ -1,3 +1,5 @@ +import { describe, expectTypeOf, it } from 'vitest'; + import type { __experimental_CheckoutCacheState, __experimental_CheckoutInstance, @@ -6,9 +8,7 @@ import type { ClerkAPIResponseError, ConfirmCheckoutParams, SetActiveNavigate, -} from '@clerk/types'; -import { describe, expectTypeOf, it } from 'vitest'; - +} from '../../../types'; import type { useCheckout } from '../useCheckout'; type UseCheckoutParameters = Parameters[0]; diff --git a/packages/shared/src/react/hooks/createBillingPaginatedHook.tsx b/packages/shared/src/react/hooks/createBillingPaginatedHook.tsx index 58b3e1ba1be..fd605445e4d 100644 --- a/packages/shared/src/react/hooks/createBillingPaginatedHook.tsx +++ b/packages/shared/src/react/hooks/createBillingPaginatedHook.tsx @@ -1,6 +1,5 @@ -import type { ClerkPaginatedResponse, ClerkResource, EnvironmentResource, ForPayerType } from '@clerk/types'; - import { eventMethodCalled } from '../../telemetry/events/method-called'; +import type { ClerkPaginatedResponse, ClerkResource, EnvironmentResource, ForPayerType } from '../../types'; import { useAssertWrappedByClerkProvider, useClerkInstanceContext, diff --git a/packages/shared/src/react/hooks/useCheckout.ts b/packages/shared/src/react/hooks/useCheckout.ts index 9bdfcc45970..78d7daf282b 100644 --- a/packages/shared/src/react/hooks/useCheckout.ts +++ b/packages/shared/src/react/hooks/useCheckout.ts @@ -1,12 +1,12 @@ +import { useMemo, useSyncExternalStore } from 'react'; + +import type { ClerkAPIResponseError } from '../..'; import type { __experimental_CheckoutCacheState, __experimental_CheckoutInstance, BillingCheckoutResource, SetActiveNavigate, -} from '@clerk/types'; -import { useMemo, useSyncExternalStore } from 'react'; - -import type { ClerkAPIResponseError } from '../..'; +} from '../../types'; import type { __experimental_CheckoutProvider } from '../contexts'; import { useCheckoutContext } from '../contexts'; import { useClerk } from './useClerk'; diff --git a/packages/shared/src/react/hooks/useClerk.ts b/packages/shared/src/react/hooks/useClerk.ts index 87f36ca3c2c..18c4bff187f 100644 --- a/packages/shared/src/react/hooks/useClerk.ts +++ b/packages/shared/src/react/hooks/useClerk.ts @@ -1,5 +1,4 @@ -import type { LoadedClerk } from '@clerk/types'; - +import type { LoadedClerk } from '../../types'; import { useAssertWrappedByClerkProvider, useClerkInstanceContext } from '../contexts'; /** diff --git a/packages/shared/src/react/hooks/useOrganization.tsx b/packages/shared/src/react/hooks/useOrganization.tsx index 16219412a3b..ff3a7d3c0b9 100644 --- a/packages/shared/src/react/hooks/useOrganization.tsx +++ b/packages/shared/src/react/hooks/useOrganization.tsx @@ -1,3 +1,5 @@ +import { getCurrentOrganizationMembership } from '../../organization'; +import { eventMethodCalled } from '../../telemetry/events/method-called'; import type { ClerkPaginatedResponse, GetDomainsParams, @@ -9,10 +11,7 @@ import type { OrganizationMembershipRequestResource, OrganizationMembershipResource, OrganizationResource, -} from '@clerk/types'; - -import { getCurrentOrganizationMembership } from '../../organization'; -import { eventMethodCalled } from '../../telemetry/events/method-called'; +} from '../../types'; import { useAssertWrappedByClerkProvider, useClerkInstanceContext, diff --git a/packages/shared/src/react/hooks/useOrganizationList.tsx b/packages/shared/src/react/hooks/useOrganizationList.tsx index 6cdc297c0f8..f56159c20bf 100644 --- a/packages/shared/src/react/hooks/useOrganizationList.tsx +++ b/packages/shared/src/react/hooks/useOrganizationList.tsx @@ -1,3 +1,4 @@ +import { eventMethodCalled } from '../../telemetry/events/method-called'; import type { ClerkPaginatedResponse, CreateOrganizationParams, @@ -9,9 +10,7 @@ import type { OrganizationSuggestionResource, SetActive, UserOrganizationInvitationResource, -} from '@clerk/types'; - -import { eventMethodCalled } from '../../telemetry/events/method-called'; +} from '../../types'; import { useAssertWrappedByClerkProvider, useClerkInstanceContext, useUserContext } from '../contexts'; import type { PaginatedHookConfig, PaginatedResources, PaginatedResourcesWithDefault } from '../types'; import { usePagesOrInfinite, useWithSafeValues } from './usePagesOrInfinite'; diff --git a/packages/shared/src/react/hooks/usePaymentAttempts.tsx b/packages/shared/src/react/hooks/usePaymentAttempts.tsx index f74ba4c09cc..50c2f4a0ef0 100644 --- a/packages/shared/src/react/hooks/usePaymentAttempts.tsx +++ b/packages/shared/src/react/hooks/usePaymentAttempts.tsx @@ -1,5 +1,4 @@ -import type { BillingPaymentResource, GetPaymentAttemptsParams } from '@clerk/types'; - +import type { BillingPaymentResource, GetPaymentAttemptsParams } from '../../types'; import { useClerkInstanceContext } from '../contexts'; import { createBillingPaginatedHook } from './createBillingPaginatedHook'; diff --git a/packages/shared/src/react/hooks/usePaymentMethods.tsx b/packages/shared/src/react/hooks/usePaymentMethods.tsx index 2cfb7bbc3c9..0c8f9a9e8d1 100644 --- a/packages/shared/src/react/hooks/usePaymentMethods.tsx +++ b/packages/shared/src/react/hooks/usePaymentMethods.tsx @@ -1,5 +1,4 @@ -import type { BillingPaymentMethodResource, GetPaymentMethodsParams } from '@clerk/types'; - +import type { BillingPaymentMethodResource, GetPaymentMethodsParams } from '../../types'; import { useOrganizationContext, useUserContext } from '../contexts'; import { createBillingPaginatedHook } from './createBillingPaginatedHook'; diff --git a/packages/shared/src/react/hooks/usePlans.tsx b/packages/shared/src/react/hooks/usePlans.tsx index 25ed68e6424..0b724041bcf 100644 --- a/packages/shared/src/react/hooks/usePlans.tsx +++ b/packages/shared/src/react/hooks/usePlans.tsx @@ -1,5 +1,4 @@ -import type { BillingPlanResource, GetPlansParams } from '@clerk/types'; - +import type { BillingPlanResource, GetPlansParams } from '../../types'; import { useClerkInstanceContext } from '../contexts'; import { createBillingPaginatedHook } from './createBillingPaginatedHook'; diff --git a/packages/shared/src/react/hooks/useReverification.ts b/packages/shared/src/react/hooks/useReverification.ts index dadbe438104..107fa645285 100644 --- a/packages/shared/src/react/hooks/useReverification.ts +++ b/packages/shared/src/react/hooks/useReverification.ts @@ -1,16 +1,19 @@ -import type { Clerk, SessionVerificationLevel } from '@clerk/types'; import { useCallback, useRef } from 'react'; import { validateReverificationConfig } from '../../authorization'; import { isReverificationHint, reverificationError } from '../../authorization-errors'; import { ClerkRuntimeError, isClerkAPIResponseError } from '../../error'; import { eventMethodCalled } from '../../telemetry'; +import type { Clerk, SessionVerificationLevel } from '../../types'; import { createDeferredPromise } from '../../utils/createDeferredPromise'; import { useClerk } from './useClerk'; import { useSafeLayoutEffect } from './useSafeLayoutEffect'; const CLERK_API_REVERIFICATION_ERROR_CODE = 'session_reverification_required'; +/** + * + */ async function resolveResult(result: Promise | T): Promise> { try { const r = await result; @@ -42,6 +45,7 @@ type NeedsReverificationParameters = { /** * The optional options object. + * * @interface */ type UseReverificationOptions = { @@ -51,7 +55,6 @@ type UseReverificationOptions = { * @param cancel - A function that will cancel the reverification process. * @param complete - A function that will retry the original request after reverification. * @param level - The level returned with the reverification hint. - * */ onNeedsReverification?: (properties: NeedsReverificationParameters) => void; }; @@ -79,7 +82,13 @@ type CreateReverificationHandlerParams = UseReverificationOptions & { telemetry: Clerk['telemetry']; }; +/** + * + */ function createReverificationHandler(params: CreateReverificationHandlerParams) { + /** + * + */ function assertReverification Promise | undefined>( fetcher: Fetcher, ): (...args: Parameters) => Promise>>> { @@ -191,7 +200,6 @@ function createReverificationHandler(params: CreateReverificationHandlerParams) * return * } * ``` - * */ export const useReverification: UseReverification = (fetcher, options) => { const { __internal_openReverification, telemetry } = useClerk(); diff --git a/packages/shared/src/react/hooks/useSession.ts b/packages/shared/src/react/hooks/useSession.ts index 7427e53baf3..7c1490bd689 100644 --- a/packages/shared/src/react/hooks/useSession.ts +++ b/packages/shared/src/react/hooks/useSession.ts @@ -1,6 +1,5 @@ -import type { UseSessionReturn } from '@clerk/types'; - import { eventMethodCalled } from '../../telemetry/events/method-called'; +import type { UseSessionReturn } from '../../types'; import { useAssertWrappedByClerkProvider, useClerkInstanceContext, useSessionContext } from '../contexts'; type UseSession = () => UseSessionReturn; @@ -15,7 +14,6 @@ const hookName = `useSession`; * @function * * @param [options] - An object containing options for the `useSession()` hook. - * * @example * ### Access the `Session` object * diff --git a/packages/shared/src/react/hooks/useSessionList.ts b/packages/shared/src/react/hooks/useSessionList.ts index 6d0ee1b0bd1..510d8aa3671 100644 --- a/packages/shared/src/react/hooks/useSessionList.ts +++ b/packages/shared/src/react/hooks/useSessionList.ts @@ -1,6 +1,5 @@ -import type { UseSessionListReturn } from '@clerk/types'; - import { eventMethodCalled } from '../../telemetry/events/method-called'; +import type { UseSessionListReturn } from '../../types'; import { useAssertWrappedByClerkProvider, useClerkInstanceContext, useClientContext } from '../contexts'; const hookName = 'useSessionList'; diff --git a/packages/shared/src/react/hooks/useStatements.tsx b/packages/shared/src/react/hooks/useStatements.tsx index 78817ffebc1..31a99c726d1 100644 --- a/packages/shared/src/react/hooks/useStatements.tsx +++ b/packages/shared/src/react/hooks/useStatements.tsx @@ -1,5 +1,4 @@ -import type { BillingStatementResource, GetStatementsParams } from '@clerk/types'; - +import type { BillingStatementResource, GetStatementsParams } from '../../types'; import { useClerkInstanceContext } from '../contexts'; import { createBillingPaginatedHook } from './createBillingPaginatedHook'; diff --git a/packages/shared/src/react/hooks/useSubscription.tsx b/packages/shared/src/react/hooks/useSubscription.tsx index 53c48df8c08..e80024db1e2 100644 --- a/packages/shared/src/react/hooks/useSubscription.tsx +++ b/packages/shared/src/react/hooks/useSubscription.tsx @@ -1,7 +1,7 @@ -import type { EnvironmentResource, ForPayerType } from '@clerk/types'; import { useCallback } from 'react'; import { eventMethodCalled } from '../../telemetry/events'; +import type { EnvironmentResource, ForPayerType } from '../../types'; import { useSWR } from '../clerk-swr'; import { useAssertWrappedByClerkProvider, diff --git a/packages/shared/src/react/hooks/useUser.ts b/packages/shared/src/react/hooks/useUser.ts index a25367b8c89..7cabcb2b837 100644 --- a/packages/shared/src/react/hooks/useUser.ts +++ b/packages/shared/src/react/hooks/useUser.ts @@ -1,6 +1,5 @@ -import type { UseUserReturn } from '@clerk/types'; - import { eventMethodCalled } from '../../telemetry/events/method-called'; +import type { UseUserReturn } from '../../types'; import { useAssertWrappedByClerkProvider, useClerkInstanceContext, useUserContext } from '../contexts'; const hookName = 'useUser'; diff --git a/packages/shared/src/react/types.ts b/packages/shared/src/react/types.ts index ddc2603fa59..93ee8325553 100644 --- a/packages/shared/src/react/types.ts +++ b/packages/shared/src/react/types.ts @@ -1,6 +1,5 @@ -import type { ClerkPaginatedResponse } from '@clerk/types'; - import type { ClerkAPIResponseError } from '../error'; +import type { ClerkPaginatedResponse } from '../types'; export type ValueOrSetter = (size: T | ((_size: T) => T)) => void; @@ -115,6 +114,7 @@ export type PagesOrInfiniteConfig = PaginatedHookConfig<{ * @default undefined * * @hidden + * * @experimental */ __experimental_mode?: 'cache'; diff --git a/packages/shared/src/router/router.ts b/packages/shared/src/router/router.ts index 69cd41eb159..23337ed6f42 100644 --- a/packages/shared/src/router/router.ts +++ b/packages/shared/src/router/router.ts @@ -1,5 +1,4 @@ -import type { ClerkHostRouter, RoutingMode } from '@clerk/types'; - +import type { ClerkHostRouter, RoutingMode } from '../types'; import { isAbsoluteUrl, withLeadingSlash, withoutTrailingSlash } from '../url'; export const PRESERVED_QUERYSTRING_PARAMS = ['after_sign_in_url', 'after_sign_up_url', 'redirect_url']; @@ -64,8 +63,8 @@ function normalizePath(path: string) { /** * Factory function to create an instance of ClerkRouter with the provided host router. * - * @param router host router instance to be used by the router - * @param basePath base path of the router, navigation and matching will be scoped to this path + * @param router - host router instance to be used by the router + * @param basePath - base path of the router, navigation and matching will be scoped to this path * @returns A ClerkRouter instance */ export function createClerkRouter(router: ClerkHostRouter, basePath: string = '/'): ClerkRouter { @@ -93,6 +92,9 @@ export function createClerkRouter(router: ClerkHostRouter, basePath: string = '/ return `${destinationUrl.pathname}${destinationUrl.search}`; } + /** + * + */ function match(path?: string, index?: boolean) { const pathToMatch = path ?? (index && '/'); @@ -105,29 +107,47 @@ export function createClerkRouter(router: ClerkHostRouter, basePath: string = '/ return normalizePath(`${normalizedBasePath}${normalizedPath}`) === normalizePath(router.pathname()); } + /** + * + */ function child(childBasePath: string) { return createClerkRouter(router, `${normalizedBasePath}${normalizePath(childBasePath)}`); } + /** + * + */ function push(path: string) { const destinationUrl = makeDestinationUrlWithPreservedQueryParameters(path); return router.push(destinationUrl); } + /** + * + */ function replace(path: string) { const destinationUrl = makeDestinationUrlWithPreservedQueryParameters(path); return router.replace(destinationUrl); } + /** + * + */ function shallowPush(path: string) { const destinationUrl = makeDestinationUrlWithPreservedQueryParameters(path); return router.shallowPush(destinationUrl); } + /** + * + */ function pathname() { return router.pathname(); } + /** + * + */ function searchParams() { return router.searchParams(); } diff --git a/packages/shared/src/saml.ts b/packages/shared/src/saml.ts index 953006b3bd8..8627d160f05 100644 --- a/packages/shared/src/saml.ts +++ b/packages/shared/src/saml.ts @@ -1,4 +1,4 @@ -import type { SamlIdpMap } from '@clerk/types'; +import type { SamlIdpMap } from './types'; export const SAML_IDPS: SamlIdpMap = { saml_okta: { diff --git a/packages/shared/src/telemetry/collector.ts b/packages/shared/src/telemetry/collector.ts index 79b092e8ade..e07ace47334 100644 --- a/packages/shared/src/telemetry/collector.ts +++ b/packages/shared/src/telemetry/collector.ts @@ -10,6 +10,7 @@ * * For more information, please see the telemetry documentation page: https://clerk.com/docs/telemetry. */ +import { parsePublishableKey } from '../keys'; import type { InstanceType, SDKMetadata, @@ -17,9 +18,7 @@ import type { TelemetryEvent, TelemetryEventRaw, TelemetryLogEntry, -} from '@clerk/types'; - -import { parsePublishableKey } from '../keys'; +} from '../types'; import { isTruthy } from '../underscore'; import { InMemoryThrottlerCache, LocalStorageThrottlerCache, TelemetryEventThrottler } from './throttler'; import type { TelemetryCollectorOptions } from './types'; diff --git a/packages/shared/src/telemetry/events/component-mounted.ts b/packages/shared/src/telemetry/events/component-mounted.ts index 940f8a1a943..595100cc62f 100644 --- a/packages/shared/src/telemetry/events/component-mounted.ts +++ b/packages/shared/src/telemetry/events/component-mounted.ts @@ -1,4 +1,4 @@ -import type { TelemetryEventRaw } from '@clerk/types'; +import type { TelemetryEventRaw } from '../../types'; const EVENT_COMPONENT_MOUNTED = 'COMPONENT_MOUNTED'; const EVENT_COMPONENT_OPENED = 'COMPONENT_OPENED'; diff --git a/packages/shared/src/telemetry/events/framework-metadata.ts b/packages/shared/src/telemetry/events/framework-metadata.ts index 1a5f69e187e..d8a70b63a28 100644 --- a/packages/shared/src/telemetry/events/framework-metadata.ts +++ b/packages/shared/src/telemetry/events/framework-metadata.ts @@ -1,4 +1,4 @@ -import type { TelemetryEventRaw } from '@clerk/types'; +import type { TelemetryEventRaw } from '../../types'; const EVENT_FRAMEWORK_METADATA = 'FRAMEWORK_METADATA'; const EVENT_SAMPLING_RATE = 0.1; diff --git a/packages/shared/src/telemetry/events/method-called.ts b/packages/shared/src/telemetry/events/method-called.ts index 8258e0c6892..f22f21fd17f 100644 --- a/packages/shared/src/telemetry/events/method-called.ts +++ b/packages/shared/src/telemetry/events/method-called.ts @@ -1,4 +1,4 @@ -import type { TelemetryEventRaw } from '@clerk/types'; +import type { TelemetryEventRaw } from '../../types'; const EVENT_METHOD_CALLED = 'METHOD_CALLED'; const EVENT_SAMPLING_RATE = 0.1; diff --git a/packages/shared/src/telemetry/events/theme-usage.ts b/packages/shared/src/telemetry/events/theme-usage.ts index 0848bb81ced..dade8e68c61 100644 --- a/packages/shared/src/telemetry/events/theme-usage.ts +++ b/packages/shared/src/telemetry/events/theme-usage.ts @@ -1,4 +1,4 @@ -import type { Appearance, BaseTheme, TelemetryEventRaw } from '@clerk/types'; +import type { Appearance, BaseTheme, TelemetryEventRaw } from '../../types'; export const EVENT_THEME_USAGE = 'THEME_USAGE'; export const EVENT_SAMPLING_RATE = 1; diff --git a/packages/shared/src/telemetry/throttler.ts b/packages/shared/src/telemetry/throttler.ts index 9ed196783f6..04137b49af4 100644 --- a/packages/shared/src/telemetry/throttler.ts +++ b/packages/shared/src/telemetry/throttler.ts @@ -1,4 +1,4 @@ -import type { TelemetryEvent } from '@clerk/types'; +import type { TelemetryEvent } from '../types'; type TtlInMilliseconds = number; diff --git a/packages/types/src/apiKeys.ts b/packages/shared/src/types/apiKeys.ts similarity index 100% rename from packages/types/src/apiKeys.ts rename to packages/shared/src/types/apiKeys.ts diff --git a/packages/types/src/apiKeysSettings.ts b/packages/shared/src/types/apiKeysSettings.ts similarity index 100% rename from packages/types/src/apiKeysSettings.ts rename to packages/shared/src/types/apiKeysSettings.ts diff --git a/packages/types/src/appearance.ts b/packages/shared/src/types/appearance.ts similarity index 99% rename from packages/types/src/appearance.ts rename to packages/shared/src/types/appearance.ts index a36614fa0a1..b4f1d00c36e 100644 --- a/packages/types/src/appearance.ts +++ b/packages/shared/src/types/appearance.ts @@ -654,34 +654,41 @@ export type Elements = { export type Variables = { /** * The primary color used throughout the components. Set this to your brand color. + * * @default '#2F3037' */ colorPrimary?: CssColorOrScale; /** * The color of text appearing on top of an element that with a background color of {@link Variables.colorPrimary}, * eg: solid primary buttons. + * * @deprecated Use {@link Variables.colorPrimaryForeground} instead. + * * @default 'white' */ colorTextOnPrimaryBackground?: CssColor; /** * The color of text appearing on top of an element that with a background color of {@link Variables.colorPrimary}, * eg: solid primary buttons. + * * @default 'white' */ colorPrimaryForeground?: CssColor; /** * The color used to indicate errors or destructive actions. Set this to your brand's danger color. + * * @default '#EF4444' */ colorDanger?: CssColorOrScale; /** * The color used to indicate an action that completed successfully or a positive result. + * * @default '#22C543' */ colorSuccess?: CssColorOrScale; /** * The color used for potentially destructive actions or when the user's attention is required. + * * @default '#F36B16' */ colorWarning?: CssColorOrScale; @@ -689,17 +696,21 @@ export type Variables = { * The color that will be used as the neutral color for all the components. To achieve sufficient contrast, * light themes should be using dark shades ('black'), while dark themes should be using light shades ('white'). * This option applies to borders, backgrounds for hovered elements, hovered dropdown options etc. + * * @default 'black' */ colorNeutral?: CssColorOrAlphaScale; /** * The default text color. + * * @deprecated Use {@link Variables.colorForeground} instead. + * * @default '#212126' */ colorText?: CssColor; /** * The default text color. + * * @default 'inherit' */ colorForeground?: CssColor; @@ -711,65 +722,80 @@ export type Variables = { /** * The text color for elements of lower importance, eg: a subtitle text. * This color is a lighter shade of {@link Variables.colorText}. + * * @deprecated Use {@link Variables.colorMutedForeground} instead. + * * @default '#747686' */ colorTextSecondary?: CssColor; /** * The text color for elements of lower importance, eg: a subtitle text. * This color is a lighter shade of {@link Variables.colorText}. + * * @default '#747686' */ colorMutedForeground?: CssColor; /** * The background color for the card container. + * * @default 'white' */ colorBackground?: CssColor; /** * The default text color inside input elements. To customise the input background color instead, use {@link Variables.colorInputBackground}. + * * @deprecated Use {@link Variables.colorInputForeground} instead. + * * @default 'black' */ colorInputText?: CssColor; /** * The default text color inside input elements. To customise the input background color instead, use {@link Variables.colorInputBackground}. + * * @default 'black' */ colorInputForeground?: CssColor; /** * The background color for all input elements. + * * @deprecated Use {@link Variables.colorInput} instead. + * * @default 'white' */ colorInputBackground?: CssColor; /** * The background color for all input elements. + * * @default 'white' */ colorInput?: CssColor; /** * The color of the avatar shimmer + * * @default 'rgba(255, 255, 255, 0.36)' */ colorShimmer?: CssColor; /** * The color of the ring when an interactive element is focused rendered at 15% opacity. + * * @default {@link Variables.colorNeutral} at 15% opacity */ colorRing?: CssColor; /** * The base shadow color used in the components. + * * @default '#000000' */ colorShadow?: CssColor; /** * The base border color used in the components. + * * @default {@link Variables.colorNeutral} */ colorBorder?: CssColor; /** * The background color of the modal backdrop rendered at 73% opacity. + * * @default {@link Variables.colorNeutral} at 73% opacity */ colorModalBackdrop?: CssColor; @@ -777,7 +803,9 @@ export type Variables = { * The default font that will be used in all components. * This can be the name of a custom font loaded by your code or the name of a web-safe font ((@link WebSafeFont}) * If a specific fontFamily is not provided, the components will inherit the font of the parent element. + * * @default 'inherit' + * * @example * { fontFamily: 'Montserrat' } */ @@ -785,12 +813,14 @@ export type Variables = { /** * The default font that will be used in all buttons. See {@link Variables.fontFamily} for details. * If not provided, {@link Variables.fontFamily} will be used instead. + * * @default 'inherit' */ fontFamilyButtons?: FontFamily; /** * The value will be used as the base `md` to calculate all the other scale values (`xs`, `sm`, `lg` and `xl`). * By default, this value is relative to the root fontSize of the html element. + * * @default '0.8125rem' */ fontSize?: CssLengthUnit | FontSizeScale; @@ -798,6 +828,7 @@ export type Variables = { * The font weight the components will use. By default, the components will use the 400, 500, 600 and 700 weights * for normal, medium, semibold and bold text respectively. * You can override the default weights by passing a {@link FontWeightScale} object + * * @default { normal: 400, medium: 500, semibold: 600, bold: 700 }; */ fontWeight?: FontWeightScale; @@ -805,17 +836,21 @@ export type Variables = { * The size that will be used as the `md` base borderRadius value. This is used as the base to calculate the `sm`, `lg`, `xl`, * our components use. As a general rule, the bigger an element is, the larger its borderRadius is going to be. * eg: the Card element uses 'xl' + * * @default '0.375rem' */ borderRadius?: CssLengthUnit; /** * The base spacing unit that all margins, paddings and gaps between the elements are derived from. + * * @deprecated Use {@link Variables.spacing} instead. + * * @default '1rem' */ spacingUnit?: CssLengthUnit; /** * The base spacing that all margins, paddings and gaps between the elements are derived from. + * * @default '1rem' */ spacing?: CssLengthUnit; @@ -830,6 +865,7 @@ export type Theme = { * For further customisation, you can use the {@link Theme.layout}, {@link Theme.variables} and {@link Theme.elements} props. * * Supports both object-based themes and string-based themes: + * * @example * import { dark } from "@clerk/themes"; * appearance={{ theme: dark }} @@ -844,6 +880,7 @@ export type Theme = { * @deprecated Use `theme` instead. This property will be removed in a future version. * A theme used as the base theme for the components. * For further customisation, you can use the {@link Theme.layout}, {@link Theme.variables} and {@link Theme.elements} props. + * * @example * import { dark } from "@clerk/themes"; * appearance={{ baseTheme: dark }} @@ -879,6 +916,7 @@ export type Layout = { /** * Controls whether the logo will be rendered inside or outside the component card. * To customise the logo further, you can use {@link Appearance.elements} + * * @default inside */ logoPlacement?: 'inside' | 'outside' | 'none'; @@ -888,6 +926,7 @@ export type Layout = { * This option is helpful when you need to display different logos for different themes, * eg: white logo on dark themes, black logo on light themes * To customise the logo further, you can use {@link Appearance.elements} + * * @default undefined */ logoImageUrl?: string; @@ -896,6 +935,7 @@ export type Layout = { * usually found in the SignIn and SignUp components. * If a URL is provided, it will be used as the `href` of the link. * If a value is not passed in, the components will use the Home URL as set in the Clerk dashboard + * * @default undefined */ logoLinkUrl?: string; @@ -904,18 +944,21 @@ export type Layout = { * By default, the components will use block buttons if you have less than * 3 social providers enabled, otherwise icon buttons will be used. * To customise the social buttons further, you can use {@link Appearance.elements} + * * @default auto */ socialButtonsVariant?: 'auto' | 'iconButton' | 'blockButton'; /** * Controls whether the social buttons will be rendered above or below the card form. * To customise the social button container further, you can use {@link Appearance.elements} + * * @default 'top' */ socialButtonsPlacement?: 'top' | 'bottom'; /** * Controls whether the SignIn or SignUp forms will include optional fields. * You can make a field required or optional through the {@link https://dashboard.clerk.com|Clerk dashboard}. + * * @default true */ showOptionalFields?: boolean; @@ -936,12 +979,14 @@ export type Layout = { privacyPageUrl?: string; /** * This option enables the shimmer animation for the avatars of and + * * @default true */ shimmer?: boolean; /** * This option enables/disables animations for the components. If you want to disable animations, you can set this to false. * Also the prefers-reduced-motion media query is respected and animations are disabled if the user has set it to reduce motion regardless of this option. + * * @default true */ animations?: boolean; @@ -949,6 +994,7 @@ export type Layout = { /** * This option disables development mode warning. * We don't recommend disabling this unless you want to see a preview of how the components will look in production. + * * @default false */ unsafe_disableDevelopmentModeWarnings?: boolean; @@ -957,11 +1003,13 @@ export type Layout = { export type CaptchaAppearanceOptions = { /** * The widget theme. Can take the following values: light, dark, auto. + * * @default 'auto' */ theme?: 'auto' | 'light' | 'dark'; /** * The widget size. Can take the following values: normal, flexible, compact. + * * @default 'normal' */ size?: 'normal' | 'flexible' | 'compact'; diff --git a/packages/types/src/attributes.ts b/packages/shared/src/types/attributes.ts similarity index 100% rename from packages/types/src/attributes.ts rename to packages/shared/src/types/attributes.ts diff --git a/packages/types/src/authConfig.ts b/packages/shared/src/types/authConfig.ts similarity index 100% rename from packages/types/src/authConfig.ts rename to packages/shared/src/types/authConfig.ts diff --git a/packages/types/src/authObject.ts b/packages/shared/src/types/authObject.ts similarity index 100% rename from packages/types/src/authObject.ts rename to packages/shared/src/types/authObject.ts diff --git a/packages/types/src/backupCode.ts b/packages/shared/src/types/backupCode.ts similarity index 100% rename from packages/types/src/backupCode.ts rename to packages/shared/src/types/backupCode.ts diff --git a/packages/types/src/billing.ts b/packages/shared/src/types/billing.ts similarity index 99% rename from packages/types/src/billing.ts rename to packages/shared/src/types/billing.ts index 9f97a66df45..139511c38be 100644 --- a/packages/types/src/billing.ts +++ b/packages/shared/src/types/billing.ts @@ -491,6 +491,11 @@ export interface BillingSubscriptionItemResource extends ClerkResource { * The unique identifier for the subscription item. */ id: string; + /** + * The unique identifier for the payment method being used for the subscription item. + */ + //TODO(@COMMERCE): should this be nullable ? + paymentMethodId: string; /** * The plan associated with the subscription item. */ diff --git a/packages/types/src/clerk.ts b/packages/shared/src/types/clerk.ts similarity index 100% rename from packages/types/src/clerk.ts rename to packages/shared/src/types/clerk.ts diff --git a/packages/types/src/client.ts b/packages/shared/src/types/client.ts similarity index 100% rename from packages/types/src/client.ts rename to packages/shared/src/types/client.ts diff --git a/packages/types/src/commerceSettings.ts b/packages/shared/src/types/commerceSettings.ts similarity index 100% rename from packages/types/src/commerceSettings.ts rename to packages/shared/src/types/commerceSettings.ts diff --git a/packages/types/src/customMenuItems.ts b/packages/shared/src/types/customMenuItems.ts similarity index 100% rename from packages/types/src/customMenuItems.ts rename to packages/shared/src/types/customMenuItems.ts diff --git a/packages/types/src/customPages.ts b/packages/shared/src/types/customPages.ts similarity index 100% rename from packages/types/src/customPages.ts rename to packages/shared/src/types/customPages.ts diff --git a/packages/types/src/deletedObject.ts b/packages/shared/src/types/deletedObject.ts similarity index 100% rename from packages/types/src/deletedObject.ts rename to packages/shared/src/types/deletedObject.ts diff --git a/packages/types/src/displayConfig.ts b/packages/shared/src/types/displayConfig.ts similarity index 100% rename from packages/types/src/displayConfig.ts rename to packages/shared/src/types/displayConfig.ts diff --git a/packages/types/src/elementIds.ts b/packages/shared/src/types/elementIds.ts similarity index 100% rename from packages/types/src/elementIds.ts rename to packages/shared/src/types/elementIds.ts diff --git a/packages/types/src/emailAddress.ts b/packages/shared/src/types/emailAddress.ts similarity index 100% rename from packages/types/src/emailAddress.ts rename to packages/shared/src/types/emailAddress.ts diff --git a/packages/types/src/enterpriseAccount.ts b/packages/shared/src/types/enterpriseAccount.ts similarity index 100% rename from packages/types/src/enterpriseAccount.ts rename to packages/shared/src/types/enterpriseAccount.ts diff --git a/packages/types/src/environment.ts b/packages/shared/src/types/environment.ts similarity index 100% rename from packages/types/src/environment.ts rename to packages/shared/src/types/environment.ts diff --git a/packages/types/src/errors.ts b/packages/shared/src/types/errors.ts similarity index 100% rename from packages/types/src/errors.ts rename to packages/shared/src/types/errors.ts diff --git a/packages/types/src/externalAccount.ts b/packages/shared/src/types/externalAccount.ts similarity index 100% rename from packages/types/src/externalAccount.ts rename to packages/shared/src/types/externalAccount.ts diff --git a/packages/types/src/factors.ts b/packages/shared/src/types/factors.ts similarity index 100% rename from packages/types/src/factors.ts rename to packages/shared/src/types/factors.ts diff --git a/packages/types/src/hooks.ts b/packages/shared/src/types/hooks.ts similarity index 100% rename from packages/types/src/hooks.ts rename to packages/shared/src/types/hooks.ts diff --git a/packages/types/src/identificationLink.ts b/packages/shared/src/types/identificationLink.ts similarity index 100% rename from packages/types/src/identificationLink.ts rename to packages/shared/src/types/identificationLink.ts diff --git a/packages/types/src/identifiers.ts b/packages/shared/src/types/identifiers.ts similarity index 100% rename from packages/types/src/identifiers.ts rename to packages/shared/src/types/identifiers.ts diff --git a/packages/types/src/image.ts b/packages/shared/src/types/image.ts similarity index 100% rename from packages/types/src/image.ts rename to packages/shared/src/types/image.ts diff --git a/packages/shared/src/types/index.ts b/packages/shared/src/types/index.ts index fbf0cff513f..40f96733b9f 100644 --- a/packages/shared/src/types/index.ts +++ b/packages/shared/src/types/index.ts @@ -1 +1,83 @@ -export type { Simplify } from './utils'; +export type * from './apiKeys'; +export type * from './apiKeysSettings'; +export type * from './appearance'; +export type * from './attributes'; +export type * from './authConfig'; +export type * from './authObject'; +export type * from './backupCode'; +export type * from './billing'; +export type * from './clerk'; +export type * from './client'; +export type * from './commerceSettings'; +export type * from './customMenuItems'; +export type * from './customPages'; +export type * from './deletedObject'; +export type * from './displayConfig'; +export type * from './elementIds'; +export type * from './emailAddress'; +export type * from './enterpriseAccount'; +export type * from './environment'; +export type * from './errors'; +export type * from './externalAccount'; +export type * from './factors'; +export type * from './hooks'; +export type * from './identificationLink'; +export type * from './identifiers'; +export type * from './image'; +export type * from './instance'; +export type * from './json'; +export type * from './jwt'; +export type * from './jwtv2'; +export type * from './key'; +export type * from './localization'; +export type * from './multiDomain'; +export type * from './oauth'; +export type * from './organization'; +export type * from './organizationDomain'; +export type * from './organizationInvitation'; +export type * from './organizationMembership'; +export type * from './organizationMembershipRequest'; +export type * from './organizationSettings'; +export type * from './organizationSuggestion'; +export type * from './pagination'; +export type * from './passkey'; +export type * from './passwords'; +export type * from './permission'; +export type * from './phoneCodeChannel'; +export type * from './phoneNumber'; +export type * from './protect'; +export type * from './redirects'; +export type * from './resource'; +export type * from './role'; +export type * from './router'; +/** + * TODO @revamp-hooks: Drop this in the next major release. + */ +export type * from './runtime-values'; +export type * from './saml'; +export type * from './samlAccount'; +export type * from './samlConnection'; +export type * from './session'; +export type * from './sessionVerification'; +export type * from './signIn'; +export type * from './signInCommon'; +export type * from './signInFuture'; +export type * from './signUp'; +export type * from './signUpCommon'; +export type * from './signUpFuture'; +export type * from './snapshots'; +export type * from './ssr'; +export type * from './state'; +export type * from './strategies'; +export type * from './telemetry'; +export type * from './theme'; +export type * from './token'; +export type * from './totp'; +export type * from './user'; +export type * from './userOrganizationInvitation'; +export type * from './userSettings'; +export type * from './utils'; +export type * from './verification'; +export type * from './waitlist'; +export type * from './web3'; +export type * from './web3Wallet'; diff --git a/packages/types/src/instance.ts b/packages/shared/src/types/instance.ts similarity index 100% rename from packages/types/src/instance.ts rename to packages/shared/src/types/instance.ts diff --git a/packages/types/src/json.ts b/packages/shared/src/types/json copy.ts similarity index 99% rename from packages/types/src/json.ts rename to packages/shared/src/types/json copy.ts index aff67668362..4a71431fb0a 100644 --- a/packages/types/src/json.ts +++ b/packages/shared/src/types/json copy.ts @@ -730,6 +730,7 @@ export interface BillingSubscriptionItemJSON extends ClerkResourceJSON { credit?: { amount: BillingMoneyAmountJSON; }; + payment_method_id: string; plan: BillingPlanJSON; plan_period: BillingSubscriptionPlanPeriod; status: BillingSubscriptionStatus; diff --git a/packages/shared/src/types/json.ts b/packages/shared/src/types/json.ts index e69de29bb2d..4a71431fb0a 100644 --- a/packages/shared/src/types/json.ts +++ b/packages/shared/src/types/json.ts @@ -0,0 +1,859 @@ +/** + * Currently representing API DTOs in their JSON form. + */ + +import type { APIKeysSettingsJSON } from './apiKeysSettings'; +import type { + BillingPayerResourceType, + BillingPaymentChargeType, + BillingPaymentMethodStatus, + BillingPaymentStatus, + BillingStatementStatus, + BillingSubscriptionPlanPeriod, + BillingSubscriptionStatus, +} from './billing'; +import type { CommerceSettingsJSON } from './commerceSettings'; +import type { DisplayConfigJSON } from './displayConfig'; +import type { EnterpriseProtocol, EnterpriseProvider } from './enterpriseAccount'; +import type { ClerkAPIErrorJSON } from './errors'; +import type { EmailAddressIdentifier, UsernameIdentifier } from './identifiers'; +import type { ActClaim } from './jwtv2'; +import type { OAuthProvider } from './oauth'; +import type { OrganizationDomainVerificationStatus, OrganizationEnrollmentMode } from './organizationDomain'; +import type { OrganizationInvitationStatus } from './organizationInvitation'; +import type { OrganizationCustomRoleKey, OrganizationPermissionKey } from './organizationMembership'; +import type { OrganizationSettingsJSON } from './organizationSettings'; +import type { OrganizationSuggestionStatus } from './organizationSuggestion'; +import type { PhoneCodeChannel } from './phoneCodeChannel'; +import type { SamlIdpSlug } from './saml'; +import type { SessionStatus, SessionTask } from './session'; +import type { SessionVerificationLevel, SessionVerificationStatus } from './sessionVerification'; +import type { SignInJSON } from './signIn'; +import type { SignInFirstFactor, SignInSecondFactor } from './signInCommon'; +import type { SignUpField, SignUpIdentificationField, SignUpStatus } from './signUpCommon'; +import type { + EmailCodeStrategy, + EmailLinkStrategy, + OAuthStrategy, + PasswordStrategy, + PhoneCodeStrategy, + Web3Strategy, +} from './strategies'; +import type { BoxShadow, Color, EmUnit, FontWeight, HexColor } from './theme'; +import type { UserSettingsJSON } from './userSettings'; +import type { CamelToSnake } from './utils'; +import type { VerificationStatus } from './verification'; + +export interface ClerkResourceJSON { + // TODO: Shall we make this optional? + id: string; + object: string; +} + +export type PartialWithClerkResource = Omit, 'id' | 'object'> & + Pick; + +export interface DisplayThemeJSON { + general: { + color: HexColor; + background_color: Color; + font_family: string; + font_color: HexColor; + label_font_weight: FontWeight; + padding: EmUnit; + border_radius: EmUnit; + box_shadow: BoxShadow; + }; + buttons: { + font_color: HexColor; + font_family: string; + font_weight: FontWeight; + }; + accounts: { + background_color: Color; + }; +} + +export interface ImageJSON { + object: 'image'; + id: string; + name: string; + public_url: string; +} + +export interface EnvironmentJSON extends ClerkResourceJSON { + api_keys_settings: APIKeysSettingsJSON; + auth_config: AuthConfigJSON; + client_debug_mode?: boolean; + commerce_settings: CommerceSettingsJSON; + display_config: DisplayConfigJSON; + maintenance_mode: boolean; + organization_settings: OrganizationSettingsJSON; + user_settings: UserSettingsJSON; +} + +export type LastAuthenticationStrategy = + | EmailAddressIdentifier + | EmailCodeStrategy + | EmailLinkStrategy + | PhoneCodeStrategy + | PasswordStrategy + | UsernameIdentifier + | OAuthStrategy + | Web3Strategy; + +export interface ClientJSON extends ClerkResourceJSON { + object: 'client'; + id: string; + sessions: SessionJSON[]; + sign_up: SignUpJSON | null; + sign_in: SignInJSON | null; + captcha_bypass?: boolean; // this is used by the @clerk/testing package + last_active_session_id: string | null; + last_authentication_strategy: LastAuthenticationStrategy | null; + cookie_expires_at: number | null; + created_at: number; + updated_at: number; +} + +export interface SignUpJSON extends ClerkResourceJSON { + object: 'sign_up'; + status: SignUpStatus; + required_fields: SignUpField[]; + optional_fields: SignUpField[]; + missing_fields: SignUpField[]; + unverified_fields: SignUpIdentificationField[]; + username: string | null; + first_name: string | null; + last_name: string | null; + email_address: string | null; + phone_number: string | null; + web3_wallet: string | null; + external_account_strategy: string | null; + external_account: any; + has_password: boolean; + unsafe_metadata: SignUpUnsafeMetadata; + created_session_id: string | null; + created_user_id: string | null; + abandon_at: number | null; + legal_accepted_at: number | null; + locale: string | null; + verifications: SignUpVerificationsJSON | null; +} + +/** + * @experimental + */ +export interface SignUpEnterpriseConnectionJSON extends ClerkResourceJSON { + id: string; + name: string; +} + +export interface SessionJSON extends ClerkResourceJSON { + object: 'session'; + id: string; + status: SessionStatus; + /** + * The tuple represents the minutes that have passed since the last time a first or second factor were verified. + * + * @experimental This API is experimental and may change at any moment. + */ + factor_verification_age: [firstFactorAge: number, secondFactorAge: number] | null; + expire_at: number; + abandon_at: number; + last_active_at: number; + last_active_token: TokenJSON; + last_active_organization_id: string | null; + actor: ActClaim | null; + tasks: Array | null; + user: UserJSON; + public_user_data: PublicUserDataJSON; + created_at: number; + updated_at: number; +} + +export interface SessionVerificationJSON extends ClerkResourceJSON { + object: 'session_verification'; + status: SessionVerificationStatus; + first_factor_verification: VerificationJSON | null; + session: SessionJSON; + second_factor_verification: VerificationJSON | null; + level: SessionVerificationLevel; + supported_first_factors: SignInFirstFactorJSON[] | null; + supported_second_factors: SignInSecondFactorJSON[] | null; +} + +export interface EmailAddressJSON extends ClerkResourceJSON { + object: 'email_address'; + email_address: string; + verification: VerificationJSON | null; + linked_to: IdentificationLinkJSON[]; + matches_sso_connection: boolean; +} + +export interface IdentificationLinkJSON extends ClerkResourceJSON { + id: string; + type: string; +} + +export interface PhoneNumberJSON extends ClerkResourceJSON { + object: 'phone_number'; + id: string; + phone_number: string; + reserved_for_second_factor: boolean; + default_second_factor: boolean; + linked_to: IdentificationLinkJSON[]; + verification: VerificationJSON | null; + backup_codes?: string[]; +} + +export interface PasskeyJSON extends ClerkResourceJSON { + object: 'passkey'; + id: string; + name: string | null; + verification: VerificationJSON | null; + last_used_at: number | null; + updated_at: number; + created_at: number; +} + +export interface Web3WalletJSON extends ClerkResourceJSON { + object: 'web3_wallet'; + id: string; + web3_wallet: string; + verification: VerificationJSON | null; +} + +export interface ExternalAccountJSON extends ClerkResourceJSON { + object: 'external_account'; + provider: OAuthProvider; + identification_id: string; + provider_user_id: string; + approved_scopes: string; + email_address: string; + first_name: string; + last_name: string; + image_url: string; + username: string; + phone_number: string; + public_metadata: Record; + label: string; + verification?: VerificationJSON; +} + +export interface EnterpriseAccountJSON extends ClerkResourceJSON { + object: 'enterprise_account'; + active: boolean; + email_address: string; + enterprise_connection: EnterpriseAccountConnectionJSON | null; + first_name: string | null; + last_name: string | null; + protocol: EnterpriseProtocol; + provider: EnterpriseProvider; + provider_user_id: string | null; + public_metadata: Record; + verification: VerificationJSON | null; + last_authenticated_at: number | null; + enterprise_connection_id: string | null; +} + +export interface EnterpriseAccountConnectionJSON extends ClerkResourceJSON { + active: boolean; + allow_idp_initiated: boolean; + allow_subdomains: boolean; + disable_additional_identifications: boolean; + domain: string; + logo_public_url: string | null; + name: string; + protocol: EnterpriseProtocol; + provider: EnterpriseProvider; + sync_user_attributes: boolean; + created_at: number; + updated_at: number; + enterprise_connection_id: string | null; +} + +export interface SamlAccountJSON extends ClerkResourceJSON { + object: 'saml_account'; + provider: SamlIdpSlug; + provider_user_id: string | null; + active: boolean; + email_address: string; + first_name: string; + last_name: string; + verification?: VerificationJSON; + saml_connection?: SamlAccountConnectionJSON; + last_authenticated_at: number | null; + enterprise_connection_id: string | null; +} + +export interface UserJSON extends ClerkResourceJSON { + object: 'user'; + id: string; + external_id: string | null; + primary_email_address_id: string | null; + primary_phone_number_id: string | null; + primary_web3_wallet_id: string | null; + image_url: string; + has_image: boolean; + username: string | null; + email_addresses: EmailAddressJSON[]; + phone_numbers: PhoneNumberJSON[]; + web3_wallets: Web3WalletJSON[]; + external_accounts: ExternalAccountJSON[]; + enterprise_accounts: EnterpriseAccountJSON[]; + passkeys: PasskeyJSON[]; + /** + * @deprecated Use `enterprise_accounts` instead. + */ + saml_accounts: SamlAccountJSON[]; + + organization_memberships: OrganizationMembershipJSON[]; + password_enabled: boolean; + profile_image_id: string; + first_name: string | null; + last_name: string | null; + totp_enabled: boolean; + backup_code_enabled: boolean; + two_factor_enabled: boolean; + public_metadata: UserPublicMetadata; + unsafe_metadata: UserUnsafeMetadata; + last_sign_in_at: number | null; + create_organization_enabled: boolean; + create_organizations_limit: number | null; + delete_self_enabled: boolean; + legal_accepted_at: number | null; + updated_at: number; + created_at: number; +} + +export interface PublicUserDataJSON { + first_name: string | null; + last_name: string | null; + image_url: string; + has_image: boolean; + identifier: string; + user_id?: string; +} + +export interface SessionWithActivitiesJSON extends Omit { + user: null; + latest_activity: SessionActivityJSON; +} + +export interface AuthConfigJSON extends ClerkResourceJSON { + single_session_mode: boolean; + claimed_at: number | null; + reverification: boolean; + preferred_channels?: Record; +} + +export interface VerificationJSON extends ClerkResourceJSON { + status: VerificationStatus; + verified_at_client: string; + strategy: string; + nonce?: string; + message?: string; + external_verification_redirect_url?: string; + attempts: number; + expire_at: number; + channel?: PhoneCodeChannel; + error: ClerkAPIErrorJSON; +} + +export interface SignUpVerificationsJSON { + email_address: SignUpVerificationJSON; + phone_number: SignUpVerificationJSON; + web3_wallet: SignUpVerificationJSON; + external_account: VerificationJSON; +} + +export interface SignUpVerificationJSON extends VerificationJSON { + next_action: string; + supported_strategies: string[]; + channel?: PhoneCodeChannel; +} + +export interface TokenJSON extends ClerkResourceJSON { + object: 'token'; + jwt: string; +} + +export interface SessionActivityJSON extends ClerkResourceJSON { + object: 'session_activity'; + browser_name?: string; + browser_version?: string; + device_type?: string; + ip_address?: string; + city?: string; + country?: string; + is_mobile?: boolean; +} + +export interface OrganizationJSON extends ClerkResourceJSON { + object: 'organization'; + id: string; + image_url: string; + has_image: boolean; + name: string; + slug: string; + public_metadata: OrganizationPublicMetadata; + created_at: number; + updated_at: number; + members_count: number; + pending_invitations_count: number; + admin_delete_enabled: boolean; + max_allowed_memberships: number; +} + +export interface OrganizationMembershipJSON extends ClerkResourceJSON { + object: 'organization_membership'; + id: string; + organization: OrganizationJSON; + permissions: OrganizationPermissionKey[]; + public_metadata: OrganizationMembershipPublicMetadata; + public_user_data?: PublicUserDataJSON; + role: OrganizationCustomRoleKey; + role_name: string; + created_at: number; + updated_at: number; +} + +export interface OrganizationInvitationJSON extends ClerkResourceJSON { + object: 'organization_invitation'; + id: string; + email_address: string; + organization_id: string; + public_metadata: OrganizationInvitationPublicMetadata; + status: OrganizationInvitationStatus; + role: OrganizationCustomRoleKey; + role_name: string; + created_at: number; + updated_at: number; +} + +export interface OrganizationDomainVerificationJSON { + status: OrganizationDomainVerificationStatus; + strategy: 'email_code'; // only available value for now + attempts: number; + expires_at: number; +} + +export interface OrganizationDomainJSON extends ClerkResourceJSON { + object: 'organization_domain'; + id: string; + name: string; + organization_id: string; + enrollment_mode: OrganizationEnrollmentMode; + verification: OrganizationDomainVerificationJSON | null; + affiliation_email_address: string | null; + created_at: number; + updated_at: number; + total_pending_invitations: number; + total_pending_suggestions: number; +} + +export interface RoleJSON extends ClerkResourceJSON { + object: 'role'; + id: string; + key: string; + name: string; + description: string; + permissions: PermissionJSON[]; + created_at: number; + updated_at: number; +} + +export interface PermissionJSON extends ClerkResourceJSON { + object: 'permission'; + id: string; + key: string; + name: string; + description: string; + type: 'system' | 'user'; + created_at: number; + updated_at: number; +} + +export interface PublicOrganizationDataJSON { + id: string; + name: string; + slug: string | null; + has_image: boolean; + image_url: string; +} + +export interface OrganizationSuggestionJSON extends ClerkResourceJSON { + object: 'organization_suggestion'; + id: string; + public_organization_data: PublicOrganizationDataJSON; + status: OrganizationSuggestionStatus; + created_at: number; + updated_at: number; +} + +export interface OrganizationMembershipRequestJSON extends ClerkResourceJSON { + object: 'organization_membership_request'; + id: string; + organization_id: string; + status: OrganizationInvitationStatus; + public_user_data: PublicUserDataJSON; + created_at: number; + updated_at: number; +} + +export interface UserOrganizationInvitationJSON extends ClerkResourceJSON { + object: 'organization_invitation'; + id: string; + email_address: string; + public_organization_data: PublicOrganizationDataJSON; + public_metadata: OrganizationInvitationPublicMetadata; + status: OrganizationInvitationStatus; + role: OrganizationCustomRoleKey; + created_at: number; + updated_at: number; +} + +export interface UserDataJSON { + first_name?: string; + last_name?: string; + image_url: string; + has_image: boolean; +} + +export interface TOTPJSON extends ClerkResourceJSON { + object: 'totp'; + id: string; + secret?: string; + uri?: string; + verified: boolean; + backup_codes?: string[]; + created_at: number; + updated_at: number; +} + +export interface BackupCodeJSON extends ClerkResourceJSON { + object: 'backup_code'; + id: string; + codes: string[]; + created_at: number; + updated_at: number; +} + +export interface DeletedObjectJSON { + object: string; + id?: string; + slug?: string; + deleted: boolean; +} + +export type SignInFirstFactorJSON = CamelToSnake; +export type SignInSecondFactorJSON = CamelToSnake; + +/** + * Types for WebAuthN passkeys + */ + +type Base64UrlString = string; + +interface PublicKeyCredentialUserEntityJSON { + name: string; + displayName: string; + id: Base64UrlString; +} + +interface PublicKeyCredentialDescriptorJSON { + type: 'public-key'; + id: Base64UrlString; + transports?: ('ble' | 'hybrid' | 'internal' | 'nfc' | 'usb')[]; +} + +interface AuthenticatorSelectionCriteriaJSON { + requireResidentKey: boolean; + residentKey: 'discouraged' | 'preferred' | 'required'; + userVerification: 'discouraged' | 'preferred' | 'required'; +} + +export interface PublicKeyCredentialCreationOptionsJSON { + rp: PublicKeyCredentialRpEntity; + user: PublicKeyCredentialUserEntityJSON; + challenge: Base64UrlString; + pubKeyCredParams: PublicKeyCredentialParameters[]; + timeout: number; + excludeCredentials: PublicKeyCredentialDescriptorJSON[]; + authenticatorSelection: AuthenticatorSelectionCriteriaJSON; + attestation: 'direct' | 'enterprise' | 'indirect' | 'none'; +} + +export interface PublicKeyCredentialRequestOptionsJSON { + allowCredentials: PublicKeyCredentialDescriptorJSON[]; + challenge: Base64UrlString; + rpId: string; + timeout: number; + userVerification: 'discouraged' | 'preferred' | 'required'; +} + +export interface SamlAccountConnectionJSON extends ClerkResourceJSON { + id: string; + name: string; + domain: string; + active: boolean; + provider: string; + sync_user_attributes: boolean; + allow_subdomains: boolean; + allow_idp_initiated: boolean; + disable_additional_identifications: boolean; + created_at: number; + updated_at: number; +} + +export interface WaitlistJSON extends ClerkResourceJSON { + object: 'waitlist'; + id: string; + created_at: number; + updated_at: number; +} + +/** + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface FeatureJSON extends ClerkResourceJSON { + object: 'feature'; + id: string; + name: string; + description: string; + slug: string; + avatar_url: string; +} + +/** + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface BillingPlanJSON extends ClerkResourceJSON { + object: 'commerce_plan'; + id: string; + name: string; + fee: BillingMoneyAmountJSON; + annual_fee: BillingMoneyAmountJSON; + annual_monthly_fee: BillingMoneyAmountJSON; + amount: number; + amount_formatted: string; + annual_amount: number; + annual_amount_formatted: string; + annual_monthly_amount: number; + annual_monthly_amount_formatted: string; + currency_symbol: string; + currency: string; + description: string; + is_default: boolean; + is_recurring: boolean; + has_base_fee: boolean; + for_payer_type: BillingPayerResourceType; + publicly_visible: boolean; + slug: string; + avatar_url: string; + features: FeatureJSON[]; + free_trial_days?: number | null; + free_trial_enabled?: boolean; +} + +/** + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface BillingPaymentMethodJSON extends ClerkResourceJSON { + object: 'commerce_payment_method'; + id: string; + last4: string; + payment_type: 'card' | 'link'; + card_type: string; + is_default: boolean; + is_removable: boolean; + status: BillingPaymentMethodStatus; + wallet_type: string | null; +} + +/** + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface BillingInitializedPaymentMethodJSON extends ClerkResourceJSON { + object: 'commerce_payment_method_initialize'; + external_client_secret: string; + external_gateway_id: string; + payment_method_order: string[]; +} + +/** + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface BillingStatementJSON extends ClerkResourceJSON { + object: 'commerce_statement'; + id: string; + status: BillingStatementStatus; + timestamp: number; + groups: BillingStatementGroupJSON[]; + totals: BillingStatementTotalsJSON; +} + +/** + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface BillingStatementGroupJSON extends ClerkResourceJSON { + object: 'commerce_statement_group'; + timestamp: number; + items: BillingPaymentJSON[]; +} + +/** + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface BillingPaymentJSON extends ClerkResourceJSON { + object: 'commerce_payment'; + id: string; + amount: BillingMoneyAmountJSON; + paid_at?: number; + failed_at?: number; + updated_at: number; + payment_method: BillingPaymentMethodJSON; + subscription: BillingSubscriptionItemJSON; + subscription_item: BillingSubscriptionItemJSON; + charge_type: BillingPaymentChargeType; + status: BillingPaymentStatus; +} + +/** + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface BillingSubscriptionItemJSON extends ClerkResourceJSON { + object: 'commerce_subscription_item'; + id: string; + amount?: BillingMoneyAmountJSON; + credit?: { + amount: BillingMoneyAmountJSON; + }; + payment_method_id: string; + plan: BillingPlanJSON; + plan_period: BillingSubscriptionPlanPeriod; + status: BillingSubscriptionStatus; + created_at: number; + period_start: number; + /** + * Period end is `null` for subscription items that are on the free plan. + */ + period_end: number | null; + canceled_at: number | null; + past_due_at: number | null; + // TODO(@COMMERCE): Remove optional after GA. + is_free_trial?: boolean; +} + +/** + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface BillingSubscriptionJSON extends ClerkResourceJSON { + object: 'commerce_subscription'; + id: string; + /** + * Describes the details for the next payment cycle. It is `undefined` for subscription items that are cancelled or on the free plan. + */ + next_payment?: { + amount: BillingMoneyAmountJSON; + date: number; + }; + /** + * Due to the free plan subscription item, the top level subscription can either be `active` or `past_due`. + */ + status: Extract; + created_at: number; + active_at: number; + updated_at: number | null; + past_due_at: number | null; + subscription_items: BillingSubscriptionItemJSON[] | null; + eligible_for_free_trial?: boolean; +} + +/** + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface BillingMoneyAmountJSON { + amount: number; + amount_formatted: string; + currency: string; + currency_symbol: string; +} + +/** + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface BillingCheckoutTotalsJSON { + grand_total: BillingMoneyAmountJSON; + subtotal: BillingMoneyAmountJSON; + tax_total: BillingMoneyAmountJSON; + total_due_now: BillingMoneyAmountJSON; + credit: BillingMoneyAmountJSON; + past_due: BillingMoneyAmountJSON; +} + +/** + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface BillingStatementTotalsJSON extends Omit {} + +/** + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface BillingCheckoutJSON extends ClerkResourceJSON { + object: 'commerce_checkout'; + id: string; + external_client_secret: string; + external_gateway_id: string; + payment_method?: BillingPaymentMethodJSON; + plan: BillingPlanJSON; + plan_period: BillingSubscriptionPlanPeriod; + plan_period_start?: number; + status: 'needs_confirmation' | 'completed'; + totals: BillingCheckoutTotalsJSON; + is_immediate_plan_change: boolean; + // TODO(@COMMERCE): Remove optional after GA. + free_trial_ends_at: number | null; + payer: BillingPayerJSON; +} + +/** + * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + */ +export interface BillingPayerJSON extends ClerkResourceJSON { + object: 'commerce_payer'; + id: string; + created_at: number; + updated_at: number; + image_url: string | null; + + // User attributes + user_id?: string; + email?: string; + first_name?: string; + last_name?: string; + + // Organization attributes + organization_id?: string; + organization_name?: string; +} + +export interface ApiKeyJSON extends ClerkResourceJSON { + id: string; + type: string; + name: string; + subject: string; + scopes: string[]; + claims: Record | null; + revoked: boolean; + revocation_reason: string | null; + expired: boolean; + expiration: number | null; + created_by: string | null; + description: string | null; + last_used_at: number | null; + created_at: number; + updated_at: number; +} diff --git a/packages/types/src/jwt.ts b/packages/shared/src/types/jwt.ts similarity index 100% rename from packages/types/src/jwt.ts rename to packages/shared/src/types/jwt.ts diff --git a/packages/types/src/jwtv2.ts b/packages/shared/src/types/jwtv2.ts similarity index 100% rename from packages/types/src/jwtv2.ts rename to packages/shared/src/types/jwtv2.ts diff --git a/packages/types/src/key.ts b/packages/shared/src/types/key.ts similarity index 100% rename from packages/types/src/key.ts rename to packages/shared/src/types/key.ts diff --git a/packages/types/src/localization.ts b/packages/shared/src/types/localization.ts similarity index 100% rename from packages/types/src/localization.ts rename to packages/shared/src/types/localization.ts diff --git a/packages/types/src/multiDomain.ts b/packages/shared/src/types/multiDomain.ts similarity index 100% rename from packages/types/src/multiDomain.ts rename to packages/shared/src/types/multiDomain.ts diff --git a/packages/types/src/oauth.ts b/packages/shared/src/types/oauth.ts similarity index 100% rename from packages/types/src/oauth.ts rename to packages/shared/src/types/oauth.ts diff --git a/packages/types/src/organization.ts b/packages/shared/src/types/organization.ts similarity index 100% rename from packages/types/src/organization.ts rename to packages/shared/src/types/organization.ts diff --git a/packages/types/src/organizationDomain.ts b/packages/shared/src/types/organizationDomain.ts similarity index 100% rename from packages/types/src/organizationDomain.ts rename to packages/shared/src/types/organizationDomain.ts diff --git a/packages/types/src/organizationInvitation.ts b/packages/shared/src/types/organizationInvitation.ts similarity index 99% rename from packages/types/src/organizationInvitation.ts rename to packages/shared/src/types/organizationInvitation.ts index 347699b254c..cc4f91eea04 100644 --- a/packages/types/src/organizationInvitation.ts +++ b/packages/shared/src/types/organizationInvitation.ts @@ -18,6 +18,7 @@ declare global { /** * The `OrganizationInvitation` object is the model around an organization invitation. + * * @interface */ export interface OrganizationInvitationResource extends ClerkResource { diff --git a/packages/types/src/organizationMembership.ts b/packages/shared/src/types/organizationMembership.ts similarity index 100% rename from packages/types/src/organizationMembership.ts rename to packages/shared/src/types/organizationMembership.ts diff --git a/packages/types/src/organizationMembershipRequest.ts b/packages/shared/src/types/organizationMembershipRequest.ts similarity index 100% rename from packages/types/src/organizationMembershipRequest.ts rename to packages/shared/src/types/organizationMembershipRequest.ts diff --git a/packages/types/src/organizationSettings.ts b/packages/shared/src/types/organizationSettings.ts similarity index 100% rename from packages/types/src/organizationSettings.ts rename to packages/shared/src/types/organizationSettings.ts diff --git a/packages/types/src/organizationSuggestion.ts b/packages/shared/src/types/organizationSuggestion.ts similarity index 100% rename from packages/types/src/organizationSuggestion.ts rename to packages/shared/src/types/organizationSuggestion.ts diff --git a/packages/types/src/pagination.ts b/packages/shared/src/types/pagination.ts similarity index 100% rename from packages/types/src/pagination.ts rename to packages/shared/src/types/pagination.ts diff --git a/packages/types/src/passkey.ts b/packages/shared/src/types/passkey.ts similarity index 100% rename from packages/types/src/passkey.ts rename to packages/shared/src/types/passkey.ts diff --git a/packages/types/src/passwords.ts b/packages/shared/src/types/passwords.ts similarity index 100% rename from packages/types/src/passwords.ts rename to packages/shared/src/types/passwords.ts diff --git a/packages/types/src/permission.ts b/packages/shared/src/types/permission.ts similarity index 100% rename from packages/types/src/permission.ts rename to packages/shared/src/types/permission.ts diff --git a/packages/types/src/phoneCodeChannel.ts b/packages/shared/src/types/phoneCodeChannel.ts similarity index 100% rename from packages/types/src/phoneCodeChannel.ts rename to packages/shared/src/types/phoneCodeChannel.ts diff --git a/packages/types/src/phoneNumber.ts b/packages/shared/src/types/phoneNumber.ts similarity index 100% rename from packages/types/src/phoneNumber.ts rename to packages/shared/src/types/phoneNumber.ts diff --git a/packages/types/src/protect.ts b/packages/shared/src/types/protect.ts similarity index 100% rename from packages/types/src/protect.ts rename to packages/shared/src/types/protect.ts diff --git a/packages/types/src/redirects.ts b/packages/shared/src/types/redirects.ts similarity index 100% rename from packages/types/src/redirects.ts rename to packages/shared/src/types/redirects.ts diff --git a/packages/types/src/resource.ts b/packages/shared/src/types/resource.ts similarity index 100% rename from packages/types/src/resource.ts rename to packages/shared/src/types/resource.ts diff --git a/packages/types/src/role.ts b/packages/shared/src/types/role.ts similarity index 100% rename from packages/types/src/role.ts rename to packages/shared/src/types/role.ts diff --git a/packages/types/src/router.ts b/packages/shared/src/types/router.ts similarity index 100% rename from packages/types/src/router.ts rename to packages/shared/src/types/router.ts diff --git a/packages/types/src/runtime-values.ts b/packages/shared/src/types/runtime-values.ts similarity index 100% rename from packages/types/src/runtime-values.ts rename to packages/shared/src/types/runtime-values.ts diff --git a/packages/types/src/saml.ts b/packages/shared/src/types/saml.ts similarity index 100% rename from packages/types/src/saml.ts rename to packages/shared/src/types/saml.ts diff --git a/packages/types/src/samlAccount.ts b/packages/shared/src/types/samlAccount.ts similarity index 100% rename from packages/types/src/samlAccount.ts rename to packages/shared/src/types/samlAccount.ts diff --git a/packages/types/src/samlConnection.ts b/packages/shared/src/types/samlConnection.ts similarity index 100% rename from packages/types/src/samlConnection.ts rename to packages/shared/src/types/samlConnection.ts diff --git a/packages/types/src/session.ts b/packages/shared/src/types/session.ts similarity index 100% rename from packages/types/src/session.ts rename to packages/shared/src/types/session.ts diff --git a/packages/types/src/sessionVerification.ts b/packages/shared/src/types/sessionVerification.ts similarity index 100% rename from packages/types/src/sessionVerification.ts rename to packages/shared/src/types/sessionVerification.ts diff --git a/packages/types/src/signIn.ts b/packages/shared/src/types/signIn.ts similarity index 100% rename from packages/types/src/signIn.ts rename to packages/shared/src/types/signIn.ts diff --git a/packages/types/src/signInCommon.ts b/packages/shared/src/types/signInCommon.ts similarity index 100% rename from packages/types/src/signInCommon.ts rename to packages/shared/src/types/signInCommon.ts diff --git a/packages/types/src/signInFuture.ts b/packages/shared/src/types/signInFuture.ts similarity index 100% rename from packages/types/src/signInFuture.ts rename to packages/shared/src/types/signInFuture.ts diff --git a/packages/types/src/signUp.ts b/packages/shared/src/types/signUp.ts similarity index 100% rename from packages/types/src/signUp.ts rename to packages/shared/src/types/signUp.ts diff --git a/packages/types/src/signUpCommon.ts b/packages/shared/src/types/signUpCommon.ts similarity index 100% rename from packages/types/src/signUpCommon.ts rename to packages/shared/src/types/signUpCommon.ts diff --git a/packages/types/src/signUpFuture.ts b/packages/shared/src/types/signUpFuture.ts similarity index 100% rename from packages/types/src/signUpFuture.ts rename to packages/shared/src/types/signUpFuture.ts diff --git a/packages/types/src/snapshots.ts b/packages/shared/src/types/snapshots.ts similarity index 100% rename from packages/types/src/snapshots.ts rename to packages/shared/src/types/snapshots.ts diff --git a/packages/types/src/ssr.ts b/packages/shared/src/types/ssr.ts similarity index 100% rename from packages/types/src/ssr.ts rename to packages/shared/src/types/ssr.ts diff --git a/packages/types/src/state.ts b/packages/shared/src/types/state.ts similarity index 100% rename from packages/types/src/state.ts rename to packages/shared/src/types/state.ts diff --git a/packages/types/src/strategies.ts b/packages/shared/src/types/strategies.ts similarity index 100% rename from packages/types/src/strategies.ts rename to packages/shared/src/types/strategies.ts diff --git a/packages/types/src/telemetry.ts b/packages/shared/src/types/telemetry.ts similarity index 100% rename from packages/types/src/telemetry.ts rename to packages/shared/src/types/telemetry.ts diff --git a/packages/types/src/theme.ts b/packages/shared/src/types/theme.ts similarity index 100% rename from packages/types/src/theme.ts rename to packages/shared/src/types/theme.ts diff --git a/packages/types/src/token.ts b/packages/shared/src/types/token.ts similarity index 100% rename from packages/types/src/token.ts rename to packages/shared/src/types/token.ts diff --git a/packages/types/src/totp.ts b/packages/shared/src/types/totp.ts similarity index 100% rename from packages/types/src/totp.ts rename to packages/shared/src/types/totp.ts diff --git a/packages/types/src/user.ts b/packages/shared/src/types/user.ts similarity index 99% rename from packages/types/src/user.ts rename to packages/shared/src/types/user.ts index 951735d88c6..54b949411d3 100644 --- a/packages/types/src/user.ts +++ b/packages/shared/src/types/user.ts @@ -50,6 +50,10 @@ declare global { interface UserUnsafeMetadata { [k: string]: unknown; } + + interface ikosadfas { + [k: string]: unknown; + } } /** diff --git a/packages/types/src/userOrganizationInvitation.ts b/packages/shared/src/types/userOrganizationInvitation.ts similarity index 100% rename from packages/types/src/userOrganizationInvitation.ts rename to packages/shared/src/types/userOrganizationInvitation.ts diff --git a/packages/types/src/userSettings.ts b/packages/shared/src/types/userSettings.ts similarity index 100% rename from packages/types/src/userSettings.ts rename to packages/shared/src/types/userSettings.ts diff --git a/packages/types/src/utils.ts b/packages/shared/src/types/utils copy.ts similarity index 100% rename from packages/types/src/utils.ts rename to packages/shared/src/types/utils copy.ts diff --git a/packages/shared/src/types/utils.ts b/packages/shared/src/types/utils.ts index 7d406a3f1f5..50c968bcd31 100644 --- a/packages/shared/src/types/utils.ts +++ b/packages/shared/src/types/utils.ts @@ -5,3 +5,121 @@ export type Simplify = { [K in keyof T]: T[K]; } & {}; + +export type SnakeToCamel = T extends `${infer A}_${infer B}` + ? `${Uncapitalize}${Capitalize>}` + : T extends object + ? { [K in keyof T as SnakeToCamel]: T[K] } + : T; + +export type DeepSnakeToCamel = T extends `${infer A}_${infer B}` + ? `${Uncapitalize}${Capitalize>}` + : T extends object + ? { [K in keyof T as DeepSnakeToCamel]: DeepSnakeToCamel } + : T; + +export type DeepCamelToSnake = T extends `${infer C0}${infer R}` + ? `${C0 extends Uppercase ? '_' : ''}${Lowercase}${DeepCamelToSnake}` + : T extends object + ? { + [K in keyof T as DeepCamelToSnake>]: DeepCamelToSnake; + } + : T; + +export type CamelToSnake = T extends `${infer C0}${infer R}` + ? `${C0 extends Uppercase ? '_' : ''}${Lowercase}${CamelToSnake}` + : T extends object + ? { + [K in keyof T as CamelToSnake>]: T[K]; + } + : T; + +/** + * @internal + */ +export type DeepPartial = { + [P in keyof T]?: T[P] extends object ? DeepPartial : T[P]; +}; + +export type DeepRequired = Required<{ + [P in keyof T]: T[P] extends object | undefined ? DeepRequired> : T[P]; +}>; + +export type Nullable = { + [P in keyof T]: P extends K ? T[P] | null : T[P]; +}; + +/** + * Internal type used by RecordToPath + */ +type PathImpl = Key extends string + ? T[Key] extends Record + ? + | `${Key}.${PathImpl> & string}` + | `${Key}.${Exclude & string}` + : never + : never; + +/** + * Internal type used by RecordToPath + */ +type PathImpl2 = PathImpl | keyof T; + +/** + * Used to construct a type union containing all the keys (even if nested) of an object defined as const + * const obj = { a: { b: '' }, c: '' } as const; + * type Paths = RecordToPath + * Paths contains: 'a' | 'a.b' | 'c' + */ +export type RecordToPath = PathImpl2 extends string | keyof T ? PathImpl2 : keyof T; + +/** + * Used to read the value of a string path inside an object defined as const + * const obj = { a: { b: 'hello' }} as const; + * type Value = PathValue + * Value is now a union set containing a single type: 'hello' + */ +export type PathValue> = P extends `${infer Key}.${infer Rest}` + ? Key extends keyof T + ? Rest extends RecordToPath + ? PathValue + : never + : never + : P extends keyof T + ? T[P] + : never; + +// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type +type IsSerializable = T extends Function ? false : true; + +/** + * Excludes any non-serializable prop from an object + * + * @hidden + */ +export type Serializable = { + [K in keyof T as IsSerializable extends true ? K : never]: T[K]; +}; + +/** + * Enables autocompletion for a union type, while keeping the ability to use any string + * or type of `T` + * + * @internal + */ +export type Autocomplete = U | (T & Record); + +/** + * Omit without union flattening + */ +export type Without = { + [P in keyof T as Exclude]: T[P]; +}; + +/** + * Overrides the type of existing properties + * const obj = { a: string, b: number } as const; + * type Value = Override + * Value contains: { a:string, b: string } + */ +export type Override = Omit & U; diff --git a/packages/types/src/verification.ts b/packages/shared/src/types/verification.ts similarity index 100% rename from packages/types/src/verification.ts rename to packages/shared/src/types/verification.ts diff --git a/packages/types/src/waitlist.ts b/packages/shared/src/types/waitlist.ts similarity index 100% rename from packages/types/src/waitlist.ts rename to packages/shared/src/types/waitlist.ts diff --git a/packages/types/src/web3.ts b/packages/shared/src/types/web3.ts similarity index 100% rename from packages/types/src/web3.ts rename to packages/shared/src/types/web3.ts diff --git a/packages/types/src/web3Wallet.ts b/packages/shared/src/types/web3Wallet.ts similarity index 100% rename from packages/types/src/web3Wallet.ts rename to packages/shared/src/types/web3Wallet.ts diff --git a/packages/shared/src/web3.ts b/packages/shared/src/web3.ts index 7f84ffcebf5..25392eece24 100644 --- a/packages/shared/src/web3.ts +++ b/packages/shared/src/web3.ts @@ -1,4 +1,4 @@ -import type { Web3ProviderData } from '@clerk/types'; +import type { Web3ProviderData } from './types'; export const WEB3_PROVIDERS: Web3ProviderData[] = [ { diff --git a/packages/shared/src/workerTimers/createWorkerTimers.ts b/packages/shared/src/workerTimers/createWorkerTimers.ts index fd465acbcc6..d2b02dcd673 100644 --- a/packages/shared/src/workerTimers/createWorkerTimers.ts +++ b/packages/shared/src/workerTimers/createWorkerTimers.ts @@ -1,4 +1,5 @@ import { noop } from '../utils/noop'; +import pollerWorkerSource from './workerTimers.built'; import type { WorkerClearTimeout, WorkerSetTimeout, @@ -7,9 +8,6 @@ import type { WorkerTimerId, WorkerTimerResponseEvent, } from './workerTimers.types'; -// @ts-ignore -// eslint-disable-next-line import/default -import pollerWorkerSource from './workerTimers.worker'; const createWebWorker = (source: string, opts: ConstructorParameters[1] = {}): Worker | null => { if (typeof Worker === 'undefined') { diff --git a/packages/shared/src/workerTimers/workerTimers.built.ts b/packages/shared/src/workerTimers/workerTimers.built.ts new file mode 100644 index 00000000000..29b404ec2cc --- /dev/null +++ b/packages/shared/src/workerTimers/workerTimers.built.ts @@ -0,0 +1,20 @@ +/** + * + * This is the minified string output of transforming workerTimers.worker.ts + * Once the tsdown docs are complete, we will write a similar plugin as the one below: + * + * (this was the previous esbuild plugin we were using) + * export const WebWorkerMinifyPlugin: Plugin = { + * name: 'WebWorkerMinifyPlugin', + * setup(build) { + * build.onLoad({ filter: /\.worker\.ts/ }, async args => { + * console.log('aaaaaaaaaaaaa'); + * const f = await readFile(args.path); + * const js = await esbuild.transform(f, { loader: 'ts', minify: true }); + * return { loader: 'text', contents: js.code }; + * }); + * }, + * }; + * + */ +export default 'const respond=r=>{self.postMessage(r)},workerToTabIds={};self.addEventListener("message",r=>{const e=r.data;switch(e.type){case"setTimeout":workerToTabIds[e.id]=setTimeout(()=>{respond({id:e.id}),delete workerToTabIds[e.id]},e.ms);break;case"clearTimeout":workerToTabIds[e.id]&&(clearTimeout(workerToTabIds[e.id]),delete workerToTabIds[e.id]);break;case"setInterval":workerToTabIds[e.id]=setInterval(()=>{respond({id:e.id})},e.ms);break;case"clearInterval":workerToTabIds[e.id]&&(clearInterval(workerToTabIds[e.id]),delete workerToTabIds[e.id]);break}});\n'; diff --git a/packages/shared/tsconfig.declarations.json b/packages/shared/tsconfig.declarations.json deleted file mode 100644 index b97a0330a47..00000000000 --- a/packages/shared/tsconfig.declarations.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "declaration": true, - "declarationDir": "./dist", - "declarationMap": true, - "emitDeclarationOnly": true, - "skipLibCheck": true - }, - "exclude": ["**/__tests__/**/*"] -} diff --git a/packages/shared/tsconfig.json b/packages/shared/tsconfig.json index 05919363e30..fbb3e74d4c8 100644 --- a/packages/shared/tsconfig.json +++ b/packages/shared/tsconfig.json @@ -1,18 +1,26 @@ { "compilerOptions": { - "target": "ES2022", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "moduleResolution": "Bundler", - "module": "ESNext", - "preserveWatchOutput": true, - "skipLibCheck": true, + "rootDir": "src", + "verbatimModuleSyntax": true, + "types": ["node"], + "target": "es2022", "strict": true, - "outDir": "dist", + "skipLibCheck": true, "resolveJsonModule": true, + "preserveWatchOutput": true, + "outDir": "dist", + "noUnusedLocals": true, + "moduleResolution": "bundler", + "moduleDetection": "force", + "module": "preserve", + "lib": ["ES2023", "DOM", "WebWorker"], "jsx": "react", - "lib": ["ES2022", "DOM", "WebWorker"], + "isolatedModules": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "emitDeclarationOnly": true, + "declaration": true, + "declarationMap": true, "allowJs": true }, "exclude": ["node_modules"], diff --git a/packages/shared/tsdown.config.mts b/packages/shared/tsdown.config.mts new file mode 100644 index 00000000000..6a559c60060 --- /dev/null +++ b/packages/shared/tsdown.config.mts @@ -0,0 +1,50 @@ +import type { Options } from 'tsdown'; +import { defineConfig } from 'tsdown'; + +import clerkJsPackage from '../clerk-js/package.json' with { type: 'json' }; +import sharedPackage from './package.json' with { type: 'json' }; + +export default defineConfig(({ watch }) => { + const common = { + dts: true, + sourcemap: true, + clean: true, + target: 'es2022', + platform: 'neutral', + external: ['react', 'react-dom'], + format: ['cjs', 'esm'], + minify: false, + define: { + PACKAGE_NAME: `"${sharedPackage.name}"`, + PACKAGE_VERSION: `"${sharedPackage.version}"`, + JS_PACKAGE_VERSION: `"${clerkJsPackage.version}"`, + __DEV__: `${watch}`, + }, + } satisfies Options; + + return [ + { + ...common, + entry: [ + // + './src/types/index.ts', + ], + unbundle: false, + outDir: './dist/types', + }, + { + ...common, + entry: [ + './src/*.{ts,tsx}', + './src/react/index.ts', + './src/utils/index.ts', + './src/workerTimers/index.ts', + './src/types/index.ts', + './src/dom/*.ts', + '!./src/**/*.{test,spec}.{ts,tsx}', + ], + outDir: './dist/runtime', + unbundle: false, + }, + ]; +}); diff --git a/packages/shared/tsup.config.ts b/packages/shared/tsup.config.ts deleted file mode 100644 index 5ced114533c..00000000000 --- a/packages/shared/tsup.config.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { Plugin } from 'esbuild'; -import * as esbuild from 'esbuild'; -import { readFile } from 'fs/promises'; -import { defineConfig } from 'tsup'; - -import { version as clerkJsVersion } from '../clerk-js/package.json'; -import { name, version } from './package.json'; - -export default defineConfig(overrideOptions => { - const isWatch = !!overrideOptions.watch; - - return { - entry: [ - './src/*.{ts,tsx}', - './src/react/index.ts', - './src/utils/index.ts', - './src/workerTimers/index.ts', - './src/dom/*.ts', - './src/types/*.ts', - '!./src/**/*.test.{ts,tsx}', - ], - format: ['cjs', 'esm'], - bundle: true, - clean: true, - minify: false, - sourcemap: true, - dts: true, - target: 'es2022', - external: ['react', 'react-dom'], - esbuildPlugins: [WebWorkerMinifyPlugin as any], - define: { - PACKAGE_NAME: `"${name}"`, - PACKAGE_VERSION: `"${version}"`, - JS_PACKAGE_VERSION: `"${clerkJsVersion}"`, - __DEV__: `${isWatch}`, - }, - }; -}); - -// Read transform and minify any files ending in .worker.ts -// These files can be imported as modules and used as string when instantiating -// a new web worker, without loading an external file during runtime -export const WebWorkerMinifyPlugin: Plugin = { - name: 'WebWorkerMinifyPlugin', - setup(build) { - build.onLoad({ filter: /\.worker\.ts/ }, async args => { - const f = await readFile(args.path); - const js = await esbuild.transform(f, { loader: 'ts', minify: true }); - return { loader: 'text', contents: js.code }; - }); - }, -}; diff --git a/packages/shared/vitest.config.mts b/packages/shared/vitest.config.mts index b8782de3ebc..3d926296ff2 100644 --- a/packages/shared/vitest.config.mts +++ b/packages/shared/vitest.config.mts @@ -7,13 +7,13 @@ export default defineConfig({ typecheck: { enabled: true, tsconfig: './tsconfig.test.json', - include: ['**/*.type.spec.{ts,tsx}'], + include: ['**/*.type.{test,spec}.{ts,tsx}'], }, env: { CLERK_SECRET_KEY: 'TEST_SECRET_KEY', }, environment: 'jsdom', - include: ['**/*.{spec,test}.{js,ts,jsx,tsx}'], + include: ['**/*.{test,spec}.{ts,tsx}'], setupFiles: './vitest.setup.mts', }, }); diff --git a/packages/themes/package.json b/packages/themes/package.json index 6066bb887d6..755d556d054 100644 --- a/packages/themes/package.json +++ b/packages/themes/package.json @@ -48,7 +48,7 @@ "lint:attw": "attw --pack . --exclude-entrypoints shadcn.css --profile node16" }, "dependencies": { - "@clerk/types": "workspace:^", + "@clerk/shared": "workspace:^", "tslib": "catalog:repo" }, "devDependencies": { diff --git a/packages/themes/src/createTheme.ts b/packages/themes/src/createTheme.ts index b6e022e1e04..e5bccc19df7 100644 --- a/packages/themes/src/createTheme.ts +++ b/packages/themes/src/createTheme.ts @@ -1,6 +1,6 @@ // Temp way to import the type. We will clean this up when we extract // theming into its own package -import type { BaseTheme, DeepPartial, Elements, Theme } from '@clerk/types'; +import type { BaseTheme, DeepPartial, Elements, Theme } from '@clerk/shared/types'; import type { InternalTheme } from '../../clerk-js/src/ui/foundations'; diff --git a/packages/themes/tsconfig.build.json b/packages/themes/tsconfig.build.json deleted file mode 100644 index 4cff749aa58..00000000000 --- a/packages/themes/tsconfig.build.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "outDir": "dist", - "baseUrl": ".", - "lib": ["es6", "dom"], - "module": "commonjs", - "moduleResolution": "node", - "importHelpers": true, - "declaration": true, - "declarationMap": false, - "noImplicitReturns": true, - "noUnusedLocals": false, - "noUnusedParameters": true, - "resolveJsonModule": true, - "sourceMap": false, - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "allowJs": true, - "target": "ES2019" - }, - "include": ["src"] -} diff --git a/packages/themes/tsconfig.json b/packages/themes/tsconfig.json index bbee8dfdabe..6cc55e67b3b 100644 --- a/packages/themes/tsconfig.json +++ b/packages/themes/tsconfig.json @@ -1,6 +1,23 @@ { - "extends": "./tsconfig.build.json", "compilerOptions": { - "incremental": true - } + "outDir": "dist", + "baseUrl": ".", + "lib": ["es6", "dom"], + "module": "nodenext", + "moduleResolution": "nodenext", + "importHelpers": true, + "declaration": true, + "declarationMap": false, + "noImplicitReturns": true, + "noUnusedLocals": false, + "noUnusedParameters": true, + "resolveJsonModule": true, + "sourceMap": false, + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "allowJs": true, + "target": "es2020" + }, + "include": ["src"] } diff --git a/packages/themes/tsup.config.ts b/packages/themes/tsup.config.ts index 4e91f53be8d..ad4d2719a51 100644 --- a/packages/themes/tsup.config.ts +++ b/packages/themes/tsup.config.ts @@ -10,7 +10,6 @@ export default defineConfig({ minify: false, sourcemap: false, dts: true, - tsconfig: './tsconfig.build.json', target: 'es2020', onSuccess: async () => { // Ensure dist/themes directory exists diff --git a/packages/types/package.json b/packages/types/package.json index 76d1e1a432c..83df0223927 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -23,25 +23,31 @@ }, "license": "MIT", "author": "Clerk", - "main": "dist/index.js", - "module": "dist/esm/index.js", - "types": "dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./src/index.d.mts", + "default": "./src/index.mjs" + }, + "require": { + "types": "./src/index.d.ts", + "default": "./src/index.js" + } + } + }, + "main": "src/index.js", + "module": "src/index.js", + "types": "src/index.d.ts", "files": [ - "dist" + "src" ], "scripts": { - "build": "tsup --env.NODE_ENV production", - "build:declarations": "tsc -p tsconfig.declarations.json", - "clean": "rimraf ./dist", - "dev": "tsup --watch", "format": "node ../../scripts/format-package.mjs", "format:check": "node ../../scripts/format-package.mjs --check", - "lint": "eslint src", - "lint:attw": "attw --pack . --profile node16", - "publish:local": "pnpm yalc push --replace --sig" + "lint:attw": "attw --pack . --profile node16" }, "dependencies": { - "csstype": "3.1.3" + "@clerk/shared": "workspace:^" }, "devDependencies": {}, "engines": { diff --git a/packages/types/src/index.d.mts b/packages/types/src/index.d.mts new file mode 100644 index 00000000000..fad33bb401a --- /dev/null +++ b/packages/types/src/index.d.mts @@ -0,0 +1,8 @@ +/** + * `@clerk/types` is now merged with `@clerk/shared` + * Please import from `@clerk/shared/types` instead. + * + * This export exists for backwards compatibility + * until we drop the package completely with the next major release. + */ +export type * from '@clerk/shared/types'; diff --git a/packages/types/src/index.d.ts b/packages/types/src/index.d.ts new file mode 100644 index 00000000000..fad33bb401a --- /dev/null +++ b/packages/types/src/index.d.ts @@ -0,0 +1,8 @@ +/** + * `@clerk/types` is now merged with `@clerk/shared` + * Please import from `@clerk/shared/types` instead. + * + * This export exists for backwards compatibility + * until we drop the package completely with the next major release. + */ +export type * from '@clerk/shared/types'; diff --git a/packages/types/src/index.js b/packages/types/src/index.js new file mode 100644 index 00000000000..591fd038c7c --- /dev/null +++ b/packages/types/src/index.js @@ -0,0 +1,8 @@ +/** + * `@clerk/types` is now merged with `@clerk/shared` + * Please import from `@clerk/shared/types` instead. + * + * This export exists for backwards compatibility + * until we drop the package completely with the next major release. + */ +module.exports = {}; diff --git a/packages/types/src/index.mjs b/packages/types/src/index.mjs new file mode 100644 index 00000000000..a43da491762 --- /dev/null +++ b/packages/types/src/index.mjs @@ -0,0 +1,8 @@ +/** + * `@clerk/types` is now merged with `@clerk/shared` + * Please import from `@clerk/shared/types` instead. + * + * This export exists for backwards compatibility + * until we drop the package completely with the next major release. + */ +export {}; diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts deleted file mode 100644 index e5d17f28dc8..00000000000 --- a/packages/types/src/index.ts +++ /dev/null @@ -1,83 +0,0 @@ -export * from './apiKeys'; -export * from './apiKeysSettings'; -export * from './appearance'; -export * from './attributes'; -export * from './authConfig'; -export * from './authObject'; -export * from './backupCode'; -export * from './billing'; -export * from './clerk'; -export * from './client'; -export * from './commerceSettings'; -export * from './customMenuItems'; -export * from './customPages'; -export * from './deletedObject'; -export * from './displayConfig'; -export * from './elementIds'; -export * from './emailAddress'; -export * from './enterpriseAccount'; -export * from './environment'; -export * from './errors'; -export * from './externalAccount'; -export * from './factors'; -export * from './hooks'; -export * from './identificationLink'; -export * from './identifiers'; -export * from './image'; -export * from './instance'; -export * from './json'; -export * from './jwt'; -export * from './jwtv2'; -export * from './key'; -export * from './localization'; -export * from './multiDomain'; -export * from './oauth'; -export * from './organization'; -export * from './organizationDomain'; -export * from './organizationInvitation'; -export * from './organizationMembership'; -export * from './organizationMembershipRequest'; -export * from './organizationSettings'; -export * from './organizationSuggestion'; -export * from './pagination'; -export * from './passkey'; -export * from './passwords'; -export * from './permission'; -export * from './phoneCodeChannel'; -export * from './phoneNumber'; -export * from './protect'; -export * from './redirects'; -export * from './resource'; -export * from './role'; -export * from './router'; -/** - * TODO @revamp-hooks: Drop this in the next major release. - */ -export * from './runtime-values'; -export * from './saml'; -export * from './samlAccount'; -export * from './samlConnection'; -export * from './session'; -export * from './sessionVerification'; -export * from './signIn'; -export * from './signInCommon'; -export * from './signInFuture'; -export * from './signUp'; -export * from './signUpCommon'; -export * from './signUpFuture'; -export * from './snapshots'; -export * from './ssr'; -export * from './state'; -export * from './strategies'; -export * from './telemetry'; -export * from './theme'; -export * from './token'; -export * from './totp'; -export * from './user'; -export * from './userOrganizationInvitation'; -export * from './userSettings'; -export * from './utils'; -export * from './verification'; -export * from './waitlist'; -export * from './web3'; -export * from './web3Wallet'; diff --git a/packages/types/tsconfig.build.json b/packages/types/tsconfig.build.json deleted file mode 100644 index 7f85b7d24bb..00000000000 --- a/packages/types/tsconfig.build.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "outDir": "dist", - "baseUrl": ".", - "lib": ["es6", "dom"], - "module": "commonjs", - "moduleResolution": "node", - "declaration": true, - "declarationMap": false, - "noImplicitReturns": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "resolveJsonModule": true, - "sourceMap": false, - "strict": true, - "types": [] - }, - "include": ["src/**/*.ts"], - "exclude": ["node_modules"] -} diff --git a/packages/types/tsconfig.declarations.json b/packages/types/tsconfig.declarations.json deleted file mode 100644 index b97a0330a47..00000000000 --- a/packages/types/tsconfig.declarations.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "declaration": true, - "declarationDir": "./dist", - "declarationMap": true, - "emitDeclarationOnly": true, - "skipLibCheck": true - }, - "exclude": ["**/__tests__/**/*"] -} diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json deleted file mode 100644 index 2dc99c17b81..00000000000 --- a/packages/types/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "baseUrl": ".", - "lib": ["es6", "dom"], - "module": "NodeNext", - "moduleResolution": "NodeNext", - "declaration": true, - "declarationMap": true, - "noImplicitReturns": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "resolveJsonModule": true, - "sourceMap": false, - "strict": true, - "types": [] - }, - "include": ["src"], - "exclude": ["node_modules"] -} diff --git a/packages/types/tsup.config.ts b/packages/types/tsup.config.ts deleted file mode 100644 index 7b74421dbb4..00000000000 --- a/packages/types/tsup.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default defineConfig(overrideOptions => { - return { - entry: { - index: 'src/index.ts', - }, - onSuccess: overrideOptions.watch ? 'pnpm build:declarations' : undefined, - minify: false, - clean: true, - sourcemap: true, - format: ['cjs', 'esm'], - legacyOutput: true, - dts: !overrideOptions.watch, - }; -}); diff --git a/packages/vue/src/components/CheckoutButton.vue b/packages/vue/src/components/CheckoutButton.vue index 8867c918fd8..3d5332a4e61 100644 --- a/packages/vue/src/components/CheckoutButton.vue +++ b/packages/vue/src/components/CheckoutButton.vue @@ -1,6 +1,6 @@