@theholocron/holocron-plugin-clerk 5.0.0-alpha.245 → 5.0.0-alpha.247

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/index.d.mts CHANGED
@@ -1,11 +1,8 @@
1
1
  import { Auth, AuthDescription, AuthError, AuthEvent, AuthIdentity, AuthUser, CreateAuthUserInput, ParseWebhookInput, ResolveTokenInput, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess, WebhookDashboardInfo } from "@theholocron/cli";
2
2
  import { ClerkClient, ClerkClientOptions, createClerkClient } from "@theholocron/clerk-client";
3
- //#region src/auth.d.ts
4
- declare const resolveToken: (input?: ResolveTokenInput) => string;
5
- //#endregion
6
- //#region src/capabilities/auth.d.ts
3
+ export declare const resolveToken: (input?: ResolveTokenInput) => string;
7
4
  type ClerkAuthOptions = Record<string, never>;
8
- declare class ClerkAuth implements Auth {
5
+ export declare class ClerkAuth implements Auth {
9
6
  private readonly client;
10
7
  readonly key: "auth";
11
8
  readonly providerName = "clerk";
@@ -18,31 +15,25 @@ declare class ClerkAuth implements Auth {
18
15
  getWebhookDashboardUrl(): Promise<WebhookDashboardInfo>;
19
16
  createUser(input: CreateAuthUserInput): Promise<AuthUser>;
20
17
  }
21
- //#endregion
22
- //#region src/parse-webhook.d.ts
23
- declare function parseWebhook(input: ParseWebhookInput): Promise<AuthEvent>;
24
- //#endregion
25
- //#region src/verify-token.d.ts
18
+ export declare function parseWebhook(input: ParseWebhookInput): Promise<AuthEvent>;
26
19
  interface VerifyTokenOptions {
27
20
  baseUrl?: string;
28
21
  fetch?: typeof fetch;
29
22
  }
30
- declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
31
- //#endregion
32
- //#region src/index.d.ts
33
- interface ClerkPluginOptions extends ResolveTokenInput {
23
+ export declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
24
+ export interface ClerkPluginOptions extends ResolveTokenInput {
34
25
  /** Override base URL for tests. */
35
26
  baseUrl?: string;
36
27
  /** Override `fetch` for tests. */
37
28
  fetch?: typeof fetch;
38
29
  }
39
- interface PluginContext {
30
+ export interface PluginContext {
40
31
  options: ClerkPluginOptions;
41
32
  client: () => ClerkClient;
42
33
  }
43
- declare function createContext(options?: ClerkPluginOptions): PluginContext;
44
- declare function auth(ctx: PluginContext): Auth;
45
- declare function createPlugin(options?: ClerkPluginOptions): {
34
+ export declare function createContext(options?: ClerkPluginOptions): PluginContext;
35
+ export declare function auth(ctx: PluginContext): Auth;
36
+ export declare function createPlugin(options?: ClerkPluginOptions): {
46
37
  name: string;
47
38
  probes: {
48
39
  connection: import("@theholocron/cli").Probe;
@@ -57,6 +48,5 @@ declare function createPlugin(options?: ClerkPluginOptions): {
57
48
  * the Clerk dashboard's API Keys section — MUST be the SECRET key
58
49
  * (sk_test_* / sk_live_*), not the publishable key.
59
50
  */
60
- declare const AUTH_HINT: string;
61
- //#endregion
62
- export { AUTH_HINT, AuthError, ClerkAuth, type ClerkClientOptions, ClerkPluginOptions, PluginContext, type ResolveTokenInput, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, auth, createClerkClient, createContext, createPlugin, parseWebhook, resolveToken, verifyToken };
51
+ export declare const AUTH_HINT: string;
52
+ export { AuthError, type ClerkClientOptions, type ResolveTokenInput, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, createClerkClient };
package/dist/index.mjs CHANGED
@@ -2,15 +2,14 @@ import { AuthError, ProviderApiError, WebhookVerificationError, connectionProbe,
2
2
  import { createClerkClient } from "@theholocron/clerk-client";
3
3
  import { errorMessage } from "@theholocron/misc-utils";
4
4
  import { createHmac, timingSafeEqual } from "node:crypto";
5
- //#region src/auth.ts
5
+ // src/auth.ts
6
6
  const resolveToken = createResolveToken({
7
7
  envName: "HOLOCRON_CLERK_SECRET_KEY",
8
8
  vendorEnvName: "CLERK_SECRET_KEY",
9
9
  keyringService: "clerk",
10
10
  errorMessage: "no Clerk secret key found. Pass --token <KEY>, set HOLOCRON_CLERK_SECRET_KEY / CLERK_SECRET_KEY, or run: holocron auth set clerk <KEY>"
11
11
  });
12
- //#endregion
13
- //#region src/capabilities/auth.ts
12
+ // src/capabilities/auth.ts
14
13
  var ClerkAuth = class {
15
14
  client;
16
15
  key = "auth";
@@ -71,8 +70,7 @@ function isAlreadyExistsError(err) {
71
70
  }
72
71
  return false;
73
72
  }
74
- //#endregion
75
- //#region src/verify-token.ts
73
+ // src/verify-token.ts
76
74
  async function verifyToken(token, opts = {}) {
77
75
  const client = createClerkClient({
78
76
  token,
@@ -92,8 +90,7 @@ async function verifyToken(token, opts = {}) {
92
90
  };
93
91
  }
94
92
  }
95
- //#endregion
96
- //#region src/parse-webhook.ts
93
+ // src/parse-webhook.ts
97
94
  /**
98
95
  * Translates a Clerk webhook delivery into the normalized `AuthEvent`
99
96
  * shape defined in `@theholocron/cli`, with full Svix HMAC-SHA256
@@ -170,8 +167,7 @@ async function verifySignature(input) {
170
167
  return timingSafeEqual(sigBytes, computed);
171
168
  })) throw new WebhookVerificationError("Svix signature verification failed");
172
169
  }
173
- //#endregion
174
- //#region src/index.ts
170
+ // src/index.ts
175
171
  function createContext(options = {}) {
176
172
  let client;
177
173
  return {
@@ -210,5 +206,4 @@ function createPlugin(options = {}) {
210
206
  * (sk_test_* / sk_live_*), not the publishable key.
211
207
  */
212
208
  const AUTH_HINT = "grab your SECRET key (sk_test_* / sk_live_*) at https://dashboard.clerk.com → API Keys, then run: holocron auth set clerk <KEY>. Do NOT use the publishable key.";
213
- //#endregion
214
209
  export { AUTH_HINT, AuthError, ClerkAuth, auth, createClerkClient, createContext, createPlugin, parseWebhook, resolveToken, verifyToken };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-clerk",
3
- "version": "5.0.0-alpha.245",
3
+ "version": "5.0.0-alpha.247",
4
4
  "description": "Holocron plugin for Clerk. Implements the auth capability against Clerk's Backend REST API.",
5
5
  "keywords": [
6
6
  "auth",
@@ -38,21 +38,21 @@
38
38
  "@theholocron/tsdown-config": "^8.8.2",
39
39
  "@theholocron/vitest-config": "^8.8.2",
40
40
  "@types/node": "^26",
41
- "@vitest/coverage-v8": "^4.1.11",
41
+ "@vitest/coverage-v8": "^5.0.5",
42
42
  "@vitest/eslint-plugin": "^1.6.27",
43
43
  "eslint": "^10.8.1",
44
44
  "eslint-plugin-n": "^18.3.0",
45
45
  "globals": "^17.11.0",
46
- "tsdown": "^0.22.14",
46
+ "tsdown": "^0.23.3",
47
47
  "tsx": "4.23.15",
48
48
  "typescript": "^5.9.3",
49
- "vitest": "^4.1.11",
50
- "@theholocron/cli": "5.0.0-alpha.245"
49
+ "vitest": "^5.0.5",
50
+ "@theholocron/cli": "5.0.0-alpha.247"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@theholocron/clerk-client": "^1.43.1",
54
54
  "@theholocron/misc-utils": "^1.16.0",
55
- "@theholocron/cli": "5.0.0-alpha.245"
55
+ "@theholocron/cli": "5.0.0-alpha.247"
56
56
  },
57
57
  "engines": {
58
58
  "node": ">=22"