@garuhq/cli 0.10.0 → 0.11.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 +18 -0
- package/dist/index.cjs +24 -29
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to `@garuhq/cli` are documented in this file. Format:
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versioning: [SemVer](https://semver.org/).
|
|
5
5
|
|
|
6
|
+
## [0.11.0] — 2026-08-22
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
|
|
10
|
+
- **`garu webhooks events` now targets `/api/v1/webhook-events`, uuid-keyed.**
|
|
11
|
+
`get`, `retry`, and `resend` take a `<uuid>` positional argument instead of
|
|
12
|
+
a numeric id. `list` output now reports `count`/`totalCount`/`totalPages`
|
|
13
|
+
instead of a `page`/`total` counter, and every row/detail view prints the
|
|
14
|
+
event's `uuid`.
|
|
15
|
+
- **`@garuhq/node` bumped to `3.0.0`.** Breaking for `garu.webhookEvents.*`
|
|
16
|
+
(see that package's changelog).
|
|
17
|
+
|
|
18
|
+
### Breaking
|
|
19
|
+
|
|
20
|
+
- `garu webhooks events get <id>` / `retry <id>` / `resend <id>` now expect
|
|
21
|
+
a `uuid`, not a numeric id. Run `garu webhooks events list` to read the
|
|
22
|
+
`uuid` of the event you want to act on.
|
|
23
|
+
|
|
6
24
|
## [0.10.0] — 2026-08-22
|
|
7
25
|
|
|
8
26
|
### Added
|
package/dist/index.cjs
CHANGED
|
@@ -15,7 +15,7 @@ var pc__default = /*#__PURE__*/_interopDefault(pc);
|
|
|
15
15
|
// src/index.ts
|
|
16
16
|
|
|
17
17
|
// src/version.ts
|
|
18
|
-
var CLI_VERSION = "0.
|
|
18
|
+
var CLI_VERSION = "0.11.0";
|
|
19
19
|
var CliError = class extends Error {
|
|
20
20
|
code;
|
|
21
21
|
exitCode;
|
|
@@ -1292,20 +1292,20 @@ async function webhooksEventsListCommand(opts) {
|
|
|
1292
1292
|
}
|
|
1293
1293
|
async function webhooksEventsGetCommand(opts) {
|
|
1294
1294
|
const garu = await getClient7(opts);
|
|
1295
|
-
const event = await garu.webhookEvents.get(opts.
|
|
1295
|
+
const event = await garu.webhookEvents.get(opts.uuid);
|
|
1296
1296
|
printResult(event, { ...opts, prettyPrint: prettyWebhookEvent });
|
|
1297
1297
|
return event;
|
|
1298
1298
|
}
|
|
1299
1299
|
async function webhooksEventsRetryCommand(opts) {
|
|
1300
1300
|
const garu = await getClient7(opts);
|
|
1301
|
-
const event = await garu.webhookEvents.retry(opts.
|
|
1301
|
+
const event = await garu.webhookEvents.retry(opts.uuid);
|
|
1302
1302
|
printResult(event, { ...opts, prettyPrint: prettyWebhookEvent });
|
|
1303
1303
|
return event;
|
|
1304
1304
|
}
|
|
1305
1305
|
async function webhooksEventsResendCommand(opts) {
|
|
1306
1306
|
const garu = await getClient7(opts);
|
|
1307
|
-
const clone = await garu.webhookEvents.resend(opts.
|
|
1308
|
-
printSuccess(`Resent event ${opts.
|
|
1307
|
+
const clone = await garu.webhookEvents.resend(opts.uuid);
|
|
1308
|
+
printSuccess(`Resent event ${opts.uuid} \u2192 new event ${clone.uuid}`, opts);
|
|
1309
1309
|
printResult(clone, { ...opts, prettyPrint: prettyWebhookEvent });
|
|
1310
1310
|
return clone;
|
|
1311
1311
|
}
|
|
@@ -1316,18 +1316,16 @@ function statusBadge(status) {
|
|
|
1316
1316
|
return pc__default.default.yellow(padded);
|
|
1317
1317
|
}
|
|
1318
1318
|
function prettyWebhookEventList(list) {
|
|
1319
|
-
if (list.data.length === 0)
|
|
1320
|
-
|
|
1321
|
-
}
|
|
1322
|
-
const header = `Webhook events (page ${list.meta.page}/${list.meta.totalPages || "?"}, ${list.meta.total} total)`;
|
|
1319
|
+
if (list.data.length === 0) return "No webhook events found";
|
|
1320
|
+
const header = `Webhook events (${list.count} of ${list.totalCount} total, ${list.totalPages} page(s))`;
|
|
1323
1321
|
const rows = list.data.map(
|
|
1324
|
-
(e) => ` ${
|
|
1322
|
+
(e) => ` ${e.uuid} ${statusBadge(e.status)} attempts=${String(e.attempts).padStart(2)} ${e.eventType.padEnd(38)} ${e.createdAt}`
|
|
1325
1323
|
);
|
|
1326
1324
|
return [header, ...rows].join("\n");
|
|
1327
1325
|
}
|
|
1328
1326
|
function prettyWebhookEvent(event) {
|
|
1329
1327
|
const lines = [
|
|
1330
|
-
`Webhook event ${event.
|
|
1328
|
+
`Webhook event ${event.uuid}`,
|
|
1331
1329
|
` status: ${statusBadge(event.status)}`,
|
|
1332
1330
|
` eventType: ${event.eventType}`,
|
|
1333
1331
|
` attempts: ${event.attempts}`,
|
|
@@ -1639,30 +1637,27 @@ Recipes:
|
|
|
1639
1637
|
}).catch((err) => printErrorAndExit(err, base));
|
|
1640
1638
|
}
|
|
1641
1639
|
);
|
|
1642
|
-
events.command("get <
|
|
1640
|
+
events.command("get <uuid>").description("Fetch a single webhook event by uuid").action(async (uuid) => {
|
|
1643
1641
|
const base = toCommandOptions(program);
|
|
1644
|
-
await webhooksEventsGetCommand({
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
}).catch((err) => printErrorAndExit(err, base));
|
|
1642
|
+
await webhooksEventsGetCommand({ ...base, uuid }).catch(
|
|
1643
|
+
(err) => printErrorAndExit(err, base)
|
|
1644
|
+
);
|
|
1648
1645
|
});
|
|
1649
|
-
events.command("retry <
|
|
1646
|
+
events.command("retry <uuid>").description(
|
|
1650
1647
|
"[deprecated: prefer `resend`] Re-deliver a webhook event in place (resets the original row to pending and triggers an immediate attempt; destroys the prior failure record)"
|
|
1651
|
-
).action(async (
|
|
1648
|
+
).action(async (uuid) => {
|
|
1652
1649
|
const base = toCommandOptions(program);
|
|
1653
|
-
await webhooksEventsRetryCommand({
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
}).catch((err) => printErrorAndExit(err, base));
|
|
1650
|
+
await webhooksEventsRetryCommand({ ...base, uuid }).catch(
|
|
1651
|
+
(err) => printErrorAndExit(err, base)
|
|
1652
|
+
);
|
|
1657
1653
|
});
|
|
1658
|
-
events.command("resend <
|
|
1659
|
-
"Re-deliver a webhook event by cloning it (audit-trail preserving: original row is untouched, clone gets a new
|
|
1660
|
-
).action(async (
|
|
1654
|
+
events.command("resend <uuid>").description(
|
|
1655
|
+
"Re-deliver a webhook event by cloning it (audit-trail preserving: original row is untouched, clone gets a new uuid and points back via manualResendOf)"
|
|
1656
|
+
).action(async (uuid) => {
|
|
1661
1657
|
const base = toCommandOptions(program);
|
|
1662
|
-
await webhooksEventsResendCommand({
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
}).catch((err) => printErrorAndExit(err, base));
|
|
1658
|
+
await webhooksEventsResendCommand({ ...base, uuid }).catch(
|
|
1659
|
+
(err) => printErrorAndExit(err, base)
|
|
1660
|
+
);
|
|
1666
1661
|
});
|
|
1667
1662
|
const customers = program.command("customers").description("Manage your customer base");
|
|
1668
1663
|
customers.command("create").description("Register a customer for the current seller (dedup by document)").requiredOption("--name <name>", "customer name").requiredOption("--email <email>", "customer email").requiredOption("--document <document>", "CPF (11 digits) or CNPJ (14 digits), digits only").requiredOption("--phone <phone>", "phone with area code, 10-11 digits").requiredOption("--person-type <type>", "'fisica' or 'juridica'").option("--zip-code <cep>", "ZIP code, 8 digits").option("--street <street>", "street address").option("--number <number>", "address number").option("--complement <text>", "address complement").option("--neighborhood <text>", "neighborhood").option("--city <city>", "city").option("--state <uf>", "2-letter state code, e.g. SP").action(async (cmdOpts) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@garuhq/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Official command-line interface for the Garu payment gateway.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://garu.com.br",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"prepublishOnly": "npm run check:version-sync && npm run typecheck && npm test && npm run build"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@garuhq/node": "
|
|
49
|
+
"@garuhq/node": "3.0.0",
|
|
50
50
|
"@inquirer/prompts": "8.4.1",
|
|
51
51
|
"commander": "12.0.0",
|
|
52
52
|
"picocolors": "1.0.0",
|