@vvedantb/server 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.0
4
+
5
+ Retires the per-app `vibot_pro` plan. Only the shared `v_pro` plan counts as V Pro. No new dependency.
6
+
7
+ ### Removed
8
+
9
+ - `V_PRO_LEGACY_PLAN_KEY` (`"vibot_pro"`). Breaking for any consumer that imports it.
10
+
11
+ ### Changed
12
+
13
+ - `V_PRO_PLAN_KEYS` is now `["v_pro"]`. The export stays.
14
+ - `hasVPlan` no longer treats `vibot_pro` (`u:vibot_pro`, `o:vibot_pro` or bare) as V Pro; it returns `false`.
15
+
16
+ ### Tests
17
+
18
+ - `tests/convex/vPlan.test.ts` and `tests-node/esm-exports.mjs` check that `vibot_pro` no longer counts.
19
+
3
20
  ## 0.9.0
4
21
 
5
22
  Shared "V Pro" plan check for every Project V app. Additive; no new dependency.
@@ -15,4 +15,4 @@ export { assertMcpTools, expectMcpToolCount } from "./mcpTestHelpers.js";
15
15
  export { tempId, type TempIdFormat, type TempIdOptions } from "./tempId.js";
16
16
  export { consoleClerkVerifyLogger, verifyClerkAccessToken, type ClerkAuthLike, type ClerkLike, type ClerkRequestStateLike, type ClerkTokenType, type ClerkVerifyRejection, type VerifiedClerkToken, type VerifyClerkAccessTokenOptions, } from "./verifyClerkAccessToken.js";
17
17
  export { authenticateClerkBearer, CLERK_JWKS_REFETCH_MIN_MS, CLERK_JWKS_TTL_MS, clearClerkJwksCache, isOAuthAccessTokenJwt, looksLikeJwt, verifyClerkOAuthJwt, type AuthenticateClerkBearerOptions, type ClerkOAuthJwtRejection, type VerifiedClerkOAuthJwt, type VerifyClerkOAuthJwtOptions, } from "./verifyClerkOAuthJwt.js";
18
- export { hasVPlan, V_PRO_PLAN_KEY, V_PRO_PLAN_KEYS, V_PRO_LEGACY_PLAN_KEY, } from "./vPlan.js";
18
+ export { hasVPlan, V_PRO_PLAN_KEY, V_PRO_PLAN_KEYS, } from "./vPlan.js";
@@ -15,4 +15,4 @@ export { assertMcpTools, expectMcpToolCount } from "./mcpTestHelpers.js";
15
15
  export { tempId } from "./tempId.js";
16
16
  export { consoleClerkVerifyLogger, verifyClerkAccessToken, } from "./verifyClerkAccessToken.js";
17
17
  export { authenticateClerkBearer, CLERK_JWKS_REFETCH_MIN_MS, CLERK_JWKS_TTL_MS, clearClerkJwksCache, isOAuthAccessTokenJwt, looksLikeJwt, verifyClerkOAuthJwt, } from "./verifyClerkOAuthJwt.js";
18
- export { hasVPlan, V_PRO_PLAN_KEY, V_PRO_PLAN_KEYS, V_PRO_LEGACY_PLAN_KEY, } from "./vPlan.js";
18
+ export { hasVPlan, V_PRO_PLAN_KEY, V_PRO_PLAN_KEYS, } from "./vPlan.js";
@@ -1,11 +1,9 @@
1
1
  /** Clerk Billing plan key for the shared V Pro plan ($10/month or $100/year). */
2
2
  export declare const V_PRO_PLAN_KEY = "v_pro";
3
- /** The earlier single-app plan. It still counts as V Pro. */
4
- export declare const V_PRO_LEGACY_PLAN_KEY = "vibot_pro";
5
3
  /** Plan keys that grant V Pro. */
6
4
  export declare const V_PRO_PLAN_KEYS: readonly string[];
