@hisaabo/cli 0.1.0 → 0.3.2

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 (146) hide show
  1. package/README.md +332 -0
  2. package/dist/bin/audit-trail-2YGXGUXW.js +78 -0
  3. package/dist/bin/categories-P5VFWD5F.js +47 -0
  4. package/dist/bin/check-slug-4TMOTWUJ.js +65 -0
  5. package/dist/bin/chunk-2P35S2C3.js +46 -0
  6. package/dist/bin/chunk-EYNDY7RB.js +175 -0
  7. package/dist/bin/chunk-FFBG6RU4.js +156 -0
  8. package/dist/bin/chunk-FTOBDKMO.js +804 -0
  9. package/dist/bin/client-QNJ2H5CW.js +11 -0
  10. package/dist/bin/collection-efficiency-WMKEGS6U.js +165 -0
  11. package/dist/bin/config-UKVQYPPR.js +18 -0
  12. package/dist/bin/create-Y22FAVOW.js +83 -0
  13. package/dist/bin/default-account-SA56M66A.js +58 -0
  14. package/dist/bin/expenses-VZAOLYUW.js +89 -0
  15. package/dist/bin/export-QZ6WT6PJ.js +59 -0
  16. package/dist/bin/factory-2DCU3B5T.js +483 -0
  17. package/dist/bin/get-6UYP6UVD.js +71 -0
  18. package/dist/bin/get-EXL44I2X.js +66 -0
  19. package/dist/bin/hisaabo.js +2029 -1450
  20. package/dist/bin/invite-O26SAL72.js +53 -0
  21. package/dist/bin/invoice-breakdown-XEATXVMR.js +97 -0
  22. package/dist/bin/items-3U5USBVG.js +62 -0
  23. package/dist/bin/items-toggle-YEKMI2CM.js +46 -0
  24. package/dist/bin/list-FX2C3NCL.js +46 -0
  25. package/dist/bin/list-VBAHY72W.js +79 -0
  26. package/dist/bin/members-5FPRUAB6.js +55 -0
  27. package/dist/bin/monthly-comparison-JEJ3TTY2.js +176 -0
  28. package/dist/bin/order-cancel-XI2LKYXV.js +55 -0
  29. package/dist/bin/order-confirm-HUFCU6MO.js +53 -0
  30. package/dist/bin/order-get-NSDMPUZR.js +88 -0
  31. package/dist/bin/order-update-C7QYSD5R.js +60 -0
  32. package/dist/bin/output-QFLEKG5W.js +35 -0
  33. package/dist/bin/payment-modes-WI3AWSES.js +126 -0
  34. package/dist/bin/profit-loss-5RIEOBKP.js +135 -0
  35. package/dist/bin/receivables-aging-L6DIQCNE.js +161 -0
  36. package/dist/bin/remove-M2B4TZ37.js +52 -0
  37. package/dist/bin/revoke-H3V2GNCD.js +52 -0
  38. package/dist/bin/sales-trend-TICB3KGF.js +71 -0
  39. package/dist/bin/sequence-XUD6FAKY.js +66 -0
  40. package/dist/bin/store-UQ2DDQ5I.js +82 -0
  41. package/dist/bin/summary-BPNFC7I2.js +113 -0
  42. package/dist/bin/top-customers-WGGJWKCN.js +81 -0
  43. package/dist/bin/top-items-C7ZDDJMR.js +84 -0
  44. package/dist/bin/top-outstanding-MOGWJIQS.js +64 -0
  45. package/dist/bin/unpaid-invoices-ZUPNMQJP.js +65 -0
  46. package/dist/bin/untracked-BCJEVDW4.js +67 -0
  47. package/dist/bin/update-HIU4PANX.js +54 -0
  48. package/dist/bin/update-IG565YIN.js +61 -0
  49. package/dist/bin/update-PVLAX7T3.js +57 -0
  50. package/dist/bin/update-role-Q4ZYJRYT.js +45 -0
  51. package/dist/bin/update-settings-XPC6L5WM.js +56 -0
  52. package/package.json +6 -1
  53. package/src/bin/hisaabo.ts +42 -933
  54. package/src/bin/registrars/api-key.ts +44 -0
  55. package/src/bin/registrars/auth.ts +153 -0
  56. package/src/bin/registrars/automated-invoice.ts +167 -0
  57. package/src/bin/registrars/bank.ts +90 -0
  58. package/src/bin/registrars/business.ts +120 -0
  59. package/src/bin/registrars/dashboard.ts +225 -0
  60. package/src/bin/registrars/document.ts +184 -0
  61. package/src/bin/registrars/expense.ts +87 -0
  62. package/src/bin/registrars/gst.ts +41 -0
  63. package/src/bin/registrars/import.ts +49 -0
  64. package/src/bin/registrars/invoice.ts +117 -0
  65. package/src/bin/registrars/item.ts +112 -0
  66. package/src/bin/registrars/party.ts +81 -0
  67. package/src/bin/registrars/payment.ts +128 -0
  68. package/src/bin/registrars/report.ts +142 -0
  69. package/src/bin/registrars/shipment.ts +74 -0
  70. package/src/bin/registrars/store.ts +128 -0
  71. package/src/bin/registrars/target.ts +46 -0
  72. package/src/bin/registrars/tenant.ts +55 -0
  73. package/src/client.ts +495 -4
  74. package/src/commands/api-key/create.ts +72 -0
  75. package/src/commands/api-key/list.ts +71 -0
  76. package/src/commands/api-key/revoke.ts +46 -0
  77. package/src/commands/automated-invoice/create.ts +85 -0
  78. package/src/commands/automated-invoice/delete.ts +42 -0
  79. package/src/commands/automated-invoice/get.ts +113 -0
  80. package/src/commands/automated-invoice/history.ts +65 -0
  81. package/src/commands/automated-invoice/index.ts +11 -0
  82. package/src/commands/automated-invoice/list.ts +91 -0
  83. package/src/commands/automated-invoice/pause.ts +29 -0
  84. package/src/commands/automated-invoice/resume.ts +29 -0
  85. package/src/commands/automated-invoice/run-now.ts +29 -0
  86. package/src/commands/automated-invoice/suggestions.ts +68 -0
  87. package/src/commands/automated-invoice/update.ts +54 -0
  88. package/src/commands/automated-invoice/usage.ts +68 -0
  89. package/src/commands/business/audit-trail.ts +79 -0
  90. package/src/commands/business/export.ts +52 -0
  91. package/src/commands/business/get.ts +55 -0
  92. package/src/commands/business/sequence.ts +65 -0
  93. package/src/commands/business/update.ts +64 -0
  94. package/src/commands/dashboard/collection-efficiency.ts +164 -0
  95. package/src/commands/dashboard/expenses.ts +76 -0
  96. package/src/commands/dashboard/invoice-breakdown.ts +89 -0
  97. package/src/commands/dashboard/monthly-comparison.ts +193 -0
  98. package/src/commands/dashboard/payment-modes.ts +121 -0
  99. package/src/commands/dashboard/profit-loss.ts +146 -0
  100. package/src/commands/dashboard/receivables-aging.ts +169 -0
  101. package/src/commands/dashboard/sales-trend.ts +68 -0
  102. package/src/commands/dashboard/summary.ts +105 -0
  103. package/src/commands/dashboard/top-customers.ts +70 -0
  104. package/src/commands/dashboard/top-items.ts +74 -0
  105. package/src/commands/dashboard/top-outstanding.ts +61 -0
  106. package/src/commands/document/factory.ts +590 -0
  107. package/src/commands/expense/categories.ts +40 -0
  108. package/src/commands/expense/update.ts +58 -0
  109. package/src/commands/import/index.ts +68 -0
  110. package/src/commands/item/categories.ts +40 -0
  111. package/src/commands/item/low-stock-count.ts +32 -0
  112. package/src/commands/item/merge.ts +53 -0
  113. package/src/commands/item/price-history.ts +59 -0
  114. package/src/commands/item/rename-unit.ts +39 -0
  115. package/src/commands/item/sales-stats.ts +44 -0
  116. package/src/commands/item/stock-history.ts +70 -0
  117. package/src/commands/item/switch-base-unit.ts +42 -0
  118. package/src/commands/item/update.ts +59 -0
  119. package/src/commands/item/variants-create.ts +58 -0
  120. package/src/commands/item/variants-delete.ts +47 -0
  121. package/src/commands/item/variants-list.ts +63 -0
  122. package/src/commands/item/variants-update.ts +61 -0
  123. package/src/commands/party/ledger-report.ts +81 -0
  124. package/src/commands/party/merge.ts +50 -0
  125. package/src/commands/party/stats.ts +40 -0
  126. package/src/commands/party/top-items.ts +57 -0
  127. package/src/commands/party/update.ts +65 -0
  128. package/src/commands/payment/default-account.ts +56 -0
  129. package/src/commands/payment/get.ts +59 -0
  130. package/src/commands/payment/unpaid-invoices.ts +69 -0
  131. package/src/commands/payment/untracked.ts +70 -0
  132. package/src/commands/payment/update.ts +54 -0
  133. package/src/commands/report/index.ts +348 -1
  134. package/src/commands/store/check-slug.ts +48 -0
  135. package/src/commands/store/items-toggle.ts +41 -0
  136. package/src/commands/store/items.ts +61 -0
  137. package/src/commands/store/order-cancel.ts +48 -0
  138. package/src/commands/store/order-confirm.ts +45 -0
  139. package/src/commands/store/order-get.ts +66 -0
  140. package/src/commands/store/order-update.ts +52 -0
  141. package/src/commands/store/update-settings.ts +52 -0
  142. package/src/commands/tenant/invite.ts +57 -0
  143. package/src/commands/tenant/list.ts +46 -0
  144. package/src/commands/tenant/members.ts +55 -0
  145. package/src/commands/tenant/remove.ts +47 -0
  146. package/src/commands/tenant/update-role.ts +41 -0
