mcp-scraper 0.3.21 → 0.3.22

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.
@@ -5,13 +5,13 @@ import {
5
5
  exportFanout,
6
6
  registerPaaExtractorMcpTools,
7
7
  sanitizeOutboundDiagnostics
8
- } from "../chunk-UO252634.js";
8
+ } from "../chunk-FEUCMGIJ.js";
9
9
  import {
10
10
  renderInstallTerminal
11
11
  } from "../chunk-DE7WP4UU.js";
12
12
  import {
13
13
  PACKAGE_VERSION
14
- } from "../chunk-J4PSMJNZ.js";
14
+ } from "../chunk-2IXMOXDH.js";
15
15
  import {
16
16
  browserServiceProfileName,
17
17
  browserServiceProfileSaveChanges
@@ -0,0 +1,7 @@
1
+ // src/version.ts
2
+ var PACKAGE_VERSION = "0.3.22";
3
+
4
+ export {
5
+ PACKAGE_VERSION
6
+ };
7
+ //# sourceMappingURL=chunk-2IXMOXDH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/version.ts"],"sourcesContent":["export const PACKAGE_VERSION = '0.3.22'\n"],"mappings":";AAAO,IAAM,kBAAkB;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PACKAGE_VERSION
3
- } from "./chunk-J4PSMJNZ.js";
3
+ } from "./chunk-2IXMOXDH.js";
4
4
  import {
5
5
  browserServiceProfileName,
6
6
  browserServiceProfileSaveChanges,
@@ -4315,4 +4315,4 @@ export {
4315
4315
  HttpMcpToolExecutor,
4316
4316
  exportFanout
4317
4317
  };
4318
- //# sourceMappingURL=chunk-UO252634.js.map
4318
+ //# sourceMappingURL=chunk-FEUCMGIJ.js.map
@@ -21,7 +21,7 @@ import {
21
21
  renderLinkReport,
22
22
  sanitizeAttempts,
23
23
  sanitizeHarvestResult
24
- } from "./chunk-UO252634.js";
24
+ } from "./chunk-FEUCMGIJ.js";
25
25
  import {
26
26
  csvRecords,
27
27
  listWorkflowDefinitions,
@@ -33,7 +33,7 @@ import {
33
33
  workflowStepCount,
34
34
  workflowSupportsSteps
35
35
  } from "./chunk-H2R232HK.js";
36
- import "./chunk-J4PSMJNZ.js";
36
+ import "./chunk-2IXMOXDH.js";
37
37
  import {
38
38
  BROWSER_OPEN_MIN_BALANCE_MC,
39
39
  CONCURRENCY_PRICE_ID,
@@ -17460,6 +17460,61 @@ app.post("/billing/concurrency/terminal-checkout", auth2, async (c) => {
17460
17460
  return c.json({ error: message }, 500);
17461
17461
  }
17462
17462
  });
17463
+ app.post("/billing/subscribe/terminal-checkout", auth2, async (c) => {
17464
+ try {
17465
+ const user = c.get("user");
17466
+ const raw = await c.req.json().catch(() => ({}));
17467
+ const tier = SUBSCRIPTION_TIER_BY_KEY[String(raw.tier ?? "")];
17468
+ if (!tier) return c.json({ error: "Invalid tier. Choose starter, growth, or scale.", tiers: Object.keys(SUBSCRIPTION_TIER_BY_KEY) }, 400);
17469
+ const secret2 = process.env.STRIPE_SECRET_KEY?.trim();
17470
+ if (!secret2) return c.json({ error: "Stripe is not configured." }, 503);
17471
+ const stripeClient = new Stripe2(secret2, { apiVersion: STRIPE_API_VERSION });
17472
+ let customerId = user.stripe_customer_id;
17473
+ if (!customerId) {
17474
+ const customer = await stripeClient.customers.create({ email: user.email });
17475
+ customerId = customer.id;
17476
+ await setStripeCustomerId(user.id, customerId);
17477
+ }
17478
+ if (user.subscription_id) {
17479
+ const sub = await stripeClient.subscriptions.retrieve(user.subscription_id);
17480
+ const itemId = sub.items.data[0]?.id;
17481
+ if (itemId) {
17482
+ await stripeClient.subscriptions.update(user.subscription_id, {
17483
+ items: [{ id: itemId, price: tier.price_id }],
17484
+ proration_behavior: "create_prorations"
17485
+ });
17486
+ return c.json({ updated: true, tier: tier.tier, message: `Switched to ${tier.label} (prorated). Credits and concurrency update on the next invoice.` });
17487
+ }
17488
+ }
17489
+ const session = await stripeClient.checkout.sessions.create({
17490
+ customer: customerId,
17491
+ mode: "subscription",
17492
+ line_items: [{ price: tier.price_id, quantity: 1 }],
17493
+ ...tier.intro_coupon ? { discounts: [{ coupon: tier.intro_coupon }] } : {},
17494
+ automatic_tax: { enabled: true },
17495
+ billing_address_collection: "required",
17496
+ customer_update: { address: "auto", name: "auto" },
17497
+ tax_id_collection: { enabled: true },
17498
+ success_url: `${appOrigin()}/billing?subscribed=${tier.tier}&source=terminal`,
17499
+ cancel_url: `${appOrigin()}/billing?subscribe_cancelled=1&source=terminal`
17500
+ });
17501
+ if (!session.url) return c.json({ error: "Stripe did not return a checkout URL." }, 502);
17502
+ return c.json({
17503
+ checkout_url: session.url,
17504
+ tier: tier.tier,
17505
+ label: tier.label,
17506
+ monthly_usd: tier.monthly_usd,
17507
+ credits_per_month: tier.credits_mc / 1e3,
17508
+ concurrency: tier.concurrency,
17509
+ intro: tier.intro_coupon ? "$1 first month" : null,
17510
+ next_step: "Open checkout_url in a browser to complete payment."
17511
+ });
17512
+ } catch (err) {
17513
+ const message = err instanceof Error ? err.message : "Unable to start subscription checkout.";
17514
+ console.error("[billing/subscribe/terminal-checkout]", message);
17515
+ return c.json({ error: message }, 500);
17516
+ }
17517
+ });
17463
17518
  app.post("/billing/concurrency/cancel", requireAllowedOrigin, sessionAuth, async (c) => {
17464
17519
  const user = c.get("sessionUser");
17465
17520
  if (!user.concurrency_stripe_sub_id) return c.json({ error: "No active concurrency subscription." }, 404);
@@ -17664,4 +17719,4 @@ app.get("/blog/:slug/", (c) => {
17664
17719
  export {
17665
17720
  app
17666
17721
  };
17667
- //# sourceMappingURL=server-K4UIE2R3.js.map
17722
+ //# sourceMappingURL=server-G7PVVOH3.js.map