@hisaabo/cli 0.1.0 → 0.4.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/.turbo/turbo-typecheck.log +1 -1
- package/README.md +332 -0
- package/dist/bin/audit-trail-5LOCJ7XZ.js +78 -0
- package/dist/bin/categories-64WWZTND.js +47 -0
- package/dist/bin/check-slug-FLHHUDYS.js +65 -0
- package/dist/bin/chunk-4MEL44QX.js +848 -0
- package/dist/bin/chunk-FIMJZAS4.js +84 -0
- package/dist/bin/chunk-NO4FIFMS.js +176 -0
- package/dist/bin/chunk-T63VQXNM.js +156 -0
- package/dist/bin/client-5NZ23GML.js +11 -0
- package/dist/bin/collection-efficiency-U56XNVEE.js +165 -0
- package/dist/bin/config-335MN4I7.js +18 -0
- package/dist/bin/create-RPDEORDD.js +83 -0
- package/dist/bin/default-account-AE6EXZZR.js +58 -0
- package/dist/bin/expenses-5N2QSG54.js +89 -0
- package/dist/bin/export-QICOQK34.js +59 -0
- package/dist/bin/factory-KOCW2AQM.js +483 -0
- package/dist/bin/get-A43QCI2S.js +66 -0
- package/dist/bin/get-GWH6S5SJ.js +71 -0
- package/dist/bin/hisaabo.js +2302 -1510
- package/dist/bin/invitations-P3EEN5WI.js +66 -0
- package/dist/bin/invite-T3CKX53E.js +53 -0
- package/dist/bin/invoice-breakdown-FN5BEFJD.js +97 -0
- package/dist/bin/items-2OOCQKVF.js +62 -0
- package/dist/bin/items-toggle-SKZWCGJH.js +46 -0
- package/dist/bin/list-A2RKI3ZG.js +79 -0
- package/dist/bin/list-NRMBMKMI.js +90 -0
- package/dist/bin/list-T74SN6IR.js +46 -0
- package/dist/bin/members-W2GW3ODT.js +55 -0
- package/dist/bin/monthly-comparison-T34ZFOHL.js +176 -0
- package/dist/bin/order-cancel-TI27JYYD.js +55 -0
- package/dist/bin/order-confirm-VMRAMNTD.js +53 -0
- package/dist/bin/order-get-C2RBUR4O.js +88 -0
- package/dist/bin/order-update-RE3HATNF.js +60 -0
- package/dist/bin/output-NUOL7KJW.js +35 -0
- package/dist/bin/payment-modes-WOOT22I7.js +126 -0
- package/dist/bin/profit-loss-T4RESJ32.js +135 -0
- package/dist/bin/receivables-aging-6XMENEWS.js +161 -0
- package/dist/bin/remove-6QZI4JCY.js +52 -0
- package/dist/bin/revoke-AVEMPAC7.js +40 -0
- package/dist/bin/revoke-YUCFZFNR.js +52 -0
- package/dist/bin/revoke-all-LFW5WBHO.js +33 -0
- package/dist/bin/revoke-invitation-DTGQRJR4.js +40 -0
- package/dist/bin/sales-trend-ZYBRUDUU.js +71 -0
- package/dist/bin/sequence-FPOJTI2P.js +66 -0
- package/dist/bin/store-IOB4Y67C.js +82 -0
- package/dist/bin/summary-5KYBA4ZO.js +113 -0
- package/dist/bin/top-customers-WSQ2UEJL.js +81 -0
- package/dist/bin/top-items-RWQPDGLN.js +84 -0
- package/dist/bin/top-outstanding-QAMO2E7Y.js +64 -0
- package/dist/bin/unpaid-invoices-WB3TK5B4.js +65 -0
- package/dist/bin/untracked-H733MYJL.js +67 -0
- package/dist/bin/update-H6LPO2Z4.js +61 -0
- package/dist/bin/update-JU2X3XU5.js +54 -0
- package/dist/bin/update-TLBUIC5J.js +57 -0
- package/dist/bin/update-role-QST7BVFX.js +45 -0
- package/dist/bin/update-settings-Q2EGRLKZ.js +56 -0
- package/package.json +7 -6
- package/src/auth.ts +12 -3
- package/src/bin/hisaabo.ts +49 -935
- package/src/bin/registrars/api-key.ts +44 -0
- package/src/bin/registrars/auth.ts +222 -0
- package/src/bin/registrars/automated-invoice.ts +167 -0
- package/src/bin/registrars/bank.ts +124 -0
- package/src/bin/registrars/business.ts +120 -0
- package/src/bin/registrars/dashboard.ts +225 -0
- package/src/bin/registrars/document.ts +184 -0
- package/src/bin/registrars/expense.ts +87 -0
- package/src/bin/registrars/gst.ts +41 -0
- package/src/bin/registrars/import.ts +49 -0
- package/src/bin/registrars/invoice.ts +117 -0
- package/src/bin/registrars/item.ts +112 -0
- package/src/bin/registrars/party.ts +81 -0
- package/src/bin/registrars/payment.ts +128 -0
- package/src/bin/registrars/report.ts +142 -0
- package/src/bin/registrars/session.ts +32 -0
- package/src/bin/registrars/shipment.ts +74 -0
- package/src/bin/registrars/store.ts +128 -0
- package/src/bin/registrars/target.ts +46 -0
- package/src/bin/registrars/tenant.ts +73 -0
- package/src/client.ts +589 -15
- package/src/commands/api-key/create.ts +72 -0
- package/src/commands/api-key/list.ts +71 -0
- package/src/commands/api-key/revoke.ts +46 -0
- package/src/commands/automated-invoice/create.ts +85 -0
- package/src/commands/automated-invoice/delete.ts +42 -0
- package/src/commands/automated-invoice/get.ts +113 -0
- package/src/commands/automated-invoice/history.ts +65 -0
- package/src/commands/automated-invoice/index.ts +11 -0
- package/src/commands/automated-invoice/list.ts +91 -0
- package/src/commands/automated-invoice/pause.ts +29 -0
- package/src/commands/automated-invoice/resume.ts +29 -0
- package/src/commands/automated-invoice/run-now.ts +29 -0
- package/src/commands/automated-invoice/suggestions.ts +68 -0
- package/src/commands/automated-invoice/update.ts +54 -0
- package/src/commands/automated-invoice/usage.ts +68 -0
- package/src/commands/bank/gateway-config.ts +61 -0
- package/src/commands/bank/update-gateway.ts +84 -0
- package/src/commands/business/audit-trail.ts +79 -0
- package/src/commands/business/export.ts +52 -0
- package/src/commands/business/get.ts +55 -0
- package/src/commands/business/sequence.ts +65 -0
- package/src/commands/business/update.ts +64 -0
- package/src/commands/dashboard/collection-efficiency.ts +164 -0
- package/src/commands/dashboard/expenses.ts +76 -0
- package/src/commands/dashboard/invoice-breakdown.ts +89 -0
- package/src/commands/dashboard/monthly-comparison.ts +193 -0
- package/src/commands/dashboard/payment-modes.ts +121 -0
- package/src/commands/dashboard/profit-loss.ts +146 -0
- package/src/commands/dashboard/receivables-aging.ts +169 -0
- package/src/commands/dashboard/sales-trend.ts +68 -0
- package/src/commands/dashboard/summary.ts +105 -0
- package/src/commands/dashboard/top-customers.ts +70 -0
- package/src/commands/dashboard/top-items.ts +74 -0
- package/src/commands/dashboard/top-outstanding.ts +61 -0
- package/src/commands/document/factory.ts +590 -0
- package/src/commands/expense/categories.ts +40 -0
- package/src/commands/expense/update.ts +58 -0
- package/src/commands/import/index.ts +68 -0
- package/src/commands/item/categories.ts +40 -0
- package/src/commands/item/low-stock-count.ts +32 -0
- package/src/commands/item/merge.ts +53 -0
- package/src/commands/item/price-history.ts +59 -0
- package/src/commands/item/rename-unit.ts +39 -0
- package/src/commands/item/sales-stats.ts +44 -0
- package/src/commands/item/stock-history.ts +70 -0
- package/src/commands/item/switch-base-unit.ts +42 -0
- package/src/commands/item/update.ts +59 -0
- package/src/commands/item/variants-create.ts +58 -0
- package/src/commands/item/variants-delete.ts +47 -0
- package/src/commands/item/variants-list.ts +63 -0
- package/src/commands/item/variants-update.ts +61 -0
- package/src/commands/party/ledger-report.ts +81 -0
- package/src/commands/party/merge.ts +50 -0
- package/src/commands/party/stats.ts +40 -0
- package/src/commands/party/top-items.ts +57 -0
- package/src/commands/party/update.ts +65 -0
- package/src/commands/payment/default-account.ts +56 -0
- package/src/commands/payment/get.ts +59 -0
- package/src/commands/payment/unpaid-invoices.ts +69 -0
- package/src/commands/payment/untracked.ts +70 -0
- package/src/commands/payment/update.ts +54 -0
- package/src/commands/report/index.ts +348 -1
- package/src/commands/session/list.ts +91 -0
- package/src/commands/session/revoke-all.ts +20 -0
- package/src/commands/session/revoke.ts +32 -0
- package/src/commands/store/check-slug.ts +48 -0
- package/src/commands/store/items-toggle.ts +41 -0
- package/src/commands/store/items.ts +61 -0
- package/src/commands/store/order-cancel.ts +48 -0
- package/src/commands/store/order-confirm.ts +45 -0
- package/src/commands/store/order-get.ts +66 -0
- package/src/commands/store/order-update.ts +52 -0
- package/src/commands/store/update-settings.ts +52 -0
- package/src/commands/tenant/invitations.ts +62 -0
- package/src/commands/tenant/invite.ts +57 -0
- package/src/commands/tenant/list.ts +46 -0
- package/src/commands/tenant/members.ts +55 -0
- package/src/commands/tenant/remove.ts +47 -0
- package/src/commands/tenant/revoke-invitation.ts +32 -0
- package/src/commands/tenant/update-role.ts +41 -0
- package/src/config.ts +51 -2
- package/src/error-handler.ts +53 -0
- package/src/output.ts +1 -0
- package/src/spinner.ts +39 -0
- package/tsup.config.ts +6 -1
- package/src/components/ErrorDisplay.tsx +0 -16
- package/src/components/Header.tsx +0 -26
- package/src/components/MoneyCell.tsx +0 -16
- package/src/components/Spinner.tsx +0 -12
- package/src/components/StatusBadge.tsx +0 -39
- package/src/components/Table.tsx +0 -63
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
formatDate,
|
|
4
|
+
formatINR,
|
|
5
|
+
fyStart,
|
|
6
|
+
monthEnd,
|
|
7
|
+
monthStart,
|
|
8
|
+
todayISO
|
|
9
|
+
} from "./chunk-T63VQXNM.js";
|
|
10
|
+
import {
|
|
11
|
+
HisaaboApiError,
|
|
12
|
+
HisaaboClient
|
|
13
|
+
} from "./chunk-4MEL44QX.js";
|
|
14
|
+
import {
|
|
15
|
+
requireAuth
|
|
16
|
+
} from "./chunk-FIMJZAS4.js";
|
|
17
|
+
import {
|
|
18
|
+
EXIT,
|
|
19
|
+
fatalError,
|
|
20
|
+
hasColor,
|
|
21
|
+
outputJSON,
|
|
22
|
+
termWidth
|
|
23
|
+
} from "./chunk-NO4FIFMS.js";
|
|
24
|
+
|
|
25
|
+
// src/commands/dashboard/profit-loss.ts
|
|
26
|
+
import chalk from "chalk";
|
|
27
|
+
function plLine(label, value, innerW, opts = {}) {
|
|
28
|
+
const indent = opts.indent ?? 0;
|
|
29
|
+
const indentStr = " ".repeat(indent * 2);
|
|
30
|
+
const fullLabel = indentStr + label;
|
|
31
|
+
const rightPad = 2;
|
|
32
|
+
const maxValueLen = 18;
|
|
33
|
+
const labelWidth = innerW - maxValueLen - rightPad;
|
|
34
|
+
const truncLabel = fullLabel.length > labelWidth ? fullLabel.slice(0, labelWidth - 1) + "\u2026" : fullLabel;
|
|
35
|
+
const paddedLabel = truncLabel.padEnd(labelWidth);
|
|
36
|
+
const paddedValue = value.padStart(maxValueLen - rightPad) + " ".repeat(rightPad);
|
|
37
|
+
let line = `\u2502 ${paddedLabel}${paddedValue}\u2502`;
|
|
38
|
+
if (!hasColor()) return line;
|
|
39
|
+
if (opts.bold) line = line.replace(paddedLabel, chalk.bold(truncLabel.padEnd(labelWidth)));
|
|
40
|
+
if (opts.dim) line = chalk.dim(line);
|
|
41
|
+
return line;
|
|
42
|
+
}
|
|
43
|
+
function plSeparator(innerW) {
|
|
44
|
+
const dashLen = 18;
|
|
45
|
+
const leftPad = innerW - dashLen;
|
|
46
|
+
const line = `\u2502 ${" ".repeat(leftPad - 1)}${"\u2500".repeat(dashLen)} \u2502`;
|
|
47
|
+
return hasColor() ? chalk.dim(line) : line;
|
|
48
|
+
}
|
|
49
|
+
function plBlank(innerW) {
|
|
50
|
+
return `\u2502 ${" ".repeat(innerW)} \u2502`;
|
|
51
|
+
}
|
|
52
|
+
function plBorder(innerW, char) {
|
|
53
|
+
const side = char === "\u250C" ? "\u2510" : "\u2518";
|
|
54
|
+
return char + "\u2500".repeat(innerW) + side;
|
|
55
|
+
}
|
|
56
|
+
function plTitle(title, innerW) {
|
|
57
|
+
const pad = Math.max(0, innerW - title.length - 2);
|
|
58
|
+
const line = `\u2502 ${hasColor() ? chalk.bold(title) : title}${" ".repeat(pad)} \u2502`;
|
|
59
|
+
return line;
|
|
60
|
+
}
|
|
61
|
+
function formatPL(amount) {
|
|
62
|
+
if (amount < 0) return `(${formatINR(Math.abs(amount))})`;
|
|
63
|
+
return formatINR(amount);
|
|
64
|
+
}
|
|
65
|
+
function colorPL(formatted, isProfit) {
|
|
66
|
+
if (!hasColor()) return formatted;
|
|
67
|
+
const num = parseFloat(formatted.replace(/[₹,()]/g, ""));
|
|
68
|
+
if (isNaN(num) || num === 0) return chalk.dim(formatted);
|
|
69
|
+
return isProfit ? chalk.green(formatted) : chalk.red(formatted);
|
|
70
|
+
}
|
|
71
|
+
async function dashboardProfitLossCommand(opts) {
|
|
72
|
+
const cfg = requireAuth();
|
|
73
|
+
const client = new HisaaboClient(cfg);
|
|
74
|
+
let fromDate = opts.from ?? fyStart();
|
|
75
|
+
let toDate = opts.to ?? todayISO();
|
|
76
|
+
if (opts.thisMonth) {
|
|
77
|
+
fromDate = monthStart();
|
|
78
|
+
toDate = monthEnd();
|
|
79
|
+
} else if (opts.thisFy) {
|
|
80
|
+
fromDate = fyStart();
|
|
81
|
+
toDate = todayISO();
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
const data = await client.dashboard.profitAndLoss({ fromDate, toDate });
|
|
85
|
+
if (opts.json) {
|
|
86
|
+
outputJSON(data);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const pl = data;
|
|
90
|
+
const revenue = parseFloat(String(pl["revenue"] ?? pl["totalRevenue"] ?? pl["sales"] ?? "0"));
|
|
91
|
+
const cogs = parseFloat(String(pl["cogs"] ?? pl["costOfGoodsSold"] ?? pl["purchases"] ?? "0"));
|
|
92
|
+
const grossProfit = parseFloat(String(pl["grossProfit"] ?? String(revenue - cogs)));
|
|
93
|
+
const opex = parseFloat(String(pl["operatingExpenses"] ?? pl["expenses"] ?? pl["totalExpenses"] ?? "0"));
|
|
94
|
+
const netProfit = parseFloat(String(pl["netProfit"] ?? pl["profit"] ?? String(grossProfit - opex)));
|
|
95
|
+
const grossMargin = revenue > 0 ? (grossProfit / revenue * 100).toFixed(1) + "%" : "-";
|
|
96
|
+
const netMargin = revenue > 0 ? (netProfit / revenue * 100).toFixed(1) + "%" : "-";
|
|
97
|
+
const width = Math.min(termWidth() - 2, 52);
|
|
98
|
+
const innerW = width - 2;
|
|
99
|
+
const lines = [];
|
|
100
|
+
lines.push(plBorder(innerW, "\u250C"));
|
|
101
|
+
lines.push(plTitle("PROFIT & LOSS STATEMENT", innerW));
|
|
102
|
+
lines.push(plTitle(`${formatDate(fromDate)} \u2013 ${formatDate(toDate)}`, innerW));
|
|
103
|
+
lines.push(`\u251C${"\u2500".repeat(innerW)}\u2524`);
|
|
104
|
+
lines.push(plBlank(innerW));
|
|
105
|
+
lines.push(plLine("Revenue", formatPL(revenue), innerW, { bold: true }));
|
|
106
|
+
lines.push(plLine("Cost of Goods Sold", formatPL(-cogs), innerW));
|
|
107
|
+
lines.push(plSeparator(innerW));
|
|
108
|
+
const gpFormatted = formatPL(grossProfit);
|
|
109
|
+
lines.push(plLine("Gross Profit", colorPL(gpFormatted, grossProfit >= 0), innerW, { bold: true }));
|
|
110
|
+
lines.push(plLine("Gross Margin", grossMargin, innerW, { dim: true }));
|
|
111
|
+
lines.push(plBlank(innerW));
|
|
112
|
+
lines.push(plLine("Operating Expenses", formatPL(-opex), innerW));
|
|
113
|
+
lines.push(plSeparator(innerW));
|
|
114
|
+
const npFormatted = formatPL(netProfit);
|
|
115
|
+
lines.push(plLine("Net Profit", colorPL(npFormatted, netProfit >= 0), innerW, { bold: true }));
|
|
116
|
+
lines.push(plLine("Net Margin", netMargin, innerW, { dim: true }));
|
|
117
|
+
lines.push(plBlank(innerW));
|
|
118
|
+
lines.push(plBorder(innerW, "\u2514"));
|
|
119
|
+
process.stdout.write("\n");
|
|
120
|
+
for (const l of lines) {
|
|
121
|
+
process.stdout.write(" " + l + "\n");
|
|
122
|
+
}
|
|
123
|
+
process.stdout.write("\n");
|
|
124
|
+
} catch (e) {
|
|
125
|
+
if (e instanceof HisaaboApiError) {
|
|
126
|
+
const err = e.hisaaboError;
|
|
127
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
128
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
129
|
+
}
|
|
130
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
export {
|
|
134
|
+
dashboardProfitLossCommand
|
|
135
|
+
};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
formatAmount
|
|
4
|
+
} from "./chunk-T63VQXNM.js";
|
|
5
|
+
import {
|
|
6
|
+
HisaaboApiError,
|
|
7
|
+
HisaaboClient
|
|
8
|
+
} from "./chunk-4MEL44QX.js";
|
|
9
|
+
import {
|
|
10
|
+
requireAuth
|
|
11
|
+
} from "./chunk-FIMJZAS4.js";
|
|
12
|
+
import {
|
|
13
|
+
EXIT,
|
|
14
|
+
fatalError,
|
|
15
|
+
hasColor,
|
|
16
|
+
outputCSV,
|
|
17
|
+
outputJSON,
|
|
18
|
+
outputTSV,
|
|
19
|
+
outputTable,
|
|
20
|
+
termWidth
|
|
21
|
+
} from "./chunk-NO4FIFMS.js";
|
|
22
|
+
|
|
23
|
+
// src/commands/dashboard/receivables-aging.ts
|
|
24
|
+
import chalk from "chalk";
|
|
25
|
+
function agingBar(amount, maxAmount, barWidth) {
|
|
26
|
+
if (maxAmount <= 0 || amount <= 0) return "";
|
|
27
|
+
const filled = Math.round(amount / maxAmount * barWidth);
|
|
28
|
+
return "\u2588".repeat(filled) + "\u2591".repeat(barWidth - filled);
|
|
29
|
+
}
|
|
30
|
+
async function dashboardReceivablesAgingCommand(opts) {
|
|
31
|
+
const cfg = requireAuth();
|
|
32
|
+
const client = new HisaaboClient(cfg);
|
|
33
|
+
try {
|
|
34
|
+
const data = await client.dashboard.receivablesAging();
|
|
35
|
+
if (opts.json) {
|
|
36
|
+
outputJSON(data);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const BUCKETS = [
|
|
40
|
+
{ key: "current", label: "Current (not due)" },
|
|
41
|
+
{ key: "1_30", label: "1\u201330 days" },
|
|
42
|
+
{ key: "31_60", label: "31\u201360 days" },
|
|
43
|
+
{ key: "61_90", label: "61\u201390 days" },
|
|
44
|
+
{ key: "90_plus", label: "90+ days" }
|
|
45
|
+
];
|
|
46
|
+
let bucketData = [];
|
|
47
|
+
if (Array.isArray(data)) {
|
|
48
|
+
bucketData = data.map((r) => ({
|
|
49
|
+
bucket: String(r["bucket"] ?? r["range"] ?? r["label"] ?? "-"),
|
|
50
|
+
amount: parseFloat(String(r["amount"] ?? r["totalAmount"] ?? "0")),
|
|
51
|
+
count: parseInt(String(r["count"] ?? r["invoiceCount"] ?? "0"), 10)
|
|
52
|
+
}));
|
|
53
|
+
} else if (data && typeof data === "object") {
|
|
54
|
+
const obj = data;
|
|
55
|
+
for (const { key, label } of BUCKETS) {
|
|
56
|
+
const entry = obj[key] ?? obj[label];
|
|
57
|
+
if (entry != null) {
|
|
58
|
+
bucketData.push({
|
|
59
|
+
bucket: label,
|
|
60
|
+
amount: parseFloat(String(entry["amount"] ?? entry["totalAmount"] ?? "0")),
|
|
61
|
+
count: parseInt(String(entry["count"] ?? entry["invoiceCount"] ?? "0"), 10)
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (bucketData.length === 0) {
|
|
66
|
+
for (const { key, label } of BUCKETS) {
|
|
67
|
+
const val = obj[key];
|
|
68
|
+
if (val != null) {
|
|
69
|
+
bucketData.push({
|
|
70
|
+
bucket: label,
|
|
71
|
+
amount: parseFloat(String(val)),
|
|
72
|
+
count: 0
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (opts.format === "tsv" || opts.format === "csv") {
|
|
79
|
+
const rows = bucketData.map((r) => ({
|
|
80
|
+
bucket: r.bucket,
|
|
81
|
+
amount: formatAmount(r.amount),
|
|
82
|
+
count: String(r.count || "-")
|
|
83
|
+
}));
|
|
84
|
+
const columns = [
|
|
85
|
+
{ key: "bucket", header: "Aging Bucket", align: "left" },
|
|
86
|
+
{ key: "amount", header: "Amount \u20B9", align: "right" },
|
|
87
|
+
{ key: "count", header: "Invoices", align: "right" }
|
|
88
|
+
];
|
|
89
|
+
if (opts.format === "tsv") outputTSV(rows, columns);
|
|
90
|
+
else outputCSV(rows, columns);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const total = bucketData.reduce((s, r) => s + r.amount, 0);
|
|
94
|
+
const maxAmount = Math.max(...bucketData.map((r) => r.amount), 1);
|
|
95
|
+
const width = Math.min(termWidth() - 4, 60);
|
|
96
|
+
const innerW = width - 2;
|
|
97
|
+
process.stdout.write("\n");
|
|
98
|
+
if (hasColor()) {
|
|
99
|
+
process.stdout.write(" " + chalk.bold("Receivables Aging Report") + "\n\n");
|
|
100
|
+
} else {
|
|
101
|
+
process.stdout.write(" Receivables Aging Report\n\n");
|
|
102
|
+
}
|
|
103
|
+
process.stdout.write(" \u250C" + "\u2500".repeat(innerW) + "\u2510\n");
|
|
104
|
+
const labelW = 22;
|
|
105
|
+
const amtW = 16;
|
|
106
|
+
const barW = Math.max(4, innerW - labelW - amtW - 5);
|
|
107
|
+
for (const row of bucketData) {
|
|
108
|
+
const pct = total > 0 ? (row.amount / total * 100).toFixed(1) : "0.0";
|
|
109
|
+
const label = row.bucket.padEnd(labelW).slice(0, labelW);
|
|
110
|
+
const amtStr = formatAmount(row.amount).padStart(amtW);
|
|
111
|
+
const bar = agingBar(row.amount, maxAmount, barW);
|
|
112
|
+
let coloredBar = bar;
|
|
113
|
+
let coloredLabel = label;
|
|
114
|
+
if (hasColor()) {
|
|
115
|
+
const idx = bucketData.indexOf(row);
|
|
116
|
+
const colors = [chalk.green, chalk.yellow, chalk.yellow, chalk.red, chalk.red];
|
|
117
|
+
const labelColors = [chalk.green, chalk.yellow, chalk.yellow, chalk.red, (s) => chalk.bold(chalk.red(s))];
|
|
118
|
+
const colorFn = colors[idx] ?? chalk.white;
|
|
119
|
+
const labelFn = labelColors[idx] ?? chalk.white;
|
|
120
|
+
coloredBar = colorFn(bar);
|
|
121
|
+
coloredLabel = labelFn(label);
|
|
122
|
+
}
|
|
123
|
+
const pctStr = `${pct}%`.padStart(6);
|
|
124
|
+
process.stdout.write(` \u2502 ${coloredLabel} ${coloredBar} ${amtStr} ${pctStr} \u2502
|
|
125
|
+
`);
|
|
126
|
+
}
|
|
127
|
+
process.stdout.write(" \u251C" + "\u2500".repeat(innerW) + "\u2524\n");
|
|
128
|
+
const totalLabel = "Total Receivables".padEnd(labelW);
|
|
129
|
+
const totalAmt = formatAmount(total).padStart(amtW);
|
|
130
|
+
const totalLine = ` \u2502 ${hasColor() ? chalk.bold(totalLabel) : totalLabel} ${" ".repeat(barW)} ${hasColor() ? chalk.bold(totalAmt) : totalAmt} \u2502`;
|
|
131
|
+
process.stdout.write(totalLine + "\n");
|
|
132
|
+
process.stdout.write(" \u2514" + "\u2500".repeat(innerW) + "\u2518\n\n");
|
|
133
|
+
if (bucketData.length === 0) {
|
|
134
|
+
process.stdout.write(" No receivables data available.\n\n");
|
|
135
|
+
}
|
|
136
|
+
if (bucketData.some((r) => r.count > 0)) {
|
|
137
|
+
const rows = bucketData.map((r) => ({
|
|
138
|
+
bucket: r.bucket,
|
|
139
|
+
amount: formatAmount(r.amount),
|
|
140
|
+
count: String(r.count)
|
|
141
|
+
}));
|
|
142
|
+
const columns = [
|
|
143
|
+
{ key: "bucket", header: "Aging Bucket", align: "left" },
|
|
144
|
+
{ key: "amount", header: "Amount \u20B9", align: "right" },
|
|
145
|
+
{ key: "count", header: "Invoices", align: "right" }
|
|
146
|
+
];
|
|
147
|
+
outputTable(rows, columns);
|
|
148
|
+
process.stdout.write("\n");
|
|
149
|
+
}
|
|
150
|
+
} catch (e) {
|
|
151
|
+
if (e instanceof HisaaboApiError) {
|
|
152
|
+
const err = e.hisaaboError;
|
|
153
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
154
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
155
|
+
}
|
|
156
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
export {
|
|
160
|
+
dashboardReceivablesAgingCommand
|
|
161
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
HisaaboApiError,
|
|
4
|
+
HisaaboClient
|
|
5
|
+
} from "./chunk-4MEL44QX.js";
|
|
6
|
+
import {
|
|
7
|
+
requireAuth
|
|
8
|
+
} from "./chunk-FIMJZAS4.js";
|
|
9
|
+
import {
|
|
10
|
+
EXIT,
|
|
11
|
+
fatalError,
|
|
12
|
+
outputJSON,
|
|
13
|
+
success
|
|
14
|
+
} from "./chunk-NO4FIFMS.js";
|
|
15
|
+
|
|
16
|
+
// src/commands/tenant/remove.ts
|
|
17
|
+
import * as readline from "readline";
|
|
18
|
+
async function tenantRemoveCommand(userId, opts) {
|
|
19
|
+
const cfg = requireAuth();
|
|
20
|
+
const client = new HisaaboClient(cfg);
|
|
21
|
+
try {
|
|
22
|
+
if (!opts.yes && process.stdin.isTTY) {
|
|
23
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
24
|
+
const answer = await new Promise((resolve) => {
|
|
25
|
+
rl.question(` Remove member ${userId} from the organization? (y/N): `, resolve);
|
|
26
|
+
});
|
|
27
|
+
rl.close();
|
|
28
|
+
if (answer.trim().toLowerCase() !== "y") {
|
|
29
|
+
console.log(" Cancelled.");
|
|
30
|
+
process.exit(0);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const result = await client.tenant.removeMember({ userId });
|
|
34
|
+
if (opts.json) {
|
|
35
|
+
outputJSON(result);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
success(`Removed member: ${userId}`);
|
|
39
|
+
} catch (e) {
|
|
40
|
+
if (e instanceof HisaaboApiError) {
|
|
41
|
+
const err = e.hisaaboError;
|
|
42
|
+
if (err.code === "not_found") fatalError(`Member not found: ${userId}`, EXIT.NOT_FOUND);
|
|
43
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
44
|
+
if (err.code === "forbidden") fatalError(err.message, EXIT.FORBIDDEN);
|
|
45
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
46
|
+
}
|
|
47
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
tenantRemoveCommand
|
|
52
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
HisaaboApiError,
|
|
4
|
+
HisaaboClient
|
|
5
|
+
} from "./chunk-4MEL44QX.js";
|
|
6
|
+
import {
|
|
7
|
+
requireAuth
|
|
8
|
+
} from "./chunk-FIMJZAS4.js";
|
|
9
|
+
import {
|
|
10
|
+
EXIT,
|
|
11
|
+
fatalError,
|
|
12
|
+
outputJSON,
|
|
13
|
+
success
|
|
14
|
+
} from "./chunk-NO4FIFMS.js";
|
|
15
|
+
|
|
16
|
+
// src/commands/session/revoke.ts
|
|
17
|
+
async function revokeSessionCommand(sessionId, opts) {
|
|
18
|
+
const cfg = requireAuth();
|
|
19
|
+
const client = new HisaaboClient(cfg);
|
|
20
|
+
try {
|
|
21
|
+
const result = await client.auth.revokeSession({ sessionId });
|
|
22
|
+
if (opts.json) {
|
|
23
|
+
outputJSON(result);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
success("Session revoked successfully.");
|
|
27
|
+
} catch (e) {
|
|
28
|
+
if (e instanceof HisaaboApiError) {
|
|
29
|
+
const err = e.hisaaboError;
|
|
30
|
+
if (err.code === "not_found") fatalError(`Session not found: ${sessionId}`, EXIT.NOT_FOUND);
|
|
31
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
32
|
+
if (err.code === "forbidden") fatalError(err.message, EXIT.FORBIDDEN);
|
|
33
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
34
|
+
}
|
|
35
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
revokeSessionCommand
|
|
40
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
HisaaboApiError,
|
|
4
|
+
HisaaboClient
|
|
5
|
+
} from "./chunk-4MEL44QX.js";
|
|
6
|
+
import {
|
|
7
|
+
requireAuth
|
|
8
|
+
} from "./chunk-FIMJZAS4.js";
|
|
9
|
+
import {
|
|
10
|
+
EXIT,
|
|
11
|
+
fatalError,
|
|
12
|
+
outputJSON,
|
|
13
|
+
success
|
|
14
|
+
} from "./chunk-NO4FIFMS.js";
|
|
15
|
+
|
|
16
|
+
// src/commands/api-key/revoke.ts
|
|
17
|
+
import * as readline from "readline";
|
|
18
|
+
async function apiKeyRevokeCommand(id, opts) {
|
|
19
|
+
const cfg = requireAuth();
|
|
20
|
+
const client = new HisaaboClient(cfg);
|
|
21
|
+
if (!opts.yes && process.stdin.isTTY) {
|
|
22
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
23
|
+
const answer = await new Promise((resolve) => {
|
|
24
|
+
rl.question(` Revoke API key ${id}? This cannot be undone. (y/N): `, resolve);
|
|
25
|
+
});
|
|
26
|
+
rl.close();
|
|
27
|
+
if (answer.trim().toLowerCase() !== "y") {
|
|
28
|
+
console.log(" Cancelled.");
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
const result = await client.apiKey.revoke({ id });
|
|
34
|
+
if (opts.json) {
|
|
35
|
+
outputJSON(result);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
success(`API key revoked: ${id}`);
|
|
39
|
+
} catch (e) {
|
|
40
|
+
if (e instanceof HisaaboApiError) {
|
|
41
|
+
const err = e.hisaaboError;
|
|
42
|
+
if (err.code === "not_found") fatalError(`API key not found: ${id}`, EXIT.NOT_FOUND);
|
|
43
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
44
|
+
if (err.code === "forbidden") fatalError(err.message, EXIT.FORBIDDEN);
|
|
45
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
46
|
+
}
|
|
47
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
apiKeyRevokeCommand
|
|
52
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
HisaaboApiError,
|
|
4
|
+
HisaaboClient
|
|
5
|
+
} from "./chunk-4MEL44QX.js";
|
|
6
|
+
import {
|
|
7
|
+
requireAuth
|
|
8
|
+
} from "./chunk-FIMJZAS4.js";
|
|
9
|
+
import {
|
|
10
|
+
EXIT,
|
|
11
|
+
fatalError,
|
|
12
|
+
success
|
|
13
|
+
} from "./chunk-NO4FIFMS.js";
|
|
14
|
+
|
|
15
|
+
// src/commands/session/revoke-all.ts
|
|
16
|
+
async function revokeAllSessionsCommand() {
|
|
17
|
+
const cfg = requireAuth();
|
|
18
|
+
const client = new HisaaboClient(cfg);
|
|
19
|
+
try {
|
|
20
|
+
await client.auth.logoutAll();
|
|
21
|
+
success("Signed out from all devices.");
|
|
22
|
+
} catch (e) {
|
|
23
|
+
if (e instanceof HisaaboApiError) {
|
|
24
|
+
const err = e.hisaaboError;
|
|
25
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
26
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
27
|
+
}
|
|
28
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
revokeAllSessionsCommand
|
|
33
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
HisaaboApiError,
|
|
4
|
+
HisaaboClient
|
|
5
|
+
} from "./chunk-4MEL44QX.js";
|
|
6
|
+
import {
|
|
7
|
+
requireAuth
|
|
8
|
+
} from "./chunk-FIMJZAS4.js";
|
|
9
|
+
import {
|
|
10
|
+
EXIT,
|
|
11
|
+
fatalError,
|
|
12
|
+
outputJSON,
|
|
13
|
+
success
|
|
14
|
+
} from "./chunk-NO4FIFMS.js";
|
|
15
|
+
|
|
16
|
+
// src/commands/tenant/revoke-invitation.ts
|
|
17
|
+
async function revokeInvitationCommand(invitationId, opts) {
|
|
18
|
+
const cfg = requireAuth();
|
|
19
|
+
const client = new HisaaboClient(cfg);
|
|
20
|
+
try {
|
|
21
|
+
const result = await client.tenant.revokeInvitation({ invitationId });
|
|
22
|
+
if (opts.json) {
|
|
23
|
+
outputJSON(result);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
success("Invitation revoked successfully.");
|
|
27
|
+
} catch (e) {
|
|
28
|
+
if (e instanceof HisaaboApiError) {
|
|
29
|
+
const err = e.hisaaboError;
|
|
30
|
+
if (err.code === "not_found") fatalError(`Invitation not found: ${invitationId}`, EXIT.NOT_FOUND);
|
|
31
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
32
|
+
if (err.code === "forbidden") fatalError(err.message, EXIT.FORBIDDEN);
|
|
33
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
34
|
+
}
|
|
35
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
revokeInvitationCommand
|
|
40
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
formatAmount
|
|
4
|
+
} from "./chunk-T63VQXNM.js";
|
|
5
|
+
import {
|
|
6
|
+
HisaaboApiError,
|
|
7
|
+
HisaaboClient
|
|
8
|
+
} from "./chunk-4MEL44QX.js";
|
|
9
|
+
import {
|
|
10
|
+
requireAuth
|
|
11
|
+
} from "./chunk-FIMJZAS4.js";
|
|
12
|
+
import {
|
|
13
|
+
EXIT,
|
|
14
|
+
fatalError,
|
|
15
|
+
hasColor,
|
|
16
|
+
outputCSV,
|
|
17
|
+
outputJSON,
|
|
18
|
+
outputTSV,
|
|
19
|
+
outputTable
|
|
20
|
+
} from "./chunk-NO4FIFMS.js";
|
|
21
|
+
|
|
22
|
+
// src/commands/dashboard/sales-trend.ts
|
|
23
|
+
import chalk from "chalk";
|
|
24
|
+
async function dashboardSalesTrendCommand(opts) {
|
|
25
|
+
const cfg = requireAuth();
|
|
26
|
+
const client = new HisaaboClient(cfg);
|
|
27
|
+
const input = {};
|
|
28
|
+
if (opts.months) input["months"] = opts.months;
|
|
29
|
+
if (opts.from) input["fromDate"] = opts.from;
|
|
30
|
+
if (opts.to) input["toDate"] = opts.to;
|
|
31
|
+
if (opts.granularity) input["granularity"] = opts.granularity;
|
|
32
|
+
try {
|
|
33
|
+
const data = await client.dashboard.salesTrend(input);
|
|
34
|
+
if (opts.json) {
|
|
35
|
+
outputJSON(data);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const rows = Array.isArray(data) ? data.map((r) => ({
|
|
39
|
+
period: String(r["period"] ?? r["month"] ?? "-"),
|
|
40
|
+
sales: formatAmount(String(r["sales"] ?? r["totalSales"] ?? "0")),
|
|
41
|
+
collections: formatAmount(String(r["collections"] ?? r["totalCollections"] ?? "0")),
|
|
42
|
+
invoices: String(r["invoices"] ?? r["invoiceCount"] ?? "0")
|
|
43
|
+
})) : [];
|
|
44
|
+
const columns = [
|
|
45
|
+
{ key: "period", header: "Period", align: "left" },
|
|
46
|
+
{ key: "sales", header: "Sales \u20B9", align: "right" },
|
|
47
|
+
{ key: "collections", header: "Collection \u20B9", align: "right" },
|
|
48
|
+
{ key: "invoices", header: "Invoices", align: "right" }
|
|
49
|
+
];
|
|
50
|
+
if (opts.format === "tsv") {
|
|
51
|
+
outputTSV(rows, columns);
|
|
52
|
+
} else if (opts.format === "csv") {
|
|
53
|
+
outputCSV(rows, columns);
|
|
54
|
+
} else {
|
|
55
|
+
if (hasColor()) process.stdout.write("\n" + chalk.bold(" Sales Trend\n") + "\n");
|
|
56
|
+
else process.stdout.write("\n Sales Trend\n\n");
|
|
57
|
+
outputTable(rows, columns);
|
|
58
|
+
process.stdout.write("\n");
|
|
59
|
+
}
|
|
60
|
+
} catch (e) {
|
|
61
|
+
if (e instanceof HisaaboApiError) {
|
|
62
|
+
const err = e.hisaaboError;
|
|
63
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
64
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
65
|
+
}
|
|
66
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
dashboardSalesTrendCommand
|
|
71
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
HisaaboApiError,
|
|
4
|
+
HisaaboClient
|
|
5
|
+
} from "./chunk-4MEL44QX.js";
|
|
6
|
+
import {
|
|
7
|
+
requireAuth
|
|
8
|
+
} from "./chunk-FIMJZAS4.js";
|
|
9
|
+
import {
|
|
10
|
+
EXIT,
|
|
11
|
+
fatalError,
|
|
12
|
+
outputJSON,
|
|
13
|
+
success
|
|
14
|
+
} from "./chunk-NO4FIFMS.js";
|
|
15
|
+
|
|
16
|
+
// src/commands/business/sequence.ts
|
|
17
|
+
async function businessSequenceCommand(opts) {
|
|
18
|
+
const cfg = requireAuth();
|
|
19
|
+
const client = new HisaaboClient(cfg);
|
|
20
|
+
if (!opts.type) {
|
|
21
|
+
fatalError("--type is required (sale or purchase).", EXIT.USAGE);
|
|
22
|
+
}
|
|
23
|
+
if (opts.type !== "sale" && opts.type !== "purchase") {
|
|
24
|
+
fatalError("--type must be 'sale' or 'purchase'.", EXIT.USAGE);
|
|
25
|
+
}
|
|
26
|
+
const payload = { type: opts.type };
|
|
27
|
+
if (opts.prefix !== void 0) payload["prefix"] = opts.prefix;
|
|
28
|
+
if (opts.nextNumber !== void 0) {
|
|
29
|
+
const n = parseInt(opts.nextNumber, 10);
|
|
30
|
+
if (isNaN(n) || n < 1) {
|
|
31
|
+
fatalError("--next-number must be a positive integer.", EXIT.USAGE);
|
|
32
|
+
}
|
|
33
|
+
payload["nextNumber"] = n;
|
|
34
|
+
}
|
|
35
|
+
if (Object.keys(payload).length === 1) {
|
|
36
|
+
fatalError("Pass at least one of --prefix or --next-number.", EXIT.USAGE);
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const result = await client.business.updateSequenceNumber(payload);
|
|
40
|
+
if (opts.json) {
|
|
41
|
+
outputJSON(result);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const typeLabel = opts.type === "sale" ? "Sales" : "Purchase";
|
|
45
|
+
const parts = [];
|
|
46
|
+
if (opts.prefix !== void 0) parts.push(`prefix \u2192 "${opts.prefix}"`);
|
|
47
|
+
if (opts.nextNumber !== void 0) parts.push(`next number \u2192 ${opts.nextNumber}`);
|
|
48
|
+
success(`${typeLabel} invoice sequence updated: ${parts.join(", ")}.`);
|
|
49
|
+
} catch (e) {
|
|
50
|
+
if (e instanceof HisaaboApiError) {
|
|
51
|
+
const err = e.hisaaboError;
|
|
52
|
+
if (err.code === "unauthorized") fatalError("Session expired. Run: hisaabo login", EXIT.AUTH);
|
|
53
|
+
if (err.code === "forbidden") fatalError(err.message, EXIT.FORBIDDEN);
|
|
54
|
+
if (err.code === "validation_failed") {
|
|
55
|
+
const msgs = Object.entries(err.fields).map(([f, ms]) => ` ${f}: ${ms.join(", ")}`).join("\n");
|
|
56
|
+
fatalError(`Validation failed:
|
|
57
|
+
${msgs}`, EXIT.VALIDATION);
|
|
58
|
+
}
|
|
59
|
+
if (err.code === "network_error") fatalError(err.message, EXIT.NETWORK);
|
|
60
|
+
}
|
|
61
|
+
fatalError(String(e instanceof Error ? e.message : e));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
businessSequenceCommand
|
|
66
|
+
};
|