@clerk/nextjs 7.5.13-snapshot.v20260702192602 → 7.5.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/server/constants.js +1 -1
- package/dist/cjs/server/createClerkClient.js +1 -1
- package/dist/cjs/server/createClerkClient.js.map +1 -1
- package/dist/cjs/server/routeMatcher.js.map +1 -1
- package/dist/cjs/utils/debugLogger.js +1 -1
- package/dist/cjs/utils/debugLogger.js.map +1 -1
- package/dist/esm/server/constants.js +1 -1
- package/dist/esm/server/createClerkClient.js +1 -1
- package/dist/esm/server/createClerkClient.js.map +1 -1
- package/dist/esm/server/routeMatcher.js.map +1 -1
- package/dist/esm/utils/debugLogger.js +1 -1
- package/dist/esm/utils/debugLogger.js.map +1 -1
- package/dist/types/server/routeMatcher.d.ts +2 -2
- package/package.json +4 -4
|
@@ -58,7 +58,7 @@ const SIGN_IN_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL || "";
|
|
|
58
58
|
const SIGN_UP_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL || "";
|
|
59
59
|
const SDK_METADATA = {
|
|
60
60
|
name: "@clerk/nextjs",
|
|
61
|
-
version: "7.5.13
|
|
61
|
+
version: "7.5.13",
|
|
62
62
|
environment: process.env.NODE_ENV
|
|
63
63
|
};
|
|
64
64
|
const TELEMETRY_DISABLED = (0, import_underscore.isTruthy)(process.env.NEXT_PUBLIC_CLERK_TELEMETRY_DISABLED);
|
|
@@ -28,7 +28,7 @@ const clerkClientDefaultOptions = {
|
|
|
28
28
|
publishableKey: import_constants.PUBLISHABLE_KEY,
|
|
29
29
|
apiUrl: import_constants.API_URL,
|
|
30
30
|
apiVersion: import_constants.API_VERSION,
|
|
31
|
-
userAgent: `${"@clerk/nextjs"}@${"7.5.13
|
|
31
|
+
userAgent: `${"@clerk/nextjs"}@${"7.5.13"}`,
|
|
32
32
|
proxyUrl: import_constants.PROXY_URL,
|
|
33
33
|
domain: import_constants.DOMAIN,
|
|
34
34
|
isSatellite: import_constants.IS_SATELLITE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/server/createClerkClient.ts"],"sourcesContent":["import { createClerkClient } from '@clerk/backend';\n\nimport {\n API_URL,\n API_VERSION,\n DOMAIN,\n IS_SATELLITE,\n MACHINE_SECRET_KEY,\n PROXY_URL,\n PUBLISHABLE_KEY,\n SDK_METADATA,\n SECRET_KEY,\n TELEMETRY_DEBUG,\n TELEMETRY_DISABLED,\n} from './constants';\n\nconst clerkClientDefaultOptions = {\n secretKey: SECRET_KEY,\n publishableKey: PUBLISHABLE_KEY,\n apiUrl: API_URL,\n apiVersion: API_VERSION,\n userAgent: `${PACKAGE_NAME}@${PACKAGE_VERSION}`,\n proxyUrl: PROXY_URL,\n domain: DOMAIN,\n isSatellite: IS_SATELLITE,\n machineSecretKey: MACHINE_SECRET_KEY,\n sdkMetadata: SDK_METADATA,\n telemetry: {\n disabled: TELEMETRY_DISABLED,\n debug: TELEMETRY_DEBUG,\n },\n};\n\nexport const createClerkClientWithOptions: typeof createClerkClient = options =>\n createClerkClient({ ...clerkClientDefaultOptions, ...options });\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAkC;AAElC,uBAYO;AAEP,MAAM,4BAA4B;AAAA,EAChC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW,GAAG,eAAY,IAAI,
|
|
1
|
+
{"version":3,"sources":["../../../src/server/createClerkClient.ts"],"sourcesContent":["import { createClerkClient } from '@clerk/backend';\n\nimport {\n API_URL,\n API_VERSION,\n DOMAIN,\n IS_SATELLITE,\n MACHINE_SECRET_KEY,\n PROXY_URL,\n PUBLISHABLE_KEY,\n SDK_METADATA,\n SECRET_KEY,\n TELEMETRY_DEBUG,\n TELEMETRY_DISABLED,\n} from './constants';\n\nconst clerkClientDefaultOptions = {\n secretKey: SECRET_KEY,\n publishableKey: PUBLISHABLE_KEY,\n apiUrl: API_URL,\n apiVersion: API_VERSION,\n userAgent: `${PACKAGE_NAME}@${PACKAGE_VERSION}`,\n proxyUrl: PROXY_URL,\n domain: DOMAIN,\n isSatellite: IS_SATELLITE,\n machineSecretKey: MACHINE_SECRET_KEY,\n sdkMetadata: SDK_METADATA,\n telemetry: {\n disabled: TELEMETRY_DISABLED,\n debug: TELEMETRY_DEBUG,\n },\n};\n\nexport const createClerkClientWithOptions: typeof createClerkClient = options =>\n createClerkClient({ ...clerkClientDefaultOptions, ...options });\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAkC;AAElC,uBAYO;AAEP,MAAM,4BAA4B;AAAA,EAChC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW,GAAG,eAAY,IAAI,QAAe;AAAA,EAC7C,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AACF;AAEO,MAAM,+BAAyD,iBACpE,kCAAkB,EAAE,GAAG,2BAA2B,GAAG,QAAQ,CAAC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/server/routeMatcher.ts"],"sourcesContent":["import { createPathMatcher, type
|
|
1
|
+
{"version":3,"sources":["../../../src/server/routeMatcher.ts"],"sourcesContent":["import { createPathMatcher, type WithPathSegmentWildcard } from '@clerk/shared/pathMatcher';\nimport type { Autocomplete } from '@clerk/shared/types';\nimport type Link from 'next/link';\nimport type { NextRequest } from 'next/server';\n\ntype NextTypedRoute<T = Parameters<typeof Link>['0']['href']> = T extends string ? T : never;\ntype RouteMatcherWithNextTypedRoutes = Autocomplete<WithPathSegmentWildcard<NextTypedRoute> | NextTypedRoute>;\n\nexport type RouteMatcherParam =\n | Array<RegExp | RouteMatcherWithNextTypedRoutes>\n | RegExp\n | RouteMatcherWithNextTypedRoutes\n | ((req: NextRequest) => boolean);\n\n/**\n * Returns a function that accepts a `Request` object and returns whether the request matches the list of\n * predefined routes that can be passed in as the first argument.\n *\n * You can use glob patterns to match multiple routes or a function to match against the request object.\n * Path patterns and regular expressions are supported, for example: `['/foo', '/bar(.*)'] or `[/^\\/foo\\/.*$/]`\n * For more information, see: https://clerk.com/docs\n */\nexport const createRouteMatcher = (routes: RouteMatcherParam) => {\n if (typeof routes === 'function') {\n return (req: NextRequest) => routes(req);\n }\n\n const matcher = createPathMatcher(routes);\n return (req: NextRequest) => matcher(req.nextUrl.pathname);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAgE;AAsBzD,MAAM,qBAAqB,CAAC,WAA8B;AAC/D,MAAI,OAAO,WAAW,YAAY;AAChC,WAAO,CAAC,QAAqB,OAAO,GAAG;AAAA,EACzC;AAEA,QAAM,cAAU,sCAAkB,MAAM;AACxC,SAAO,CAAC,QAAqB,QAAQ,IAAI,QAAQ,QAAQ;AAC3D;","names":[]}
|
|
@@ -90,7 +90,7 @@ function debugLogHeader(name) {
|
|
|
90
90
|
return `[clerk debug start: ${name}]`;
|
|
91
91
|
}
|
|
92
92
|
function debugLogFooter(name) {
|
|
93
|
-
return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.5.13
|
|
93
|
+
return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.5.13"},next=${import_package.default.version},timestamp=${Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3)})`;
|
|
94
94
|
}
|
|
95
95
|
function truncate(str, maxLength) {
|
|
96
96
|
const encoder = new TextEncoder();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/debugLogger.ts"],"sourcesContent":["// TODO: Replace with a more sophisticated logging solution\n\nimport nextPkg from 'next/package.json';\n\nimport { logFormatter } from './logFormatter';\n\nexport type Log = string | Record<string, unknown>;\nexport type LogEntry = Log | Log[];\nexport type Logger<L = Log> = {\n commit: () => void;\n debug: (...args: Array<L | (() => L)>) => void;\n enable: () => void;\n};\nexport type LoggerNoCommit<L = Logger> = Omit<L, 'commit'>;\n\nexport const createDebugLogger = (name: string, formatter: (val: LogEntry) => string) => (): Logger => {\n const entries: LogEntry[] = [];\n let isEnabled = false;\n\n return {\n enable: () => {\n isEnabled = true;\n },\n debug: (...args) => {\n if (isEnabled) {\n entries.push(args.map(arg => (typeof arg === 'function' ? arg() : arg)));\n }\n },\n commit: () => {\n if (isEnabled) {\n console.log(debugLogHeader(name));\n\n /**\n * We buffer each collected log entry so we can format them and log them all at once.\n * Individual console.log calls are used to ensure we don't hit platform-specific log limits (Vercel and Netlify are 4kb).\n */\n for (const log of entries) {\n let output = formatter(log);\n\n output = output\n .split('\\n')\n .map(l => ` ${l}`)\n .join('\\n');\n\n // Vercel errors if the output is > 4kb, so we truncate it\n if (process.env.VERCEL) {\n output = truncate(output, 4096);\n }\n\n console.log(output);\n }\n\n console.log(debugLogFooter(name));\n }\n },\n };\n};\n\ntype WithLogger = <L extends Logger, H extends (...args: any[]) => any>(\n loggerFactoryOrName: string | (() => L),\n handlerCtor: (logger: LoggerNoCommit<L>) => H,\n) => H;\n\nexport const withLogger: WithLogger = (loggerFactoryOrName, handlerCtor) => {\n return ((...args: any) => {\n const factory =\n typeof loggerFactoryOrName === 'string'\n ? createDebugLogger(loggerFactoryOrName, logFormatter)\n : loggerFactoryOrName;\n\n const logger = factory();\n const handler = handlerCtor(logger as any);\n\n try {\n const res = handler(...args);\n if (typeof res === 'object' && 'then' in res && typeof res.then === 'function') {\n return res\n .then((val: any) => {\n logger.commit();\n return val;\n })\n .catch((err: any) => {\n logger.commit();\n throw err;\n });\n }\n // handle sync methods\n logger.commit();\n return res;\n } catch (err: any) {\n logger.commit();\n throw err;\n }\n }) as ReturnType<typeof handlerCtor>;\n};\n\nfunction debugLogHeader(name: string) {\n return `[clerk debug start: ${name}]`;\n}\n\nfunction debugLogFooter(name: string) {\n return `[clerk debug end: ${name}] (@clerk/nextjs=${PACKAGE_VERSION},next=${nextPkg.version},timestamp=${Math.round(new Date().getTime() / 1_000)})`;\n}\n\n// ref: https://stackoverflow.com/questions/57769465/javascript-truncate-text-by-bytes-length\nfunction truncate(str: string, maxLength: number) {\n const encoder = new TextEncoder();\n const decoder = new TextDecoder('utf-8');\n\n const encodedString = encoder.encode(str);\n const truncatedString = encodedString.slice(0, maxLength);\n\n // return the truncated string, removing any replacement characters that result from partially truncated characters\n return decoder.decode(truncatedString).replace(/\\uFFFD/g, '');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAAoB;AAEpB,0BAA6B;AAWtB,MAAM,oBAAoB,CAAC,MAAc,cAAyC,MAAc;AACrG,QAAM,UAAsB,CAAC;AAC7B,MAAI,YAAY;AAEhB,SAAO;AAAA,IACL,QAAQ,MAAM;AACZ,kBAAY;AAAA,IACd;AAAA,IACA,OAAO,IAAI,SAAS;AAClB,UAAI,WAAW;AACb,gBAAQ,KAAK,KAAK,IAAI,SAAQ,OAAO,QAAQ,aAAa,IAAI,IAAI,GAAI,CAAC;AAAA,MACzE;AAAA,IACF;AAAA,IACA,QAAQ,MAAM;AACZ,UAAI,WAAW;AACb,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAMhC,mBAAW,OAAO,SAAS;AACzB,cAAI,SAAS,UAAU,GAAG;AAE1B,mBAAS,OACN,MAAM,IAAI,EACV,IAAI,OAAK,KAAK,CAAC,EAAE,EACjB,KAAK,IAAI;AAGZ,cAAI,QAAQ,IAAI,QAAQ;AACtB,qBAAS,SAAS,QAAQ,IAAI;AAAA,UAChC;AAEA,kBAAQ,IAAI,MAAM;AAAA,QACpB;AAEA,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AACF;AAOO,MAAM,aAAyB,CAAC,qBAAqB,gBAAgB;AAC1E,UAAQ,IAAI,SAAc;AACxB,UAAM,UACJ,OAAO,wBAAwB,WAC3B,kBAAkB,qBAAqB,gCAAY,IACnD;AAEN,UAAM,SAAS,QAAQ;AACvB,UAAM,UAAU,YAAY,MAAa;AAEzC,QAAI;AACF,YAAM,MAAM,QAAQ,GAAG,IAAI;AAC3B,UAAI,OAAO,QAAQ,YAAY,UAAU,OAAO,OAAO,IAAI,SAAS,YAAY;AAC9E,eAAO,IACJ,KAAK,CAAC,QAAa;AAClB,iBAAO,OAAO;AACd,iBAAO;AAAA,QACT,CAAC,EACA,MAAM,CAAC,QAAa;AACnB,iBAAO,OAAO;AACd,gBAAM;AAAA,QACR,CAAC;AAAA,MACL;AAEA,aAAO,OAAO;AACd,aAAO;AAAA,IACT,SAAS,KAAU;AACjB,aAAO,OAAO;AACd,YAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,uBAAuB,IAAI;AACpC;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,qBAAqB,IAAI,oBAAoB,
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/debugLogger.ts"],"sourcesContent":["// TODO: Replace with a more sophisticated logging solution\n\nimport nextPkg from 'next/package.json';\n\nimport { logFormatter } from './logFormatter';\n\nexport type Log = string | Record<string, unknown>;\nexport type LogEntry = Log | Log[];\nexport type Logger<L = Log> = {\n commit: () => void;\n debug: (...args: Array<L | (() => L)>) => void;\n enable: () => void;\n};\nexport type LoggerNoCommit<L = Logger> = Omit<L, 'commit'>;\n\nexport const createDebugLogger = (name: string, formatter: (val: LogEntry) => string) => (): Logger => {\n const entries: LogEntry[] = [];\n let isEnabled = false;\n\n return {\n enable: () => {\n isEnabled = true;\n },\n debug: (...args) => {\n if (isEnabled) {\n entries.push(args.map(arg => (typeof arg === 'function' ? arg() : arg)));\n }\n },\n commit: () => {\n if (isEnabled) {\n console.log(debugLogHeader(name));\n\n /**\n * We buffer each collected log entry so we can format them and log them all at once.\n * Individual console.log calls are used to ensure we don't hit platform-specific log limits (Vercel and Netlify are 4kb).\n */\n for (const log of entries) {\n let output = formatter(log);\n\n output = output\n .split('\\n')\n .map(l => ` ${l}`)\n .join('\\n');\n\n // Vercel errors if the output is > 4kb, so we truncate it\n if (process.env.VERCEL) {\n output = truncate(output, 4096);\n }\n\n console.log(output);\n }\n\n console.log(debugLogFooter(name));\n }\n },\n };\n};\n\ntype WithLogger = <L extends Logger, H extends (...args: any[]) => any>(\n loggerFactoryOrName: string | (() => L),\n handlerCtor: (logger: LoggerNoCommit<L>) => H,\n) => H;\n\nexport const withLogger: WithLogger = (loggerFactoryOrName, handlerCtor) => {\n return ((...args: any) => {\n const factory =\n typeof loggerFactoryOrName === 'string'\n ? createDebugLogger(loggerFactoryOrName, logFormatter)\n : loggerFactoryOrName;\n\n const logger = factory();\n const handler = handlerCtor(logger as any);\n\n try {\n const res = handler(...args);\n if (typeof res === 'object' && 'then' in res && typeof res.then === 'function') {\n return res\n .then((val: any) => {\n logger.commit();\n return val;\n })\n .catch((err: any) => {\n logger.commit();\n throw err;\n });\n }\n // handle sync methods\n logger.commit();\n return res;\n } catch (err: any) {\n logger.commit();\n throw err;\n }\n }) as ReturnType<typeof handlerCtor>;\n};\n\nfunction debugLogHeader(name: string) {\n return `[clerk debug start: ${name}]`;\n}\n\nfunction debugLogFooter(name: string) {\n return `[clerk debug end: ${name}] (@clerk/nextjs=${PACKAGE_VERSION},next=${nextPkg.version},timestamp=${Math.round(new Date().getTime() / 1_000)})`;\n}\n\n// ref: https://stackoverflow.com/questions/57769465/javascript-truncate-text-by-bytes-length\nfunction truncate(str: string, maxLength: number) {\n const encoder = new TextEncoder();\n const decoder = new TextDecoder('utf-8');\n\n const encodedString = encoder.encode(str);\n const truncatedString = encodedString.slice(0, maxLength);\n\n // return the truncated string, removing any replacement characters that result from partially truncated characters\n return decoder.decode(truncatedString).replace(/\\uFFFD/g, '');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAAoB;AAEpB,0BAA6B;AAWtB,MAAM,oBAAoB,CAAC,MAAc,cAAyC,MAAc;AACrG,QAAM,UAAsB,CAAC;AAC7B,MAAI,YAAY;AAEhB,SAAO;AAAA,IACL,QAAQ,MAAM;AACZ,kBAAY;AAAA,IACd;AAAA,IACA,OAAO,IAAI,SAAS;AAClB,UAAI,WAAW;AACb,gBAAQ,KAAK,KAAK,IAAI,SAAQ,OAAO,QAAQ,aAAa,IAAI,IAAI,GAAI,CAAC;AAAA,MACzE;AAAA,IACF;AAAA,IACA,QAAQ,MAAM;AACZ,UAAI,WAAW;AACb,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAMhC,mBAAW,OAAO,SAAS;AACzB,cAAI,SAAS,UAAU,GAAG;AAE1B,mBAAS,OACN,MAAM,IAAI,EACV,IAAI,OAAK,KAAK,CAAC,EAAE,EACjB,KAAK,IAAI;AAGZ,cAAI,QAAQ,IAAI,QAAQ;AACtB,qBAAS,SAAS,QAAQ,IAAI;AAAA,UAChC;AAEA,kBAAQ,IAAI,MAAM;AAAA,QACpB;AAEA,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AACF;AAOO,MAAM,aAAyB,CAAC,qBAAqB,gBAAgB;AAC1E,UAAQ,IAAI,SAAc;AACxB,UAAM,UACJ,OAAO,wBAAwB,WAC3B,kBAAkB,qBAAqB,gCAAY,IACnD;AAEN,UAAM,SAAS,QAAQ;AACvB,UAAM,UAAU,YAAY,MAAa;AAEzC,QAAI;AACF,YAAM,MAAM,QAAQ,GAAG,IAAI;AAC3B,UAAI,OAAO,QAAQ,YAAY,UAAU,OAAO,OAAO,IAAI,SAAS,YAAY;AAC9E,eAAO,IACJ,KAAK,CAAC,QAAa;AAClB,iBAAO,OAAO;AACd,iBAAO;AAAA,QACT,CAAC,EACA,MAAM,CAAC,QAAa;AACnB,iBAAO,OAAO;AACd,gBAAM;AAAA,QACR,CAAC;AAAA,MACL;AAEA,aAAO,OAAO;AACd,aAAO;AAAA,IACT,SAAS,KAAU;AACjB,aAAO,OAAO;AACd,YAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,uBAAuB,IAAI;AACpC;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,qBAAqB,IAAI,oBAAoB,QAAe,SAAS,eAAAA,QAAQ,OAAO,cAAc,KAAK,OAAM,oBAAI,KAAK,GAAE,QAAQ,IAAI,GAAK,CAAC;AACnJ;AAGA,SAAS,SAAS,KAAa,WAAmB;AAChD,QAAM,UAAU,IAAI,YAAY;AAChC,QAAM,UAAU,IAAI,YAAY,OAAO;AAEvC,QAAM,gBAAgB,QAAQ,OAAO,GAAG;AACxC,QAAM,kBAAkB,cAAc,MAAM,GAAG,SAAS;AAGxD,SAAO,QAAQ,OAAO,eAAe,EAAE,QAAQ,WAAW,EAAE;AAC9D;","names":["nextPkg"]}
|
|
@@ -18,7 +18,7 @@ const SIGN_IN_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL || "";
|
|
|
18
18
|
const SIGN_UP_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL || "";
|
|
19
19
|
const SDK_METADATA = {
|
|
20
20
|
name: "@clerk/nextjs",
|
|
21
|
-
version: "7.5.13
|
|
21
|
+
version: "7.5.13",
|
|
22
22
|
environment: process.env.NODE_ENV
|
|
23
23
|
};
|
|
24
24
|
const TELEMETRY_DISABLED = isTruthy(process.env.NEXT_PUBLIC_CLERK_TELEMETRY_DISABLED);
|
|
@@ -18,7 +18,7 @@ const clerkClientDefaultOptions = {
|
|
|
18
18
|
publishableKey: PUBLISHABLE_KEY,
|
|
19
19
|
apiUrl: API_URL,
|
|
20
20
|
apiVersion: API_VERSION,
|
|
21
|
-
userAgent: `${"@clerk/nextjs"}@${"7.5.13
|
|
21
|
+
userAgent: `${"@clerk/nextjs"}@${"7.5.13"}`,
|
|
22
22
|
proxyUrl: PROXY_URL,
|
|
23
23
|
domain: DOMAIN,
|
|
24
24
|
isSatellite: IS_SATELLITE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/server/createClerkClient.ts"],"sourcesContent":["import { createClerkClient } from '@clerk/backend';\n\nimport {\n API_URL,\n API_VERSION,\n DOMAIN,\n IS_SATELLITE,\n MACHINE_SECRET_KEY,\n PROXY_URL,\n PUBLISHABLE_KEY,\n SDK_METADATA,\n SECRET_KEY,\n TELEMETRY_DEBUG,\n TELEMETRY_DISABLED,\n} from './constants';\n\nconst clerkClientDefaultOptions = {\n secretKey: SECRET_KEY,\n publishableKey: PUBLISHABLE_KEY,\n apiUrl: API_URL,\n apiVersion: API_VERSION,\n userAgent: `${PACKAGE_NAME}@${PACKAGE_VERSION}`,\n proxyUrl: PROXY_URL,\n domain: DOMAIN,\n isSatellite: IS_SATELLITE,\n machineSecretKey: MACHINE_SECRET_KEY,\n sdkMetadata: SDK_METADATA,\n telemetry: {\n disabled: TELEMETRY_DISABLED,\n debug: TELEMETRY_DEBUG,\n },\n};\n\nexport const createClerkClientWithOptions: typeof createClerkClient = options =>\n createClerkClient({ ...clerkClientDefaultOptions, ...options });\n"],"mappings":";AAAA,SAAS,yBAAyB;AAElC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,4BAA4B;AAAA,EAChC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW,GAAG,eAAY,IAAI,
|
|
1
|
+
{"version":3,"sources":["../../../src/server/createClerkClient.ts"],"sourcesContent":["import { createClerkClient } from '@clerk/backend';\n\nimport {\n API_URL,\n API_VERSION,\n DOMAIN,\n IS_SATELLITE,\n MACHINE_SECRET_KEY,\n PROXY_URL,\n PUBLISHABLE_KEY,\n SDK_METADATA,\n SECRET_KEY,\n TELEMETRY_DEBUG,\n TELEMETRY_DISABLED,\n} from './constants';\n\nconst clerkClientDefaultOptions = {\n secretKey: SECRET_KEY,\n publishableKey: PUBLISHABLE_KEY,\n apiUrl: API_URL,\n apiVersion: API_VERSION,\n userAgent: `${PACKAGE_NAME}@${PACKAGE_VERSION}`,\n proxyUrl: PROXY_URL,\n domain: DOMAIN,\n isSatellite: IS_SATELLITE,\n machineSecretKey: MACHINE_SECRET_KEY,\n sdkMetadata: SDK_METADATA,\n telemetry: {\n disabled: TELEMETRY_DISABLED,\n debug: TELEMETRY_DEBUG,\n },\n};\n\nexport const createClerkClientWithOptions: typeof createClerkClient = options =>\n createClerkClient({ ...clerkClientDefaultOptions, ...options });\n"],"mappings":";AAAA,SAAS,yBAAyB;AAElC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,4BAA4B;AAAA,EAChC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW,GAAG,eAAY,IAAI,QAAe;AAAA,EAC7C,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AACF;AAEO,MAAM,+BAAyD,aACpE,kBAAkB,EAAE,GAAG,2BAA2B,GAAG,QAAQ,CAAC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/server/routeMatcher.ts"],"sourcesContent":["import { createPathMatcher, type
|
|
1
|
+
{"version":3,"sources":["../../../src/server/routeMatcher.ts"],"sourcesContent":["import { createPathMatcher, type WithPathSegmentWildcard } from '@clerk/shared/pathMatcher';\nimport type { Autocomplete } from '@clerk/shared/types';\nimport type Link from 'next/link';\nimport type { NextRequest } from 'next/server';\n\ntype NextTypedRoute<T = Parameters<typeof Link>['0']['href']> = T extends string ? T : never;\ntype RouteMatcherWithNextTypedRoutes = Autocomplete<WithPathSegmentWildcard<NextTypedRoute> | NextTypedRoute>;\n\nexport type RouteMatcherParam =\n | Array<RegExp | RouteMatcherWithNextTypedRoutes>\n | RegExp\n | RouteMatcherWithNextTypedRoutes\n | ((req: NextRequest) => boolean);\n\n/**\n * Returns a function that accepts a `Request` object and returns whether the request matches the list of\n * predefined routes that can be passed in as the first argument.\n *\n * You can use glob patterns to match multiple routes or a function to match against the request object.\n * Path patterns and regular expressions are supported, for example: `['/foo', '/bar(.*)'] or `[/^\\/foo\\/.*$/]`\n * For more information, see: https://clerk.com/docs\n */\nexport const createRouteMatcher = (routes: RouteMatcherParam) => {\n if (typeof routes === 'function') {\n return (req: NextRequest) => routes(req);\n }\n\n const matcher = createPathMatcher(routes);\n return (req: NextRequest) => matcher(req.nextUrl.pathname);\n};\n"],"mappings":";AAAA,SAAS,yBAAuD;AAsBzD,MAAM,qBAAqB,CAAC,WAA8B;AAC/D,MAAI,OAAO,WAAW,YAAY;AAChC,WAAO,CAAC,QAAqB,OAAO,GAAG;AAAA,EACzC;AAEA,QAAM,UAAU,kBAAkB,MAAM;AACxC,SAAO,CAAC,QAAqB,QAAQ,IAAI,QAAQ,QAAQ;AAC3D;","names":[]}
|
|
@@ -57,7 +57,7 @@ function debugLogHeader(name) {
|
|
|
57
57
|
return `[clerk debug start: ${name}]`;
|
|
58
58
|
}
|
|
59
59
|
function debugLogFooter(name) {
|
|
60
|
-
return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.5.13
|
|
60
|
+
return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.5.13"},next=${nextPkg.version},timestamp=${Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3)})`;
|
|
61
61
|
}
|
|
62
62
|
function truncate(str, maxLength) {
|
|
63
63
|
const encoder = new TextEncoder();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/debugLogger.ts"],"sourcesContent":["// TODO: Replace with a more sophisticated logging solution\n\nimport nextPkg from 'next/package.json';\n\nimport { logFormatter } from './logFormatter';\n\nexport type Log = string | Record<string, unknown>;\nexport type LogEntry = Log | Log[];\nexport type Logger<L = Log> = {\n commit: () => void;\n debug: (...args: Array<L | (() => L)>) => void;\n enable: () => void;\n};\nexport type LoggerNoCommit<L = Logger> = Omit<L, 'commit'>;\n\nexport const createDebugLogger = (name: string, formatter: (val: LogEntry) => string) => (): Logger => {\n const entries: LogEntry[] = [];\n let isEnabled = false;\n\n return {\n enable: () => {\n isEnabled = true;\n },\n debug: (...args) => {\n if (isEnabled) {\n entries.push(args.map(arg => (typeof arg === 'function' ? arg() : arg)));\n }\n },\n commit: () => {\n if (isEnabled) {\n console.log(debugLogHeader(name));\n\n /**\n * We buffer each collected log entry so we can format them and log them all at once.\n * Individual console.log calls are used to ensure we don't hit platform-specific log limits (Vercel and Netlify are 4kb).\n */\n for (const log of entries) {\n let output = formatter(log);\n\n output = output\n .split('\\n')\n .map(l => ` ${l}`)\n .join('\\n');\n\n // Vercel errors if the output is > 4kb, so we truncate it\n if (process.env.VERCEL) {\n output = truncate(output, 4096);\n }\n\n console.log(output);\n }\n\n console.log(debugLogFooter(name));\n }\n },\n };\n};\n\ntype WithLogger = <L extends Logger, H extends (...args: any[]) => any>(\n loggerFactoryOrName: string | (() => L),\n handlerCtor: (logger: LoggerNoCommit<L>) => H,\n) => H;\n\nexport const withLogger: WithLogger = (loggerFactoryOrName, handlerCtor) => {\n return ((...args: any) => {\n const factory =\n typeof loggerFactoryOrName === 'string'\n ? createDebugLogger(loggerFactoryOrName, logFormatter)\n : loggerFactoryOrName;\n\n const logger = factory();\n const handler = handlerCtor(logger as any);\n\n try {\n const res = handler(...args);\n if (typeof res === 'object' && 'then' in res && typeof res.then === 'function') {\n return res\n .then((val: any) => {\n logger.commit();\n return val;\n })\n .catch((err: any) => {\n logger.commit();\n throw err;\n });\n }\n // handle sync methods\n logger.commit();\n return res;\n } catch (err: any) {\n logger.commit();\n throw err;\n }\n }) as ReturnType<typeof handlerCtor>;\n};\n\nfunction debugLogHeader(name: string) {\n return `[clerk debug start: ${name}]`;\n}\n\nfunction debugLogFooter(name: string) {\n return `[clerk debug end: ${name}] (@clerk/nextjs=${PACKAGE_VERSION},next=${nextPkg.version},timestamp=${Math.round(new Date().getTime() / 1_000)})`;\n}\n\n// ref: https://stackoverflow.com/questions/57769465/javascript-truncate-text-by-bytes-length\nfunction truncate(str: string, maxLength: number) {\n const encoder = new TextEncoder();\n const decoder = new TextDecoder('utf-8');\n\n const encodedString = encoder.encode(str);\n const truncatedString = encodedString.slice(0, maxLength);\n\n // return the truncated string, removing any replacement characters that result from partially truncated characters\n return decoder.decode(truncatedString).replace(/\\uFFFD/g, '');\n}\n"],"mappings":";AAEA,OAAO,aAAa;AAEpB,SAAS,oBAAoB;AAWtB,MAAM,oBAAoB,CAAC,MAAc,cAAyC,MAAc;AACrG,QAAM,UAAsB,CAAC;AAC7B,MAAI,YAAY;AAEhB,SAAO;AAAA,IACL,QAAQ,MAAM;AACZ,kBAAY;AAAA,IACd;AAAA,IACA,OAAO,IAAI,SAAS;AAClB,UAAI,WAAW;AACb,gBAAQ,KAAK,KAAK,IAAI,SAAQ,OAAO,QAAQ,aAAa,IAAI,IAAI,GAAI,CAAC;AAAA,MACzE;AAAA,IACF;AAAA,IACA,QAAQ,MAAM;AACZ,UAAI,WAAW;AACb,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAMhC,mBAAW,OAAO,SAAS;AACzB,cAAI,SAAS,UAAU,GAAG;AAE1B,mBAAS,OACN,MAAM,IAAI,EACV,IAAI,OAAK,KAAK,CAAC,EAAE,EACjB,KAAK,IAAI;AAGZ,cAAI,QAAQ,IAAI,QAAQ;AACtB,qBAAS,SAAS,QAAQ,IAAI;AAAA,UAChC;AAEA,kBAAQ,IAAI,MAAM;AAAA,QACpB;AAEA,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AACF;AAOO,MAAM,aAAyB,CAAC,qBAAqB,gBAAgB;AAC1E,UAAQ,IAAI,SAAc;AACxB,UAAM,UACJ,OAAO,wBAAwB,WAC3B,kBAAkB,qBAAqB,YAAY,IACnD;AAEN,UAAM,SAAS,QAAQ;AACvB,UAAM,UAAU,YAAY,MAAa;AAEzC,QAAI;AACF,YAAM,MAAM,QAAQ,GAAG,IAAI;AAC3B,UAAI,OAAO,QAAQ,YAAY,UAAU,OAAO,OAAO,IAAI,SAAS,YAAY;AAC9E,eAAO,IACJ,KAAK,CAAC,QAAa;AAClB,iBAAO,OAAO;AACd,iBAAO;AAAA,QACT,CAAC,EACA,MAAM,CAAC,QAAa;AACnB,iBAAO,OAAO;AACd,gBAAM;AAAA,QACR,CAAC;AAAA,MACL;AAEA,aAAO,OAAO;AACd,aAAO;AAAA,IACT,SAAS,KAAU;AACjB,aAAO,OAAO;AACd,YAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,uBAAuB,IAAI;AACpC;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,qBAAqB,IAAI,oBAAoB,
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/debugLogger.ts"],"sourcesContent":["// TODO: Replace with a more sophisticated logging solution\n\nimport nextPkg from 'next/package.json';\n\nimport { logFormatter } from './logFormatter';\n\nexport type Log = string | Record<string, unknown>;\nexport type LogEntry = Log | Log[];\nexport type Logger<L = Log> = {\n commit: () => void;\n debug: (...args: Array<L | (() => L)>) => void;\n enable: () => void;\n};\nexport type LoggerNoCommit<L = Logger> = Omit<L, 'commit'>;\n\nexport const createDebugLogger = (name: string, formatter: (val: LogEntry) => string) => (): Logger => {\n const entries: LogEntry[] = [];\n let isEnabled = false;\n\n return {\n enable: () => {\n isEnabled = true;\n },\n debug: (...args) => {\n if (isEnabled) {\n entries.push(args.map(arg => (typeof arg === 'function' ? arg() : arg)));\n }\n },\n commit: () => {\n if (isEnabled) {\n console.log(debugLogHeader(name));\n\n /**\n * We buffer each collected log entry so we can format them and log them all at once.\n * Individual console.log calls are used to ensure we don't hit platform-specific log limits (Vercel and Netlify are 4kb).\n */\n for (const log of entries) {\n let output = formatter(log);\n\n output = output\n .split('\\n')\n .map(l => ` ${l}`)\n .join('\\n');\n\n // Vercel errors if the output is > 4kb, so we truncate it\n if (process.env.VERCEL) {\n output = truncate(output, 4096);\n }\n\n console.log(output);\n }\n\n console.log(debugLogFooter(name));\n }\n },\n };\n};\n\ntype WithLogger = <L extends Logger, H extends (...args: any[]) => any>(\n loggerFactoryOrName: string | (() => L),\n handlerCtor: (logger: LoggerNoCommit<L>) => H,\n) => H;\n\nexport const withLogger: WithLogger = (loggerFactoryOrName, handlerCtor) => {\n return ((...args: any) => {\n const factory =\n typeof loggerFactoryOrName === 'string'\n ? createDebugLogger(loggerFactoryOrName, logFormatter)\n : loggerFactoryOrName;\n\n const logger = factory();\n const handler = handlerCtor(logger as any);\n\n try {\n const res = handler(...args);\n if (typeof res === 'object' && 'then' in res && typeof res.then === 'function') {\n return res\n .then((val: any) => {\n logger.commit();\n return val;\n })\n .catch((err: any) => {\n logger.commit();\n throw err;\n });\n }\n // handle sync methods\n logger.commit();\n return res;\n } catch (err: any) {\n logger.commit();\n throw err;\n }\n }) as ReturnType<typeof handlerCtor>;\n};\n\nfunction debugLogHeader(name: string) {\n return `[clerk debug start: ${name}]`;\n}\n\nfunction debugLogFooter(name: string) {\n return `[clerk debug end: ${name}] (@clerk/nextjs=${PACKAGE_VERSION},next=${nextPkg.version},timestamp=${Math.round(new Date().getTime() / 1_000)})`;\n}\n\n// ref: https://stackoverflow.com/questions/57769465/javascript-truncate-text-by-bytes-length\nfunction truncate(str: string, maxLength: number) {\n const encoder = new TextEncoder();\n const decoder = new TextDecoder('utf-8');\n\n const encodedString = encoder.encode(str);\n const truncatedString = encodedString.slice(0, maxLength);\n\n // return the truncated string, removing any replacement characters that result from partially truncated characters\n return decoder.decode(truncatedString).replace(/\\uFFFD/g, '');\n}\n"],"mappings":";AAEA,OAAO,aAAa;AAEpB,SAAS,oBAAoB;AAWtB,MAAM,oBAAoB,CAAC,MAAc,cAAyC,MAAc;AACrG,QAAM,UAAsB,CAAC;AAC7B,MAAI,YAAY;AAEhB,SAAO;AAAA,IACL,QAAQ,MAAM;AACZ,kBAAY;AAAA,IACd;AAAA,IACA,OAAO,IAAI,SAAS;AAClB,UAAI,WAAW;AACb,gBAAQ,KAAK,KAAK,IAAI,SAAQ,OAAO,QAAQ,aAAa,IAAI,IAAI,GAAI,CAAC;AAAA,MACzE;AAAA,IACF;AAAA,IACA,QAAQ,MAAM;AACZ,UAAI,WAAW;AACb,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAMhC,mBAAW,OAAO,SAAS;AACzB,cAAI,SAAS,UAAU,GAAG;AAE1B,mBAAS,OACN,MAAM,IAAI,EACV,IAAI,OAAK,KAAK,CAAC,EAAE,EACjB,KAAK,IAAI;AAGZ,cAAI,QAAQ,IAAI,QAAQ;AACtB,qBAAS,SAAS,QAAQ,IAAI;AAAA,UAChC;AAEA,kBAAQ,IAAI,MAAM;AAAA,QACpB;AAEA,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AACF;AAOO,MAAM,aAAyB,CAAC,qBAAqB,gBAAgB;AAC1E,UAAQ,IAAI,SAAc;AACxB,UAAM,UACJ,OAAO,wBAAwB,WAC3B,kBAAkB,qBAAqB,YAAY,IACnD;AAEN,UAAM,SAAS,QAAQ;AACvB,UAAM,UAAU,YAAY,MAAa;AAEzC,QAAI;AACF,YAAM,MAAM,QAAQ,GAAG,IAAI;AAC3B,UAAI,OAAO,QAAQ,YAAY,UAAU,OAAO,OAAO,IAAI,SAAS,YAAY;AAC9E,eAAO,IACJ,KAAK,CAAC,QAAa;AAClB,iBAAO,OAAO;AACd,iBAAO;AAAA,QACT,CAAC,EACA,MAAM,CAAC,QAAa;AACnB,iBAAO,OAAO;AACd,gBAAM;AAAA,QACR,CAAC;AAAA,MACL;AAEA,aAAO,OAAO;AACd,aAAO;AAAA,IACT,SAAS,KAAU;AACjB,aAAO,OAAO;AACd,YAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,uBAAuB,IAAI;AACpC;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,qBAAqB,IAAI,oBAAoB,QAAe,SAAS,QAAQ,OAAO,cAAc,KAAK,OAAM,oBAAI,KAAK,GAAE,QAAQ,IAAI,GAAK,CAAC;AACnJ;AAGA,SAAS,SAAS,KAAa,WAAmB;AAChD,QAAM,UAAU,IAAI,YAAY;AAChC,QAAM,UAAU,IAAI,YAAY,OAAO;AAEvC,QAAM,gBAAgB,QAAQ,OAAO,GAAG;AACxC,QAAM,kBAAkB,cAAc,MAAM,GAAG,SAAS;AAGxD,SAAO,QAAQ,OAAO,eAAe,EAAE,QAAQ,WAAW,EAAE;AAC9D;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type WithPathSegmentWildcard } from '@clerk/shared/pathMatcher';
|
|
2
2
|
import type { Autocomplete } from '@clerk/shared/types';
|
|
3
3
|
import type Link from 'next/link';
|
|
4
4
|
import type { NextRequest } from 'next/server';
|
|
5
5
|
type NextTypedRoute<T = Parameters<typeof Link>['0']['href']> = T extends string ? T : never;
|
|
6
|
-
type RouteMatcherWithNextTypedRoutes = Autocomplete<
|
|
6
|
+
type RouteMatcherWithNextTypedRoutes = Autocomplete<WithPathSegmentWildcard<NextTypedRoute> | NextTypedRoute>;
|
|
7
7
|
export type RouteMatcherParam = Array<RegExp | RouteMatcherWithNextTypedRoutes> | RegExp | RouteMatcherWithNextTypedRoutes | ((req: NextRequest) => boolean);
|
|
8
8
|
/**
|
|
9
9
|
* Returns a function that accepts a `Request` object and returns whether the request matches the list of
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerk/nextjs",
|
|
3
|
-
"version": "7.5.13
|
|
3
|
+
"version": "7.5.13",
|
|
4
4
|
"description": "Clerk SDK for NextJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"clerk",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"server-only": "0.0.1",
|
|
74
74
|
"tslib": "2.8.1",
|
|
75
|
-
"@clerk/
|
|
76
|
-
"@clerk/react": "6.11.4
|
|
77
|
-
"@clerk/
|
|
75
|
+
"@clerk/backend": "^3.11.0",
|
|
76
|
+
"@clerk/react": "^6.11.4",
|
|
77
|
+
"@clerk/shared": "^4.24.0"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"crypto-es": "^2.1.0",
|