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
@@ -0,0 +1,766 @@
1
+ /**
2
+ * Reading a pack: the files, the CSV, and what the schema says about them.
3
+ *
4
+ * A pack is `packs/<cc>/`: a manifest, a chart of accounts as CSV, taxes as
5
+ * JSON, and — accepted here, compiled later — the declaration boxes, the
6
+ * financial statements and the translations. Nothing in it executes.
7
+ */
8
+ import { type VatRegime } from './vat-codes.js';
9
+ /**
10
+ * The chart a pack has when it declares none, and the name of the framework
11
+ * pack. Both are mechanism words: `default` is not a country and `generic` is
12
+ * not a language — a pack says its chart is called PCMN, in its own data.
13
+ */
14
+ export declare const DEFAULT_CHART = "default";
15
+ export declare const GENERIC_PACK = "generic";
16
+ /**
17
+ * One text of a pack's source register.
18
+ *
19
+ * The register is where a link lives, and the only place: a tax, a box of the
20
+ * declaration or a sentence of an invoice writes the article it claims in its
21
+ * own `legal_reference` and names the key of the text that article is in. So a
22
+ * publisher that reorganises its site is one line of the pack to change, and a
23
+ * reviewer opening a pack has the reading list before they have read a rule.
24
+ *
25
+ * Nothing here is a copy of the text. A pack says where the law is, never what
26
+ * it says: a quotation ages without anybody noticing, and a country pack that
27
+ * carried one would be a second, unversioned edition of a statute.
28
+ */
29
+ export interface PackSource {
30
+ /** How the rest of the pack names this text. Unique inside one register. */
31
+ key: string;
32
+ title: string;
33
+ /** Who publishes it officially — the half of a source a link cannot carry. */
34
+ publisher: string;
35
+ /** Absolute, https, and a permanent identifier wherever the publisher has one. */
36
+ url: string;
37
+ /** The day somebody opened it. What says how old the reading is. */
38
+ consulted_on: string;
39
+ /** law | regulation | form | standard | portal | guidance. */
40
+ kind: string;
41
+ /**
42
+ * True on the one entry that publishes the list an exemption reason code of
43
+ * this country comes from — BT-121, outside the common system of VAT, where
44
+ * the VATEX list of EN 16931 does not reach.
45
+ *
46
+ * At most one entry of a register carries it, and it has to be a `standard`,
47
+ * because a code list is one. It exists because the opposite is not true: a
48
+ * `standard` is "a technical norm or code list", so FRS 102 and the FASB
49
+ * Accounting Standards Codification are `standard` entries too, and reading
50
+ * the first of them as this list authorised a reason code on any tax of the
51
+ * pack in declaration order.
52
+ */
53
+ reason_codes?: boolean;
54
+ }
55
+ /**
56
+ * What a manifest says about who stands behind a pack.
57
+ *
58
+ * `sources` holds the register above and — for a pack written before it —
59
+ * bare strings, which are titles with nowhere to read them. Both are accepted
60
+ * so that a community pack goes on compiling; `ekwo pack check` warns on the
61
+ * string, and a pack that is not `community` has to carry at least one entry
62
+ * of the register.
63
+ */
64
+ export interface PackCertification {
65
+ status: string;
66
+ by?: string | null;
67
+ on?: string;
68
+ sources?: (string | PackSource)[];
69
+ }
70
+ /** The register of a pack: the entries, with the deprecated bare titles dropped. */
71
+ export declare function sourcesOf(certification: PackCertification | null | undefined): PackSource[];
72
+ /**
73
+ * Which VAT the country of a pack levies, as the three code lists see it.
74
+ *
75
+ * Two of those lists are the Union's — EN 16931 is a European standard and the
76
+ * VATEX list is published by the European Commission — so whether a pack may
77
+ * carry a code from them is a question about its country. The answer is a row
78
+ * of `territories`, read from the seed the database reads, and never a country
79
+ * written into this repository's code.
80
+ *
81
+ * **The day is the pack's `released_at`, not today.** A pack is a transcription
82
+ * of a country's law, and `released_at` is the day it says that transcription
83
+ * is true; it is in the manifest, it is inside the pack's checksum, and asking
84
+ * it makes `ekwo pack check` answer the same thing about the same commit for
85
+ * ever. Today would not: a pack that passes in the morning and fails in the
86
+ * evening with nothing committed in between is the one thing a check must
87
+ * never be, and the day a State acceded or left is exactly when it would
88
+ * happen. A tax's own `valid_from` would be worse still — the taxes of a pack
89
+ * span decades, so one pack would speak two regimes at once and a British rate
90
+ * of 1994 would be asked for a VATEX code from a list that did not exist. A
91
+ * pack whose manifest names no day falls back on today, because a pack that
92
+ * does not say when it speaks of is speaking of now.
93
+ *
94
+ * **A table that says nothing is not a table saying no.** `eu_vat_scope_of()`
95
+ * answers `none` for a code it does not carry, which is right for its own
96
+ * question — a supply to a place the Union has never heard of is not an
97
+ * intra-Community one. It is not right for this one. Every refusal below
98
+ * *narrows* what a pack may say, and narrowing on the strength of a missing
99
+ * row would refuse a valid pack for a country somebody has not added to the
100
+ * reference data yet. So a country the table carries no row for is held to the
101
+ * table as published — the Union's — and the gap is closed where it belongs:
102
+ * `tests/territories.test.ts` refuses a pack of this repository whose country
103
+ * is not in `territories`, and the test beside it says the same of the seed the
104
+ * CLI reads.
105
+ *
106
+ * `full` and nothing else counts as being in the system **for a pack**. The
107
+ * third value, `goods`, is Northern Ireland, and it is not a fact about a pack
108
+ * at all: the Union's rules reach goods there and not services, so half the
109
+ * table applies and which half depends on the tax. A pack whose country is
110
+ * such a territory is therefore still held to the rules of a country outside
111
+ * the system, which refuses a code rather than accepting a wrong one — and a
112
+ * *tax* that names the territory it applies in is judged on that territory
113
+ * instead, by `regimeOfTerritory` below.
114
+ *
115
+ * **Whether BT-151 is read is a second question, and the manifest answers the
116
+ * other half of it.** The category codes are UNCL5305, a UN/CEFACT list, and
117
+ * they hold wherever a pack is; being *asked* for one is about whether an
118
+ * invoice governed by the standard exists. Inside the common system it does.
119
+ * Outside it, it does where the pack declares an e-invoicing profile —
120
+ * `peppol-bis-3`, `factur-x-en16931`, `xrechnung`, a PINT — every one of which
121
+ * is built on the semantic model of EN 16931 and carries the field. Where the
122
+ * pack declares neither, as the first pack of a country with no value added
123
+ * tax did, nothing reads BT-151 and nothing demands it.
124
+ *
125
+ * **Which list a reason code may come from is named by the entry itself.**
126
+ * `reasonList` was the title of the first entry of the register whose `kind`
127
+ * was `standard`, and `standard` covers a code list *and* an accounting
128
+ * standard, so a pack naming FRS 102 or the FASB Codification was silently
129
+ * declaring a list of exemption reason codes. An entry now says so with
130
+ * `reason_codes`, at most one per pack, and `sourceRegister` refuses the rest.
131
+ */
132
+ export declare function vatRegime(manifest: Manifest, root?: string): Promise<VatRegime>;
133
+ export interface PackAccount {
134
+ code: string;
135
+ parent: string | null;
136
+ type: string;
137
+ reconcilable: boolean;
138
+ name: string;
139
+ sequence: number;
140
+ }
141
+ export interface PackPosting {
142
+ /**
143
+ * `base` is the line itself and `tax_on_base` is the share of the tax that
144
+ * is not recoverable; neither carries an account, because both land on the
145
+ * account the document line names.
146
+ */
147
+ type: 'base' | 'tax' | 'tax_on_base';
148
+ factor: number;
149
+ account: string | null;
150
+ /**
151
+ * The box the posting is known by: the first of `boxes`, and null when it
152
+ * reports to none. It is what the natural key of a posting is read on, and
153
+ * what a reader that knows nothing of several boxes still sees.
154
+ */
155
+ box: string | null;
156
+ /**
157
+ * Every box this one amount is printed in. One box is the ordinary case;
158
+ * several is a form that prints the same figure in boxes no total can
159
+ * derive from one another — box 6.1 inside box 6 inside box 1 on the
160
+ * Estonian KMD, box 6 beside box 7 on the British VAT Return. `box` is
161
+ * `boxes[0]`, and an empty list means the posting reports nowhere.
162
+ */
163
+ boxes: string[];
164
+ box_factor: number;
165
+ /** Declaration form the box belongs to. Defaults to the pack's periodic return. */
166
+ report: string | null;
167
+ sequence: number;
168
+ }
169
+ export interface PackTax {
170
+ code: string;
171
+ name: string;
172
+ description: string | null;
173
+ /** vat | gst | sales_tax | withholding | other. A label for the reports. */
174
+ kind: string;
175
+ amount_type: string;
176
+ rate: number;
177
+ scope: string;
178
+ treatment: string;
179
+ valid_from: string;
180
+ valid_to: string | null;
181
+ legal_reference: string | null;
182
+ /** Key of the register entry where that reference can be read. Null where the pack names none. */
183
+ source: string | null;
184
+ vat_category: string | null;
185
+ exemption_code: string | null;
186
+ /** False when the buyer never gets the tax back. */
187
+ recoverable: boolean;
188
+ /** The unit price already holds the tax. */
189
+ price_include: boolean;
190
+ /**
191
+ * What this tax turns on that the ledger cannot see, from a closed
192
+ * vocabulary. What the question is, never how to answer it: no value, no
193
+ * operator, no expression — the article that sets a threshold or prescribes
194
+ * a certificate is the one in `legal_reference`.
195
+ */
196
+ conditions: string[];
197
+ /** ISO 3166-2 with the country prefix, for a tax levied by a state. */
198
+ jurisdiction: string | null;
199
+ /**
200
+ * Where the parties have to be for this tax to apply: `applies_when` of the
201
+ * pack, flattened. Each is a code of `territories`, or null where the tax
202
+ * says nothing about that party.
203
+ */
204
+ applies_seller_territory: string | null;
205
+ applies_buyer_territory: string | null;
206
+ applies_supply_territory: string | null;
207
+ /** Due on collection. Compiled to a column the cash-basis engine reads. */
208
+ cash_basis: boolean;
209
+ /** Account the tax waits on until the invoice is paid. */
210
+ cash_basis_transition_account: string | null;
211
+ sequence: number;
212
+ postings: {
213
+ invoice: PackPosting[];
214
+ credit_note: PackPosting[];
215
+ };
216
+ /** Reserved for phase 1: several taxes on one line. Refused until the core carries it. */
217
+ group?: string[];
218
+ }
219
+ /** One chart of accounts of a country, and the accounts it holds. */
220
+ export interface PackChart {
221
+ code: string;
222
+ name: string;
223
+ name_i18n: Record<string, string>;
224
+ /** File the accounts were read from, relative to the pack directory. */
225
+ file: string;
226
+ accounts: PackAccount[];
227
+ is_default: boolean;
228
+ audience: string | null;
229
+ /** Codes of the statements this chart reports on. */
230
+ statements: string[];
231
+ certification: PackCertification | null;
232
+ legal_reference: string | null;
233
+ /** Key of the register entry where that reference can be read. */
234
+ source: string | null;
235
+ }
236
+ /** One rule bringing accounts of a chart to a line of a statement. */
237
+ export interface PackStatementRule {
238
+ kind: 'code_range' | 'code_prefix' | 'account_type' | 'account_code';
239
+ code_from: string | null;
240
+ code_to: string | null;
241
+ account_type: string | null;
242
+ side: 'debit' | 'credit' | 'any';
243
+ sequence: number;
244
+ }
245
+ /** One line of a financial statement. */
246
+ export interface PackStatementLine {
247
+ code: string;
248
+ parent: string | null;
249
+ name: string;
250
+ sequence: number;
251
+ sign: 1 | -1;
252
+ /**
253
+ * Whether the line wrote `sign` itself, as opposed to taking the 1 every
254
+ * line reads with. The checker needs the difference: a total that declares
255
+ * `"sign": 1` is saying something about a total that a total cannot say,
256
+ * and it is worth telling its author so while they are writing the pack.
257
+ */
258
+ declares_sign: boolean;
259
+ is_total: boolean;
260
+ plus: string[];
261
+ minus: string[];
262
+ xbrl: string | null;
263
+ legal_reference: string | null;
264
+ /** Key of the register entry where that reference can be read. */
265
+ source: string | null;
266
+ rules: PackStatementRule[];
267
+ }
268
+ /** `statements.json`: the financial statements of a pack. */
269
+ export interface PackStatement {
270
+ code: string;
271
+ kind: string;
272
+ framework: string | null;
273
+ /**
274
+ * Taxonomy the `xbrl` fact keys of this statement are written against, as
275
+ * `name:version` — `nbb-cbso:26.0`. The format library that reads the keys
276
+ * carries the table of one version; against another, a key resolves onto a
277
+ * different line and nothing says so.
278
+ */
279
+ taxonomy: string | null;
280
+ name: string;
281
+ valid_from: string;
282
+ valid_to: string | null;
283
+ legal_reference: string | null;
284
+ /** Key of the register entry where that reference can be read. */
285
+ source: string | null;
286
+ /** Chart this statement belongs to, or null for every chart of the country. */
287
+ chart_code: string | null;
288
+ lines: PackStatementLine[];
289
+ }
290
+ /** One box of a declaration form. A total carries the lists it is added from. */
291
+ export interface PackReportBox {
292
+ box: string;
293
+ kind: 'base' | 'tax' | 'total';
294
+ name: string;
295
+ sequence: number;
296
+ /**
297
+ * Where the administration prints this box, when that is not where the pack
298
+ * declares it. Null means the same as `sequence`.
299
+ *
300
+ * The two were one field until a third pack paid for it: an eCDF subtotal
301
+ * prints above the boxes it adds up, and CDTFA-401-A prints line 11 on page
302
+ * one and computes it from the sections on page three. A pack had to spend
303
+ * its one ordering field on the evaluator, and the form's own order was
304
+ * lost. The evaluation order is the dependencies and is neither of these.
305
+ */
306
+ print_sequence: number | null;
307
+ plus: string[];
308
+ minus: string[];
309
+ /**
310
+ * Percentage of `rate_of` this box comes to. The other way a box is
311
+ * computed, for a form that states a line as a multiplication in words.
312
+ * Null on every box that is a list, which is most of them.
313
+ */
314
+ rate: number | null;
315
+ /** The box `rate` is applied to, bare or qualified with its kind. */
316
+ rate_of: string | null;
317
+ floor_zero: boolean;
318
+ hidden: boolean;
319
+ xml_element: string | null;
320
+ legal_reference: string | null;
321
+ /** Key of the register entry where that reference can be read. */
322
+ source: string | null;
323
+ }
324
+ /** One sentence a country requires on an invoice, and when it applies. */
325
+ export interface PackMention {
326
+ code: string;
327
+ /** One of the nine conditions of the closed vocabulary. */
328
+ applies_when: string;
329
+ text: string;
330
+ text_i18n: Record<string, string>;
331
+ sequence: number;
332
+ valid_from: string;
333
+ valid_to: string | null;
334
+ legal_reference: string | null;
335
+ /** Key of the register entry where that reference can be read. */
336
+ source: string | null;
337
+ }
338
+ /**
339
+ * Where one rule of a country comes from.
340
+ *
341
+ * A tax and a box of a declaration form are rows, and each carries its own
342
+ * `legal_reference` and `source`. A document rule is a word — `gapless_per_year`,
343
+ * `30`, `invoice_date` — with nowhere to write either, so the citation lives
344
+ * beside it under `documents.references` and comes back here in the same shape.
345
+ */
346
+ export interface PackRuleReference {
347
+ /** The article that imposes the rule. Null where the pack cites none. */
348
+ legal_reference: string | null;
349
+ /** Key of the register entry where that reference can be read. */
350
+ source: string | null;
351
+ }
352
+ /**
353
+ * The `documents`, `einvoicing` and `bank` sections of the manifest, read as
354
+ * one thing because they compile to one row: what a country requires on a
355
+ * document, how it is exchanged, and the formats its banks speak.
356
+ *
357
+ * Every field is null where the pack said nothing, and null is what reaches
358
+ * the column. There is no fallback here and there is none in the schema: a
359
+ * legal payment term or an e-invoicing profile invented for a country that
360
+ * has not spoken would be one country's law printed on another's invoice.
361
+ */
362
+ export interface PackDocumentRules {
363
+ /** True where the law forbids a hole in the sequence. Null if unsaid. */
364
+ numbering_gapless: boolean | null;
365
+ number_format: string | null;
366
+ legal_payment_days: number | null;
367
+ late_payment_reference: string | null;
368
+ /** invoice_date | delivery_date | payment_date. */
369
+ tax_point_rule: string | null;
370
+ /**
371
+ * Where the three rules above come from, one citation per rule.
372
+ *
373
+ * Three and not one, because they are three articles of two or three
374
+ * different texts in every country the packs cover: Belgium numbers an
375
+ * invoice under a royal decree and counts a payment term under a law of
376
+ * 2002, France numbers under an annex to the tax code and counts under the
377
+ * commercial code. A single reference on the section would have had to name
378
+ * them all in one string, and then no rule would have had one.
379
+ */
380
+ numbering_reference: PackRuleReference;
381
+ payment_terms_reference: PackRuleReference;
382
+ tax_point_reference: PackRuleReference;
383
+ einvoice_profile: string | null;
384
+ einvoice_mandatory_from: string | null;
385
+ /** The text that makes the profile obligatory, and where it is read. */
386
+ einvoice_reference: PackRuleReference;
387
+ /** ISO 6523 ICD, four digits. */
388
+ party_scheme: string | null;
389
+ vat_scheme: string | null;
390
+ bank_statement_formats: string[];
391
+ payment_formats: string[];
392
+ fiscal_year_default: string | null;
393
+ mentions: PackMention[];
394
+ }
395
+ /**
396
+ * When a form is due, as a rule rather than a date.
397
+ *
398
+ * Two shapes and nothing else. `day_of_month_after_period` is Belgium's
399
+ * twentieth and Estonia's; `last_day_of_month_after_period` is California's
400
+ * quarterly return and, with `plus_days`, the United Kingdom's month and seven
401
+ * days. What is deliberately unsayable is a schedule that depends on *who* is
402
+ * filing rather than on *what period* — France staggers its dates by the
403
+ * taxpayer's identification number, and a pack that cannot say that says
404
+ * nothing at all, which is better than a date that is wrong for most filers.
405
+ */
406
+ export interface PackDeadline {
407
+ rule: 'day_of_month_after_period' | 'last_day_of_month_after_period';
408
+ day: number | null;
409
+ plus_days: number | null;
410
+ legal_reference: string;
411
+ source: string | null;
412
+ }
413
+ /** `tax_report.json`: one declaration form and its boxes. */
414
+ export interface PackReport {
415
+ code: string;
416
+ name: string;
417
+ /**
418
+ * The cadences this form is filed on, in the order month, quarter, year.
419
+ *
420
+ * A list because a country may file one set of boxes on more than one
421
+ * cadence, and because the single value it replaced had no honest answer
422
+ * for the country that files three: the word `month_or_quarter` was two
423
+ * cadences pretending to be one, and there was no `month_or_quarter_or_year`
424
+ * to invent next. A pack written before the list still says
425
+ * `"period": "month_or_quarter"`, and that is read as the two it names.
426
+ */
427
+ periods: string[];
428
+ /**
429
+ * The cadence this form is filed on unless the company has asked for
430
+ * another, or null where the law gives no single answer.
431
+ *
432
+ * It sits on the form and not on the country because the proposal is about a
433
+ * declaration: a country proposing one cadence can only ever be speaking
434
+ * about one of the several declarations a company files, and the moment a
435
+ * company records a cadence per form the proposal has to be per form too. A
436
+ * pack written before the move says it in `defaults.vat_period`, which is
437
+ * still read and no longer written.
438
+ */
439
+ period_default: string | null;
440
+ valid_from: string;
441
+ valid_to: string | null;
442
+ legal_reference: string | null;
443
+ /** Key of the register entry where that reference can be read. */
444
+ source: string | null;
445
+ /** When the form is due, or null where the pack says nothing about it. */
446
+ deadline: PackDeadline | null;
447
+ /**
448
+ * The file this form is deposited as, by the name of the brick that writes
449
+ * it — `vat-consignment` for the Belgian XML Intervat takes. Null where no
450
+ * brick writes it yet, which is most of them: a form nobody can write is
451
+ * still a form a company files by hand on a portal.
452
+ */
453
+ file_format: string | null;
454
+ boxes: PackReportBox[];
455
+ }
456
+ /**
457
+ * `packs/<cc>/golden/scenario.json` — one year of books, declared.
458
+ *
459
+ * A country pack says what its taxes are and where they post. Nothing in the
460
+ * pack says what comes *out* of all that on a real year, so nothing in the
461
+ * pack could be wrong in a way anyone would notice: a box that sums the wrong
462
+ * postings and a posting that writes the wrong box agree with each other and
463
+ * the pack still compiles. The golden scenario is the second opinion — a set
464
+ * of documents and payments, and beside them, in their own files, the
465
+ * declaration, the statements and the trial balance the engine makes of them,
466
+ * to the cent.
467
+ *
468
+ * It proves internal coherence and nothing else, which is why every tax and
469
+ * every box also cites its source and why the manifest carries a
470
+ * certification status. A golden test is not a reviewer.
471
+ */
472
+ export interface PackGolden {
473
+ name: string;
474
+ /** Chart the scenario installs. Null takes the pack's default. */
475
+ chart: string | null;
476
+ /**
477
+ * Territory the company of the scenario is established in, where its country
478
+ * is not precise enough. Null everywhere a country is the answer.
479
+ */
480
+ territory: string | null;
481
+ language: string | null;
482
+ fiscalYear: {
483
+ name: string;
484
+ start: string;
485
+ end: string;
486
+ };
487
+ /** The periods the declaration is filed for, in the order they are filed. */
488
+ periods: {
489
+ code: string;
490
+ from: string;
491
+ to: string;
492
+ }[];
493
+ /** Statement codes to evaluate. Empty takes the statements of the chart. */
494
+ statements: string[];
495
+ contacts: PackGoldenContact[];
496
+ documents: PackGoldenDocument[];
497
+ payments: PackGoldenPayment[];
498
+ }
499
+ export interface PackGoldenContact {
500
+ ref: string;
501
+ name: string;
502
+ type: 'customer' | 'supplier';
503
+ country: string;
504
+ /** Territory of the party, where the country is not precise enough. */
505
+ territory: string | null;
506
+ vat_number: string | null;
507
+ auxiliary_code: string | null;
508
+ }
509
+ export interface PackGoldenDocument {
510
+ ref: string;
511
+ type: 'sale_invoice' | 'sale_credit_note' | 'purchase_invoice' | 'purchase_credit_note';
512
+ contact: string;
513
+ date: string;
514
+ due_date: string | null;
515
+ /** Territory the supply takes place in, where the buyer's is not the answer. */
516
+ supply_territory: string | null;
517
+ /** What this document is in the scenario for. */
518
+ why: string;
519
+ lines: {
520
+ name: string;
521
+ quantity: number;
522
+ unit_price: number;
523
+ discount_percent: number;
524
+ tax: string | null;
525
+ account: string;
526
+ }[];
527
+ }
528
+ export interface PackGoldenPayment {
529
+ ref: string;
530
+ direction: 'inbound' | 'outbound';
531
+ date: string;
532
+ amount: number;
533
+ contact: string;
534
+ journal: string;
535
+ /** `ref` of the document this settles, or null for a payment on account. */
536
+ match: string | null;
537
+ why: string;
538
+ }
539
+ /** One line of `assets.json`: what a kind of asset is usually depreciated over. */
540
+ export interface PackAssetCategory {
541
+ code: string;
542
+ name: string;
543
+ name_i18n: Record<string, string>;
544
+ method: string;
545
+ duration_months: number;
546
+ coefficient: number | null;
547
+ prorata: string | null;
548
+ account_type: string | null;
549
+ sequence: number;
550
+ legal_reference: string | null;
551
+ /** Key of the register entry where that reference can be read. */
552
+ source: string | null;
553
+ }
554
+ /**
555
+ * `packs/<cc>/assets.json` — the country data of the `assets` module.
556
+ *
557
+ * It is read here, with the rest of the pack, rather than by the module: a
558
+ * pack is one object with one checksum and one `ekwo pack check`, and a module
559
+ * that read its own section would be a second reader of the same folder with
560
+ * its own idea of what a valid pack is. What is module-specific is where the
561
+ * compiler writes it — `supabase/seed/modules/assets/` and not the pack seed.
562
+ */
563
+ export interface PackAssets {
564
+ prorata_straight_line: string;
565
+ prorata_declining: string;
566
+ day_count: string;
567
+ declining_cap_percent: number | null;
568
+ declining_switch_to_linear: boolean;
569
+ disposal_style: string | null;
570
+ legal_reference: string | null;
571
+ /** Key of the register entry where that reference can be read. */
572
+ source: string | null;
573
+ categories: PackAssetCategory[];
574
+ }
575
+ export interface Pack {
576
+ /** Lower-case directory name, e.g. `be`. */
577
+ slug: string;
578
+ dir: string;
579
+ manifest: Manifest;
580
+ /** Charts of this country, the default one first. Never empty. */
581
+ charts: PackChart[];
582
+ /** Accounts of the default chart. The chart a pack has when it declares only one. */
583
+ accounts: PackAccount[];
584
+ taxes: PackTax[];
585
+ /** `statements.json`, with every line and rule normalised. */
586
+ statements: PackStatement[];
587
+ /**
588
+ * Languages this pack publishes, the language of its own files first. A
589
+ * language the manifest declares covers every label; one that is only a
590
+ * file under `i18n/` may be partial.
591
+ */
592
+ languages: string[];
593
+ /** Every translated label of the pack, by section, by key, by language. */
594
+ labels: PackLabels;
595
+ /** What this country requires on a document, how it is exchanged, and its bank formats. */
596
+ documents: PackDocumentRules;
597
+ /** The periodic return of this pack, from `tax_report.json`. */
598
+ report: PackReport | null;
599
+ /** Code of the periodic return. The default of every box. */
600
+ reportCode: string | null;
601
+ /** `assets.json`, or null where this country says nothing about fixed assets. */
602
+ assets: PackAssets | null;
603
+ /** `golden/scenario.json`, or null where the manifest says why there is none. */
604
+ golden: PackGolden | null;
605
+ /** The reason the manifest gives for carrying no golden. Null where it carries one. */
606
+ goldenExemption: string | null;
607
+ /** sha256 of every file of the pack, so a change is visible without a diff. */
608
+ checksum: string;
609
+ /** Sections the schema accepts and this release does not compile. */
610
+ deferred: string[];
611
+ /**
612
+ * The source register: every text this pack was built from, with the
613
+ * publisher that serves it and the day somebody opened it.
614
+ *
615
+ * Only the entries. A bare title the manifest still carries is the
616
+ * deprecated form and reaches `warnings` instead, because a title nobody can
617
+ * open is not a source — it is the memory of having read one.
618
+ */
619
+ sources: PackSource[];
620
+ /**
621
+ * What a reader should know and what nothing refuses over.
622
+ *
623
+ * A pack that keeps a bare title in its register, or one this release
624
+ * compiles less of than the schema accepts, still builds. The difference
625
+ * between this and an issue is whether a figure could come out wrong.
626
+ */
627
+ warnings: string[];
628
+ }
629
+ export interface Manifest {
630
+ country: string;
631
+ name: string;
632
+ version: string;
633
+ schema_min: string;
634
+ seed_sequence: number;
635
+ released_at?: string;
636
+ certification?: PackCertification;
637
+ defaults: {
638
+ currency: string;
639
+ language?: string;
640
+ roles: Record<string, string | null | undefined>;
641
+ journal_roles?: Record<string, string | undefined>;
642
+ [key: string]: unknown;
643
+ };
644
+ languages?: string[];
645
+ journals: {
646
+ code: string;
647
+ type: string;
648
+ name: string;
649
+ sequence?: number;
650
+ }[];
651
+ charts?: {
652
+ code: string;
653
+ name: string;
654
+ accounts: string;
655
+ default?: boolean;
656
+ audience?: string;
657
+ statements?: string[];
658
+ certification?: PackCertification;
659
+ legal_reference?: string | null;
660
+ source?: string | null;
661
+ }[];
662
+ [key: string]: unknown;
663
+ }
664
+ /** `packs/generic/pack.json`: a framework of statements, with no country. */
665
+ export interface FrameworkManifest {
666
+ code: string;
667
+ name: string;
668
+ version: string;
669
+ schema_min: string;
670
+ released_at?: string;
671
+ language?: string;
672
+ certification?: PackCertification;
673
+ golden?: {
674
+ exempt: string;
675
+ };
676
+ }
677
+ /**
678
+ * Every label of a pack in every language but its own, read from `i18n/`.
679
+ *
680
+ * One shape throughout: section, then the key the label belongs to, then the
681
+ * language. It is the only place a translation lives — the rest of the pack
682
+ * is written in `defaults.language` and carries no second wording, so a
683
+ * contributor adding a language edits one file and a reviewer reads one file.
684
+ */
685
+ export interface PackLabels {
686
+ /** The country itself, by language. The one section keyed by language alone. */
687
+ pack_name: Record<string, string>;
688
+ /** By chart code. */
689
+ charts: Record<string, Record<string, string>>;
690
+ /** By account code, across every chart. */
691
+ accounts: Record<string, Record<string, string>>;
692
+ /** By journal code. */
693
+ journals: Record<string, Record<string, string>>;
694
+ /** By tax code. */
695
+ taxes: Record<string, Record<string, string>>;
696
+ /** By `box|kind`, because a form may carry a base and a tax on one line. */
697
+ tax_report_boxes: Record<string, Record<string, string>>;
698
+ /** By `statement:line`, because two statements may both carry a line `20`. */
699
+ statement_lines: Record<string, Record<string, string>>;
700
+ /** By legal mention code. */
701
+ legal_mentions: Record<string, Record<string, string>>;
702
+ /** By fixed-asset category code. */
703
+ asset_categories: Record<string, Record<string, string>>;
704
+ }
705
+ /** A pack with no country: statements by account type, and nothing else. */
706
+ export interface FrameworkPack {
707
+ slug: string;
708
+ dir: string;
709
+ manifest: FrameworkManifest;
710
+ statements: PackStatement[];
711
+ /** Why this pack carries no golden scenario. Never null: it can carry none. */
712
+ goldenExemption: string | null;
713
+ checksum: string;
714
+ }
715
+ export declare class PackError extends Error {
716
+ }
717
+ /** Repository root: the folder that holds both `packs/` and `supabase/seed/`. */
718
+ export declare function repoRootDir(): string;
719
+ export declare function packsDir(root?: string): string;
720
+ export declare function seedOutputDir(root?: string): string;
721
+ /**
722
+ * The seed number each pack of a checkout declares, by slug.
723
+ *
724
+ * Read on its own, one field out of each manifest, rather than through
725
+ * `readPack`: naming the seed file of a pack must not depend on every other
726
+ * pack in the checkout being valid, or `ekwo pack build be` would fail because
727
+ * somebody's work in progress next door does not compile yet.
728
+ */
729
+ export declare function declaredSeedSequences(dir?: string): Promise<Map<string, number>>;
730
+ /** The packs of this repository, by directory name, alphabetically. */
731
+ export declare function listPacks(dir?: string): Promise<string[]>;
732
+ /** The published schema, read from `packs/schema/pack.1.json`. */
733
+ export declare function readSchema(dir?: string): Promise<Record<string, unknown>>;
734
+ /**
735
+ * Reads, validates and normalises one pack.
736
+ *
737
+ * Validation is the published schema for every document, then the three
738
+ * things a schema cannot say: a role, a posting and a journal role must name
739
+ * something the pack itself carries.
740
+ */
741
+ export declare function readPack(slug: string, dir?: string): Promise<Pack>;
742
+ /**
743
+ * The framework pack: statements by account type, no country, no chart.
744
+ *
745
+ * It is read and compiled beside the country packs because it is the same
746
+ * kind of thing — declarative lines an accountant can read — and because the
747
+ * fallback that gives any chart a readable balance sheet should not be the one
748
+ * object of the system that lives in a migration.
749
+ */
750
+ export declare function readFrameworkPack(slug?: string, dir?: string): Promise<FrameworkPack>;
751
+ /**
752
+ * A reference in a plus/minus list, or in an i18n key, to the one box it
753
+ * names. Bare, it has to match exactly one box of the form; qualified
754
+ * (`08:tax`), it names the kind itself — the French CA3 carries a base and a
755
+ * tax on line 08 and the Belgian form never does. Returns the box, or the
756
+ * sentence that says why it does not resolve.
757
+ */
758
+ export declare function resolveBoxRef(ref: string, boxes: PackReportBox[]): PackReportBox | string;
759
+ /**
760
+ * The CSV subset a chart of accounts is written in: a header line, one row
761
+ * per account, no newline inside a field, a field quoted only when it holds a
762
+ * comma or a quote, a quote doubled inside a quoted field. Forty lines,
763
+ * because anything richer is a format nobody can review in a diff.
764
+ */
765
+ export declare function parseCsv(text: string, file: string): Record<string, string>[];
766
+ //# sourceMappingURL=read.d.ts.map