ekwo-os 0.4.1

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 (361) hide show
  1. package/README.md +873 -0
  2. package/dist/args.d.ts +57 -0
  3. package/dist/args.d.ts.map +1 -0
  4. package/dist/args.js +134 -0
  5. package/dist/args.js.map +1 -0
  6. package/dist/assets/expected-objects.json +9432 -0
  7. package/dist/assets/migrations/20260911120000_core_companies.sql +260 -0
  8. package/dist/assets/migrations/20260911120100_accounts_journals.sql +211 -0
  9. package/dist/assets/migrations/20260911120200_contacts.sql +90 -0
  10. package/dist/assets/migrations/20260911120300_taxes.sql +146 -0
  11. package/dist/assets/migrations/20260911120400_entries.sql +338 -0
  12. package/dist/assets/migrations/20260911120500_documents.sql +279 -0
  13. package/dist/assets/migrations/20260911120600_payments_reconciliation.sql +251 -0
  14. package/dist/assets/migrations/20260911120700_bank.sql +178 -0
  15. package/dist/assets/migrations/20260911120800_analytics_attachments.sql +128 -0
  16. package/dist/assets/migrations/20260911120900_post_document.sql +279 -0
  17. package/dist/assets/migrations/20260911121000_reporting.sql +235 -0
  18. package/dist/assets/migrations/20260911121100_country_templates.sql +226 -0
  19. package/dist/assets/migrations/20260911121200_fec.sql +71 -0
  20. package/dist/assets/migrations/20260911130000_instance.sql +77 -0
  21. package/dist/assets/migrations/20260911130100_instance_members.sql +224 -0
  22. package/dist/assets/migrations/20260911140000_instance_admins.sql +112 -0
  23. package/dist/assets/migrations/20260911160000_tax_posting_templates_unique.sql +17 -0
  24. package/dist/assets/migrations/20260911170000_document_amount_paid.sql +82 -0
  25. package/dist/assets/migrations/20260911173000_post_payment.sql +122 -0
  26. package/dist/assets/migrations/20260911173100_sequence_counters_under_rls.sql +84 -0
  27. package/dist/assets/migrations/20260911183000_country_journal_defaults.sql +143 -0
  28. package/dist/assets/migrations/20260911193853_line_account_defaults.sql +274 -0
  29. package/dist/assets/migrations/20260911195054_products.sql +221 -0
  30. package/dist/assets/migrations/20260911210131_anon_surface.sql +85 -0
  31. package/dist/assets/migrations/20260912074712_country_packs.sql +318 -0
  32. package/dist/assets/migrations/20260912080311_report_code_and_region.sql +198 -0
  33. package/dist/assets/migrations/20260912081014_pack_certification_maintained.sql +31 -0
  34. package/dist/assets/migrations/20260912081015_pack_certification_backfill.sql +16 -0
  35. package/dist/assets/migrations/20260912090407_tax_report_boxes.sql +329 -0
  36. package/dist/assets/migrations/20260912091917_tax_on_base_value.sql +25 -0
  37. package/dist/assets/migrations/20260912091918_tax_engine_columns.sql +776 -0
  38. package/dist/assets/migrations/20260912094412_opening_and_closing.sql +759 -0
  39. package/dist/assets/migrations/20260912095825_charts_of_accounts.sql +326 -0
  40. package/dist/assets/migrations/20260912100412_financial_statements.sql +632 -0
  41. package/dist/assets/migrations/20260912104719_one_formula_evaluator.sql +209 -0
  42. package/dist/assets/migrations/20260912105720_entry_kind_appropriation.sql +26 -0
  43. package/dist/assets/migrations/20260912105721_appropriation_entry_kind.sql +444 -0
  44. package/dist/assets/migrations/20260912111751_document_rules.sql +274 -0
  45. package/dist/assets/migrations/20260912112132_cash_basis_vat_and_fx.sql +1189 -0
  46. package/dist/assets/migrations/20260913074512_modules.sql +493 -0
  47. package/dist/assets/migrations/20260913075903_asset_disposal_roles.sql +47 -0
  48. package/dist/assets/migrations/20260913083216_capabilities.sql +637 -0
  49. package/dist/assets/migrations/20260913083901_company_invitations.sql +262 -0
  50. package/dist/assets/migrations/20260913084402_user_preferences.sql +376 -0
  51. package/dist/assets/migrations/20260913084847_company_profile.sql +261 -0
  52. package/dist/assets/migrations/20260913085436_numbering_reads_the_pack.sql +235 -0
  53. package/dist/assets/migrations/20260913085932_api_keys.sql +303 -0
  54. package/dist/assets/migrations/20260913090216_fiscal_year_bounds.sql +159 -0
  55. package/dist/assets/migrations/20260913092527_entries_import.sql +219 -0
  56. package/dist/assets/migrations/20260913101536_null_safe_guards.sql +188 -0
  57. package/dist/assets/migrations/20260913102115_installer_is_named.sql +462 -0
  58. package/dist/assets/migrations/20260913102758_no_currency_default.sql +138 -0
  59. package/dist/assets/migrations/20260913103355_cash_basis_needs_a_box.sql +453 -0
  60. package/dist/assets/migrations/20260913104014_aged_balance_named_group.sql +79 -0
  61. package/dist/assets/migrations/20260913104232_foreign_key_indexes.sql +144 -0
  62. package/dist/assets/migrations/20260913105120_declared_no_reader.sql +41 -0
  63. package/dist/assets/migrations/20260913111407_pack_languages.sql +223 -0
  64. package/dist/assets/migrations/20260913112233_schema_comments_for_a_reader.sql +27 -0
  65. package/dist/assets/migrations/20260913114535_fec_opening_balances.sql +307 -0
  66. package/dist/assets/migrations/20260914103412_audit_log.sql +509 -0
  67. package/dist/assets/migrations/20260914111907_pack_upgrade.sql +428 -0
  68. package/dist/assets/migrations/20260914120500_rounding_reads_the_currency.sql +206 -0
  69. package/dist/assets/migrations/20260914121200_amounts_round_at_the_currency.sql +2403 -0
  70. package/dist/assets/migrations/20260914134325_schema_version_0_2_0.sql +36 -0
  71. package/dist/assets/migrations/20260914143915_accounts_in_use.sql +428 -0
  72. package/dist/assets/migrations/20260914144731_account_code_frozen.sql +99 -0
  73. package/dist/assets/migrations/20260914151207_schema_grants_its_own_rights.sql +284 -0
  74. package/dist/assets/migrations/20260914152840_pack_upgrade_records_its_own_line.sql +237 -0
  75. package/dist/assets/migrations/20260914163943_declaration_periodicity.sql +349 -0
  76. package/dist/assets/migrations/20260915094000_foreign_services_received.sql +37 -0
  77. package/dist/assets/migrations/20260915094500_mentions_read_a_foreign_service.sql +72 -0
  78. package/dist/assets/migrations/20260915153000_document_shares.sql +568 -0
  79. package/dist/assets/migrations/20260915160000_ec_sales_list.sql +181 -0
  80. package/dist/assets/migrations/20260915161842_pack_sources.sql +56 -0
  81. package/dist/assets/migrations/20260915170500_schema_version_0_3_0.sql +45 -0
  82. package/dist/assets/migrations/20260915174500_a_vat_category_is_a_code.sql +177 -0
  83. package/dist/assets/migrations/20260915180000_document_rule_references.sql +85 -0
  84. package/dist/assets/migrations/20260915181000_territories.sql +342 -0
  85. package/dist/assets/migrations/20260915181500_ec_sales_list_reads_the_territories.sql +222 -0
  86. package/dist/assets/migrations/20260915182000_intracom_triangular.sql +53 -0
  87. package/dist/assets/migrations/20260915182500_a_triangular_supply_says_reverse_charge.sql +99 -0
  88. package/dist/assets/migrations/20260915191200_a_document_knows_its_language.sql +633 -0
  89. package/dist/assets/migrations/20260915195000_a_price_that_holds_its_tax.sql +649 -0
  90. package/dist/assets/migrations/20260915200000_a_posting_names_its_boxes.sql +1004 -0
  91. package/dist/assets/migrations/20260916094500_a_company_files_more_than_one_declaration.sql +795 -0
  92. package/dist/assets/migrations/20260916103000_a_ledger_line_names_its_posting.sql +902 -0
  93. package/dist/assets/migrations/20260916123000_a_vocabulary_for_a_tax_that_is_not_a_vat.sql +144 -0
  94. package/dist/assets/migrations/20260916124000_a_box_can_be_a_rate_of_a_box.sql +525 -0
  95. package/dist/assets/migrations/20260916125000_a_tax_follows_the_territory.sql +1318 -0
  96. package/dist/assets/migrations/20260916126000_a_tax_point_and_its_exception.sql +1211 -0
  97. package/dist/assets/migrations/20260917090000_a_counterparty_that_learns.sql +561 -0
  98. package/dist/assets/migrations/20260917120000_what_the_money_pays.sql +545 -0
  99. package/dist/assets/migrations/20260917150000_a_filing_is_a_row.sql +488 -0
  100. package/dist/assets/migrations/20260917170000_when_it_is_due.sql +194 -0
  101. package/dist/assets/migrations/20260917180000_a_box_is_a_number_and_a_kind.sql +213 -0
  102. package/dist/assets/migrations/20260917190000_what_a_declaration_owes.sql +486 -0
  103. package/dist/assets/migrations/20260917200000_what_moved_after_it_went.sql +227 -0
  104. package/dist/assets/migrations/20260918090000_a_form_names_its_file.sql +27 -0
  105. package/dist/assets/migrations/20260918110000_a_deposit_and_what_came_back.sql +286 -0
  106. package/dist/assets/migrations/20260918113741_a_fourth_preset_is_named.sql +9 -0
  107. package/dist/assets/migrations/20260918113807_a_client_reads_and_hands_over.sql +96 -0
  108. package/dist/assets/migrations/20260918114322_two_definer_functions_check_their_caller.sql +75 -0
  109. package/dist/assets/migrations/20260918130000_every_company_somebody_keeps.sql +177 -0
  110. package/dist/assets/migrations/20260918140000_a_session_nobody_prepared.sql +40 -0
  111. package/dist/assets/migrations/20260918141107_a_line_keeps_the_tax_it_was_posted_with.sql +256 -0
  112. package/dist/assets/migrations/20260918141342_a_company_has_an_electronic_address.sql +66 -0
  113. package/dist/assets/migrations/20260918141605_an_invoice_reads_whole_from_the_views.sql +313 -0
  114. package/dist/assets/migrations/20260918141627_a_policy_asks_once.sql +132 -0
  115. package/dist/assets/migrations/20260918143352_a_suggestion_reads_the_words_once.sql +204 -0
  116. package/dist/assets/migrations/20260918143417_a_reference_of_the_caller_and_a_rehearsal.sql +115 -0
  117. package/dist/assets/migrations/20260918150712_a_company_leaves_with_its_books.sql +1119 -0
  118. package/dist/assets/migrations/20260918150931_a_statement_is_imported_once.sql +654 -0
  119. package/dist/assets/migrations/20260918161204_a_posted_document_does_not_move.sql +437 -0
  120. package/dist/assets/migrations/20260918161538_a_posted_entry_does_not_move.sql +252 -0
  121. package/dist/assets/migrations/20260918171946_an_entry_is_posted_by_post_entry.sql +289 -0
  122. package/dist/assets/migrations/20260918174312_schema_version_0_4_0.sql +53 -0
  123. package/dist/assets/modules/assets/module.json +13 -0
  124. package/dist/assets/modules/assets/supabase/migrations/20260913081447_assets.sql +1190 -0
  125. package/dist/assets/modules/assets/supabase/migrations/20260913104234_foreign_key_indexes.sql +47 -0
  126. package/dist/assets/modules/assets/supabase/migrations/20260913104500_assets_capabilities.sql +145 -0
  127. package/dist/assets/modules/assets/supabase/migrations/20260914122100_assets_round_at_the_currency.sql +564 -0
  128. package/dist/assets/modules/assets/supabase/migrations/20260914145012_assets_accounts_in_use.sql +37 -0
  129. package/dist/assets/modules/assets/supabase/migrations/20260914151530_assets_grants_its_own_rights.sql +63 -0
  130. package/dist/assets/modules/assets/supabase/migrations/20260918113912_assets_client_reads.sql +20 -0
  131. package/dist/assets/modules/assets/supabase/migrations/20260918150801_assets_leave_with_the_company.sql +41 -0
  132. package/dist/assets/modules/budgets/module.json +12 -0
  133. package/dist/assets/modules/budgets/supabase/migrations/20260913083012_budgets.sql +210 -0
  134. package/dist/assets/modules/budgets/supabase/migrations/20260913104233_foreign_key_indexes.sql +37 -0
  135. package/dist/assets/modules/budgets/supabase/migrations/20260913104501_budgets_capabilities.sql +72 -0
  136. package/dist/assets/modules/budgets/supabase/migrations/20260914122400_budgets_round_at_the_currency.sql +68 -0
  137. package/dist/assets/modules/budgets/supabase/migrations/20260914145048_budgets_accounts_in_use.sql +30 -0
  138. package/dist/assets/modules/budgets/supabase/migrations/20260914151812_budgets_grants_its_own_rights.sql +31 -0
  139. package/dist/assets/modules/budgets/supabase/migrations/20260918113954_budgets_client_reads.sql +20 -0
  140. package/dist/assets/modules/budgets/supabase/migrations/20260918150823_budgets_leave_with_the_company.sql +37 -0
  141. package/dist/assets/modules/schema/module.1.json +69 -0
  142. package/dist/assets/seed/00_currencies.sql +15 -0
  143. package/dist/assets/seed/00_territories.sql +280 -0
  144. package/dist/assets/seed/05_framework_generic.sql +110 -0
  145. package/dist/assets/seed/10_pack_be.sql +1284 -0
  146. package/dist/assets/seed/11_pack_fr.sql +1112 -0
  147. package/dist/assets/seed/12_pack_lu.sql +2484 -0
  148. package/dist/assets/seed/13_pack_ee.sql +733 -0
  149. package/dist/assets/seed/14_pack_gb.sql +796 -0
  150. package/dist/assets/seed/15_pack_us.sql +751 -0
  151. package/dist/assets/seed/90_demo_company.sql +368 -0
  152. package/dist/assets/seed/modules/assets/10_pack_be.sql +58 -0
  153. package/dist/assets/seed/modules/assets/11_pack_fr.sql +57 -0
  154. package/dist/assets/seed/modules/assets/14_pack_gb.sql +58 -0
  155. package/dist/assets/seed/modules/assets/15_pack_us.sql +60 -0
  156. package/dist/auth.d.ts +59 -0
  157. package/dist/auth.d.ts.map +1 -0
  158. package/dist/auth.js +134 -0
  159. package/dist/auth.js.map +1 -0
  160. package/dist/bin.d.ts +6 -0
  161. package/dist/bin.d.ts.map +1 -0
  162. package/dist/bin.js +8 -0
  163. package/dist/bin.js.map +1 -0
  164. package/dist/books.d.ts +60 -0
  165. package/dist/books.d.ts.map +1 -0
  166. package/dist/books.js +168 -0
  167. package/dist/books.js.map +1 -0
  168. package/dist/bootstrap.d.ts +236 -0
  169. package/dist/bootstrap.d.ts.map +1 -0
  170. package/dist/bootstrap.js +459 -0
  171. package/dist/bootstrap.js.map +1 -0
  172. package/dist/bundle.d.ts +27 -0
  173. package/dist/bundle.d.ts.map +1 -0
  174. package/dist/bundle.js +47 -0
  175. package/dist/bundle.js.map +1 -0
  176. package/dist/checklist.d.ts +35 -0
  177. package/dist/checklist.d.ts.map +1 -0
  178. package/dist/checklist.js +64 -0
  179. package/dist/checklist.js.map +1 -0
  180. package/dist/cli.d.ts +14 -0
  181. package/dist/cli.d.ts.map +1 -0
  182. package/dist/cli.js +318 -0
  183. package/dist/cli.js.map +1 -0
  184. package/dist/commands/company.d.ts +59 -0
  185. package/dist/commands/company.d.ts.map +1 -0
  186. package/dist/commands/company.js +287 -0
  187. package/dist/commands/company.js.map +1 -0
  188. package/dist/commands/contact.d.ts +9 -0
  189. package/dist/commands/contact.d.ts.map +1 -0
  190. package/dist/commands/contact.js +82 -0
  191. package/dist/commands/contact.js.map +1 -0
  192. package/dist/commands/demo.d.ts +19 -0
  193. package/dist/commands/demo.d.ts.map +1 -0
  194. package/dist/commands/demo.js +72 -0
  195. package/dist/commands/demo.js.map +1 -0
  196. package/dist/commands/doctor.d.ts +12 -0
  197. package/dist/commands/doctor.d.ts.map +1 -0
  198. package/dist/commands/doctor.js +68 -0
  199. package/dist/commands/doctor.js.map +1 -0
  200. package/dist/commands/document.d.ts +17 -0
  201. package/dist/commands/document.d.ts.map +1 -0
  202. package/dist/commands/document.js +217 -0
  203. package/dist/commands/document.js.map +1 -0
  204. package/dist/commands/init.d.ts +31 -0
  205. package/dist/commands/init.d.ts.map +1 -0
  206. package/dist/commands/init.js +535 -0
  207. package/dist/commands/init.js.map +1 -0
  208. package/dist/commands/login.d.ts +24 -0
  209. package/dist/commands/login.d.ts.map +1 -0
  210. package/dist/commands/login.js +128 -0
  211. package/dist/commands/login.js.map +1 -0
  212. package/dist/commands/migrate.d.ts +30 -0
  213. package/dist/commands/migrate.d.ts.map +1 -0
  214. package/dist/commands/migrate.js +115 -0
  215. package/dist/commands/migrate.js.map +1 -0
  216. package/dist/commands/module.d.ts +32 -0
  217. package/dist/commands/module.d.ts.map +1 -0
  218. package/dist/commands/module.js +285 -0
  219. package/dist/commands/module.js.map +1 -0
  220. package/dist/commands/pack.d.ts +22 -0
  221. package/dist/commands/pack.d.ts.map +1 -0
  222. package/dist/commands/pack.js +481 -0
  223. package/dist/commands/pack.js.map +1 -0
  224. package/dist/commands/payment.d.ts +15 -0
  225. package/dist/commands/payment.d.ts.map +1 -0
  226. package/dist/commands/payment.js +97 -0
  227. package/dist/commands/payment.js.map +1 -0
  228. package/dist/commands/register.d.ts +20 -0
  229. package/dist/commands/register.d.ts.map +1 -0
  230. package/dist/commands/register.js +134 -0
  231. package/dist/commands/register.js.map +1 -0
  232. package/dist/commands/status.d.ts +8 -0
  233. package/dist/commands/status.d.ts.map +1 -0
  234. package/dist/commands/status.js +134 -0
  235. package/dist/commands/status.js.map +1 -0
  236. package/dist/commands/whoami.d.ts +21 -0
  237. package/dist/commands/whoami.d.ts.map +1 -0
  238. package/dist/commands/whoami.js +133 -0
  239. package/dist/commands/whoami.js.map +1 -0
  240. package/dist/company.d.ts +16 -0
  241. package/dist/company.d.ts.map +1 -0
  242. package/dist/company.js +26 -0
  243. package/dist/company.js.map +1 -0
  244. package/dist/config.d.ts +24 -0
  245. package/dist/config.d.ts.map +1 -0
  246. package/dist/config.js +50 -0
  247. package/dist/config.js.map +1 -0
  248. package/dist/connection.d.ts +79 -0
  249. package/dist/connection.d.ts.map +1 -0
  250. package/dist/connection.js +116 -0
  251. package/dist/connection.js.map +1 -0
  252. package/dist/context.d.ts +47 -0
  253. package/dist/context.d.ts.map +1 -0
  254. package/dist/context.js +93 -0
  255. package/dist/context.js.map +1 -0
  256. package/dist/doctor.d.ts +45 -0
  257. package/dist/doctor.d.ts.map +1 -0
  258. package/dist/doctor.js +448 -0
  259. package/dist/doctor.js.map +1 -0
  260. package/dist/grants.d.ts +88 -0
  261. package/dist/grants.d.ts.map +1 -0
  262. package/dist/grants.js +174 -0
  263. package/dist/grants.js.map +1 -0
  264. package/dist/identity.d.ts +54 -0
  265. package/dist/identity.d.ts.map +1 -0
  266. package/dist/identity.js +132 -0
  267. package/dist/identity.js.map +1 -0
  268. package/dist/index.d.ts +44 -0
  269. package/dist/index.d.ts.map +1 -0
  270. package/dist/index.js +43 -0
  271. package/dist/index.js.map +1 -0
  272. package/dist/inventory.d.ts +155 -0
  273. package/dist/inventory.d.ts.map +1 -0
  274. package/dist/inventory.js +303 -0
  275. package/dist/inventory.js.map +1 -0
  276. package/dist/migrations.d.ts +76 -0
  277. package/dist/migrations.d.ts.map +1 -0
  278. package/dist/migrations.js +226 -0
  279. package/dist/migrations.js.map +1 -0
  280. package/dist/module/read.d.ts +91 -0
  281. package/dist/module/read.d.ts.map +1 -0
  282. package/dist/module/read.js +172 -0
  283. package/dist/module/read.js.map +1 -0
  284. package/dist/output.d.ts +110 -0
  285. package/dist/output.d.ts.map +1 -0
  286. package/dist/output.js +173 -0
  287. package/dist/output.js.map +1 -0
  288. package/dist/pack/certification.d.ts +27 -0
  289. package/dist/pack/certification.d.ts.map +1 -0
  290. package/dist/pack/certification.js +38 -0
  291. package/dist/pack/certification.js.map +1 -0
  292. package/dist/pack/compile.d.ts +75 -0
  293. package/dist/pack/compile.d.ts.map +1 -0
  294. package/dist/pack/compile.js +801 -0
  295. package/dist/pack/compile.js.map +1 -0
  296. package/dist/pack/filing.d.ts +48 -0
  297. package/dist/pack/filing.d.ts.map +1 -0
  298. package/dist/pack/filing.js +56 -0
  299. package/dist/pack/filing.js.map +1 -0
  300. package/dist/pack/read.d.ts +766 -0
  301. package/dist/pack/read.d.ts.map +1 -0
  302. package/dist/pack/read.js +2336 -0
  303. package/dist/pack/read.js.map +1 -0
  304. package/dist/pack/schema.d.ts +26 -0
  305. package/dist/pack/schema.d.ts.map +1 -0
  306. package/dist/pack/schema.js +181 -0
  307. package/dist/pack/schema.js.map +1 -0
  308. package/dist/pack/territories.d.ts +98 -0
  309. package/dist/pack/territories.d.ts.map +1 -0
  310. package/dist/pack/territories.js +0 -0
  311. package/dist/pack/territories.js.map +1 -0
  312. package/dist/pack/upgrade.d.ts +86 -0
  313. package/dist/pack/upgrade.d.ts.map +1 -0
  314. package/dist/pack/upgrade.js +76 -0
  315. package/dist/pack/upgrade.js.map +1 -0
  316. package/dist/pack/vat-codes.d.ts +273 -0
  317. package/dist/pack/vat-codes.d.ts.map +1 -0
  318. package/dist/pack/vat-codes.js +513 -0
  319. package/dist/pack/vat-codes.js.map +1 -0
  320. package/dist/profiles.d.ts +67 -0
  321. package/dist/profiles.d.ts.map +1 -0
  322. package/dist/profiles.js +187 -0
  323. package/dist/profiles.js.map +1 -0
  324. package/dist/prompt.d.ts +40 -0
  325. package/dist/prompt.d.ts.map +1 -0
  326. package/dist/prompt.js +120 -0
  327. package/dist/prompt.js.map +1 -0
  328. package/dist/registry.d.ts +84 -0
  329. package/dist/registry.d.ts.map +1 -0
  330. package/dist/registry.js +104 -0
  331. package/dist/registry.js.map +1 -0
  332. package/dist/rest.d.ts +81 -0
  333. package/dist/rest.d.ts.map +1 -0
  334. package/dist/rest.js +245 -0
  335. package/dist/rest.js.map +1 -0
  336. package/dist/schema.d.ts +15 -0
  337. package/dist/schema.d.ts.map +1 -0
  338. package/dist/schema.js +15 -0
  339. package/dist/schema.js.map +1 -0
  340. package/dist/seeds.d.ts +27 -0
  341. package/dist/seeds.d.ts.map +1 -0
  342. package/dist/seeds.js +47 -0
  343. package/dist/seeds.js.map +1 -0
  344. package/dist/session.d.ts +39 -0
  345. package/dist/session.d.ts.map +1 -0
  346. package/dist/session.js +92 -0
  347. package/dist/session.js.map +1 -0
  348. package/dist/sql.d.ts +48 -0
  349. package/dist/sql.d.ts.map +1 -0
  350. package/dist/sql.js +112 -0
  351. package/dist/sql.js.map +1 -0
  352. package/dist/status.d.ts +94 -0
  353. package/dist/status.d.ts.map +1 -0
  354. package/dist/status.js +120 -0
  355. package/dist/status.js.map +1 -0
  356. package/dist/ui.d.ts +55 -0
  357. package/dist/ui.d.ts.map +1 -0
  358. package/dist/ui.js +114 -0
  359. package/dist/ui.js.map +1 -0
  360. package/package.json +29 -0
  361. package/schema/output.1.json +613 -0
