@waitcher/cli 0.2.3 → 0.2.5

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +59 -14
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -62021,6 +62021,13 @@ Authentication
62021
62021
  Immediately refuse new requests using that token
62022
62022
  token history [--before CURSOR] Read recent owner-scoped credential activity
62023
62023
 
62024
+ Plans and billing
62025
+ account billing Plan, limits and subscription status
62026
+ account upgrade [--yearly] Stripe Checkout URL for the pro plan (human session)
62027
+ account billing-portal Stripe portal URL to change payment or cancel
62028
+ The plan changes only when Stripe confirms the payment, never on the return page.
62029
+ Billing appears when the server reports features.billing.
62030
+
62024
62031
  Account data
62025
62032
  account deletion Review current deletion revision and impact
62026
62033
  account deletion-prepare --expected-revision N --output NEW_PRIVATE_RECEIPT
@@ -62479,7 +62486,7 @@ ${exitCodes}
62479
62486
  // package.json
62480
62487
  var package_default = {
62481
62488
  name: "@waitcher/cli",
62482
- version: "0.2.3",
62489
+ version: "0.2.5",
62483
62490
  description: "Synthetic monitoring from your repository: deploy HTTP, certificate, heartbeat, API and browser monitors from waitcher.json.",
62484
62491
  license: "SEE LICENSE IN LICENSE.txt",
62485
62492
  author: "S\u0142awomir Radzymi\u0144ski",
@@ -62670,6 +62677,7 @@ async function main() {
62670
62677
  enable: { type: "boolean" },
62671
62678
  "dry-run": { type: "boolean" },
62672
62679
  yes: { type: "boolean" },
62680
+ yearly: { type: "boolean" },
62673
62681
  browser: { type: "boolean" },
62674
62682
  global: { type: "boolean" },
62675
62683
  wait: { type: "boolean" },
@@ -62764,6 +62772,9 @@ async function main() {
62764
62772
  "account invocations": [],
62765
62773
  "account budget": ["daily-invocations", "expected-revision"],
62766
62774
  "account settings": [],
62775
+ "account billing": [],
62776
+ "account upgrade": ["yearly"],
62777
+ "account billing-portal": [],
62767
62778
  "account configure": ["file", "expected-revision"],
62768
62779
  "account activity": ["before"],
62769
62780
  "heartbeat status": ["id"],
@@ -63050,7 +63061,9 @@ async function main() {
63050
63061
  const known = new Set(environments[0]?.monitors.map((m) => m.key));
63051
63062
  const unknown2 = (v.key ?? []).filter((k) => !known.has(k));
63052
63063
  if (unknown2.length)
63053
- usage2(`No monitor with key ${unknown2.join(", ")} in environment ${v.env}.`);
63064
+ usage2(
63065
+ `No monitor with key ${unknown2.join(", ")} in environment ${v.env}.`
63066
+ );
63054
63067
  const buildFailed = built.issues.some((i) => i.severity === "error");
63055
63068
  const local = v.verify && !buildFailed ? await verifyLocally({
63056
63069
  path: path2,
@@ -64304,9 +64317,12 @@ async function main() {
64304
64317
  body: parsed2.data
64305
64318
  });
64306
64319
  } else if (command === "deploy plan" || command === "deploy apply") {
64307
- if (!v.env) usage2("Provide --env with an environment name from waitcher.json.");
64320
+ if (!v.env)
64321
+ usage2("Provide --env with an environment name from waitcher.json.");
64308
64322
  if (v["based-on"] !== void 0 && v["based-on"] !== "none" && !/^[0-9a-f-]{36}$/.test(v["based-on"]))
64309
- usage2("--based-on takes the basedOn deploy ID from deploy plan, or none.");
64323
+ usage2(
64324
+ "--based-on takes the basedOn deploy ID from deploy plan, or none."
64325
+ );
64310
64326
  const { path: path2, config: config2 } = await readProjectConfig(v.file);
64311
64327
  const apply = command === "deploy apply";
64312
64328
  const smokeTimeout = integer2(v.timeout ?? "180", "timeout", 10, 900);
@@ -64401,15 +64417,14 @@ async function main() {
64401
64417
  file: path2,
64402
64418
  ...deployed,
64403
64419
  // Local warnings (RUNTIME_VERSION_OUTDATED) travel with the server's issues.
64404
- issues: [
64405
- ...built.issues,
64406
- ...deployed.issues
64407
- ],
64420
+ issues: [...built.issues, ...deployed.issues],
64408
64421
  builds: built.builds,
64409
64422
  ...v.verify ? { verify: local.runs } : {},
64410
64423
  ...v.smoke ? { smoke } : {},
64411
64424
  next: [
64412
- ...built.issues.length ? [`waitcher runtime install --file ${path2} upgrades the project runtime before the previous pins stop working`] : [],
64425
+ ...built.issues.length ? [
64426
+ `waitcher runtime install --file ${path2} upgrades the project runtime before the previous pins stop working`
64427
+ ] : [],
64413
64428
  ...deployNextSteps(deployed, {
64414
64429
  file: path2,
64415
64430
  env: v.env,
@@ -64425,7 +64440,9 @@ async function main() {
64425
64440
  else if (smoke.some((r) => r.status !== "passed")) exitCode = 4;
64426
64441
  } else if (command === "deploy rollback") {
64427
64442
  if (v["based-on"] !== void 0 && v["based-on"] !== "none" && !/^[0-9a-f-]{36}$/.test(v["based-on"]))
64428
- usage2("--based-on takes the basedOn deploy ID from a rollback plan, or none.");
64443
+ usage2(
64444
+ "--based-on takes the basedOn deploy ID from a rollback plan, or none."
64445
+ );
64429
64446
  const deployed = await api(`deploys/${id3(v.id)}/rollback`, {
64430
64447
  method: "POST",
64431
64448
  body: {
@@ -64437,7 +64454,13 @@ async function main() {
64437
64454
  result2 = {
64438
64455
  event: deployed.dryRun ? "planned" : deployed.applied ? "rolled_back" : "rejected",
64439
64456
  ...deployed,
64440
- next: deployed.ok ? deployed.dryRun ? [`waitcher deploy rollback --id ${v.id} --based-on ${deployed.basedOn ?? "none"}`] : ["The repository still holds the newer configuration; revert it there before the next deploy apply."] : ["Fix the issues (often a missing secret or a changed account limit) and plan the rollback again."]
64457
+ next: deployed.ok ? deployed.dryRun ? [
64458
+ `waitcher deploy rollback --id ${v.id} --based-on ${deployed.basedOn ?? "none"}`
64459
+ ] : [
64460
+ "The repository still holds the newer configuration; revert it there before the next deploy apply."
64461
+ ] : [
64462
+ "Fix the issues (often a missing secret or a changed account limit) and plan the rollback again."
64463
+ ]
64441
64464
  };
64442
64465
  if (!deployed.ok) exitCode = 2;
64443
64466
  } else if (command.startsWith("secret ")) {
@@ -64446,13 +64469,18 @@ async function main() {
64446
64469
  const { config: config2 } = await readProjectConfig(v.file);
64447
64470
  const project = config2?.project;
64448
64471
  if (typeof project !== "string")
64449
- usage2("waitcher.json needs a project name; run waitcher config validate.");
64472
+ usage2(
64473
+ "waitcher.json needs a project name; run waitcher config validate."
64474
+ );
64450
64475
  if (command === "secret list")
64451
64476
  result2 = await api(
64452
64477
  `secrets?project=${encodeURIComponent(project)}&environment=${encodeURIComponent(v.env)}`
64453
64478
  );
64454
64479
  else if (command === "secret delete") {
64455
- if (!v.yes) usage2("Pass --yes to delete this secret; scripts using it will fail.");
64480
+ if (!v.yes)
64481
+ usage2(
64482
+ "Pass --yes to delete this secret; scripts using it will fail."
64483
+ );
64456
64484
  result2 = await api("secrets", {
64457
64485
  method: "DELETE",
64458
64486
  body: { project, environment: v.env, name: v.name }
@@ -64621,7 +64649,24 @@ async function main() {
64621
64649
  } else if (command === "system diagnostics")
64622
64650
  result2 = await api("system/diagnostics");
64623
64651
  else if (command === "system plans") result2 = await api("system/plans");
64624
- else if (command === "system plan") {
64652
+ else if (command === "account billing") result2 = await api("billing");
64653
+ else if (command === "account upgrade" || command === "account billing-portal") {
64654
+ const { url: url3 } = await api(
64655
+ command === "account upgrade" ? "billing/checkout" : "billing/portal",
64656
+ {
64657
+ method: "POST",
64658
+ body: command === "account upgrade" && v.yearly ? { interval: "year" } : {}
64659
+ }
64660
+ );
64661
+ result2 = {
64662
+ event: command === "account upgrade" ? "checkout_created" : "portal_created",
64663
+ url: url3,
64664
+ next: [
64665
+ command === "account upgrade" ? "Open the URL in a browser and pay there; the plan changes when Stripe confirms the payment" : "Open the URL in a browser to change or cancel the subscription",
64666
+ "waitcher account billing"
64667
+ ]
64668
+ };
64669
+ } else if (command === "system plan") {
64625
64670
  const owner = String(v.owner ?? ""), plan = String(v.plan ?? "");
64626
64671
  if (!/^clerk:user_[A-Za-z0-9]{8,64}$/.test(owner))
64627
64672
  usage2("--owner must be an account owner like clerk:user_ID");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waitcher/cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Synthetic monitoring from your repository: deploy HTTP, certificate, heartbeat, API and browser monitors from waitcher.json.",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "Sławomir Radzymiński",