@@ -0,0 +1,128 @@
1
+ import { Command } from "commander";
2
+
3
+ export function registerStoreCommands(program: Command): void {
4
+ // ── store ─────────────────────────────────────────────────────────────────
5
+
6
+ const store = program.command("store").description("Online store management");
7
+
8
+ store
9
+ .command("settings")
10
+ .description("Show store settings")
11
+ .option("--json", "JSON output")
12
+ .action(async (opts) => {
13
+ const { storeSettingsCommand } = await import("../../commands/store/index.js");
14
+ await storeSettingsCommand({ json: opts.json });
15
+ });
16
+
17
+ store
18
+ .command("update-settings")
19
+ .description("Update store settings")
20
+ .option("--slug <slug>", "Store URL slug")
21
+ .option("--tagline <text>", "Store tagline / description")
22
+ .option("--enabled <bool>", "Enable or disable store (true/false)")
23
+ .option("--json", "JSON output")
24
+ .action(async (opts) => {
25
+ const { storeUpdateSettingsCommand } = await import("../../commands/store/update-settings.js");
26
+ await storeUpdateSettingsCommand({
27
+ slug: opts.slug,
28
+ tagline: opts.tagline,
29
+ enabled: opts.enabled,
30
+ json: opts.json,
31
+ });
32
+ });
33
+
34
+ store
35
+ .command("items")
36
+ .description("List items available in the store")
37
+ .option("--json", "JSON output")
38
+ .option("--format <format>", "Output format: table, tsv, csv")
39
+ .action(async (opts) => {
40
+ const { storeItemsCommand } = await import("../../commands/store/items.js");
41
+ await storeItemsCommand({ json: opts.json, format: opts.format });
42
+ });
43
+
44
+ store
45
+ .command("items-toggle")
46
+ .description("Bulk enable / disable store items")
47
+ .option("--enable <ids>", "Comma-separated item IDs to enable")
48
+ .option("--disable <ids>", "Comma-separated item IDs to disable")
49
+ .option("--json", "JSON output")
50
+ .action(async (opts) => {
51
+ const { storeItemsToggleCommand } = await import("../../commands/store/items-toggle.js");
52
+ await storeItemsToggleCommand({
53
+ enable: opts.enable,
54
+ disable: opts.disable,
55
+ json: opts.json,
56
+ });
57
+ });
58
+
59
+ store
60
+ .command("orders")
61
+ .description("List store orders")
62
+ .option("--json", "JSON output")
63
+ .option("--status <status>", "Filter by order status")
64
+ .option("--page <n>", "Page number", parseInt)
65
+ .option("--limit <n>", "Items per page", parseInt)
66
+ .action(async (opts) => {
67
+ const { storeOrdersCommand } = await import("../../commands/store/index.js");
68
+ await storeOrdersCommand({
69
+ json: opts.json,
70
+ status: opts.status,
71
+ page: opts.page,
72
+ limit: opts.limit,
73
+ });
74
+ });
75
+
76
+ store
77
+ .command("order-get <id>")
78
+ .description("Get order details")
79
+ .option("--json", "JSON output")
80
+ .action(async (id, opts) => {
81
+ const { storeOrderGetCommand } = await import("../../commands/store/order-get.js");
82
+ await storeOrderGetCommand(id, { json: opts.json });
83
+ });
84
+
85
+ store
86
+ .command("order-confirm <id>")
87
+ .description("Confirm a pending order")
88
+ .option("-y, --yes", "Skip confirmation prompt")
89
+ .option("--json", "JSON output")
90
+ .action(async (id, opts) => {
91
+ const { storeOrderConfirmCommand } = await import("../../commands/store/order-confirm.js");
92
+ await storeOrderConfirmCommand(id, { json: opts.json, yes: opts.yes });
93
+ });
94
+
95
+ store
96
+ .command("order-cancel <id>")
97
+ .description("Cancel an order")
98
+ .option("-y, --yes", "Skip confirmation prompt")
99
+ .option("--reason <text>", "Cancellation reason")
100
+ .option("--json", "JSON output")
101
+ .action(async (id, opts) => {
102
+ const { storeOrderCancelCommand } = await import("../../commands/store/order-cancel.js");
103
+ await storeOrderCancelCommand(id, {
104
+ json: opts.json,
105
+ yes: opts.yes,
106
+ reason: opts.reason,
107
+ });
108
+ });
109
+
110
+ store
111
+ .command("order-update <id>")
112
+ .description("Update order status")
113
+ .option("--status <status>", "New status: preparing, ready, delivered")
114
+ .option("--json", "JSON output")
115
+ .action(async (id, opts) => {
116
+ const { storeOrderUpdateCommand } = await import("../../commands/store/order-update.js");
117
+ await storeOrderUpdateCommand(id, { json: opts.json, status: opts.status });
118
+ });
119
+
120
+ store
121
+ .command("check-slug <slug>")
122
+ .description("Check store slug availability")
123
+ .option("--json", "JSON output")
124
+ .action(async (slug, opts) => {
125
+ const { storeCheckSlugCommand } = await import("../../commands/store/check-slug.js");
126
+ await storeCheckSlugCommand(slug, { json: opts.json });
127
+ });
128
+ }
@@ -0,0 +1,46 @@
1
+ import { Command } from "commander";
2
+ import { targetListCommand, targetMyCommand, targetCreateCommand } from "../../commands/target/index.js";
3
+
4
+ export function registerTargetCommands(program: Command): void {
5
+ // ── target ────────────────────────────────────────────────────────────────
6
+
7
+ const target = program.command("target").description("Sales target management");
8
+
9
+ target
10
+ .command("list")
11
+ .description("List sales targets")
12
+ .option("--json", "JSON output")
13
+ .action(async (opts) => {
14
+ await targetListCommand({ json: opts.json });
15
+ });
16
+
17
+ target
18
+ .command("my")
19
+ .description("Show my target progress")
20
+ .option("--json", "JSON output")
21
+ .action(async (opts) => {
22
+ await targetMyCommand({ json: opts.json });
23
+ });
24
+
25
+ target
26
+ .command("create")
27
+ .description("Create a new sales target")
28
+ .option("--json", "JSON output")
29
+ .option("--type <type>", "order_count, order_value, or item_quantity")
30
+ .option("--period <period>", "daily, weekly, monthly, quarterly, or custom")
31
+ .option("--value <n>", "Target value")
32
+ .option("--start-date <date>", "Start date")
33
+ .option("--end-date <date>", "End date")
34
+ .option("--notes <text>", "Notes")
35
+ .action(async (opts) => {
36
+ await targetCreateCommand({
37
+ json: opts.json,
38
+ type: opts.type,
39
+ period: opts.period,
40
+ value: opts.value,
41
+ startDate: opts.startDate,
42
+ endDate: opts.endDate,
43
+ notes: opts.notes,
44
+ });
45
+ });
46
+ }
@@ -0,0 +1,55 @@
1
+ import { Command } from "commander";
2
+
3
+ export function registerTenantCommands(program: Command): void {
4
+ // ── tenant ────────────────────────────────────────────────────────────────
5
+
6
+ const tenant = program.command("tenant").description("Tenant / workspace management");
7
+
8
+ tenant
9
+ .command("list")
10
+ .description("List tenants / organizations you belong to")
11
+ .option("--json", "JSON output")
12
+ .action(async (opts) => {
13
+ const { tenantListCommand } = await import("../../commands/tenant/list.js");
14
+ await tenantListCommand({ json: opts.json });
15
+ });
16
+
17
+ tenant
18
+ .command("members")
19
+ .description("List members of the current tenant")
20
+ .option("--json", "JSON output")
21
+ .option("--format <format>", "Output format: table, tsv, csv")
22
+ .action(async (opts) => {
23
+ const { tenantMembersCommand } = await import("../../commands/tenant/members.js");
24
+ await tenantMembersCommand({ json: opts.json, format: opts.format });
25
+ });
26
+
27
+ tenant
28
+ .command("invite <email>")
29
+ .description("Invite a user to the tenant")
30
+ .option("--role <role>", "Role: admin, seller_manager, seller, accountant (default: seller)")
31
+ .option("--json", "JSON output")
32
+ .action(async (email, opts) => {
33
+ const { tenantInviteCommand } = await import("../../commands/tenant/invite.js");
34
+ await tenantInviteCommand(email, { role: opts.role, json: opts.json });
35
+ });
36
+
37
+ tenant
38
+ .command("remove <userId>")
39
+ .description("Remove a member from the tenant")
40
+ .option("-y, --yes", "Skip confirmation")
41
+ .option("--json", "JSON output")
42
+ .action(async (userId, opts) => {
43
+ const { tenantRemoveCommand } = await import("../../commands/tenant/remove.js");
44
+ await tenantRemoveCommand(userId, { yes: opts.yes, json: opts.json });
45
+ });
46
+
47
+ tenant
48
+ .command("update-role <userId> <role>")
49
+ .description("Update a member's role (admin, seller_manager, seller, accountant)")
50
+ .option("--json", "JSON output")
51
+ .action(async (userId, role, opts) => {
52
+ const { tenantUpdateRoleCommand } = await import("../../commands/tenant/update-role.js");
53
+ await tenantUpdateRoleCommand(userId, role, { json: opts.json });
54
+ });
55
+ }