@hisaabo/cli 0.8.6 → 0.10.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/README.md +154 -4
- package/dist/bin/{audit-trail-IJ6SKACR.js → audit-trail-RTPTWZAL.js} +12 -15
- package/dist/bin/{categories-O6TODPAH.js → categories-JJDTOT5T.js} +3 -3
- package/dist/bin/{check-slug-P7RFU6OP.js → check-slug-5L2VDAEN.js} +16 -4
- package/dist/bin/chunk-2DDIXPNI.js +1512 -0
- package/dist/bin/chunk-ALOHN6GR.js +78 -0
- package/dist/bin/{chunk-QUITS2FE.js → chunk-ESX7V56A.js} +95 -20
- package/dist/bin/chunk-M7DVLVD5.js +245 -0
- package/dist/bin/{chunk-WDN7RIE3.js → chunk-VXEEFNIY.js} +133 -47
- package/dist/bin/client-NFYNYEDI.js +17 -0
- package/dist/bin/{collection-efficiency-DA5RWG3V.js → collection-efficiency-UF3AJPQB.js} +12 -56
- package/dist/bin/{config-4LLNT4SH.js → config-7HVBRHL3.js} +2 -2
- package/dist/bin/{create-C5INBPQO.js → create-2BZQLXQA.js} +18 -9
- package/dist/bin/{default-account-2GMQ7ZA4.js → default-account-MR6O5LPT.js} +7 -13
- package/dist/bin/{expenses-S2YVA5UT.js → expenses-CU6JGDVX.js} +12 -11
- package/dist/bin/{export-YOOODNVX.js → export-GFYQIQLT.js} +9 -24
- package/dist/bin/{export-ZA43MLWO.js → export-WS24LYNH.js} +47 -14
- package/dist/bin/{factory-6MUCSXTL.js → factory-JSEQCPY3.js} +51 -57
- package/dist/bin/{get-GMQRROK2.js → get-HGMB7T6Y.js} +5 -4
- package/dist/bin/{get-ZV3SC2VY.js → get-KAOGGRJR.js} +4 -4
- package/dist/bin/hisaabo.js +2024 -837
- package/dist/bin/{import-UUHMLCKX.js → import-6CEMNCTM.js} +30 -33
- package/dist/bin/{invitations-OVORTTMF.js → invitations-LASABD2X.js} +11 -14
- package/dist/bin/{invite-GGHBZY4U.js → invite-VCBXS7VY.js} +13 -15
- package/dist/bin/{invoice-breakdown-32XXAZDP.js → invoice-breakdown-3XXSYA77.js} +12 -37
- package/dist/bin/{items-6NOIMH6B.js → items-PJPN6ZX3.js} +11 -10
- package/dist/bin/{items-toggle-L6W6QKQD.js → items-toggle-53C35MJU.js} +6 -5
- package/dist/bin/{list-RAR56EMQ.js → list-63EKE6DT.js} +13 -16
- package/dist/bin/{list-OXAVDXH7.js → list-7OSZX6C7.js} +5 -5
- package/dist/bin/{list-FC5JHKHD.js → list-OOROCQR2.js} +11 -12
- package/dist/bin/{members-Y6XJVHHR.js → members-SPHU5F4M.js} +7 -7
- package/dist/bin/monthly-comparison-3FFJT63K.js +79 -0
- package/dist/bin/{order-cancel-QRTCNART.js → order-cancel-RW4NYHKN.js} +8 -18
- package/dist/bin/{order-confirm-LGQOMC4O.js → order-confirm-NXFL2EIQ.js} +7 -15
- package/dist/bin/{order-get-4XAQCRYV.js → order-get-QPSOY2RT.js} +11 -11
- package/dist/bin/{order-update-KZY4H2UR.js → order-update-7DWKEROO.js} +4 -4
- package/dist/bin/{output-NUOL7KJW.js → output-XFDIL3A6.js} +5 -1
- package/dist/bin/{payment-modes-DY2ZEMK7.js → payment-modes-Z5WV3E3O.js} +12 -27
- package/dist/bin/{profit-loss-5GJBG3PL.js → profit-loss-AOISAJ56.js} +14 -13
- package/dist/bin/{receivables-aging-6A7XJKDT.js → receivables-aging-5JHFECGB.js} +13 -66
- package/dist/bin/{remove-ZBX34TIQ.js → remove-TC4UWMOL.js} +7 -15
- package/dist/bin/{revoke-ZTAMW2Q2.js → revoke-QHLNPGI5.js} +7 -3
- package/dist/bin/{revoke-XDNOA2GJ.js → revoke-SXVNALYQ.js} +7 -15
- package/dist/bin/{revoke-all-365NRBOA.js → revoke-all-CYW6A5UE.js} +8 -4
- package/dist/bin/{revoke-invitation-PQH7XNYA.js → revoke-invitation-Z33EUJTS.js} +7 -3
- package/dist/bin/safety-TPD2P7I5.js +18 -0
- package/dist/bin/{sales-trend-D6PQ7MHY.js → sales-trend-WCW6X5BI.js} +16 -16
- package/dist/bin/sequence-HOQ4PQRK.js +56 -0
- package/dist/bin/{store-SVRZBUFO.js → store-DDMHTNTO.js} +15 -8
- package/dist/bin/{summary-H6U7O5GJ.js → summary-TYAL2D3Q.js} +7 -5
- package/dist/bin/{top-customers-ATBN6RDI.js → top-customers-GMIS6GC3.js} +13 -11
- package/dist/bin/{top-items-XXU6KYTC.js → top-items-BK54JO3G.js} +16 -14
- package/dist/bin/{top-outstanding-JTQNGGW4.js → top-outstanding-L4NRJ6NE.js} +9 -11
- package/dist/bin/{unpaid-invoices-BTNQFWCH.js → unpaid-invoices-CEUFEYH7.js} +8 -8
- package/dist/bin/{untracked-PAMEDJ6Y.js → untracked-T6DIDMDQ.js} +9 -9
- package/dist/bin/{update-EK4NJWU4.js → update-EPNB2U74.js} +4 -4
- package/dist/bin/{update-EGHPFXLK.js → update-I2DZRVLR.js} +10 -17
- package/dist/bin/{update-6ZMX2OYX.js → update-MFNOVS6D.js} +4 -4
- package/dist/bin/{update-role-24PDTNFK.js → update-role-D2ETEL2Q.js} +7 -4
- package/dist/bin/{update-settings-AASI6WZX.js → update-settings-UGXLQRYI.js} +15 -9
- package/package.json +8 -7
- package/dist/bin/chunk-NO4FIFMS.js +0 -176
- package/dist/bin/chunk-ZPYC767N.js +0 -157
- package/dist/bin/client-36JX5MR3.js +0 -11
- package/dist/bin/monthly-comparison-IAUZ6SBJ.js +0 -176
- package/dist/bin/sequence-KZWADVD7.js +0 -66
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
HisaaboApiError,
|
|
4
|
-
HisaaboClient
|
|
5
|
-
} from "./chunk-WDN7RIE3.js";
|
|
6
|
-
import {
|
|
7
|
-
requireAuth
|
|
8
|
-
} from "./chunk-QUITS2FE.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
|
-
};
|