package/dist/sql.js ADDED
@@ -0,0 +1,112 @@
1
+ /**
2
+ * The only way this CLI talks to Postgres.
3
+ *
4
+ * Everything above this file is written against `SqlClient`, so the same
5
+ * migration runner, bootstrap and checks can run against a real Supabase
6
+ * project (the `postgres` driver, below) and against PGlite in the tests.
7
+ * No command imports a driver directly.
8
+ */
9
+ /** One row, or `undefined` when the query returned none. */
10
+ export async function first(db, sql, params = []) {
11
+ const rows = await db.query(sql, params);
12
+ return rows[0];
13
+ }
14
+ /** One scalar, or `undefined`. */
15
+ export async function scalar(db, sql, params = []) {
16
+ const row = await first(db, sql, params);
17
+ if (row === undefined)
18
+ return undefined;
19
+ const values = Object.values(row);
20
+ return values[0];
21
+ }
22
+ /**
23
+ * Connects to Postgres with the `postgres` driver.
24
+ *
25
+ * Imported lazily so that the tests — which plug PGlite into `SqlClient` —
26
+ * never load a network driver, and so `ekwo --help` costs nothing.
27
+ *
28
+ * `prepare: false` because Supabase's transaction-mode pooler (port 6543)
29
+ * rejects prepared statements; the CLI works on either port with it off.
30
+ */
31
+ export async function connect(connectionString) {
32
+ const { default: postgres } = await import('postgres');
33
+ const sql = postgres(connectionString, {
34
+ max: 1,
35
+ prepare: false,
36
+ idle_timeout: 20,
37
+ connect_timeout: 30,
38
+ onnotice: () => { },
39
+ });
40
+ const wrap = (handle) => ({
41
+ async exec(text) {
42
+ await handle.unsafe(text).simple();
43
+ },
44
+ async query(text, params = []) {
45
+ const result = await handle.unsafe(text, params);
46
+ return result;
47
+ },
48
+ async transaction(fn) {
49
+ return (await handle.begin(async (tx) => fn(wrap(tx))));
50
+ },
51
+ async close() {
52
+ await sql.end({ timeout: 5 });
53
+ },
54
+ });
55
+ // Fail here rather than in the middle of a migration — and close the pool
56
+ // on the way out, so a bad connection string does not leave the process
57
+ // holding a socket open and waiting for it.
58
+ try {
59
+ await sql `select 1`;
60
+ }
61
+ catch (error) {
62
+ await sql.end({ timeout: 5 }).catch(() => { });
63
+ throw error;
64
+ }
65
+ // This connection is the installer. The guards inside the schema ask
66
+ // `is_installer()` rather than "is there no session", so the runner has to
67
+ // say so out loud; `asUser()` below withdraws it for the length of the call
68
+ // it makes on somebody's behalf. A caller reaching the database through
69
+ // PostgREST cannot set this, which is the whole point of it being a setting.
70
+ // `set_config(..., false)` is session-wide, and the pool is capped at one.
71
+ //
72
+ // Not swallowed. A connection that cannot say it is installing is one every
73
+ // guard in the schema will refuse later, with a message about a capability
74
+ // the operator does not have and cannot get — so the failure belongs here,
75
+ // where it names itself.
76
+ try {
77
+ await sql `select set_config('ekwo.installing', 'on', false)`;
78
+ }
79
+ catch (error) {
80
+ await sql.end({ timeout: 5 }).catch(() => { });
81
+ throw error;
82
+ }
83
+ return wrap(sql);
84
+ }
85
+ /**
86
+ * Runs `fn` with `auth.uid()` answering `userId`.
87
+ *
88
+ * The CLI holds a superuser connection, so row level security is bypassed —
89
+ * but the guards written *inside* the schema's functions (`register_instance`
90
+ * refusing anyone who is not an instance administrator, for one) read
91
+ * `auth.uid()` and would refuse the installer. Setting the request claim the
92
+ * way PostgREST does makes those functions see the administrator the CLI is
93
+ * acting for, so the rule is satisfied rather than circumvented.
94
+ *
95
+ * The connection pool is capped at one, so the setting and the call land on
96
+ * the same backend.
97
+ */
98
+ export async function asUser(db, userId, fn) {
99
+ const claims = JSON.stringify({ sub: userId, role: 'authenticated' });
100
+ await db.query('select set_config($1, $2, false)', ['request.jwt.claims', claims]);
101
+ // Acting for somebody is not installing: the guards must judge this call on
102
+ // what that person may do, not on the connection it happens to travel over.
103
+ await db.query('select set_config($1, $2, false)', ['ekwo.installing', '']);
104
+ try {
105
+ return await fn();
106
+ }
107
+ finally {
108
+ await db.query('select set_config($1, $2, false)', ['request.jwt.claims', '']);
109
+ await db.query('select set_config($1, $2, false)', ['ekwo.installing', 'on']);
110
+ }
111
+ }
112
+ //# sourceMappingURL=sql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql.js","sourceRoot":"","sources":["../src/sql.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAcH,4DAA4D;AAC5D,MAAM,CAAC,KAAK,UAAU,KAAK,CACzB,EAAa,EACb,GAAW,EACX,SAAoB,EAAE;IAEtB,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,KAAK,CAAI,GAAG,EAAE,MAAM,CAAC,CAAC;IAC5C,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC;AAED,kCAAkC;AAClC,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,EAAa,EACb,GAAW,EACX,SAAoB,EAAE;IAEtB,MAAM,GAAG,GAAG,MAAM,KAAK,CAA0B,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAClE,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,MAAM,CAAC,CAAC,CAAM,CAAC;AACxB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,gBAAwB;IACpD,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;IAEvD,MAAM,GAAG,GAAG,QAAQ,CAAC,gBAAgB,EAAE;QACrC,GAAG,EAAE,CAAC;QACN,OAAO,EAAE,KAAK;QACd,YAAY,EAAE,EAAE;QA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ACzB,IAAI,CAAC;QACH,MAAM,GAAG,CAAA,mDAAmD,CAAC;IAC/D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAC9C,MAAM,KAAK,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,EAAa,EACb,MAAc,EACd,EAAoB;IAEpB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;IACtE,MAAM,EAAE,CAAC,KAAK,CAAC,kCAAkC,EAAE,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC,CAAC;IACnF,4EAA4E;IAC5E,4EAA4E;IAC5E,MAAM,EAAE,CAAC,KAAK,CAAC,kCAAkC,EAAE,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC,CAAC;IAC5E,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,EAAE,CAAC;IACpB,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,KAAK,CAAC,kCAAkC,EAAE,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC,CAAC;QAC/E,MAAM,EAAE,CAAC,KAAK,CAAC,kCAAkC,EAAE,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAC;IAChF,CAAC;AACH,CAAC"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * `ekwo status` — what is installed, against what this CLI carries.
3
+ *
4
+ * Two versions matter and they are not the same thing. `instance.schema_version`
5
+ * is what the installation believes it runs; `ekwo_schema_version()` is what
6
+ * the migrations actually define. They diverge when a migration bumped the
7
+ * function but nothing wrote it back onto the row, which is precisely the case
8
+ * `ekwo migrate` closes.
9
+ */
10
+ import type { Migration } from './migrations.js';
11
+ import { type InstanceRow } from './registry.js';
12
+ import type { SqlClient } from './sql.js';
13
+ export interface CompanySummary {
14
+ name: string;
15
+ country: string;
16
+ accounts: number;
17
+ entries: number;
18
+ fiscalYears: number;
19
+ /** How many of them are closed. `ekwo status` prints the open ones. */
20
+ closedFiscalYears: number;
21
+ /** Version of the country pack this company copied, from `company_packs`. */
22
+ packVersion: string | null;
23
+ /** Chart of accounts this company keeps its books on. */
24
+ chartCode: string | null;
25
+ /**
26
+ * How often the company files its periodic return, or null when it has not
27
+ * been recorded. Printed as "filing cadence not recorded" rather than filled
28
+ * in with a plausible one: this is the answer a reminder and a client that
29
+ * offers "file the current period" read.
30
+ */
31
+ vatPeriod: string | null;
32
+ /**
33
+ * How often this company files each declaration it is subject to, by the
34
+ * code of the form, with the name the pack gives it.
35
+ *
36
+ * `vatPeriod` above is one entry of this — the periodic return — kept because
37
+ * it is published. A company files its return and its recapitulative
38
+ * statement on cadences of their own, and printing only the first is how a
39
+ * lawful monthly statement from a quarterly filer looks like a mistake.
40
+ */
41
+ filingPeriods: {
42
+ reportCode: string;
43
+ reportName: string | null;
44
+ period: string;
45
+ }[];
46
+ /**
47
+ * Links onto this company's documents that still answer: not withdrawn, and
48
+ * not past their expiry. It is here because it is the one thing about an
49
+ * installation that is reachable without signing in, and an operator looking
50
+ * at `ekwo status` should be able to see how many doors are open.
51
+ */
52
+ liveShares: number;
53
+ }
54
+ /** A country pack loaded in this installation. */
55
+ export interface PackStatus {
56
+ country: string;
57
+ name: string;
58
+ version: string;
59
+ /** Charts this pack offers, the default one marked. */
60
+ charts: {
61
+ code: string;
62
+ name: string;
63
+ isDefault: boolean;
64
+ }[];
65
+ certificationStatus: string;
66
+ certifiedBy: string | null;
67
+ certifiedAt: string | null;
68
+ /** The structured invoice this country expects, from its pack. Null if it says nothing. */
69
+ einvoiceProfile: string | null;
70
+ }
71
+ export interface Status {
72
+ schemaInstalled: boolean;
73
+ /** Version recorded on the instance row. */
74
+ installedVersion: string | null;
75
+ /** Version the applied migrations define. */
76
+ availableVersion: string | null;
77
+ appliedCount: number;
78
+ pending: Migration[];
79
+ unknown: string[];
80
+ instance: InstanceRow | undefined;
81
+ admins: number;
82
+ companies: CompanySummary[];
83
+ /** What `country_packs` holds: the version each pack is loaded at. */
84
+ packs: PackStatus[];
85
+ }
86
+ export declare function status(db: SqlClient, migrations: Migration[]): Promise<Status>;
87
+ /**
88
+ * Writes the version the migrations define back onto the instance row.
89
+ *
90
+ * Called at the end of `ekwo migrate`, so `status` stops disagreeing with
91
+ * itself. It is the only place the CLI writes `schema_version`.
92
+ */
93
+ export declare function syncSchemaVersion(db: SqlClient): Promise<string | undefined>;
94
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,6EAA6E;IAC7E,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,yDAAyD;IACzD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;;OAKG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;;;;;OAQG;IACH,aAAa,EAAE;QAAE,UAAU,EAAE,MA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AAC,MAAM,GAAG,SAAS,CAAC,CAKlF"}
package/dist/status.js ADDED
@@ -0,0 +1,120 @@
1
+ /**
2
+ * `ekwo status` — what is installed, against what this CLI carries.
3
+ *
4
+ * Two versions matter and they are not the same thing. `instance.schema_version`
5
+ * is what the installation believes it runs; `ekwo_schema_version()` is what
6
+ * the migrations actually define. They diverge when a migration bumped the
7
+ * function but nothing wrote it back onto the row, which is precisely the case
8
+ * `ekwo migrate` closes.
9
+ */
10
+ import { migrationGap } from './migrations.js';
11
+ import { readInstance } from './registry.js';
12
+ import { scalar } from './sql.js';
13
+ export async function status(db, migrations) {
14
+ const schemaInstalled = (await scalar(db, `select exists (
15
+ select 1 from information_schema.tables
16
+ where table_schema = 'public' and table_name = 'instance'
17
+ )`)) === true;
18
+ const gap = await migrationGap(db, migrations);
19
+ if (!schemaInstalled) {
20
+ return {
21
+ schemaInstalled: false,
22
+ installedVersion: null,
23
+ availableVersion: null,
24
+ appliedCount: gap.applied.length,
25
+ pending: gap.pending,
26
+ unknown: gap.unknown,
27
+ instance: undefined,
28
+ admins: 0,
29
+ companies: [],
30
+ packs: [],
31
+ };
32
+ }
33
+ const instance = await readInstance(db);
34
+ const availableVersion = (await scalar(db, 'select ekwo_schema_version()')) ?? null;
35
+ const admins = Number((await scalar(db, 'select count(*)::text from instance_admins')) ?? '0');
36
+ const companies = await db.query(`select c.name,
37
+ c.country,
38
+ c.vat_period,
39
+ (select coalesce(jsonb_agg(jsonb_build_object(
40
+ 'report_code', f.report_code,
41
+ 'report_name', t.name,
42
+ 'period', f.period)
43
+ order by t.is_periodic_return desc nulls last, f.report_code), '[]'::jsonb)
44
+ from company_filing_periods f
45
+ left join tax_report_templates t
46
+ on t.country = c.fiscal_country and t.code = f.report_code
47
+ where f.company_id = c.id) as filing_periods,
48
+ (select count(*) from accounts a where a.company_id = c.id)::text as accounts,
49
+ (select count(*) from entries e where e.company_id = c.id)::text as entries,
50
+ (select count(*) from fiscal_years f where f.company_id = c.id)::text as fiscal_years,
51
+ (select count(*) from fiscal_years f where f.company_id = c.id and f.is_closed)::text as closed_fiscal_years,
52
+ (select count(*) from document_shares s
53
+ where s.company_id = c.id and s.revoked_at is null
54
+ and (s.expires_at is null or s.expires_at > now()))::text as live_shares,
55
+ (select p.version from company_packs p
56
+ where p.company_id = c.id and p.country = c.country) as pack_version,
57
+ (select p.chart_code from company_packs p
58
+ where p.company_id = c.id and p.country = c.country) as chart_code
59
+ from companies c
60
+ order by c.name`);
61
+ const packs = await db.query(`select p.country, p.name, p.version, p.certification_status::text, p.certified_by,
62
+ p.certified_at::text, d.einvoice_profile
63
+ from country_packs p
64
+ left join country_defaults d on d.country = p.country
65
+ order by p.country`);
66
+ const charts = await db.query('select country, code, name, is_default from chart_templates order by country, is_default desc, code');
67
+ return {
68
+ schemaInstalled: true,
69
+ installedVersion: instance?.schema_version ?? null,
70
+ availableVersion,
71
+ appliedCount: gap.applied.length,
72
+ pending: gap.pending,
73
+ unknown: gap.unknown,
74
+ instance,
75
+ admins,
76
+ companies: companies.map((c) => ({
77
+ name: c.name,
78
+ country: c.country,
79
+ accounts: Number(c.accounts),
80
+ entries: Number(c.entries),
81
+ fiscalYears: Number(c.fiscal_years),
82
+ closedFiscalYears: Number(c.closed_fiscal_years),
83
+ packVersion: c.pack_version,
84
+ chartCode: c.chart_code,
85
+ vatPeriod: c.vat_period,
86
+ filingPeriods: (c.filing_periods ?? []).map((row) => ({
87
+ reportCode: row.report_code,
88
+ reportName: row.report_name,
89
+ period: row.period,
90
+ })),
91
+ liveShares: Number(c.live_shares),
92
+ })),
93
+ packs: packs.map((p) => ({
94
+ country: p.country,
95
+ name: p.name,
96
+ version: p.version,
97
+ certificationStatus: p.certification_status,
98
+ certifiedBy: p.certified_by,
99
+ certifiedAt: p.certified_at,
100
+ einvoiceProfile: p.einvoice_profile,
101
+ charts: charts
102
+ .filter((c) => c.country === p.country)
103
+ .map((c) => ({ code: c.code, name: c.name, isDefault: c.is_default })),
104
+ })),
105
+ };
106
+ }
107
+ /**
108
+ * Writes the version the migrations define back onto the instance row.
109
+ *
110
+ * Called at the end of `ekwo migrate`, so `status` stops disagreeing with
111
+ * itself. It is the only place the CLI writes `schema_version`.
112
+ */
113
+ export async function syncSchemaVersion(db) {
114
+ const version = await scalar(db, 'select ekwo_schema_version()');
115
+ if (version === undefined)
116
+ return undefined;
117
+ await db.query('update instance set schema_version = $1 where id = 1', [version]);
118
+ return version;
119
+ }
120
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../src/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAoB,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAsElC,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,EAAa,EAAE,UAAuB;IACjE,MAAM,eAAe,GACnB,CAAC,MAAM,MAAM,CACX,EAAE,EACF;;;SAGG,CACJ,CAAC,KAAK,IAAI,CAAC;IAEd,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;IAE/C,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO;YACL,eAAe,EAAE,KAAK;YACtB,gBAAgB,EAAE,IAAI;YACtB,gBAAgB,EAAE,IAAI;YACtB,YAAY,EAAE,GAAG,CAAC,OAAO,CAAC,MAAM;YAChC,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,QAAQ,EAAE,SAAS;YACnB,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,EAAE;YACb,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,EAAE,CAAC,CAAC;IACxC,MAAM,gBAAgB,GAAG,CAAC,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OAAO,OAAO,CAAC;AACjB,CAAC"}
package/dist/ui.d.ts ADDED
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Everything the CLI prints.
3
+ *
4
+ * Colour only when the output is a terminal and `NO_COLOR` is unset, because
5
+ * `ekwo status > report.txt` should not contain escape codes.
6
+ *
7
+ * Under `--json` the standard output belongs to one JSON document and nothing
8
+ * else, so every line written here moves to the standard error: a person
9
+ * watching still sees the steps go by, and a program reading the output never
10
+ * has to find where the prose stops. There is no spinner and no line redrawn
11
+ * in place anywhere in this CLI — everything is a line that ends — so there is
12
+ * nothing to switch off when the output is a file or a pipe.
13
+ */
14
+ /** Called once per run, before anything is printed. */
15
+ export declare function setJsonMode(on: boolean): void;
16
+ export declare function isJsonMode(): boolean;
17
+ /** What `warn()` said during this run, for the `warnings` of the JSON document. */
18
+ export declare function collectedWarnings(): string[];
19
+ export declare const bold: (text: string) => string;
20
+ export declare const dim: (text: string) => string;
21
+ export declare const green: (text: string) => string;
22
+ export declare const yellow: (text: string) => string;
23
+ export declare const red: (text: string) => string;
24
+ export declare const cyan: (text: string) => string;
25
+ export declare function line(text?: string): void;
26
+ /** The one thing `--json` writes to the standard output. */
27
+ export declare function emit(value: unknown): void;
28
+ export declare function heading(text: string): void;
29
+ export declare function step(text: string): void;
30
+ export declare function skipped(text: string): void;
31
+ export declare function note(text: string): void;
32
+ export declare function warn(text: string): void;
33
+ export declare function fail(text: string): void;
34
+ /** A two-column table with the keys right-padded to the widest one. */
35
+ export declare function pairs(rows: [string, string][], indent?: string): void;
36
+ /**
37
+ * A table with every column padded to its widest cell.
38
+ *
39
+ * Width is counted on the text and not on the escape codes around it, so a
40
+ * coloured cell does not push the next column out. A number column is aligned
41
+ * on the right, which is where a reader compares two of them.
42
+ */
43
+ export declare function table(columns: {
44
+ title: string;
45
+ align?: 'left' | 'right';
46
+ }[], rows: string[][], indent?: string): void;
47
+ export declare function stripColour(text: string): string;
48
+ /**
49
+ * Redacts a secret for display. Never print one in full: terminal history and
50
+ * CI logs outlive the session.
51
+ */
52
+ export declare function mask(secret: string): string;
53
+ /** A connection string with its password replaced. */
54
+ export declare function maskUrl(url: string): string;
55
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,uDAAuD;AACvD,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,CAG7C;AAED,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,mFAAmF;AACnF,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAE5C;AAmBD,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,KAAG,MAA0B,CAAC;AAC/D,eAAO,MAAM,GAAG,GAAI,MAAM,MAAM,KAAG,MAA0B,CAAC;AAC9D,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,KAAG,MAA2B,CAAC;AACjE,eAAO,MAAM,MAAM,GAAI,MAAM,MAAM,KAAG,MAA2B,CAAC;AAClE,eAAO,MAAM,GAAG,GAAI,MAAM,MAAM,KAAG,MAA2B,CAAC;AAC/D,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,KAAG,MAA2B,CAAC;AAEhE,wBAAgB,IAAI,CAAC,IAAI,SAAK,GAAG,IAAI,CAEpC;AAED,4DAA4D;AAC5D,wBAAgB,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAEzC;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAG1C;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE1C;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAGvC;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED,uEAAuE;AACvE,wBAAgB,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,SAAO,GAAG,IAAI,CAKnE;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CACnB,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EAAE,EACtD,IAAI,EAAE,MAAM,EAAE,EAAE,EAChB,MAAM,SAAO,GACZ,IAAI,CAYN;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAG3C;AAED,sDAAsD;AACtD,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C"}
package/dist/ui.js ADDED
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Everything the CLI prints.
3
+ *
4
+ * Colour only when the output is a terminal and `NO_COLOR` is unset, because
5
+ * `ekwo status > report.txt` should not contain escape codes.
6
+ *
7
+ * Under `--json` the standard output belongs to one JSON document and nothing
8
+ * else, so every line written here moves to the standard error: a person
9
+ * watching still sees the steps go by, and a program reading the output never
10
+ * has to find where the prose stops. There is no spinner and no line redrawn
11
+ * in place anywhere in this CLI — everything is a line that ends — so there is
12
+ * nothing to switch off when the output is a file or a pipe.
13
+ */
14
+ let jsonMode = false;
15
+ let warnings = [];
16
+ /** Called once per run, before anything is printed. */
17
+ export function setJsonMode(on) {
18
+ jsonMode = on;
19
+ warnings = [];
20
+ }
21
+ export function isJsonMode() {
22
+ return jsonMode;
23
+ }
24
+ /** What `warn()` said during this run, for the `warnings` of the JSON document. */
25
+ export function collectedWarnings() {
26
+ return [...warnings];
27
+ }
28
+ function target() {
29
+ return jsonMode ? process.stderr : process.stdout;
30
+ }
31
+ /** Asked at every call: the stream a line goes to is decided per run. */
32
+ function useColour() {
33
+ return (target().isTTY === true &&
34
+ process.env['NO_COLOR'] === undefined &&
35
+ process.env['TERM'] !== 'dumb');
36
+ }
37
+ function paint(code, text) {
38
+ return useColour() ? `\u001b[${code}m${text}\u001b[0m` : text;
39
+ }
40
+ export const bold = (text) => paint('1', text);
41
+ export const dim = (text) => paint('2', text);
42
+ export const green = (text) => paint('32', text);
43
+ export const yellow = (text) => paint('33', text);
44
+ export const red = (text) => paint('31', text);
45
+ export const cyan = (text) => paint('36', text);
46
+ export function line(text = '') {
47
+ target().write(`${text}\n`);
48
+ }
49
+ /** The one thing `--json` writes to the standard output. */
50
+ export function emit(value) {
51
+ process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
52
+ }
53
+ export function heading(text) {
54
+ line();
55
+ line(bold(text));
56
+ }
57
+ export function step(text) {
58
+ line(` ${green('·')} ${text}`);
59
+ }
60
+ export function skipped(text) {
61
+ line(` ${dim('·')} ${dim(text)}`);
62
+ }
63
+ export function note(text) {
64
+ line(` ${text}`);
65
+ }
66
+ export function warn(text) {
67
+ warnings.push(stripColour(text));
68
+ line(` ${yellow('!')} ${text}`);
69
+ }
70
+ export function fail(text) {
71
+ process.stderr.write(`${red('✗')} ${text}\n`);
72
+ }
73
+ /** A two-column table with the keys right-padded to the widest one. */
74
+ export function pairs(rows, indent = ' ') {
75
+ const width = rows.reduce((max, [key]) => Math.max(max, key.length), 0);
76
+ for (const [key, value] of rows) {
77
+ line(`${indent}${dim(key.padEnd(width))} ${value}`);
78
+ }
79
+ }
80
+ /**
81
+ * A table with every column padded to its widest cell.
82
+ *
83
+ * Width is counted on the text and not on the escape codes around it, so a
84
+ * coloured cell does not push the next column out. A number column is aligned
85
+ * on the right, which is where a reader compares two of them.
86
+ */
87
+ export function table(columns, rows, indent = ' ') {
88
+ const widths = columns.map((column, index) => rows.reduce((max, row) => Math.max(max, stripColour(row[index] ?? '').length), column.title.length));
89
+ const cell = (text, index) => {
90
+ const gap = ' '.repeat(Math.max(0, (widths[index] ?? 0) - stripColour(text).length));
91
+ return columns[index]?.align === 'right' ? `${gap}${text}` : `${text}${gap}`;
92
+ };
93
+ line(`${indent}${columns.map((column, index) => dim(cell(column.title, index))).join(' ')}`.trimEnd());
94
+ for (const row of rows) {
95
+ line(`${indent}${columns.map((_, index) => cell(row[index] ?? '', index)).join(' ')}`.trimEnd());
96
+ }
97
+ }
98
+ export function stripColour(text) {
99
+ return text.replace(/\u001b\[[0-9;]*m/g, '');
100
+ }
101
+ /**
102
+ * Redacts a secret for display. Never print one in full: terminal history and
103
+ * CI logs outlive the session.
104
+ */
105
+ export function mask(secret) {
106
+ if (secret.length <= 8)
107
+ return '•'.repeat(secret.length);
108
+ return `${secret.slice(0, 4)}${'•'.repeat(Math.min(20, secret.length - 8))}${secret.slice(-4)}`;
109
+ }
110
+ /** A connection string with its password replaced. */
111
+ export function maskUrl(url) {
112
+ return url.replace(/(postgres(?:ql)?:\/\/[^:/@]+:)[^@]*(@)/i, '$1••••••$2');
113
+ }
114
+ //# sourceMappingURL=ui.js.map
package/dist/ui.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,IAAI,QAAQ,GAAa,EAAE,CAAC;AAE5B,uDAAuD;AACvD,MAAM,UAAU,WAAW,CAAC,EAAW;IACrC,QAAQ,GAAG,EAAE,CAAC;IACd,QAAQ,GAAG,EAAE,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,iBAAiB;IAC/B,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;AACvB,CAAC;AAED,SAAS,MAAM;IACb,OAAO,QAAQ,CAAC,C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IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IACxG,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,MAAc;IACjC,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACzD,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAClG,CAAC;AAED,sDAAsD;AACtD,MAAM,UAAU,OAAO,CAAC,GAAW;IACjC,OAAO,GAAG,CAAC,OAAO,CAAC,yCAAyC,EAAE,YAAY,CAAC,CAAC;AAC9E,CAAC"}
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "ekwo-os",
3
+ "version": "0.4.1",
4
+ "description": "Install and operate Ekwo OS on your own Supabase project: npx ekwo-os init.",
5
+ "keywords": ["accounting", "supabase", "postgres", "migrations", "cli", "bookkeeping", "ekwo"],
6
+ "license": "AGPL-3.0-only",
7
+ "author": "Ekwo AI",
8
+ "homepage": "https://github.com/Ekwo-ai/ekwo-os#readme",
9
+ "repository": { "type": "git", "url": "git+https://github.com/Ekwo-ai/ekwo-os.git", "directory": "packages/cli" },
10
+ "bugs": { "url": "https://github.com/Ekwo-ai/ekwo-os/issues" },
11
+ "type": "module",
12
+ "engines": { "node": ">=20" },
13
+ "ekwo": { "schemaMin": "0.4.0" },
14
+ "files": ["dist", "schema", "README.md"],
15
+ "bin": { "ekwo": "./dist/bin.js" },
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" }
20
+ },
21
+ "scripts": {
22
+ "build": "tsc -p tsconfig.build.json && node scripts/copy-assets.mjs dist/assets && node scripts/chmod-bin.mjs",
23
+ "typecheck": "tsc -p tsconfig.json --noEmit"
24
+ },
25
+ "dependencies": {
26
+ "@ekwo-ai/core": "^0.4.0",
27
+ "postgres": "^3.4.5"
28
+ }
29
+ }