@hisaabo/cli 0.7.5 → 0.8.6

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 (210) hide show
  1. package/LICENSE +31 -0
  2. package/README.md +9 -0
  3. package/dist/bin/{audit-trail-DLSSSM4T.js → audit-trail-IJ6SKACR.js} +2 -2
  4. package/dist/bin/{categories-63QR6WCV.js → categories-O6TODPAH.js} +2 -2
  5. package/dist/bin/{check-slug-NXO55WKH.js → check-slug-P7RFU6OP.js} +2 -2
  6. package/dist/bin/chunk-NO4FIFMS.js +0 -0
  7. package/dist/bin/{chunk-7MJDOL6B.js → chunk-QUITS2FE.js} +28 -0
  8. package/dist/bin/{chunk-M42SETRZ.js → chunk-WDN7RIE3.js} +23 -2
  9. package/dist/bin/chunk-ZPYC767N.js +0 -0
  10. package/dist/bin/{client-T32CIZA3.js → client-36JX5MR3.js} +1 -1
  11. package/dist/bin/{collection-efficiency-T6PWNTZO.js → collection-efficiency-DA5RWG3V.js} +2 -2
  12. package/dist/bin/{config-V4QFCONN.js → config-4LLNT4SH.js} +3 -1
  13. package/dist/bin/{create-NUKHDWLK.js → create-C5INBPQO.js} +2 -2
  14. package/dist/bin/{default-account-JWFPHMRF.js → default-account-2GMQ7ZA4.js} +2 -2
  15. package/dist/bin/{expenses-2UWUZVLI.js → expenses-S2YVA5UT.js} +2 -2
  16. package/dist/bin/{export-XSX7WQH7.js → export-YOOODNVX.js} +2 -2
  17. package/dist/bin/export-ZA43MLWO.js +191 -0
  18. package/dist/bin/{factory-BWOKRIP4.js → factory-6MUCSXTL.js} +2 -2
  19. package/dist/bin/{get-CHNTG3IM.js → get-GMQRROK2.js} +2 -2
  20. package/dist/bin/{get-ZSZ6SL3N.js → get-ZV3SC2VY.js} +2 -2
  21. package/dist/bin/hisaabo.js +100 -57
  22. package/dist/bin/import-UUHMLCKX.js +267 -0
  23. package/dist/bin/{invitations-H2SL3XAD.js → invitations-OVORTTMF.js} +2 -2
  24. package/dist/bin/{invite-EW73UIBE.js → invite-GGHBZY4U.js} +2 -2
  25. package/dist/bin/{invoice-breakdown-XP4QATCF.js → invoice-breakdown-32XXAZDP.js} +2 -2
  26. package/dist/bin/{items-DPD6EFTP.js → items-6NOIMH6B.js} +2 -2
  27. package/dist/bin/{items-toggle-R4OPSE4W.js → items-toggle-L6W6QKQD.js} +2 -2
  28. package/dist/bin/{list-PKHBE475.js → list-FC5JHKHD.js} +2 -2
  29. package/dist/bin/{list-KLEHBMQ2.js → list-OXAVDXH7.js} +2 -2
  30. package/dist/bin/{list-UR7OOJVF.js → list-RAR56EMQ.js} +2 -2
  31. package/dist/bin/{members-XA3TF4IQ.js → members-Y6XJVHHR.js} +2 -2
  32. package/dist/bin/{monthly-comparison-OLVS5HEY.js → monthly-comparison-IAUZ6SBJ.js} +2 -2
  33. package/dist/bin/{order-cancel-MXMJFFRR.js → order-cancel-QRTCNART.js} +2 -2
  34. package/dist/bin/{order-confirm-IXU45Q4L.js → order-confirm-LGQOMC4O.js} +2 -2
  35. package/dist/bin/{order-get-RDXMHLJ7.js → order-get-4XAQCRYV.js} +2 -2
  36. package/dist/bin/{order-update-KGIPBEJX.js → order-update-KZY4H2UR.js} +2 -2
  37. package/dist/bin/output-NUOL7KJW.js +0 -0
  38. package/dist/bin/{payment-modes-CZL35SVS.js → payment-modes-DY2ZEMK7.js} +2 -2
  39. package/dist/bin/{profit-loss-M332OSC5.js → profit-loss-5GJBG3PL.js} +2 -2
  40. package/dist/bin/{receivables-aging-OXRHGMBF.js → receivables-aging-6A7XJKDT.js} +2 -2
  41. package/dist/bin/{remove-I5HD2Y4K.js → remove-ZBX34TIQ.js} +2 -2
  42. package/dist/bin/{revoke-OC6AOMIZ.js → revoke-XDNOA2GJ.js} +2 -2
  43. package/dist/bin/{revoke-MFLWGCMP.js → revoke-ZTAMW2Q2.js} +2 -2
  44. package/dist/bin/{revoke-all-FSAPBB3P.js → revoke-all-365NRBOA.js} +2 -2
  45. package/dist/bin/{revoke-invitation-JXDPXTOW.js → revoke-invitation-PQH7XNYA.js} +2 -2
  46. package/dist/bin/{sales-trend-KK63WNDL.js → sales-trend-D6PQ7MHY.js} +2 -2
  47. package/dist/bin/{sequence-IQ4HUJ3W.js → sequence-KZWADVD7.js} +2 -2
  48. package/dist/bin/{store-6QT6HKG2.js → store-SVRZBUFO.js} +2 -2
  49. package/dist/bin/{summary-3FTF5B4A.js → summary-H6U7O5GJ.js} +2 -2
  50. package/dist/bin/{top-customers-HNYGXBQZ.js → top-customers-ATBN6RDI.js} +2 -2
  51. package/dist/bin/{top-items-JUDG3BVW.js → top-items-XXU6KYTC.js} +2 -2
  52. package/dist/bin/{top-outstanding-WK26ZNE5.js → top-outstanding-JTQNGGW4.js} +2 -2
  53. package/dist/bin/{unpaid-invoices-RYFIIIK7.js → unpaid-invoices-BTNQFWCH.js} +2 -2
  54. package/dist/bin/{untracked-FAFS3KCK.js → untracked-PAMEDJ6Y.js} +2 -2
  55. package/dist/bin/{update-5YSPXIWO.js → update-6ZMX2OYX.js} +2 -2
  56. package/dist/bin/{update-I46XLU77.js → update-EGHPFXLK.js} +2 -2
  57. package/dist/bin/{update-NAW2JWZS.js → update-EK4NJWU4.js} +2 -2
  58. package/dist/bin/{update-role-5GV42MSN.js → update-role-24PDTNFK.js} +2 -2
  59. package/dist/bin/{update-settings-KYSQDIEO.js → update-settings-AASI6WZX.js} +2 -2
  60. package/package.json +35 -9
  61. package/.turbo/turbo-build.log +0 -13
  62. package/.turbo/turbo-typecheck.log +0 -4
  63. package/CLI-UX-ARCHITECTURE.md +0 -1269
  64. package/src/auth.ts +0 -221
  65. package/src/bin/hisaabo.ts +0 -74
  66. package/src/bin/registrars/api-key.ts +0 -44
  67. package/src/bin/registrars/auth.ts +0 -222
  68. package/src/bin/registrars/automated-invoice.ts +0 -167
  69. package/src/bin/registrars/bank-recon.ts +0 -34
  70. package/src/bin/registrars/bank.ts +0 -124
  71. package/src/bin/registrars/business.ts +0 -120
  72. package/src/bin/registrars/dashboard.ts +0 -225
  73. package/src/bin/registrars/document.ts +0 -184
  74. package/src/bin/registrars/einvoice.ts +0 -46
  75. package/src/bin/registrars/ewb.ts +0 -37
  76. package/src/bin/registrars/expense.ts +0 -87
  77. package/src/bin/registrars/gst.ts +0 -57
  78. package/src/bin/registrars/import.ts +0 -49
  79. package/src/bin/registrars/invoice.ts +0 -117
  80. package/src/bin/registrars/itc.ts +0 -56
  81. package/src/bin/registrars/item.ts +0 -112
  82. package/src/bin/registrars/journal.ts +0 -47
  83. package/src/bin/registrars/party.ts +0 -81
  84. package/src/bin/registrars/payment.ts +0 -128
  85. package/src/bin/registrars/report.ts +0 -186
  86. package/src/bin/registrars/session.ts +0 -32
  87. package/src/bin/registrars/shipment.ts +0 -74
  88. package/src/bin/registrars/store.ts +0 -128
  89. package/src/bin/registrars/target.ts +0 -46
  90. package/src/bin/registrars/tenant.ts +0 -73
  91. package/src/client.ts +0 -2071
  92. package/src/commands/api-key/create.ts +0 -72
  93. package/src/commands/api-key/list.ts +0 -71
  94. package/src/commands/api-key/revoke.ts +0 -46
  95. package/src/commands/automated-invoice/create.ts +0 -85
  96. package/src/commands/automated-invoice/delete.ts +0 -42
  97. package/src/commands/automated-invoice/get.ts +0 -113
  98. package/src/commands/automated-invoice/history.ts +0 -65
  99. package/src/commands/automated-invoice/index.ts +0 -11
  100. package/src/commands/automated-invoice/list.ts +0 -91
  101. package/src/commands/automated-invoice/pause.ts +0 -29
  102. package/src/commands/automated-invoice/resume.ts +0 -29
  103. package/src/commands/automated-invoice/run-now.ts +0 -29
  104. package/src/commands/automated-invoice/suggestions.ts +0 -68
  105. package/src/commands/automated-invoice/update.ts +0 -54
  106. package/src/commands/automated-invoice/usage.ts +0 -68
  107. package/src/commands/bank/gateway-config.ts +0 -61
  108. package/src/commands/bank/index.ts +0 -244
  109. package/src/commands/bank/update-gateway.ts +0 -84
  110. package/src/commands/bank-recon/index.ts +0 -127
  111. package/src/commands/business/audit-trail.ts +0 -79
  112. package/src/commands/business/export.ts +0 -52
  113. package/src/commands/business/get.ts +0 -55
  114. package/src/commands/business/sequence.ts +0 -65
  115. package/src/commands/business/update.ts +0 -64
  116. package/src/commands/dashboard/collection-efficiency.ts +0 -164
  117. package/src/commands/dashboard/expenses.ts +0 -76
  118. package/src/commands/dashboard/invoice-breakdown.ts +0 -89
  119. package/src/commands/dashboard/monthly-comparison.ts +0 -193
  120. package/src/commands/dashboard/payment-modes.ts +0 -121
  121. package/src/commands/dashboard/profit-loss.ts +0 -146
  122. package/src/commands/dashboard/receivables-aging.ts +0 -169
  123. package/src/commands/dashboard/sales-trend.ts +0 -68
  124. package/src/commands/dashboard/summary.ts +0 -105
  125. package/src/commands/dashboard/top-customers.ts +0 -70
  126. package/src/commands/dashboard/top-items.ts +0 -74
  127. package/src/commands/dashboard/top-outstanding.ts +0 -61
  128. package/src/commands/dashboard.ts +0 -105
  129. package/src/commands/document/factory.ts +0 -590
  130. package/src/commands/einvoice/index.ts +0 -109
  131. package/src/commands/ewb/index.ts +0 -108
  132. package/src/commands/expense/categories.ts +0 -40
  133. package/src/commands/expense/create.ts +0 -51
  134. package/src/commands/expense/delete.ts +0 -45
  135. package/src/commands/expense/list.ts +0 -65
  136. package/src/commands/expense/update.ts +0 -58
  137. package/src/commands/gst/index.ts +0 -194
  138. package/src/commands/import/index.ts +0 -168
  139. package/src/commands/invoice/create.ts +0 -262
  140. package/src/commands/invoice/delete.ts +0 -44
  141. package/src/commands/invoice/get.ts +0 -113
  142. package/src/commands/invoice/list.ts +0 -126
  143. package/src/commands/invoice/pdf.ts +0 -75
  144. package/src/commands/invoice/status.ts +0 -41
  145. package/src/commands/itc/index.ts +0 -163
  146. package/src/commands/item/categories.ts +0 -40
  147. package/src/commands/item/create.ts +0 -98
  148. package/src/commands/item/delete.ts +0 -44
  149. package/src/commands/item/list.ts +0 -81
  150. package/src/commands/item/low-stock-count.ts +0 -32
  151. package/src/commands/item/merge.ts +0 -53
  152. package/src/commands/item/price-history.ts +0 -59
  153. package/src/commands/item/rename-unit.ts +0 -39
  154. package/src/commands/item/sales-stats.ts +0 -44
  155. package/src/commands/item/stock-history.ts +0 -70
  156. package/src/commands/item/stock.ts +0 -46
  157. package/src/commands/item/switch-base-unit.ts +0 -42
  158. package/src/commands/item/update.ts +0 -59
  159. package/src/commands/item/variants-create.ts +0 -58
  160. package/src/commands/item/variants-delete.ts +0 -47
  161. package/src/commands/item/variants-list.ts +0 -63
  162. package/src/commands/item/variants-update.ts +0 -61
  163. package/src/commands/journal/index.ts +0 -156
  164. package/src/commands/party/create.ts +0 -88
  165. package/src/commands/party/delete.ts +0 -44
  166. package/src/commands/party/get.ts +0 -42
  167. package/src/commands/party/ledger-report.ts +0 -81
  168. package/src/commands/party/ledger.ts +0 -63
  169. package/src/commands/party/list.ts +0 -69
  170. package/src/commands/party/merge.ts +0 -50
  171. package/src/commands/party/stats.ts +0 -40
  172. package/src/commands/party/top-items.ts +0 -57
  173. package/src/commands/party/update.ts +0 -65
  174. package/src/commands/payment/create.ts +0 -131
  175. package/src/commands/payment/default-account.ts +0 -56
  176. package/src/commands/payment/delete.ts +0 -46
  177. package/src/commands/payment/get.ts +0 -59
  178. package/src/commands/payment/list.ts +0 -66
  179. package/src/commands/payment/unpaid-invoices.ts +0 -69
  180. package/src/commands/payment/untracked.ts +0 -70
  181. package/src/commands/payment/update.ts +0 -54
  182. package/src/commands/report/index.ts +0 -736
  183. package/src/commands/session/list.ts +0 -91
  184. package/src/commands/session/revoke-all.ts +0 -20
  185. package/src/commands/session/revoke.ts +0 -32
  186. package/src/commands/shipment/index.ts +0 -170
  187. package/src/commands/store/check-slug.ts +0 -48
  188. package/src/commands/store/index.ts +0 -77
  189. package/src/commands/store/items-toggle.ts +0 -41
  190. package/src/commands/store/items.ts +0 -61
  191. package/src/commands/store/order-cancel.ts +0 -48
  192. package/src/commands/store/order-confirm.ts +0 -45
  193. package/src/commands/store/order-get.ts +0 -66
  194. package/src/commands/store/order-update.ts +0 -52
  195. package/src/commands/store/update-settings.ts +0 -52
  196. package/src/commands/target/index.ts +0 -118
  197. package/src/commands/tenant/invitations.ts +0 -62
  198. package/src/commands/tenant/invite.ts +0 -57
  199. package/src/commands/tenant/list.ts +0 -46
  200. package/src/commands/tenant/members.ts +0 -55
  201. package/src/commands/tenant/remove.ts +0 -47
  202. package/src/commands/tenant/revoke-invitation.ts +0 -32
  203. package/src/commands/tenant/update-role.ts +0 -41
  204. package/src/config.ts +0 -120
  205. package/src/error-handler.ts +0 -53
  206. package/src/format.ts +0 -181
  207. package/src/output.ts +0 -228
  208. package/src/spinner.ts +0 -39
  209. package/tsconfig.json +0 -22
  210. package/tsup.config.ts +0 -18
