@vonpay/checkout-cli 0.13.0 → 0.14.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.
Files changed (113) hide show
  1. package/dist/index.js +2397 -12
  2. package/package.json +5 -3
  3. package/dist/app-info.d.ts +0 -5
  4. package/dist/app-info.d.ts.map +0 -1
  5. package/dist/app-info.js +0 -11
  6. package/dist/app-info.js.map +0 -1
  7. package/dist/client-factory.d.ts +0 -10
  8. package/dist/client-factory.d.ts.map +0 -1
  9. package/dist/client-factory.js +0 -31
  10. package/dist/client-factory.js.map +0 -1
  11. package/dist/commands/capabilities.d.ts +0 -22
  12. package/dist/commands/capabilities.d.ts.map +0 -1
  13. package/dist/commands/capabilities.js +0 -123
  14. package/dist/commands/capabilities.js.map +0 -1
  15. package/dist/commands/checkout.d.ts +0 -3
  16. package/dist/commands/checkout.d.ts.map +0 -1
  17. package/dist/commands/checkout.js +0 -39
  18. package/dist/commands/checkout.js.map +0 -1
  19. package/dist/commands/doctor.d.ts +0 -59
  20. package/dist/commands/doctor.d.ts.map +0 -1
  21. package/dist/commands/doctor.js +0 -366
  22. package/dist/commands/doctor.js.map +0 -1
  23. package/dist/commands/health.d.ts +0 -3
  24. package/dist/commands/health.d.ts.map +0 -1
  25. package/dist/commands/health.js +0 -52
  26. package/dist/commands/health.js.map +0 -1
  27. package/dist/commands/init.d.ts +0 -10
  28. package/dist/commands/init.d.ts.map +0 -1
  29. package/dist/commands/init.js +0 -112
  30. package/dist/commands/init.js.map +0 -1
  31. package/dist/commands/listen.d.ts +0 -19
  32. package/dist/commands/listen.d.ts.map +0 -1
  33. package/dist/commands/listen.js +0 -249
  34. package/dist/commands/listen.js.map +0 -1
  35. package/dist/commands/login.d.ts +0 -27
  36. package/dist/commands/login.d.ts.map +0 -1
  37. package/dist/commands/login.js +0 -75
  38. package/dist/commands/login.js.map +0 -1
  39. package/dist/commands/logout.d.ts +0 -3
  40. package/dist/commands/logout.d.ts.map +0 -1
  41. package/dist/commands/logout.js +0 -23
  42. package/dist/commands/logout.js.map +0 -1
  43. package/dist/commands/payment-intents.d.ts +0 -62
  44. package/dist/commands/payment-intents.d.ts.map +0 -1
  45. package/dist/commands/payment-intents.js +0 -271
  46. package/dist/commands/payment-intents.js.map +0 -1
  47. package/dist/commands/refunds.d.ts +0 -40
  48. package/dist/commands/refunds.d.ts.map +0 -1
  49. package/dist/commands/refunds.js +0 -142
  50. package/dist/commands/refunds.js.map +0 -1
  51. package/dist/commands/sessions.d.ts +0 -16
  52. package/dist/commands/sessions.d.ts.map +0 -1
  53. package/dist/commands/sessions.js +0 -152
  54. package/dist/commands/sessions.js.map +0 -1
  55. package/dist/commands/tokens.d.ts +0 -3
  56. package/dist/commands/tokens.d.ts.map +0 -1
  57. package/dist/commands/tokens.js +0 -89
  58. package/dist/commands/tokens.js.map +0 -1
  59. package/dist/commands/trigger.d.ts +0 -38
  60. package/dist/commands/trigger.d.ts.map +0 -1
  61. package/dist/commands/trigger.js +0 -246
  62. package/dist/commands/trigger.js.map +0 -1
  63. package/dist/config.d.ts +0 -22
  64. package/dist/config.d.ts.map +0 -1
  65. package/dist/config.js +0 -72
  66. package/dist/config.js.map +0 -1
  67. package/dist/index.d.ts +0 -3
  68. package/dist/index.d.ts.map +0 -1
  69. package/dist/index.js.map +0 -1
  70. package/dist/utils/errors.d.ts +0 -80
  71. package/dist/utils/errors.d.ts.map +0 -1
  72. package/dist/utils/errors.js +0 -179
  73. package/dist/utils/errors.js.map +0 -1
  74. package/dist/utils/forward-to.d.ts +0 -38
  75. package/dist/utils/forward-to.d.ts.map +0 -1
  76. package/dist/utils/forward-to.js +0 -92
  77. package/dist/utils/forward-to.js.map +0 -1
  78. package/dist/utils/json-errors.d.ts +0 -16
  79. package/dist/utils/json-errors.d.ts.map +0 -1
  80. package/dist/utils/json-errors.js +0 -41
  81. package/dist/utils/json-errors.js.map +0 -1
  82. package/dist/utils/listen-forward.d.ts +0 -49
  83. package/dist/utils/listen-forward.d.ts.map +0 -1
  84. package/dist/utils/listen-forward.js +0 -113
  85. package/dist/utils/listen-forward.js.map +0 -1
  86. package/dist/utils/listen-output.d.ts +0 -52
  87. package/dist/utils/listen-output.d.ts.map +0 -1
  88. package/dist/utils/listen-output.js +0 -85
  89. package/dist/utils/listen-output.js.map +0 -1
  90. package/dist/utils/live-key.d.ts +0 -22
  91. package/dist/utils/live-key.d.ts.map +0 -1
  92. package/dist/utils/live-key.js +0 -37
  93. package/dist/utils/live-key.js.map +0 -1
  94. package/dist/utils/metadata.d.ts +0 -2
  95. package/dist/utils/metadata.d.ts.map +0 -1
  96. package/dist/utils/metadata.js +0 -31
  97. package/dist/utils/metadata.js.map +0 -1
  98. package/dist/utils/sanitize.d.ts +0 -4
  99. package/dist/utils/sanitize.d.ts.map +0 -1
  100. package/dist/utils/sanitize.js +0 -18
  101. package/dist/utils/sanitize.js.map +0 -1
  102. package/dist/utils/spinner.d.ts +0 -15
  103. package/dist/utils/spinner.d.ts.map +0 -1
  104. package/dist/utils/spinner.js +0 -18
  105. package/dist/utils/spinner.js.map +0 -1
  106. package/dist/utils/sse-consumer.d.ts +0 -81
  107. package/dist/utils/sse-consumer.d.ts.map +0 -1
  108. package/dist/utils/sse-consumer.js +0 -172
  109. package/dist/utils/sse-consumer.js.map +0 -1
  110. package/dist/utils/sse-parser.d.ts +0 -63
  111. package/dist/utils/sse-parser.d.ts.map +0 -1
  112. package/dist/utils/sse-parser.js +0 -149
  113. package/dist/utils/sse-parser.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vonpay/checkout-cli",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Von Payments CLI — developer tools for checkout integration",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,8 +21,10 @@
