@waitcher/cli 0.2.3 → 0.2.4

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 +55 -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 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.4",
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",
@@ -62764,6 +62771,9 @@ async function main() {
62764
62771
  "account invocations": [],
62765
62772
  "account budget": ["daily-invocations", "expected-revision"],
62766
62773
  "account settings": [],
62774
+ "account billing": [],
62775
+ "account upgrade": [],
62776
+ "account billing-portal": [],
62767
62777
  "account configure": ["file", "expected-revision"],
62768
62778
  "account activity": ["before"],
62769
62779
  "heartbeat status": ["id"],
@@ -63050,7 +63060,9 @@ async function main() {
63050
63060
  const known = new Set(environments[0]?.monitors.map((m) => m.key));
63051
63061
  const unknown2 = (v.key ?? []).filter((k) => !known.has(k));
63052
63062
  if (unknown2.length)
63053
- usage2(`No monitor with key ${unknown2.join(", ")} in environment ${v.env}.`);
63063
+ usage2(
63064
+ `No monitor with key ${unknown2.join(", ")} in environment ${v.env}.`
63065
+ );
63054
63066
  const buildFailed = built.issues.some((i) => i.severity === "error");
63055
63067
  const local = v.verify && !buildFailed ? await verifyLocally({
63056
63068
  path: path2,
@@ -64304,9 +64316,12 @@ async function main() {
64304
64316
  body: parsed2.data
64305
64317
  });
64306
64318
  } else if (command === "deploy plan" || command === "deploy apply") {
64307
- if (!v.env) usage2("Provide --env with an environment name from waitcher.json.");
64319
+ if (!v.env)
64320
+ usage2("Provide --env with an environment name from waitcher.json.");
64308
64321
  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.");
64322
+ usage2(
64323
+ "--based-on takes the basedOn deploy ID from deploy plan, or none."
64324
+ );
64310
64325
  const { path: path2, config: config2 } = await readProjectConfig(v.file);
64311
64326
  const apply = command === "deploy apply";
64312
64327
  const smokeTimeout = integer2(v.timeout ?? "180", "timeout", 10, 900);
@@ -64401,15 +64416,14 @@ async function main() {
64401
64416
  file: path2,
64402
64417
  ...deployed,
64403
64418
  // Local warnings (RUNTIME_VERSION_OUTDATED) travel with the server's issues.
64404
- issues: [
64405
- ...built.issues,
64406
- ...deployed.issues
64407
- ],
64419
+ issues: [...built.issues, ...deployed.issues],
64408
64420
  builds: built.builds,
64409
64421
  ...v.verify ? { verify: local.runs } : {},
64410
64422
  ...v.smoke ? { smoke } : {},
64411
64423
  next: [
64412
- ...built.issues.length ? [`waitcher runtime install --file ${path2} upgrades the project runtime before the previous pins stop working`] : [],
64424
+ ...built.issues.length ? [
64425
+ `waitcher runtime install --file ${path2} upgrades the project runtime before the previous pins stop working`
64426
+ ] : [],
64413
64427
  ...deployNextSteps(deployed, {
64414
64428
  file: path2,
64415
64429
  env: v.env,
@@ -64425,7 +64439,9 @@ async function main() {
64425
64439
  else if (smoke.some((r) => r.status !== "passed")) exitCode = 4;
64426
64440
  } else if (command === "deploy rollback") {
64427
64441
  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.");
64442
+ usage2(
64443
+ "--based-on takes the basedOn deploy ID from a rollback plan, or none."
64444
+ );
64429
64445
  const deployed = await api(`deploys/${id3(v.id)}/rollback`, {
64430
64446
  method: "POST",
64431
64447
  body: {
@@ -64437,7 +64453,13 @@ async function main() {
64437
64453
  result2 = {
64438
64454
  event: deployed.dryRun ? "planned" : deployed.applied ? "rolled_back" : "rejected",
64439
64455
  ...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."]
64456
+ next: deployed.ok ? deployed.dryRun ? [
64457
+ `waitcher deploy rollback --id ${v.id} --based-on ${deployed.basedOn ?? "none"}`
64458
+ ] : [
64459
+ "The repository still holds the newer configuration; revert it there before the next deploy apply."
64460
+ ] : [
64461
+ "Fix the issues (often a missing secret or a changed account limit) and plan the rollback again."
64462
+ ]
64441
64463
  };
64442
64464
  if (!deployed.ok) exitCode = 2;
64443
64465
  } else if (command.startsWith("secret ")) {
@@ -64446,13 +64468,18 @@ async function main() {
64446
64468
  const { config: config2 } = await readProjectConfig(v.file);
64447
64469
  const project = config2?.project;
64448
64470
  if (typeof project !== "string")
64449
- usage2("waitcher.json needs a project name; run waitcher config validate.");
64471
+ usage2(
64472
+ "waitcher.json needs a project name; run waitcher config validate."
64473
+ );
64450
64474
  if (command === "secret list")
64451
64475
  result2 = await api(
64452
64476
  `secrets?project=${encodeURIComponent(project)}&environment=${encodeURIComponent(v.env)}`
64453
64477
  );
64454
64478
  else if (command === "secret delete") {
64455
- if (!v.yes) usage2("Pass --yes to delete this secret; scripts using it will fail.");
64479
+ if (!v.yes)
64480
+ usage2(
64481
+ "Pass --yes to delete this secret; scripts using it will fail."
64482
+ );
64456
64483
  result2 = await api("secrets", {
64457
64484
  method: "DELETE",
64458
64485
  body: { project, environment: v.env, name: v.name }
@@ -64621,7 +64648,21 @@ async function main() {
64621
64648
  } else if (command === "system diagnostics")
64622
64649
  result2 = await api("system/diagnostics");
64623
64650
  else if (command === "system plans") result2 = await api("system/plans");
64624
- else if (command === "system plan") {
64651
+ else if (command === "account billing") result2 = await api("billing");
64652
+ else if (command === "account upgrade" || command === "account billing-portal") {
64653
+ const { url: url3 } = await api(
64654
+ command === "account upgrade" ? "billing/checkout" : "billing/portal",
64655
+ { method: "POST", body: {} }
64656
+ );
64657
+ result2 = {
64658
+ event: command === "account upgrade" ? "checkout_created" : "portal_created",
64659
+ url: url3,
64660
+ next: [
64661
+ 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",
64662
+ "waitcher account billing"
64663
+ ]
64664
+ };
64665
+ } else if (command === "system plan") {
64625
64666
  const owner = String(v.owner ?? ""), plan = String(v.plan ?? "");
64626
64667
  if (!/^clerk:user_[A-Za-z0-9]{8,64}$/.test(owner))
64627
64668
  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.4",
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",