@@ -1,112 +0,0 @@
1
- import { Command } from "commander";
2
- import { requireAuth } from "../../config.js";
3
- import { HisaaboClient, HisaaboApiError } from "../../client.js";
4
- import { fatalError, EXIT, outputJSON } from "../../output.js";
5
- import { itemListCommand } from "../../commands/item/list.js";
6
- import { itemCreateCommand } from "../../commands/item/create.js";
7
- import { itemDeleteCommand } from "../../commands/item/delete.js";
8
- import { itemStockCommand } from "../../commands/item/stock.js";
9
-
10
- export function registerItemCommands(program: Command): void {
11
- // ── item ──────────────────────────────────────────────────────────────────
12
-
13
- const item = program.command("item").description("Item / product management");
14
-
15
- item
16
- .command("list")
17
- .description("List items")
18
- .option("--json", "JSON output")
19
- .option("--format <format>", "Output format: table, tsv, csv, ids")
20
- .option("--search <q>", "Search")
21
- .option("--category <cat>", "Filter by category")
22
- .option("--type <type>", "product or service")
23
- .option("--low-stock", "Show only low-stock items")
24
- .option("--page <n>", "Page number", parseInt)
25
- .option("--limit <n>", "Items per page", parseInt)
26
- .action(async (opts) => {
27
- await itemListCommand({
28
- json: opts.json,
29
- format: opts.format,
30
- search: opts.search,
31
- category: opts.category,
32
- type: opts.type,
33
- lowStock: opts.lowStock,
34
- page: opts.page,
35
- limit: opts.limit,
36
- });
37
- });
38
-
39
- item
40
- .command("get <id>")
41
- .description("Get item details")
42
- .option("--json", "JSON output")
43
- .action(async (id, opts) => {
44
- const cfg = requireAuth();
45
- const client = new HisaaboClient(cfg);
46
- try {
47
- const it = await client.item.get(id);
48
- if (opts.json) { outputJSON(it); return; }
49
- console.log(`\n ${it.name} (${it.itemType})`);
50
- console.log(" " + "─".repeat(40));
51
- if (it.sku) console.log(` SKU: ${it.sku}`);
52
- if (it.hsn) console.log(` HSN: ${it.hsn}`);
53
- console.log(` Unit: ${it.unit}`);
54
- if (it.salePrice) console.log(` Sale: ₹${it.salePrice}`);
55
- if (it.purchasePrice) console.log(` Purchase: ₹${it.purchasePrice}`);
56
- console.log(` Tax: ${it.taxPercent}%`);
57
- if (it.itemType === "product") console.log(` Stock: ${it.stockQuantity}`);
58
- console.log();
59
- } catch (e) {
60
- if (e instanceof HisaaboApiError && e.hisaaboError.code === "not_found") fatalError(`Item not found: ${id}`, EXIT.NOT_FOUND);
61
- fatalError(String(e instanceof Error ? e.message : e));
62
- }
63
- });
64
-
65
- item
66
- .command("create")
67
- .description("Create a new item")
68
- .option("--json", "JSON output")
69
- .option("--name <name>", "Item name")
70
- .option("--unit <unit>", "Unit (pcs, kg, etc.)")
71
- .option("--sale-price <price>", "Sale price")
72
- .option("--purchase-price <price>", "Purchase price")
73
- .option("--tax <percent>", "Tax percentage")
74
- .option("--stock <qty>", "Opening stock quantity")
75
- .option("--hsn <code>", "HSN code")
76
- .option("--category <cat>", "Category")
77
- .option("--type <type>", "product or service")
78
- .option("-y, --yes", "Skip confirmation")
79
- .action(async (opts) => {
80
- await itemCreateCommand({
81
- json: opts.json,
82
- name: opts.name,
83
- unit: opts.unit,
84
- salePrice: opts.salePrice,
85
- purchasePrice: opts.purchasePrice,
86
- taxPercent: opts.tax,
87
- stock: opts.stock,
88
- hsn: opts.hsn,
89
- category: opts.category,
90
- type: opts.type,
91
- yes: opts.yes,
92
- });
93
- });
94
-
95
- item
96
- .command("delete <id>")
97
- .description("Delete an item")
98
- .option("-y, --yes", "Skip confirmation")
99
- .option("--json", "JSON output")
100
- .action(async (id, opts) => {
101
- await itemDeleteCommand(id, { yes: opts.yes, json: opts.json });
102
- });
103
-
104
- item
105
- .command("stock <id> <adjustment>")
106
- .description("Adjust item stock (+10, -5, 100)")
107
- .option("--json", "JSON output")
108
- .option("--reason <text>", "Reason for adjustment")
109
- .action(async (id, adjustment, opts) => {
110
- await itemStockCommand(id, adjustment, { json: opts.json, reason: opts.reason });
111
- });
112
- }
@@ -1,47 +0,0 @@
1
- import { Command } from "commander";
2
- import {
3
- journalListCommand,
4
- journalGetCommand,
5
- journalVoidCommand,
6
- journalTemplatesCommand,
7
- } from "../../commands/journal/index.js";
8
-
9
- export function registerJournalCommands(program: Command): void {
10
- const journal = program.command("journal").description("Journal entries and templates");
11
-
12
- journal
13
- .command("list")
14
- .description("List journal entries")
15
- .option("--json", "JSON output")
16
- .option("--page <n>", "Page number", parseInt)
17
- .option("--limit <n>", "Results per page", parseInt)
18
- .option("--from <date>", "From date")
19
- .option("--to <date>", "To date")
20
- .action(async (opts) => {
21
- await journalListCommand(opts);
22
- });
23
-
24
- journal
25
- .command("get <id>")
26
- .description("Get journal entry details")
27
- .option("--json", "JSON output")
28
- .action(async (id: string, opts) => {
29
- await journalGetCommand(id, { json: opts.json });
30
- });
31
-
32
- journal
33
- .command("void <id>")
34
- .description("Void a journal entry")
35
- .option("--json", "JSON output")
36
- .action(async (id: string, opts) => {
37
- await journalVoidCommand(id, { json: opts.json });
38
- });
39
-
40
- journal
41
- .command("templates")
42
- .description("List journal entry templates")
43
- .option("--json", "JSON output")
44
- .action(async (opts) => {
45
- await journalTemplatesCommand({ json: opts.json });
46
- });
47
- }
@@ -1,81 +0,0 @@
1
- import { Command } from "commander";
2
- import { partyListCommand } from "../../commands/party/list.js";
3
- import { partyGetCommand } from "../../commands/party/get.js";
4
- import { partyCreateCommand } from "../../commands/party/create.js";
5
- import { partyDeleteCommand } from "../../commands/party/delete.js";
6
- import { partyLedgerCommand } from "../../commands/party/ledger.js";
7
-
8
- export function registerPartyCommands(program: Command): void {
9
- // ── party ─────────────────────────────────────────────────────────────────
10
-
11
- const party = program.command("party").description("Party (customer/supplier) management");
12
-
13
-
14
- party
15
- .command("list")
16
- .description("List parties")
17
- .option("--json", "JSON output")
18
- .option("--format <format>", "Output format: table, tsv, csv, ids")
19
- .option("--type <type>", "customer or supplier")
20
- .option("--search <q>", "Search")
21
- .option("--category <cat>", "Filter by category")
22
- .option("--page <n>", "Page number", parseInt)
23
- .option("--limit <n>", "Items per page", parseInt)
24
- .action(async (opts) => {
25
- await partyListCommand({
26
- json: opts.json,
27
- format: opts.format,
28
- type: opts.type,
29
- search: opts.search,
30
- category: opts.category,
31
- page: opts.page,
32
- limit: opts.limit,
33
- });
34
- });
35
-
36
- party
37
- .command("get <id>")
38
- .description("Get party details")
39
- .option("--json", "JSON output")
40
- .action(async (id, opts) => {
41
- await partyGetCommand(id, { json: opts.json });
42
- });
43
-
44
- party
45
- .command("create")
46
- .description("Create a new party")
47
- .option("--json", "JSON output")
48
- .option("--type <type>", "customer or supplier")
49
- .option("--name <name>", "Party name")
50
- .option("--phone <phone>", "Phone number")
51
- .option("--email <email>", "Email address")
52
- .option("--gstin <gstin>", "GSTIN")
53
- .option("--city <city>", "City")
54
- .option("--category <cat>", "Category")
55
- .option("-y, --yes", "Skip confirmation")
56
- .action(async (opts) => {
57
- await partyCreateCommand(opts);
58
- });
59
-
60
- party
61
- .command("delete <id>")
62
- .description("Delete a party")
63
- .option("-y, --yes", "Skip confirmation")
64
- .option("--json", "JSON output")
65
- .action(async (id, opts) => {
66
- await partyDeleteCommand(id, { yes: opts.yes, json: opts.json });
67
- });
68
-
69
- party
70
- .command("ledger <partyId>")
71
- .description("Show party ledger (debit/credit history)")
72
- .option("--json", "JSON output")
73
- .option("--format <format>", "Output format: table, tsv, csv")
74
- .option("--from <date>", "From date")
75
- .option("--to <date>", "To date")
76
- .option("--page <n>", "Page number", parseInt)
77
- .option("--limit <n>", "Items per page", parseInt)
78
- .action(async (partyId, opts) => {
79
- await partyLedgerCommand(partyId, opts);
80
- });
81
- }
@@ -1,128 +0,0 @@
1
- import { Command } from "commander";
2
- import { paymentListCommand } from "../../commands/payment/list.js";
3
- import { paymentCreateCommand } from "../../commands/payment/create.js";
4
- import { paymentDeleteCommand } from "../../commands/payment/delete.js";
5
-
6
- export function registerPaymentCommands(program: Command): void {
7
- // ── payment ───────────────────────────────────────────────────────────────
8
-
9
- const payment = program.command("payment").description("Payment recording");
10
-
11
- payment
12
- .command("list")
13
- .description("List payments")
14
- .option("--json", "JSON output")
15
- .option("--format <format>", "Output format: table, tsv, csv, ids")
16
- .option("--party-id <id>", "Filter by party")
17
- .option("--from <date>", "From date")
18
- .option("--to <date>", "To date")
19
- .option("--page <n>", "Page number", parseInt)
20
- .option("--limit <n>", "Items per page", parseInt)
21
- .action(async (opts) => {
22
- await paymentListCommand(opts);
23
- });
24
-
25
- payment
26
- .command("create")
27
- .description("Record a payment")
28
- .option("--json", "JSON output")
29
- .option("--party-id <id>", "Party UUID")
30
- .option("--party <name>", "Party name")
31
- .option("--amount <amount>", "Payment amount")
32
- .option("--mode <mode>", "cash/bank/upi/cheque/other")
33
- .option("--invoice-id <id>", "Link to invoice")
34
- .option("--reference <ref>", "Reference number")
35
- .option("--date <date>", "Payment date")
36
- .option("--notes <text>", "Notes")
37
- .option("-y, --yes", "Skip confirmation")
38
- .action(async (opts) => {
39
- await paymentCreateCommand({
40
- json: opts.json,
41
- partyId: opts.partyId,
42
- party: opts.party,
43
- amount: opts.amount,
44
- mode: opts.mode,
45
- invoiceId: opts.invoiceId,
46
- reference: opts.reference,
47
- date: opts.date,
48
- notes: opts.notes,
49
- yes: opts.yes,
50
- });
51
- });
52
-
53
- payment
54
- .command("delete <id>")
55
- .description("Delete a payment")
56
- .option("-y, --yes", "Skip confirmation")
57
- .option("--json", "JSON output")
58
- .action(async (id, opts) => {
59
- await paymentDeleteCommand(id, { yes: opts.yes, json: opts.json });
60
- });
61
-
62
- payment
63
- .command("get <id>")
64
- .description("Get payment details")
65
- .option("--json", "JSON output")
66
- .action(async (id, opts) => {
67
- const { paymentGetCommand } = await import("../../commands/payment/get.js");
68
- await paymentGetCommand(id, { json: opts.json });
69
- });
70
-
71
- payment
72
- .command("update <id>")
73
- .description("Update a payment")
74
- .option("--amount <amount>", "New amount")
75
- .option("--mode <mode>", "Payment mode: cash, upi, bank, cheque, other")
76
- .option("--date <YYYY-MM-DD>", "Payment date")
77
- .option("--reference <ref>", "Reference number (empty string to clear)")
78
- .option("--notes <text>", "Notes (empty string to clear)")
79
- .option("--json", "JSON output")
80
- .action(async (id, opts) => {
81
- const { paymentUpdateCommand } = await import("../../commands/payment/update.js");
82
- await paymentUpdateCommand(id, {
83
- json: opts.json,
84
- amount: opts.amount,
85
- mode: opts.mode,
86
- date: opts.date,
87
- reference: opts.reference,
88
- notes: opts.notes,
89
- });
90
- });
91
-
92
- payment
93
- .command("unpaid-invoices <partyId>")
94
- .description("List unpaid invoices for a party")
95
- .option("--json", "JSON output")
96
- .option("--format <format>", "Output format: table, tsv, csv")
97
- .action(async (partyId, opts) => {
98
- const { paymentUnpaidInvoicesCommand } = await import("../../commands/payment/unpaid-invoices.js");
99
- await paymentUnpaidInvoicesCommand(partyId, { json: opts.json, format: opts.format });
100
- });
101
-
102
- payment
103
- .command("untracked")
104
- .description("List payments not linked to a bank account")
105
- .option("--page <n>", "Page number", parseInt)
106
- .option("--limit <n>", "Items per page", parseInt)
107
- .option("--json", "JSON output")
108
- .option("--format <format>", "Output format: table, tsv, csv")
109
- .action(async (opts) => {
110
- const { paymentUntrackedCommand } = await import("../../commands/payment/untracked.js");
111
- await paymentUntrackedCommand({
112
- json: opts.json,
113
- format: opts.format,
114
- page: opts.page,
115
- limit: opts.limit,
116
- });
117
- });
118
-
119
- payment
120
- .command("default-account")
121
- .description("Show recommended bank account for payments")
122
- .option("--party-id <id>", "Party UUID to scope recommendation")
123
- .option("--json", "JSON output")
124
- .action(async (opts) => {
125
- const { paymentDefaultAccountCommand } = await import("../../commands/payment/default-account.js");
126
- await paymentDefaultAccountCommand({ json: opts.json, partyId: opts.partyId });
127
- });
128
- }
@@ -1,186 +0,0 @@
1
- import { Command } from "commander";
2
- import {
3
- reportDaybookCommand, reportOutstandingCommand, reportTaxSummaryCommand,
4
- reportItemSalesCommand, reportStockSummaryCommand,
5
- reportSalesRegisterCommand, reportPurchaseRegisterCommand,
6
- reportPartyStatementCommand, reportPaymentSummaryCommand,
7
- reportCashFlowCommand, reportCollectionEfficiencyCommand,
8
- reportTrialBalanceCommand, reportBalanceSheetCommand,
9
- reportCashFlowStatementCommand, reportGeneralLedgerCommand,
10
- } from "../../commands/report/index.js";
11
-
12
- export function registerReportCommands(program: Command): void {
13
- // ── report ────────────────────────────────────────────────────────────────
14
-
15
- const report = program.command("report").description("Business reports");
16
-
17
- report
18
- .command("daybook")
19
- .description("Day book report (all transactions)")
20
- .option("--json", "JSON output")
21
- .option("--format <format>", "tsv or csv")
22
- .option("--from <date>", "From date")
23
- .option("--to <date>", "To date")
24
- .option("--this-month", "Current month")
25
- .option("--this-fy", "Current financial year")
26
- .action(async (opts) => {
27
- await reportDaybookCommand(opts);
28
- });
29
-
30
- report
31
- .command("outstanding")
32
- .description("Outstanding receivables and payables")
33
- .option("--json", "JSON output")
34
- .option("--type <type>", "receivable, payable, or both")
35
- .action(async (opts) => {
36
- await reportOutstandingCommand({ json: opts.json, type: opts.type });
37
- });
38
-
39
- report
40
- .command("tax-summary")
41
- .description("Tax summary by rate")
42
- .option("--json", "JSON output")
43
- .option("--from <date>", "From date")
44
- .option("--to <date>", "To date")
45
- .option("--this-fy", "Current financial year")
46
- .action(async (opts) => {
47
- await reportTaxSummaryCommand(opts);
48
- });
49
-
50
- report
51
- .command("item-sales")
52
- .description("Item sales report")
53
- .option("--json", "JSON output")
54
- .option("--from <date>", "From date")
55
- .option("--to <date>", "To date")
56
- .option("--this-fy", "Current financial year")
57
- .action(async (opts) => {
58
- await reportItemSalesCommand(opts);
59
- });
60
-
61
- report
62
- .command("stock")
63
- .description("Stock summary report")
64
- .option("--json", "JSON output")
65
- .option("--category <cat>", "Filter by category")
66
- .action(async (opts) => {
67
- await reportStockSummaryCommand({ json: opts.json, category: opts.category });
68
- });
69
-
70
- report
71
- .command("sales-register")
72
- .description("Sales invoice listing")
73
- .option("--json", "JSON output")
74
- .option("--format <format>", "table, tsv or csv")
75
- .option("--from <date>", "From date")
76
- .option("--to <date>", "To date")
77
- .option("--this-month", "Current month")
78
- .option("--this-fy", "Current financial year")
79
- .option("--party-id <id>", "Filter by party ID")
80
- .action(async (opts) => {
81
- await reportSalesRegisterCommand(opts);
82
- });
83
-
84
- report
85
- .command("purchase-register")
86
- .description("Purchase invoice listing")
87
- .option("--json", "JSON output")
88
- .option("--format <format>", "table, tsv or csv")
89
- .option("--from <date>", "From date")
90
- .option("--to <date>", "To date")
91
- .option("--this-month", "Current month")
92
- .option("--this-fy", "Current financial year")
93
- .option("--party-id <id>", "Filter by party ID")
94
- .action(async (opts) => {
95
- await reportPurchaseRegisterCommand(opts);
96
- });
97
-
98
- report
99
- .command("party-statement <partyId>")
100
- .description("Party transaction statement")
101
- .option("--json", "JSON output")
102
- .option("--format <format>", "table, tsv or csv")
103
- .option("--from <date>", "From date")
104
- .option("--to <date>", "To date")
105
- .option("--this-month", "Current month")
106
- .option("--this-fy", "Current financial year")
107
- .action(async (partyId: string, opts) => {
108
- await reportPartyStatementCommand(partyId, opts);
109
- });
110
-
111
- report
112
- .command("payment-summary")
113
- .description("Payment summary by mode")
114
- .option("--json", "JSON output")
115
- .option("--format <format>", "table, tsv or csv")
116
- .option("--from <date>", "From date")
117
- .option("--to <date>", "To date")
118
- .option("--this-month", "Current month")
119
- .option("--this-fy", "Current financial year")
120
- .option("--type <type>", "received, made, or both")
121
- .action(async (opts) => {
122
- await reportPaymentSummaryCommand(opts);
123
- });
124
-
125
- report
126
- .command("cash-flow")
127
- .description("Cash flow forecast")
128
- .option("--json", "JSON output")
129
- .action(async (opts) => {
130
- await reportCashFlowCommand({ json: opts.json });
131
- });
132
-
133
- report
134
- .command("collection-efficiency")
135
- .description("Collection efficiency metrics")
136
- .option("--json", "JSON output")
137
- .option("--from <date>", "From date")
138
- .option("--to <date>", "To date")
139
- .option("--this-month", "Current month")
140
- .option("--this-fy", "Current financial year")
141
- .action(async (opts) => {
142
- await reportCollectionEfficiencyCommand(opts);
143
- });
144
-
145
- report
146
- .command("trial-balance")
147
- .description("Trial balance report")
148
- .option("--json", "JSON output")
149
- .option("--to <date>", "As of date")
150
- .option("--this-fy", "Current financial year")
151
- .action(async (opts) => {
152
- await reportTrialBalanceCommand(opts);
153
- });
154
-
155
- report
156
- .command("balance-sheet")
157
- .description("Balance sheet")
158
- .option("--json", "JSON output")
159
- .option("--to <date>", "As of date")
160
- .option("--this-fy", "Current financial year")
161
- .action(async (opts) => {
162
- await reportBalanceSheetCommand(opts);
163
- });
164
-
165
- report
166
- .command("cash-flow-statement")
167
- .description("Cash flow statement (operating/investing/financing)")
168
- .option("--json", "JSON output")
169
- .option("--from <date>", "From date")
170
- .option("--to <date>", "To date")
171
- .option("--this-fy", "Current financial year")
172
- .action(async (opts) => {
173
- await reportCashFlowStatementCommand(opts);
174
- });
175
-
176
- report
177
- .command("general-ledger <accountId>")
178
- .description("General ledger for a specific account")
179
- .option("--json", "JSON output")
180
- .option("--from <date>", "From date")
181
- .option("--to <date>", "To date")
182
- .option("--this-fy", "Current financial year")
183
- .action(async (accountId: string, opts) => {
184
- await reportGeneralLedgerCommand(accountId, opts);
185
- });
186
- }
@@ -1,32 +0,0 @@
1
- import { Command } from "commander";
2
-
3
- export function registerSessionCommands(program: Command): void {
4
- const session = program.command("session").description("Manage active sessions");
5
-
6
- session
7
- .command("list")
8
- .description("List active sessions")
9
- .option("--expired", "Show expired sessions instead")
10
- .option("--json", "JSON output")
11
- .action(async (opts) => {
12
- const { listSessionsCommand } = await import("../../commands/session/list.js");
13
- await listSessionsCommand(opts);
14
- });
15
-
16
- session
17
- .command("revoke <sessionId>")
18
- .description("Revoke a specific session")
19
- .option("--json", "JSON output")
20
- .action(async (sessionId, opts) => {
21
- const { revokeSessionCommand } = await import("../../commands/session/revoke.js");
22
- await revokeSessionCommand(sessionId, opts);
23
- });
24
-
25
- session
26
- .command("revoke-all")
27
- .description("Sign out from all devices")
28
- .action(async () => {
29
- const { revokeAllSessionsCommand } = await import("../../commands/session/revoke-all.js");
30
- await revokeAllSessionsCommand();
31
- });
32
- }
@@ -1,74 +0,0 @@
1
- import { Command } from "commander";
2
- import {
3
- shipmentListCommand, shipmentGetCommand, shipmentCreateCommand, shipmentUpdateCommand,
4
- } from "../../commands/shipment/index.js";
5
-
6
- export function registerShipmentCommands(program: Command): void {
7
- // ── shipment ──────────────────────────────────────────────────────────────
8
-
9
- const shipment = program.command("shipment").description("Shipment tracking");
10
-
11
- shipment
12
- .command("list")
13
- .description("List shipments")
14
- .option("--json", "JSON output")
15
- .option("--status <status>", "Filter by status")
16
- .option("--invoice-id <id>", "Filter by invoice")
17
- .option("--page <n>", "Page number", parseInt)
18
- .option("--limit <n>", "Items per page", parseInt)
19
- .action(async (opts) => {
20
- await shipmentListCommand({
21
- json: opts.json,
22
- status: opts.status,
23
- invoiceId: opts.invoiceId,
24
- page: opts.page,
25
- limit: opts.limit,
26
- });
27
- });
28
-
29
- shipment
30
- .command("get <id>")
31
- .description("Get shipment details")
32
- .option("--json", "JSON output")
33
- .action(async (id, opts) => {
34
- await shipmentGetCommand(id, { json: opts.json });
35
- });
36
-
37
- shipment
38
- .command("create")
39
- .description("Create a new shipment")
40
- .option("--json", "JSON output")
41
- .option("--invoice-id <id>", "Invoice ID")
42
- .option("--party-id <id>", "Party ID")
43
- .option("--carrier <name>", "Carrier name")
44
- .option("--tracking <number>", "Tracking number")
45
- .option("--mode <mode>", "Shipping mode")
46
- .option("--date <date>", "Shipment date")
47
- .action(async (opts) => {
48
- await shipmentCreateCommand({
49
- json: opts.json,
50
- invoiceId: opts.invoiceId,
51
- partyId: opts.partyId,
52
- carrier: opts.carrier,
53
- tracking: opts.tracking,
54
- mode: opts.mode,
55
- date: opts.date,
56
- });
57
- });
58
-
59
- shipment
60
- .command("update <id>")
61
- .description("Update shipment status or tracking")
62
- .option("--json", "JSON output")
63
- .option("--status <status>", "New status")
64
- .option("--tracking <number>", "Tracking number")
65
- .option("--carrier <name>", "Carrier")
66
- .action(async (id, opts) => {
67
- await shipmentUpdateCommand(id, {
68
- json: opts.json,
69
- status: opts.status,
70
- tracking: opts.tracking,
71
- carrier: opts.carrier,
72
- });
73
- });
74
- }