7
5
  /**
8
- * True when the session's active plan is V Pro (`v_pro` or legacy `vibot_pro`).
6
+ * True when the session's active plan is V Pro (`v_pro`).
9
7
  * Reads the Clerk session token v2 `pla` claim, `u:<plan>` or `o:<plan>`, from a
10
8
  * Convex `ctx.auth.getUserIdentity()` result or raw JWT claims. A bare plan slug
11
9
  * also matches. Anything else, including `null`, returns `false`; it never throws.
@@ -1,11 +1,9 @@
1
1
  /** Clerk Billing plan key for the shared V Pro plan ($10/month or $100/year). */
2
2
  export const V_PRO_PLAN_KEY = "v_pro";
3
- /** The earlier single-app plan. It still counts as V Pro. */
4
- export const V_PRO_LEGACY_PLAN_KEY = "vibot_pro";
5
3
  /** Plan keys that grant V Pro. */
6
- export const V_PRO_PLAN_KEYS = [V_PRO_PLAN_KEY, V_PRO_LEGACY_PLAN_KEY];
4
+ export const V_PRO_PLAN_KEYS = [V_PRO_PLAN_KEY];
7
5
  /**
8
- * True when the session's active plan is V Pro (`v_pro` or legacy `vibot_pro`).
6
+ * True when the session's active plan is V Pro (`v_pro`).
9
7
  * Reads the Clerk session token v2 `pla` claim, `u:<plan>` or `o:<plan>`, from a
10
8
  * Convex `ctx.auth.getUserIdentity()` result or raw JWT claims. A bare plan slug
11
9
  * also matches. Anything else, including `null`, returns `false`; it never throws.
package/docs/convex.md CHANGED
@@ -396,7 +396,7 @@ expect(store.getQuery(api.tasks.list, { projectId })).toHaveLength(1);
396
396
 
397
397
  ## V Pro plan check
398
398
 
399
- `hasVPlan` tells whether a session holds the shared V Pro plan (Clerk Billing key `v_pro`, $10/month or $100/year). The legacy `vibot_pro` plan counts too. It reads the Clerk session token v2 `pla` claim (`u:v_pro`, `o:v_pro`, `u:vibot_pro`, or a bare slug), because Clerk's `has({ plan })` is not available in Convex. Convex surfaces custom JWT claims on the identity.
399
+ `hasVPlan` tells whether a session holds the shared V Pro plan (Clerk Billing key `v_pro`, $10/month or $100/year). The retired `vibot_pro` plan no longer counts. It reads the Clerk session token v2 `pla` claim (`u:v_pro`, `o:v_pro`, or a bare slug), because Clerk's `has({ plan })` is not available in Convex. Convex surfaces custom JWT claims on the identity.
400
400
 
401
401
  ```ts
402
402
  import { hasVPlan } from "@vvedantb/server";
@@ -405,7 +405,7 @@ const identity = await ctx.auth.getUserIdentity();
405
405
  if (!hasVPlan(identity)) throw new Error("V Pro required");
406
406
  ```
407
407
 
408
- `null`, a missing `pla` or a malformed value returns `false`; it never throws. `V_PRO_PLAN_KEY`, `V_PRO_LEGACY_PLAN_KEY` and `V_PRO_PLAN_KEYS` are exported too.
408
+ `null`, a missing `pla` or a malformed value returns `false`; it never throws. `V_PRO_PLAN_KEY` and `V_PRO_PLAN_KEYS` are exported too.
409
409
 
410
410
  ## Develop
411
411
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vvedantb/server",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "license": "MIT",
5
5
  "description": "Shared Convex backend helpers, MCP server scaffolding and Node-side MCP OAuth client helpers from one root import: query-limit errors, Clerk auth and token verification, an MCP bearer-token cache, Clerk-user lookups and ensure-user for Convex functions, bearer tokens, env, CORS, JSON responses, MCP route registration, a bearer-auth MCP HTTP handler, OAuth metadata, a JSON-RPC dispatcher, explorer tools, WebCrypto primitives, Convex optimistic-update helpers, MCP OAuth client helpers (provider, sign-in, refresh, revocation, loopback redirect server) for desktop apps, a QuickJS code sandbox that bridges script tool calls to host handlers, and a pure artifacts core (Zod contract, state limits and ops, quiz and flashcards pages, a sandboxed document wrapper with CSP and a guest state bridge).",
6
6
  "type": "module",