21
21
  "ora": "^8.2.0"
22
22
  },
23
23
  "devDependencies": {
24
+ "tsup": "^8.3.0",
24
25
  "typescript": "^5.7.0",
25
- "vitest": "^3.2.7"
26
+ "vitest": "^3.2.7",
27
+ "@vonpay/sse-parser": "0.1.0"
26
28
  },
27
29
  "keywords": [
28
30
  "vonpay",
@@ -31,7 +33,7 @@
31
33
  "cli"
32
34
  ],
33
35
  "scripts": {
34
- "build": "tsc",
36
+ "build": "tsup",
35
37
  "typecheck": "tsc --noEmit",
36
38
  "test": "vitest run",
37
39
  "clean": "rm -rf dist"
@@ -1,5 +0,0 @@
1
- import type { AppInfo } from "@vonpay/checkout-node";
2
- export declare const CLI_APP_INFO: AppInfo;
3
- /** The CLI renders every error itself (handleError / --json); the SDK must not print a second copy. */
4
- export declare const SILENT_ERROR_REPORTER: () => void;
5
- //# sourceMappingURL=app-info.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app-info.d.ts","sourceRoot":"","sources":["../src/app-info.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAMrD,eAAO,MAAM,YAAY,EAAE,OAAsD,CAAC;AAElF,uGAAuG;AACvG,eAAO,MAAM,qBAAqB,QAAO,IAAU,CAAC"}
package/dist/app-info.js DELETED
@@ -1,11 +0,0 @@
1
- // Identifies this CLI in the User-Agent of every API call it makes (SDK `appInfo`, checkout-node
2
- // 3.2.0+), so CLI traffic is attributable in our request logs. The version is read from
3
- // package.json so it cannot drift from the published tag.
4
- import { readFileSync } from "node:fs";
5
- import { dirname, join } from "node:path";
6
- import { fileURLToPath } from "node:url";
7
- const pkg = JSON.parse(readFileSync(join(dirname(fileURLToPath(import.meta.url)), "..", "package.json"), "utf-8"));
8
- export const CLI_APP_INFO = { name: "vonpay-cli", version: pkg.version };
9
- /** The CLI renders every error itself (handleError / --json); the SDK must not print a second copy. */
10
- export const SILENT_ERROR_REPORTER = () => { };
11
- //# sourceMappingURL=app-info.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app-info.js","sourceRoot":"","sources":["../src/app-info.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,wFAAwF;AACxF,0DAA0D;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CACpE,CAAC;AAEzB,MAAM,CAAC,MAAM,YAAY,GAAY,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;AAElF,uGAAuG;AACvG,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAS,EAAE,GAAE,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- import { VonPayCheckout } from "@vonpay/checkout-node";
2
- export declare function getBaseUrl(): string | undefined;
3
- /**
4
- * Build a VonPayCheckout client honoring the user's saved API key and the
5
- * VONPAY_BASE_URL env var (or saved baseUrl). All CLI commands should call
6
- * this instead of `new VonPayCheckout(apiKey)` — the bare constructor
7
- * silently hits prod even when VONPAY_BASE_URL points at staging.
8
- */
9
- export declare function makeCheckoutClient(): VonPayCheckout;
10
- //# sourceMappingURL=client-factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-factory.d.ts","sourceRoot":"","sources":["../src/client-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,wBAAgB,UAAU,IAAI,MAAM,GAAG,SAAS,CAQ/C;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,cAAc,CAWnD"}
@@ -1,31 +0,0 @@
1
- import { VonPayCheckout } from "@vonpay/checkout-node";
2
- import { loadConfig, requireApiKey } from "./config.js";
3
- import { CLI_APP_INFO, SILENT_ERROR_REPORTER } from "./app-info.js";
4
- export function getBaseUrl() {
5
- // VONPAY_BASE_URL env var takes precedence (matches doctor.ts pattern).
6
- // Then ~/.vonpay/config.json. Unset → SDK uses its default (prod).
7
- const envBase = process.env.VONPAY_BASE_URL;
8
- if (envBase)
9
- return envBase;
10
- const config = loadConfig();
11
- return config.checkout?.baseUrl;
12
- }
13
- /**
14
- * Build a VonPayCheckout client honoring the user's saved API key and the
15
- * VONPAY_BASE_URL env var (or saved baseUrl). All CLI commands should call
16
- * this instead of `new VonPayCheckout(apiKey)` — the bare constructor
17
- * silently hits prod even when VONPAY_BASE_URL points at staging.
18
- */
19
- export function makeCheckoutClient() {
20
- const apiKey = requireApiKey();
21
- const baseUrl = getBaseUrl();
22
- return new VonPayCheckout({
23
- apiKey,
24
- ...(baseUrl ? { baseUrl } : {}),
25
- appInfo: CLI_APP_INFO,
26
- // The CLI prints every error itself (handleError / --json). Without this the SDK's fallback
27
- // reporter adds its own `[vonpay] …` line to stderr on EVERY API error, live key included.
28
- errorReporter: SILENT_ERROR_REPORTER,
29
- });
30
- }
31
- //# sourceMappingURL=client-factory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-factory.js","sourceRoot":"","sources":["../src/client-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEpE,MAAM,UAAU,UAAU;IACxB,wEAAwE;IACxE,mEAAmE;IACnE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IAC5C,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAE5B,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,OAAO,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC;AAClC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAC/B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,OAAO,IAAI,cAAc,CAAC;QACxB,MAAM;QACN,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,YAAY;QACrB,4FAA4F;QAC5F,2FAA2F;QAC3F,aAAa,EAAE,qBAAqB;KACrC,CAAC,CAAC;AACL,CAAC"}
@@ -1,22 +0,0 @@
1
- import { Command } from "commander";
2
- import type { Capabilities } from "@vonpay/checkout-node";
3
- declare function fmtBool(v: boolean): string;
4
- declare function fmtVoidPolicy(v: Capabilities["supportedOperations"]["voidAfterCapture"]): string;
5
- declare function fmtDisputeReporting(v: string): string;
6
- /**
7
- * `subscriptionBilling.enabled`: `null` / absent is UNKNOWN, never "no" —
8
- * the SDK already normalises toward that, and this keeps the CLI honest
9
- * against an older SDK that does not send the field at all.
10
- */
11
- declare function fmtSubscriptionBilling(v: boolean | null | undefined): string;
12
- declare function printCapabilities(caps: Capabilities): void;
13
- export declare function capabilitiesCommand(): Command;
14
- export declare const __testing__: {
15
- printCapabilities: typeof printCapabilities;
16
- fmtDisputeReporting: typeof fmtDisputeReporting;
17
- fmtSubscriptionBilling: typeof fmtSubscriptionBilling;
18
- fmtBool: typeof fmtBool;
19
- fmtVoidPolicy: typeof fmtVoidPolicy;
20
- };
21
- export {};
22
- //# sourceMappingURL=capabilities.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/commands/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAI1D,iBAAS,OAAO,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAEnC;AAED,iBAAS,aAAa,CACpB,CAAC,EAAE,YAAY,CAAC,qBAAqB,CAAC,CAAC,kBAAkB,CAAC,GACzD,MAAM,CAwBR;AAED,iBAAS,mBAAmB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAI9C;AAED;;;;GAIG;AACH,iBAAS,sBAAsB,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAIrE;AAED,iBAAS,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAqDnD;AAED,wBAAgB,mBAAmB,IAAI,OAAO,CAsB7C;AAED,eAAO,MAAM,WAAW;;;;;;CAMvB,CAAC"}
@@ -1,123 +0,0 @@
1
- import { Command } from "commander";
2
- import chalk from "chalk";
3
- import { startSpinner } from "../utils/spinner.js";
4
- import { makeCheckoutClient } from "../client-factory.js";
5
- import { handleError } from "../utils/errors.js";
6
- function fmtBool(v) {
7
- return v ? chalk.green("yes") : chalk.dim("no");
8
- }
9
- function fmtVoidPolicy(v) {
10
- // ⛔ THIS PRINTED THE WORD "undefined" TO MERCHANTS IN PRODUCTION.
11
- //
12
- // The switch was exhaustive over a union that named `"unsupported"`, but the
13
- // server has only ever sent `"not_supported"` — so no case matched, the
14
- // function fell off the end, and `vonpay capabilities` rendered
15
- // `void after capture: undefined` for every binder. Reproduced against the
16
- // shipped code on 2026-08-29. The union is corrected in
17
- // `checkout-node`'s `Capabilities` type in the same change.
18
- //
19
- // The `default` is deliberate and stays even though the union is now right:
20
- // an exhaustive switch over a WIRE value is only exhaustive if the type is
21
- // accurate, and this is the second time that assumption has been wrong here.
22
- // Showing the raw value beats showing nothing.
23
- switch (v) {
24
- case "supported":
25
- return chalk.green(v);
26
- case "rerouted_to_refund":
27
- return chalk.yellow(v);
28
- case "not_supported":
29
- return chalk.dim(v);
30
- default:
31
- return chalk.dim(String(v));
32
- }
33
- }
34
- function fmtDisputeReporting(v) {
35
- // Deliberately NOT fmtBool. "not_tracked" is not a missing feature, it is a
36
- // visibility gap the merchant has to act on, so it reads amber, not dim.
37
- return v === "tracked" ? chalk.green(v) : chalk.yellow(v);
38
- }
39
- /**
40
- * `subscriptionBilling.enabled`: `null` / absent is UNKNOWN, never "no" —
41
- * the SDK already normalises toward that, and this keeps the CLI honest
42
- * against an older SDK that does not send the field at all.
43
- */
44
- function fmtSubscriptionBilling(v) {
45
- if (v === true)
46
- return chalk.yellow("yes");
47
- if (v === false)
48
- return chalk.green("no");
49
- return chalk.yellow("unknown");
50
- }
51
- function printCapabilities(caps) {
52
- const ops = caps.supportedOperations;
53
- console.log(chalk.bold("Supported operations"));
54
- console.log(` auth/capture separation: ${fmtBool(ops.authCaptureSeparation)}`);
55
- console.log(` partial capture: ${fmtBool(ops.partialCapture)}`);
56
- console.log(` partial refund: ${fmtBool(ops.partialRefund)}`);
57
- console.log(` unreferenced refund: ${fmtBool(ops.unreferencedRefund)}`);
58
- console.log(` void after capture: ${fmtVoidPolicy(ops.voidAfterCapture)}`);
59
- console.log(` MIT: ${fmtBool(ops.mit)}`);
60
- console.log(` network tokens: ${fmtBool(ops.networkTokens)}`);
61
- console.log(` 3D Secure 2: ${fmtBool(ops.threeDSecure2)}`);
62
- console.log(` ACH: ${fmtBool(ops.ach)}`);
63
- console.log(` payouts API: ${fmtBool(ops.payoutsApi)}`);
64
- console.log(` dispute reporting: ${fmtDisputeReporting(ops.disputeReporting)}`);
65
- console.log();
66
- if (ops.disputeReporting !== "tracked") {
67
- // Not decoration. On this value a disputed payment keeps reading
68
- // `succeeded` in our API indefinitely, so a merchant who does not know
69
- // cannot know — the whole reason the field exists is to say so out loud.
70
- console.log(chalk.yellow(" ⚠ Chargebacks on this connection do NOT reach Von Payments.\n" +
71
- " A `succeeded` payment is not evidence it was never disputed.\n" +
72
- " Monitor and answer disputes in your processor's own dashboard —\n" +
73
- " they carry a deadline we cannot see or report."));
74
- console.log();
75
- }
76
- console.log(chalk.bold("Subscription billing"));
77
- console.log(` Von Pay renews for you: ${fmtSubscriptionBilling(caps.subscriptionBilling?.enabled)}`);
78
- if (caps.subscriptionBilling?.enabled !== false) {
79
- // Only a literal `false` means it is safe to run renewals from your own
80
- // system. `true` and unknown both mean Von Pay may also be charging these
81
- // customers, so a second biller would charge them twice.
82
- console.log(chalk.yellow(" ⚠ Do not run renewals from your own system while this is not \"no\":\n" +
83
- " Von Pay may be charging these customers' renewals itself, and both\n" +
84
- " would charge them. Check again at the moment you renew."));
85
- }
86
- console.log();
87
- console.log(chalk.bold("Settlement currencies"));
88
- console.log(` ${caps.settlementCurrencies.length ? caps.settlementCurrencies.join(", ") : chalk.dim("(none reported)")}`);
89
- console.log();
90
- console.log(chalk.bold("Rate limits"));
91
- console.log(` payment intents / minute: ${caps.rateLimits.paymentIntentsPerMinute}`);
92
- }
93
- export function capabilitiesCommand() {
94
- return new Command("capabilities")
95
- .description("Show what this merchant's binder supports")
96
- .option("--json", "Output raw JSON")
97
- .action(async (opts) => {
98
- const client = makeCheckoutClient();
99
- const spinner = startSpinner("Fetching capabilities...");
100
- try {
101
- const caps = await client.capabilities.get();
102
- spinner.stop();
103
- if (opts.json) {
104
- console.log(JSON.stringify(caps, null, 2));
105
- }
106
- else {
107
- printCapabilities(caps);
108
- }
109
- }
110
- catch (err) {
111
- spinner.stop();
112
- handleError(err);
113
- }
114
- });
115
- }
116
- export const __testing__ = {
117
- printCapabilities,
118
- fmtDisputeReporting,
119
- fmtSubscriptionBilling,
120
- fmtBool,
121
- fmtVoidPolicy,
122
- };
123
- //# sourceMappingURL=capabilities.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/commands/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,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AAO,CAAC,GAAG,CACT,+BAA+B,IAAI,CAAC,UAAU,CAAC,uBAAuB,EAAE,CACzE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,IAAI,OAAO,CAAC,cAAc,CAAC;SAC/B,WAAW,CAAC,2CAA2C,CAAC;SACxD,MAAM,CAAC,QAAQ,EAAE,iBAAiB,CAAC;SACnC,MAAM,CAAC,KAAK,EAAE,IAAwB,EAAE,EAAE;QACzC,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,YAAY,CAAC,0BAA0B,CAAC,CAAC;QAEzD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC;YAC7C,OAAO,CAAC,IAAI,EAAE,CAAC;YAEf,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;gBACd,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC7C,CAAC;iBAAM,CAAC;gBACN,iBAAiB,CAAC,IAAI,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,WAAW,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,iBAAiB;IACjB,mBAAmB;IACnB,sBAAsB;IACtB,OAAO;IACP,aAAa;CACd,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function registerCheckout(program: Command): void;
3
- //# sourceMappingURL=checkout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/commands/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0BvD"}
@@ -1,39 +0,0 @@
1
- import { loginCommand } from "./login.js";
2
- import { logoutCommand } from "./logout.js";
3
- import { initCommand } from "./init.js";
4
- import { sessionsCommand } from "./sessions.js";
5
- import { paymentIntentsCommand } from "./payment-intents.js";
6
- import { refundsCommand } from "./refunds.js";
7
- import { tokensCommand } from "./tokens.js";
8
- import { capabilitiesCommand } from "./capabilities.js";
9
- import { triggerCommand } from "./trigger.js";
10
- import { listenCommand } from "./listen.js";
11
- import { healthCommand } from "./health.js";
12
- import { doctorCommand } from "./doctor.js";
13
- import { setJsonErrors } from "../utils/json-errors.js";
14
- export function registerCheckout(program) {
15
- const checkout = program
16
- .command("checkout")
17
- .description("Checkout integration tools");
18
- // `--json` is a per-command option, so it is read here — once, from the
19
- // command that is about to run — rather than passed into every error path.
20
- // A parent's preAction hook runs before each subcommand's action. With
21
- // `--json`, every error that command reports (an API error, a network
22
- // failure, a missing key, the live-key refusal) is one JSON line on stderr.
23
- checkout.hook("preAction", (_checkout, actionCommand) => {
24
- setJsonErrors(actionCommand.opts().json === true);
25
- });
26
- checkout.addCommand(loginCommand());
27
- checkout.addCommand(logoutCommand());
28
- checkout.addCommand(initCommand());
29
- checkout.addCommand(sessionsCommand());
30
- checkout.addCommand(paymentIntentsCommand());
31
- checkout.addCommand(refundsCommand());
32
- checkout.addCommand(tokensCommand());
33
- checkout.addCommand(capabilitiesCommand());
34
- checkout.addCommand(triggerCommand());
35
- checkout.addCommand(listenCommand());
36
- checkout.addCommand(healthCommand());
37
- checkout.addCommand(doctorCommand());
38
- }
39
- //# sourceMappingURL=checkout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../src/commands/checkout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,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C,CAAC;IAC7C,QAAQ,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,CAAC;IACtC,QAAQ,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;IACrC,QAAQ,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,CAAC;IACtC,QAAQ,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;IACrC,QAAQ,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;IACrC,QAAQ,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;AACvC,CAAC"}
@@ -1,59 +0,0 @@
1
- import { Command } from "commander";
2
- interface DoctorReport {
3
- generatedAt: string;
4
- cli: {
5
- version: string;
6
- };
7
- runtime: {
8
- node: string;
9
- npm?: string;
10
- platform: string;
11
- arch: string;
12
- /** Working directory with the user's home prefix replaced by `~` to avoid leaking username when the bundle is pasted publicly. */
13
- cwd: string;
14
- };
15
- envVarsPresent: string[];
16
- configFile: {
17
- path: string;
18
- present: boolean;
19
- keyType?: string;
20
- };
21
- apiKeyPrefix?: string;
22
- apiKeyMode?: "test" | "live";
23
- health: {
24
- baseUrl: string;
25
- reachable: boolean;
26
- latencyMs?: number;
27
- status?: string;
28
- error?: string;
29
- };
30
- validateProbe?: {
31
- ok: boolean;
32
- warnings?: string[];
33
- error?: {
34
- code: string;
35
- status: number;
36
- nextAction: string;
37
- llmHint: string;
38
- };
39
- };
40
- hints: string[];
41
- }
42
- /** Replace the user's home-directory prefix with `~` so paths in the bundle don't leak username/filesystem layout when pasted publicly. */
43
- declare function redactHome(p: string): string;
44
- declare function maskPrefix(key: string | undefined): string | undefined;
45
- declare function keyMode(key: string | undefined): "test" | "live" | undefined;
46
- declare function gather(): Promise<DoctorReport>;
47
- declare function renderHuman(r: DoctorReport): string;
48
- declare function renderForLlm(r: DoctorReport): string;
49
- export declare const __test__: {
50
- maskPrefix: typeof maskPrefix;
51
- keyMode: typeof keyMode;
52
- redactHome: typeof redactHome;
53
- renderHuman: typeof renderHuman;
54
- renderForLlm: typeof renderForLlm;
55
- gather: typeof gather;
56
- };
57
- export declare function doctorCommand(): Command;
58
- export {};
59
- //# sourceMappingURL=doctor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4BpC,UAAU,YAAY;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACzB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,kIAAkI;QAClI,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,aAAa,CAAC,EAAE;QACd,EAAE,EAAE,OAAO,CAAC;QACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,KAAK,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,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