From 04347ccb0bc087c537ebeefab7cd39f7b3dcded4 Mon Sep 17 00:00:00 2001 From: Dimitris Klouvas Date: Thu, 14 Dec 2023 20:06:09 +0200 Subject: [PATCH] chore(backend): Expose /internal subpath export --- .changeset/red-suns-perform.md | 34 +++++++++++++++++++ packages/backend/package.json | 10 ++++++ .../backend/src/__tests__/exports.test.ts | 33 +++++++++++------- packages/backend/src/index.ts | 10 ++---- packages/backend/src/internal.ts | 28 +++++++++++++++ packages/backend/src/tokens/index.ts | 6 ---- packages/backend/tsup.config.ts | 2 +- packages/fastify/src/constants.ts | 2 +- packages/fastify/src/getAuth.ts | 2 +- packages/fastify/src/withClerkMiddleware.ts | 2 +- packages/gatsby-plugin-clerk/src/ssr/types.ts | 3 +- packages/gatsby-plugin-clerk/src/ssr/utils.ts | 5 ++- .../src/ssr/withServerAuth.ts | 2 +- packages/nextjs/src/app-router/server/auth.ts | 2 +- .../__snapshots__/exports.test.ts.snap | 12 ------- .../nextjs/src/server/authMiddleware.test.ts | 2 +- packages/nextjs/src/server/authMiddleware.ts | 4 +-- packages/nextjs/src/server/getAuth.ts | 7 ++-- packages/nextjs/src/server/redirect.ts | 2 +- packages/nextjs/src/server/types.ts | 2 +- packages/nextjs/src/server/utils.ts | 4 +-- packages/remix/src/ssr/authenticateRequest.ts | 5 +-- packages/remix/src/ssr/getAuth.ts | 2 +- packages/remix/src/ssr/rootAuthLoader.ts | 2 +- packages/remix/src/ssr/types.ts | 3 +- packages/remix/src/ssr/utils.ts | 4 +-- .../__snapshots__/exports.test.ts.snap | 12 ------- .../src/__tests__/authenticateRequest.test.ts | 2 +- .../sdk-node/src/__tests__/middleware.test.ts | 2 +- packages/sdk-node/src/authenticateRequest.ts | 4 +-- .../sdk-node/src/clerkExpressRequireAuth.ts | 2 +- packages/sdk-node/src/clerkExpressWithAuth.ts | 2 +- packages/sdk-node/src/types.ts | 3 +- 33 files changed, 133 insertions(+), 84 deletions(-) create mode 100644 .changeset/red-suns-perform.md create mode 100644 packages/backend/src/internal.ts delete mode 100644 packages/backend/src/tokens/index.ts diff --git a/.changeset/red-suns-perform.md b/.changeset/red-suns-perform.md new file mode 100644 index 0000000000..8208249bcc --- /dev/null +++ b/.changeset/red-suns-perform.md @@ -0,0 +1,34 @@ +--- +'gatsby-plugin-clerk': major +'@clerk/clerk-sdk-node': major +'@clerk/backend': major +'@clerk/fastify': major +'@clerk/nextjs': major +'@clerk/remix': major +--- + +Changes in exports in `@clerk/backend`: +- Expose the following helpers and enums from `@clerk/backend/internal`: + ```typescript + import { + AuthStatus, + buildRequestUrl, + constants, + createAuthenticateRequest, + createIsomorphicRequest, + debugRequestState, + makeAuthObjectSerializable, + prunePrivateMetadata, + redirect, + sanitizeAuthObject, + signedInAuthObject, + signedOutAuthObject } from '@clerk/backend/internal'; + ``` +- Drop the above exports from the top-level api: + ```typescript + // Before + import { AuthStatus, ... } from '@clerk/backend'; + // After + import { AuthStatus, ... } from '@clerk/backend/internal'; + ``` + Dropping those exports results in also dropping the exports from `gatsby-plugin-clerk`, `@clerk/clerk-sdk-node`, `@clerk/backend`, `@clerk/fastify`, `@clerk/nextjs`, `@clerk/remix` packages. \ No newline at end of file diff --git a/packages/backend/package.json b/packages/backend/package.json index 95bceec055..c998d942b5 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -33,6 +33,16 @@ "default": "./dist/errors.js" } }, + "./internal": { + "import": { + "types": "./dist/internal.d.ts", + "default": "./dist/internal.mjs" + }, + "require": { + "types": "./dist/internal.d.ts", + "default": "./dist/internal.js" + } + }, "./package.json": "./package.json" }, "main": "./dist/index.js", diff --git a/packages/backend/src/__tests__/exports.test.ts b/packages/backend/src/__tests__/exports.test.ts index b1e16ba037..3b21dc4e0c 100644 --- a/packages/backend/src/__tests__/exports.test.ts +++ b/packages/backend/src/__tests__/exports.test.ts @@ -2,6 +2,7 @@ import type QUnit from 'qunit'; import * as errorExports from '../errors'; import * as publicExports from '../index'; +import * as internalExports from '../internal'; export default (QUnit: QUnit) => { const { module, test } = QUnit; @@ -10,7 +11,6 @@ export default (QUnit: QUnit) => { test('should not include a breaking change', assert => { const exportedApiKeys = [ 'AllowlistIdentifier', - 'AuthStatus', 'Client', 'DeletedObject', 'Email', @@ -32,21 +32,10 @@ export default (QUnit: QUnit) => { 'Token', 'User', 'Verification', - 'buildRequestUrl', - 'constants', - 'createAuthenticateRequest', 'createClerkClient', - 'createIsomorphicRequest', - 'debugRequestState', 'decodeJwt', 'hasValidSignature', - 'makeAuthObjectSerializable', - 'prunePrivateMetadata', - 'redirect', - 'sanitizeAuthObject', 'signJwt', - 'signedInAuthObject', - 'signedOutAuthObject', 'verifyJwt', 'verifyToken', ]; @@ -65,4 +54,24 @@ export default (QUnit: QUnit) => { assert.deepEqual(Object.keys(errorExports).sort(), exportedApiKeys); }); }); + + module('subpath /internal exports', () => { + test('should not include a breaking change', assert => { + const exportedApiKeys = [ + 'AuthStatus', + 'buildRequestUrl', + 'constants', + 'createAuthenticateRequest', + 'createIsomorphicRequest', + 'debugRequestState', + 'makeAuthObjectSerializable', + 'prunePrivateMetadata', + 'redirect', + 'sanitizeAuthObject', + 'signedInAuthObject', + 'signedOutAuthObject', + ]; + assert.deepEqual(Object.keys(internalExports).sort(), exportedApiKeys); + }); + }); }; diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts index e6273107ed..d9bf992bc8 100644 --- a/packages/backend/src/index.ts +++ b/packages/backend/src/index.ts @@ -4,18 +4,12 @@ import type { SDKMetadata } from '@clerk/types'; import type { ApiClient, CreateBackendApiOptions } from './api'; import { createBackendApiClient } from './api'; -import type { CreateAuthenticateRequestOptions } from './tokens'; -import { createAuthenticateRequest } from './tokens'; - -export { createIsomorphicRequest } from './util/IsomorphicRequest'; +import type { CreateAuthenticateRequestOptions } from './tokens/factory'; +import { createAuthenticateRequest } from './tokens/factory'; export * from './api/resources'; -export * from './tokens'; export * from './tokens/jwt'; export * from './tokens/verify'; -export { constants } from './constants'; -export { redirect } from './redirections'; -export { buildRequestUrl } from './utils'; export type ClerkOptions = CreateBackendApiOptions & Partial< diff --git a/packages/backend/src/internal.ts b/packages/backend/src/internal.ts new file mode 100644 index 0000000000..7327bfe5a2 --- /dev/null +++ b/packages/backend/src/internal.ts @@ -0,0 +1,28 @@ +export { constants } from './constants'; +export { redirect } from './redirections'; +export { buildRequestUrl } from './utils'; + +export type { CreateAuthenticateRequestOptions } from './tokens/factory'; +export { createAuthenticateRequest } from './tokens/factory'; + +export { debugRequestState } from './tokens/request'; + +export type { AuthenticateRequestOptions, OptionalVerifyTokenOptions } from './tokens/request'; + +export type { + SignedInAuthObjectOptions, + SignedInAuthObject, + SignedOutAuthObject, + AuthObject, +} from './tokens/authObjects'; +export { + makeAuthObjectSerializable, + sanitizeAuthObject, + prunePrivateMetadata, + signedOutAuthObject, + signedInAuthObject, +} from './tokens/authObjects'; +export { createIsomorphicRequest } from './util/IsomorphicRequest'; + +export { AuthStatus } from './tokens/authStatus'; +export type { RequestState } from './tokens/authStatus'; diff --git a/packages/backend/src/tokens/index.ts b/packages/backend/src/tokens/index.ts deleted file mode 100644 index 511068c5d8..0000000000 --- a/packages/backend/src/tokens/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from './authObjects'; -export { AuthStatus } from './authStatus'; -export type { RequestState } from './authStatus'; -export * from './factory'; -export { debugRequestState } from './request'; -export type { AuthenticateRequestOptions, OptionalVerifyTokenOptions } from './request'; diff --git a/packages/backend/tsup.config.ts b/packages/backend/tsup.config.ts index d6f5cefcdb..5ed281e635 100644 --- a/packages/backend/tsup.config.ts +++ b/packages/backend/tsup.config.ts @@ -10,7 +10,7 @@ export default defineConfig(overrideOptions => { const shouldPublish = !!overrideOptions.env?.publish; const common: Options = { - entry: ['src/index.ts', 'src/errors.ts'], + entry: ['src/index.ts', 'src/errors.ts', 'src/internal.ts'], onSuccess: `cpy 'src/runtime/**/*.{mjs,js,cjs}' dist/runtime`, sourcemap: true, define: { diff --git a/packages/fastify/src/constants.ts b/packages/fastify/src/constants.ts index 725f748d28..1f0b27991a 100644 --- a/packages/fastify/src/constants.ts +++ b/packages/fastify/src/constants.ts @@ -1,4 +1,4 @@ -import { constants } from '@clerk/backend'; +import { constants } from '@clerk/backend/internal'; import { apiUrlFromPublishableKey } from '@clerk/shared/apiUrlFromPublishableKey'; export const API_VERSION = process.env.CLERK_API_VERSION || 'v1'; diff --git a/packages/fastify/src/getAuth.ts b/packages/fastify/src/getAuth.ts index 7acb04aefc..1b6c24138e 100644 --- a/packages/fastify/src/getAuth.ts +++ b/packages/fastify/src/getAuth.ts @@ -1,4 +1,4 @@ -import type { AuthObject } from '@clerk/backend'; +import type { AuthObject } from '@clerk/backend/internal'; import type { FastifyRequest } from 'fastify'; import { pluginRegistrationRequired } from './errors'; diff --git a/packages/fastify/src/withClerkMiddleware.ts b/packages/fastify/src/withClerkMiddleware.ts index c3fe1c1ade..0a2c94a2ea 100644 --- a/packages/fastify/src/withClerkMiddleware.ts +++ b/packages/fastify/src/withClerkMiddleware.ts @@ -1,4 +1,4 @@ -import { AuthStatus } from '@clerk/backend'; +import { AuthStatus } from '@clerk/backend/internal'; import type { FastifyRequest } from 'fastify'; import { clerkClient } from './clerkClient'; diff --git a/packages/gatsby-plugin-clerk/src/ssr/types.ts b/packages/gatsby-plugin-clerk/src/ssr/types.ts index aad0a2f6d5..f823ca971b 100644 --- a/packages/gatsby-plugin-clerk/src/ssr/types.ts +++ b/packages/gatsby-plugin-clerk/src/ssr/types.ts @@ -1,4 +1,5 @@ -import type { AuthenticateRequestOptions, AuthObject, Organization, Session, User } from '@clerk/backend'; +import type { Organization, Session, User } from '@clerk/backend'; +import type { AuthenticateRequestOptions, AuthObject } from '@clerk/backend/internal'; import type { GetServerDataProps } from 'gatsby'; export type WithServerAuthResult = (props: GetServerDataProps) => Promise>; diff --git a/packages/gatsby-plugin-clerk/src/ssr/utils.ts b/packages/gatsby-plugin-clerk/src/ssr/utils.ts index fed608ad9f..575cbc82c9 100644 --- a/packages/gatsby-plugin-clerk/src/ssr/utils.ts +++ b/packages/gatsby-plugin-clerk/src/ssr/utils.ts @@ -1,10 +1,9 @@ -import type { AuthObject } from '@clerk/backend'; -import { prunePrivateMetadata } from '@clerk/backend'; +import type { AuthObject } from '@clerk/backend/internal'; +import { constants, prunePrivateMetadata } from '@clerk/backend/internal'; import cookie from 'cookie'; import type { GetServerDataProps } from 'gatsby'; import { SECRET_KEY } from '../constants'; -import { constants } from './clerkClient'; /** * @internal diff --git a/packages/gatsby-plugin-clerk/src/ssr/withServerAuth.ts b/packages/gatsby-plugin-clerk/src/ssr/withServerAuth.ts index f69e290ddd..eb5e5948ce 100644 --- a/packages/gatsby-plugin-clerk/src/ssr/withServerAuth.ts +++ b/packages/gatsby-plugin-clerk/src/ssr/withServerAuth.ts @@ -1,4 +1,4 @@ -import { AuthStatus } from '@clerk/backend'; +import { AuthStatus } from '@clerk/backend/internal'; import type { GetServerDataProps, GetServerDataReturn } from 'gatsby'; import { PUBLISHABLE_KEY, SECRET_KEY } from '../constants'; diff --git a/packages/nextjs/src/app-router/server/auth.ts b/packages/nextjs/src/app-router/server/auth.ts index d3f3f21579..6d0d4df10a 100644 --- a/packages/nextjs/src/app-router/server/auth.ts +++ b/packages/nextjs/src/app-router/server/auth.ts @@ -1,4 +1,4 @@ -import type { SignedInAuthObject, SignedOutAuthObject } from '@clerk/backend'; +import type { SignedInAuthObject, SignedOutAuthObject } from '@clerk/backend/internal'; import type { CheckAuthorizationParamsWithCustomPermissions, CheckAuthorizationWithCustomPermissions, diff --git a/packages/nextjs/src/server/__tests__/__snapshots__/exports.test.ts.snap b/packages/nextjs/src/server/__tests__/__snapshots__/exports.test.ts.snap index 91055fc68b..5ad2c4b699 100644 --- a/packages/nextjs/src/server/__tests__/__snapshots__/exports.test.ts.snap +++ b/packages/nextjs/src/server/__tests__/__snapshots__/exports.test.ts.snap @@ -3,7 +3,6 @@ exports[`/server public exports should not include a breaking change 1`] = ` [ "AllowlistIdentifier", - "AuthStatus", "Client", "DeletedObject", "Email", @@ -28,26 +27,15 @@ exports[`/server public exports should not include a breaking change 1`] = ` "auth", "authMiddleware", "buildClerkProps", - "buildRequestUrl", "clerkClient", - "constants", - "createAuthenticateRequest", "createClerkClient", - "createIsomorphicRequest", "currentUser", - "debugRequestState", "decodeJwt", "getAuth", "hasValidSignature", - "makeAuthObjectSerializable", - "prunePrivateMetadata", - "redirect", "redirectToSignIn", "redirectToSignUp", - "sanitizeAuthObject", "signJwt", - "signedInAuthObject", - "signedOutAuthObject", "verifyJwt", "verifyToken", ] diff --git a/packages/nextjs/src/server/authMiddleware.test.ts b/packages/nextjs/src/server/authMiddleware.test.ts index ee6f08de28..1e6559c654 100644 --- a/packages/nextjs/src/server/authMiddleware.test.ts +++ b/packages/nextjs/src/server/authMiddleware.test.ts @@ -1,6 +1,6 @@ // There is no need to execute the complete authenticateRequest to test authMiddleware // This mock SHOULD exist before the import of authenticateRequest -import { AuthStatus } from '@clerk/backend'; +import { AuthStatus } from '@clerk/backend/internal'; import { expectTypeOf } from 'expect-type'; import { NextURL } from 'next/dist/server/web/next-url'; import type { NextFetchEvent, NextRequest } from 'next/server'; diff --git a/packages/nextjs/src/server/authMiddleware.ts b/packages/nextjs/src/server/authMiddleware.ts index b2a8474a27..c89fcbeebb 100644 --- a/packages/nextjs/src/server/authMiddleware.ts +++ b/packages/nextjs/src/server/authMiddleware.ts @@ -1,5 +1,5 @@ -import type { AuthenticateRequestOptions, AuthObject } from '@clerk/backend'; -import { AuthStatus, buildRequestUrl, constants } from '@clerk/backend'; +import type { AuthenticateRequestOptions, AuthObject } from '@clerk/backend/internal'; +import { AuthStatus, buildRequestUrl, constants } from '@clerk/backend/internal'; import { DEV_BROWSER_JWT_MARKER, setDevBrowserJWTInURL } from '@clerk/shared/devBrowser'; import { isDevelopmentFromSecretKey } from '@clerk/shared/keys'; import { eventMethodCalled } from '@clerk/shared/telemetry'; diff --git a/packages/nextjs/src/server/getAuth.ts b/packages/nextjs/src/server/getAuth.ts index f6deeeee0d..63b7d351da 100644 --- a/packages/nextjs/src/server/getAuth.ts +++ b/packages/nextjs/src/server/getAuth.ts @@ -1,13 +1,14 @@ -import type { Organization, Session, SignedInAuthObject, SignedOutAuthObject, User } from '@clerk/backend'; +import type { Organization, Session, User } from '@clerk/backend'; +import { decodeJwt } from '@clerk/backend'; +import type { SignedInAuthObject, SignedOutAuthObject } from '@clerk/backend/internal'; import { AuthStatus, constants, - decodeJwt, makeAuthObjectSerializable, sanitizeAuthObject, signedInAuthObject, signedOutAuthObject, -} from '@clerk/backend'; +} from '@clerk/backend/internal'; import { withLogger } from '../utils/debugLogger'; import { API_URL, API_VERSION, SECRET_KEY } from './constants'; diff --git a/packages/nextjs/src/server/redirect.ts b/packages/nextjs/src/server/redirect.ts index cc955aa5d3..46d76740d4 100644 --- a/packages/nextjs/src/server/redirect.ts +++ b/packages/nextjs/src/server/redirect.ts @@ -1,4 +1,4 @@ -import { constants, redirect } from '@clerk/backend'; +import { constants, redirect } from '@clerk/backend/internal'; import { NextResponse } from 'next/server'; import { setHeader } from '../utils'; diff --git a/packages/nextjs/src/server/types.ts b/packages/nextjs/src/server/types.ts index b960002590..767e0ac73d 100644 --- a/packages/nextjs/src/server/types.ts +++ b/packages/nextjs/src/server/types.ts @@ -1,4 +1,4 @@ -import type { AuthObject, OptionalVerifyTokenOptions } from '@clerk/backend'; +import type { AuthObject, OptionalVerifyTokenOptions } from '@clerk/backend/internal'; import type { MultiDomainAndOrProxy } from '@clerk/types'; import type { IncomingMessage } from 'http'; import type { NextApiRequest } from 'next'; diff --git a/packages/nextjs/src/server/utils.ts b/packages/nextjs/src/server/utils.ts index 6f244db596..4cc1e388cc 100644 --- a/packages/nextjs/src/server/utils.ts +++ b/packages/nextjs/src/server/utils.ts @@ -1,5 +1,5 @@ -import type { AuthenticateRequestOptions, RequestState } from '@clerk/backend'; -import { buildRequestUrl, constants } from '@clerk/backend'; +import type { AuthenticateRequestOptions, RequestState } from '@clerk/backend/internal'; +import { buildRequestUrl, constants } from '@clerk/backend/internal'; import { handleValueOrFn } from '@clerk/shared/handleValueOrFn'; import { isDevelopmentFromSecretKey } from '@clerk/shared/keys'; import { isHttpOrHttps } from '@clerk/shared/proxy'; diff --git a/packages/remix/src/ssr/authenticateRequest.ts b/packages/remix/src/ssr/authenticateRequest.ts index 51d203da2e..1bf35a9624 100644 --- a/packages/remix/src/ssr/authenticateRequest.ts +++ b/packages/remix/src/ssr/authenticateRequest.ts @@ -1,5 +1,6 @@ -import type { RequestState } from '@clerk/backend'; -import { buildRequestUrl, createClerkClient } from '@clerk/backend'; +import { createClerkClient } from '@clerk/backend'; +import type { RequestState } from '@clerk/backend/internal'; +import { buildRequestUrl } from '@clerk/backend/internal'; import { apiUrlFromPublishableKey } from '@clerk/shared/apiUrlFromPublishableKey'; import { handleValueOrFn } from '@clerk/shared/handleValueOrFn'; import { isDevelopmentFromSecretKey } from '@clerk/shared/keys'; diff --git a/packages/remix/src/ssr/getAuth.ts b/packages/remix/src/ssr/getAuth.ts index 8871a5cb1f..c13836b8c3 100644 --- a/packages/remix/src/ssr/getAuth.ts +++ b/packages/remix/src/ssr/getAuth.ts @@ -1,4 +1,4 @@ -import { AuthStatus, sanitizeAuthObject } from '@clerk/backend'; +import { AuthStatus, sanitizeAuthObject } from '@clerk/backend/internal'; import { redirect } from '@remix-run/server-runtime'; import { noLoaderArgsPassedInGetAuth } from '../errors'; diff --git a/packages/remix/src/ssr/rootAuthLoader.ts b/packages/remix/src/ssr/rootAuthLoader.ts index f91094893a..0e2753a2e0 100644 --- a/packages/remix/src/ssr/rootAuthLoader.ts +++ b/packages/remix/src/ssr/rootAuthLoader.ts @@ -1,4 +1,4 @@ -import { AuthStatus, sanitizeAuthObject } from '@clerk/backend'; +import { AuthStatus, sanitizeAuthObject } from '@clerk/backend/internal'; import type { defer } from '@remix-run/server-runtime'; import { redirect } from '@remix-run/server-runtime'; import { isDeferredData } from '@remix-run/server-runtime/dist/responses'; diff --git a/packages/remix/src/ssr/types.ts b/packages/remix/src/ssr/types.ts index ec2fd551ab..dc7b6c2f0a 100644 --- a/packages/remix/src/ssr/types.ts +++ b/packages/remix/src/ssr/types.ts @@ -1,4 +1,5 @@ -import type { AuthObject, Organization, Session, User, VerifyTokenOptions } from '@clerk/backend'; +import type { Organization, Session, User, VerifyTokenOptions } from '@clerk/backend'; +import type { AuthObject } from '@clerk/backend/internal'; import type { MultiDomainAndOrProxy } from '@clerk/types'; import type { DataFunctionArgs, LoaderFunction } from '@remix-run/server-runtime'; diff --git a/packages/remix/src/ssr/utils.ts b/packages/remix/src/ssr/utils.ts index dd48b5c3d8..4273b42b80 100644 --- a/packages/remix/src/ssr/utils.ts +++ b/packages/remix/src/ssr/utils.ts @@ -1,5 +1,5 @@ -import type { AuthObject, RequestState } from '@clerk/backend'; -import { constants, debugRequestState } from '@clerk/backend'; +import type { AuthObject, RequestState } from '@clerk/backend/internal'; +import { constants, debugRequestState } from '@clerk/backend/internal'; import { isTruthy } from '@clerk/shared/underscore'; import type { AppLoadContext, defer } from '@remix-run/server-runtime'; import { json } from '@remix-run/server-runtime'; diff --git a/packages/sdk-node/src/__tests__/__snapshots__/exports.test.ts.snap b/packages/sdk-node/src/__tests__/__snapshots__/exports.test.ts.snap index 3f04f9e024..5a12311087 100644 --- a/packages/sdk-node/src/__tests__/__snapshots__/exports.test.ts.snap +++ b/packages/sdk-node/src/__tests__/__snapshots__/exports.test.ts.snap @@ -3,7 +3,6 @@ exports[`module exports should not change unless explicitly set 1`] = ` [ "AllowlistIdentifier", - "AuthStatus", "ClerkExpressRequireAuth", "ClerkExpressWithAuth", "Client", @@ -27,25 +26,14 @@ exports[`module exports should not change unless explicitly set 1`] = ` "Token", "User", "Verification", - "buildRequestUrl", "clerkClient", - "constants", - "createAuthenticateRequest", "createClerkClient", "createClerkExpressRequireAuth", "createClerkExpressWithAuth", - "createIsomorphicRequest", - "debugRequestState", "decodeJwt", "hasValidSignature", - "makeAuthObjectSerializable", - "prunePrivateMetadata", - "redirect", "requireAuth", - "sanitizeAuthObject", "signJwt", - "signedInAuthObject", - "signedOutAuthObject", "verifyJwt", "verifyToken", "withAuth", diff --git a/packages/sdk-node/src/__tests__/authenticateRequest.test.ts b/packages/sdk-node/src/__tests__/authenticateRequest.test.ts index 44b602357b..1d1751d43e 100644 --- a/packages/sdk-node/src/__tests__/authenticateRequest.test.ts +++ b/packages/sdk-node/src/__tests__/authenticateRequest.test.ts @@ -1,4 +1,4 @@ -import { constants } from '@clerk/backend'; +import { constants } from '@clerk/backend/internal'; import { Request } from 'express'; import { authenticateRequest } from '../authenticateRequest'; diff --git a/packages/sdk-node/src/__tests__/middleware.test.ts b/packages/sdk-node/src/__tests__/middleware.test.ts index 417148b7a2..74d7f7ca6c 100644 --- a/packages/sdk-node/src/__tests__/middleware.test.ts +++ b/packages/sdk-node/src/__tests__/middleware.test.ts @@ -1,4 +1,4 @@ -import type { RequestState } from '@clerk/backend'; +import type { RequestState } from '@clerk/backend/internal'; import type { NextFunction, Request, Response } from 'express'; import { createClerkExpressRequireAuth } from '../clerkExpressRequireAuth'; diff --git a/packages/sdk-node/src/authenticateRequest.ts b/packages/sdk-node/src/authenticateRequest.ts index 17db4085c2..cc04de1097 100644 --- a/packages/sdk-node/src/authenticateRequest.ts +++ b/packages/sdk-node/src/authenticateRequest.ts @@ -1,5 +1,5 @@ -import type { RequestState } from '@clerk/backend'; -import { buildRequestUrl, constants } from '@clerk/backend'; +import type { RequestState } from '@clerk/backend/internal'; +import { buildRequestUrl, constants } from '@clerk/backend/internal'; import { handleValueOrFn } from '@clerk/shared/handleValueOrFn'; import { isDevelopmentFromSecretKey } from '@clerk/shared/keys'; import { isHttpOrHttps, isProxyUrlRelative, isValidProxyUrl } from '@clerk/shared/proxy'; diff --git a/packages/sdk-node/src/clerkExpressRequireAuth.ts b/packages/sdk-node/src/clerkExpressRequireAuth.ts index 47f3eef081..fa9880ab19 100644 --- a/packages/sdk-node/src/clerkExpressRequireAuth.ts +++ b/packages/sdk-node/src/clerkExpressRequireAuth.ts @@ -1,5 +1,5 @@ import type { createClerkClient } from '@clerk/backend'; -import { AuthStatus } from '@clerk/backend'; +import { AuthStatus } from '@clerk/backend/internal'; import { authenticateRequest, decorateResponseWithObservabilityHeaders } from './authenticateRequest'; import type { ClerkMiddlewareOptions, MiddlewareRequireAuthProp, RequireAuthProp } from './types'; diff --git a/packages/sdk-node/src/clerkExpressWithAuth.ts b/packages/sdk-node/src/clerkExpressWithAuth.ts index aba87f14eb..bf3ce796e9 100644 --- a/packages/sdk-node/src/clerkExpressWithAuth.ts +++ b/packages/sdk-node/src/clerkExpressWithAuth.ts @@ -1,4 +1,4 @@ -import { AuthStatus } from '@clerk/backend'; +import { AuthStatus } from '@clerk/backend/internal'; import { authenticateRequest, decorateResponseWithObservabilityHeaders } from './authenticateRequest'; import type { CreateClerkExpressMiddlewareOptions } from './clerkExpressRequireAuth'; diff --git a/packages/sdk-node/src/types.ts b/packages/sdk-node/src/types.ts index a4e45e80ad..63bf6b209f 100644 --- a/packages/sdk-node/src/types.ts +++ b/packages/sdk-node/src/types.ts @@ -1,4 +1,5 @@ -import type { AuthenticateRequestOptions, AuthObject, createClerkClient, SignedInAuthObject } from '@clerk/backend'; +import type { createClerkClient } from '@clerk/backend'; +import type { AuthenticateRequestOptions, AuthObject, SignedInAuthObject } from '@clerk/backend/internal'; import type { MultiDomainAndOrProxy } from '@clerk/types'; import type { NextFunction, Request, Response } from 'express'; import type { IncomingMessage } from 'http';