@powerhousedao/contributor-billing 0.1.29 → 0.1.31

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 (390) hide show
  1. package/README.md +165 -8
  2. package/dist/document-models/billing-statement/actions.d.ts +1 -0
  3. package/dist/document-models/billing-statement/actions.d.ts.map +1 -1
  4. package/dist/document-models/billing-statement/gen/document-model.d.ts.map +1 -1
  5. package/dist/document-models/billing-statement/gen/document-model.js +58 -47
  6. package/dist/document-models/billing-statement/gen/document-schema.d.ts +38 -38
  7. package/dist/document-models/billing-statement/gen/document-schema.d.ts.map +1 -1
  8. package/dist/document-models/billing-statement/gen/line-items/actions.d.ts +6 -2
  9. package/dist/document-models/billing-statement/gen/line-items/actions.d.ts.map +1 -1
  10. package/dist/document-models/billing-statement/gen/line-items/creators.d.ts +3 -2
  11. package/dist/document-models/billing-statement/gen/line-items/creators.d.ts.map +1 -1
  12. package/dist/document-models/billing-statement/gen/line-items/creators.js +2 -1
  13. package/dist/document-models/billing-statement/gen/line-items/operations.d.ts +2 -1
  14. package/dist/document-models/billing-statement/gen/line-items/operations.d.ts.map +1 -1
  15. package/dist/document-models/billing-statement/gen/ph-factories.js +1 -1
  16. package/dist/document-models/billing-statement/gen/reducer.d.ts.map +1 -1
  17. package/dist/document-models/billing-statement/gen/reducer.js +5 -1
  18. package/dist/document-models/billing-statement/gen/schema/types.d.ts +3 -0
  19. package/dist/document-models/billing-statement/gen/schema/types.d.ts.map +1 -1
  20. package/dist/document-models/billing-statement/gen/schema/zod.d.ts +2 -1
  21. package/dist/document-models/billing-statement/gen/schema/zod.d.ts.map +1 -1
  22. package/dist/document-models/billing-statement/gen/schema/zod.js +5 -0
  23. package/dist/document-models/billing-statement/gen/utils.js +2 -2
  24. package/dist/document-models/billing-statement/src/reducers/general.d.ts.map +1 -1
  25. package/dist/document-models/billing-statement/src/reducers/general.js +5 -4
  26. package/dist/document-models/billing-statement/src/reducers/line-items.d.ts.map +1 -1
  27. package/dist/document-models/billing-statement/src/reducers/line-items.js +7 -2
  28. package/dist/document-models/billing-statement/src/reducers/tags.d.ts.map +1 -1
  29. package/dist/document-models/billing-statement/src/reducers/tags.js +1 -1
  30. package/dist/document-models/billing-statement/src/tests/document-model.test.d.ts +4 -0
  31. package/dist/document-models/billing-statement/src/tests/document-model.test.d.ts.map +1 -1
  32. package/dist/document-models/billing-statement/src/tests/document-model.test.js +94 -7
  33. package/dist/document-models/billing-statement/src/tests/general.test.d.ts +2 -1
  34. package/dist/document-models/billing-statement/src/tests/general.test.d.ts.map +1 -1
  35. package/dist/document-models/billing-statement/src/tests/general.test.js +33 -88
  36. package/dist/document-models/billing-statement/src/tests/line-items.test.js +22 -125
  37. package/dist/document-models/billing-statement/src/tests/tags.test.js +13 -47
  38. package/dist/document-models/document-models.js +2 -2
  39. package/dist/document-models/expense-report/gen/document-model.d.ts.map +1 -1
  40. package/dist/document-models/expense-report/gen/document-model.js +48 -48
  41. package/dist/document-models/expense-report/gen/document-schema.d.ts +6 -6
  42. package/dist/document-models/expense-report/gen/utils.js +1 -1
  43. package/dist/document-models/expense-report/src/tests/document-model.test.d.ts +4 -0
  44. package/dist/document-models/expense-report/src/tests/document-model.test.d.ts.map +1 -1
  45. package/dist/document-models/expense-report/src/tests/document-model.test.js +94 -8
  46. package/dist/document-models/expense-report/src/tests/wallet.test.js +145 -10
  47. package/dist/document-models/index.d.ts +2 -6
  48. package/dist/document-models/index.d.ts.map +1 -1
  49. package/dist/document-models/index.js +2 -6
  50. package/dist/document-models/integrations/gen/document-model.js +33 -33
  51. package/dist/document-models/integrations/gen/document-schema.d.ts +6 -6
  52. package/dist/document-models/integrations/gen/utils.js +1 -1
  53. package/dist/document-models/integrations/src/reducers/integrations.d.ts.map +1 -1
  54. package/dist/document-models/integrations/src/reducers/integrations.js +9 -32
  55. package/dist/document-models/integrations/src/tests/document-model.test.d.ts +4 -0
  56. package/dist/document-models/integrations/src/tests/document-model.test.d.ts.map +1 -1
  57. package/dist/document-models/integrations/src/tests/document-model.test.js +91 -5
  58. package/dist/document-models/integrations/src/tests/integrations.test.js +21 -46
  59. package/dist/document-models/invoice/gen/document-model.js +147 -147
  60. package/dist/document-models/invoice/gen/document-schema.d.ts +127 -127
  61. package/dist/document-models/invoice/gen/document-schema.d.ts.map +1 -1
  62. package/dist/document-models/invoice/gen/ph-factories.d.ts.map +1 -1
  63. package/dist/document-models/invoice/gen/ph-factories.js +16 -122
  64. package/dist/document-models/invoice/gen/schema/types.d.ts +4 -4
  65. package/dist/document-models/invoice/gen/schema/types.d.ts.map +1 -1
  66. package/dist/document-models/invoice/gen/schema/zod.d.ts.map +1 -1
  67. package/dist/document-models/invoice/gen/schema/zod.js +4 -4
  68. package/dist/document-models/invoice/gen/utils.d.ts.map +1 -1
  69. package/dist/document-models/invoice/gen/utils.js +17 -123
  70. package/dist/document-models/invoice/src/reducers/general.d.ts.map +1 -1
  71. package/dist/document-models/invoice/src/reducers/general.js +34 -10
  72. package/dist/document-models/invoice/src/reducers/items.d.ts.map +1 -1
  73. package/dist/document-models/invoice/src/reducers/items.js +7 -7
  74. package/dist/document-models/invoice/src/reducers/parties.d.ts.map +1 -1
  75. package/dist/document-models/invoice/src/reducers/parties.js +96 -50
  76. package/dist/document-models/invoice/src/reducers/transitions.d.ts.map +1 -1
  77. package/dist/document-models/invoice/src/reducers/transitions.js +69 -53
  78. package/dist/document-models/invoice/src/tests/document-model.test.d.ts +4 -0
  79. package/dist/document-models/invoice/src/tests/document-model.test.d.ts.map +1 -1
  80. package/dist/document-models/invoice/src/tests/document-model.test.js +91 -4
  81. package/dist/document-models/invoice/src/tests/general.test.js +24 -26
  82. package/dist/document-models/invoice/src/tests/items.test.js +37 -17
  83. package/dist/document-models/invoice/src/tests/parties.test.js +32 -26
  84. package/dist/document-models/invoice/src/tests/transitions.test.js +52 -500
  85. package/dist/document-models/invoice/utils/statusTransitions.d.ts.map +1 -1
  86. package/dist/document-models/invoice/utils/statusTransitions.js +10 -10
  87. package/dist/editors/billing-statement/components/lineItemsTable.d.ts.map +1 -1
  88. package/dist/editors/billing-statement/components/lineItemsTable.js +32 -23
  89. package/dist/editors/billing-statement/components/objectSetTable.d.ts.map +1 -1
  90. package/dist/editors/billing-statement/components/objectSetTable.js +1 -2
  91. package/dist/editors/billing-statement/editor.d.ts +4 -0
  92. package/dist/editors/billing-statement/editor.d.ts.map +1 -1
  93. package/dist/editors/billing-statement/editor.js +34 -16
  94. package/dist/editors/billing-statement/lineItemTags/lineItemTags.d.ts.map +1 -1
  95. package/dist/editors/billing-statement/lineItemTags/lineItemTags.js +36 -37
  96. package/dist/editors/billing-statement/lineItemTags/tagMapping.d.ts.map +1 -1
  97. package/dist/editors/billing-statement/lineItemTags/tagMapping.js +28 -10
  98. package/dist/editors/clean-new-editor/components/CreateDocument.d.ts +6 -0
  99. package/dist/editors/clean-new-editor/components/CreateDocument.d.ts.map +1 -0
  100. package/dist/editors/clean-new-editor/components/CreateDocument.js +18 -0
  101. package/dist/editors/clean-new-editor/components/DriveContents.d.ts +3 -0
  102. package/dist/editors/clean-new-editor/components/DriveContents.d.ts.map +1 -0
  103. package/dist/editors/clean-new-editor/components/DriveContents.js +10 -0
  104. package/dist/editors/clean-new-editor/components/DriveExplorer.d.ts +7 -0
  105. package/dist/editors/clean-new-editor/components/DriveExplorer.d.ts.map +1 -0
  106. package/dist/editors/clean-new-editor/components/DriveExplorer.js +16 -0
  107. package/dist/editors/clean-new-editor/components/EmptyState.d.ts +3 -0
  108. package/dist/editors/clean-new-editor/components/EmptyState.d.ts.map +1 -0
  109. package/dist/editors/clean-new-editor/components/EmptyState.js +10 -0
  110. package/dist/editors/clean-new-editor/components/Files.d.ts +3 -0
  111. package/dist/editors/clean-new-editor/components/Files.d.ts.map +1 -0
  112. package/dist/editors/clean-new-editor/components/Files.js +12 -0
  113. package/dist/editors/clean-new-editor/components/FolderTree.d.ts +6 -0
  114. package/dist/editors/clean-new-editor/components/FolderTree.d.ts.map +1 -0
  115. package/dist/editors/clean-new-editor/components/FolderTree.js +65 -0
  116. package/dist/editors/clean-new-editor/components/Folders.d.ts +3 -0
  117. package/dist/editors/clean-new-editor/components/Folders.d.ts.map +1 -0
  118. package/dist/editors/clean-new-editor/components/Folders.js +12 -0
  119. package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.d.ts +3 -0
  120. package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.d.ts.map +1 -0
  121. package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.js +6 -0
  122. package/dist/editors/clean-new-editor/config.d.ts +4 -0
  123. package/dist/editors/clean-new-editor/config.d.ts.map +1 -0
  124. package/dist/editors/clean-new-editor/config.js +5 -0
  125. package/dist/editors/clean-new-editor/editor.d.ts +4 -0
  126. package/dist/editors/clean-new-editor/editor.d.ts.map +1 -0
  127. package/dist/editors/clean-new-editor/editor.js +11 -0
  128. package/dist/editors/clean-new-editor/module.d.ts +3 -0
  129. package/dist/editors/clean-new-editor/module.d.ts.map +1 -0
  130. package/dist/editors/clean-new-editor/module.js +10 -0
  131. package/dist/editors/contributor-billing/components/ConfirmationModal.d.ts +14 -0
  132. package/dist/editors/contributor-billing/components/ConfirmationModal.d.ts.map +1 -0
  133. package/dist/editors/contributor-billing/components/ConfirmationModal.js +6 -0
  134. package/dist/editors/contributor-billing/components/CreateDocument.d.ts +6 -0
  135. package/dist/editors/contributor-billing/components/CreateDocument.d.ts.map +1 -0
  136. package/dist/editors/contributor-billing/components/CreateDocument.js +18 -0
  137. package/dist/editors/contributor-billing/components/DriveContents.d.ts +3 -0
  138. package/dist/editors/contributor-billing/components/DriveContents.d.ts.map +1 -0
  139. package/dist/editors/contributor-billing/components/DriveContents.js +10 -0
  140. package/dist/editors/contributor-billing/components/DriveExplorer.d.ts +3 -3
  141. package/dist/editors/contributor-billing/components/DriveExplorer.d.ts.map +1 -1
  142. package/dist/editors/contributor-billing/components/DriveExplorer.js +13 -180
  143. package/dist/editors/contributor-billing/components/EmptyState.d.ts +3 -0
  144. package/dist/editors/contributor-billing/components/EmptyState.d.ts.map +1 -0
  145. package/dist/editors/contributor-billing/components/EmptyState.js +10 -0
  146. package/dist/editors/contributor-billing/components/Files.d.ts +3 -0
  147. package/dist/editors/contributor-billing/components/Files.d.ts.map +1 -0
  148. package/dist/editors/contributor-billing/components/Files.js +12 -0
  149. package/dist/editors/contributor-billing/components/FolderTree.d.ts +6 -0
  150. package/dist/editors/contributor-billing/components/FolderTree.d.ts.map +1 -0
  151. package/dist/editors/contributor-billing/components/FolderTree.js +65 -0
  152. package/dist/editors/contributor-billing/components/Folders.d.ts +3 -0
  153. package/dist/editors/contributor-billing/components/Folders.d.ts.map +1 -0
  154. package/dist/editors/contributor-billing/components/Folders.js +12 -0
  155. package/dist/editors/contributor-billing/components/HeaderControls.d.ts +38 -0
  156. package/dist/editors/contributor-billing/components/HeaderControls.d.ts.map +1 -0
  157. package/dist/editors/contributor-billing/components/HeaderControls.js +124 -0
  158. package/dist/editors/contributor-billing/components/HeaderStats.d.ts.map +1 -0
  159. package/dist/editors/contributor-billing/components/{InvoiceTable/HeaderStats.js → HeaderStats.js} +1 -1
  160. package/dist/editors/contributor-billing/components/InvoiceTable.d.ts +22 -0
  161. package/dist/editors/contributor-billing/components/InvoiceTable.d.ts.map +1 -0
  162. package/dist/editors/contributor-billing/components/InvoiceTable.js +399 -0
  163. package/dist/editors/contributor-billing/components/InvoiceTableContainer.d.ts +6 -0
  164. package/dist/editors/contributor-billing/components/InvoiceTableContainer.d.ts.map +1 -0
  165. package/dist/editors/contributor-billing/components/InvoiceTableContainer.js +111 -0
  166. package/dist/editors/contributor-billing/components/InvoiceTableRow.d.ts +32 -0
  167. package/dist/editors/contributor-billing/components/InvoiceTableRow.d.ts.map +1 -0
  168. package/dist/editors/contributor-billing/components/InvoiceTableRow.js +55 -0
  169. package/dist/editors/contributor-billing/components/InvoiceTableSection.d.ts +13 -0
  170. package/dist/editors/contributor-billing/components/InvoiceTableSection.d.ts.map +1 -0
  171. package/dist/editors/contributor-billing/components/InvoiceTableSection.js +16 -0
  172. package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.d.ts +3 -0
  173. package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.d.ts.map +1 -0
  174. package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.js +6 -0
  175. package/dist/editors/contributor-billing/config.d.ts +1 -0
  176. package/dist/editors/contributor-billing/config.d.ts.map +1 -1
  177. package/dist/editors/contributor-billing/config.js +4 -1
  178. package/dist/editors/contributor-billing/editor.d.ts +1 -0
  179. package/dist/editors/contributor-billing/editor.d.ts.map +1 -1
  180. package/dist/editors/contributor-billing/editor.js +4 -1
  181. package/dist/editors/contributor-billing/module.d.ts +1 -1
  182. package/dist/editors/contributor-billing/module.d.ts.map +1 -1
  183. package/dist/editors/contributor-billing/module.js +3 -2
  184. package/dist/editors/contributor-billing/utils/exchangeRate.d.ts +15 -0
  185. package/dist/editors/contributor-billing/utils/exchangeRate.d.ts.map +1 -0
  186. package/dist/editors/contributor-billing/utils/exchangeRate.js +122 -0
  187. package/dist/editors/editors.js +2 -2
  188. package/dist/editors/expense-report/components/AddBillingStatementModal.d.ts.map +1 -1
  189. package/dist/editors/expense-report/editor.js +8 -8
  190. package/dist/editors/index.d.ts +2 -2
  191. package/dist/editors/index.d.ts.map +1 -1
  192. package/dist/editors/index.js +2 -2
  193. package/dist/editors/integrations/components/EditName.d.ts +3 -0
  194. package/dist/editors/integrations/components/EditName.d.ts.map +1 -0
  195. package/dist/editors/integrations/components/EditName.js +31 -0
  196. package/dist/editors/integrations/editor.d.ts +2 -4
  197. package/dist/editors/integrations/editor.d.ts.map +1 -1
  198. package/dist/editors/integrations/editor.js +5 -132
  199. package/dist/editors/integrations/module.d.ts +1 -0
  200. package/dist/editors/integrations/module.d.ts.map +1 -1
  201. package/dist/editors/integrations/module.js +3 -2
  202. package/dist/editors/invoice/components/confirmationModal.js +1 -1
  203. package/dist/editors/invoice/components/countryForm.d.ts.map +1 -1
  204. package/dist/editors/invoice/components/countryForm.js +1 -1
  205. package/dist/editors/invoice/components/currencyForm.d.ts.map +1 -1
  206. package/dist/editors/invoice/components/currencyForm.js +1 -1
  207. package/dist/editors/invoice/components/datePicker.d.ts +1 -1
  208. package/dist/editors/invoice/components/datePicker.d.ts.map +1 -1
  209. package/dist/editors/invoice/components/datePicker.js +1 -1
  210. package/dist/editors/invoice/components/inputField.d.ts.map +1 -1
  211. package/dist/editors/invoice/components/inputField.js +3 -2
  212. package/dist/editors/invoice/components/lineItemMobileModal.d.ts.map +1 -1
  213. package/dist/editors/invoice/components/lineItemMobileModal.js +1 -1
  214. package/dist/editors/invoice/components/numberForm.d.ts.map +1 -1
  215. package/dist/editors/invoice/components/selectField.js +7 -7
  216. package/dist/editors/invoice/components/statusModalComponents.d.ts.map +1 -1
  217. package/dist/editors/invoice/components/statusModalComponents.js +27 -3
  218. package/dist/editors/invoice/editor.d.ts +1 -4
  219. package/dist/editors/invoice/editor.d.ts.map +1 -1
  220. package/dist/editors/invoice/editor.js +102 -40
  221. package/dist/editors/invoice/exportUBL.d.ts.map +1 -1
  222. package/dist/editors/invoice/exportUBL.js +35 -18
  223. package/dist/editors/invoice/ingestPDF.d.ts.map +1 -1
  224. package/dist/editors/invoice/ingestPDF.js +15 -9
  225. package/dist/editors/invoice/invoiceToGnosis.js +2 -2
  226. package/dist/editors/invoice/legalEntity/bankSection.d.ts.map +1 -1
  227. package/dist/editors/invoice/legalEntity/legalEntity.d.ts.map +1 -1
  228. package/dist/editors/invoice/legalEntity/walletSection.d.ts.map +1 -1
  229. package/dist/editors/invoice/legalEntity/walletSection.js +3 -3
  230. package/dist/editors/invoice/lineItemTags/lineItemTags.d.ts.map +1 -1
  231. package/dist/editors/invoice/lineItemTags/lineItemTags.js +1 -1
  232. package/dist/editors/invoice/lineItemTags/tagMobileModal.d.ts.map +1 -1
  233. package/dist/editors/invoice/lineItemTags/tagMobileModal.js +4 -3
  234. package/dist/editors/invoice/lineItems.d.ts.map +1 -1
  235. package/dist/editors/invoice/module.d.ts +1 -0
  236. package/dist/editors/invoice/module.d.ts.map +1 -1
  237. package/dist/editors/invoice/module.js +2 -1
  238. package/dist/editors/invoice/requestFinance.js +3 -3
  239. package/dist/editors/invoice/uploadPdfChunked.d.ts.map +1 -1
  240. package/dist/editors/invoice/uploadPdfChunked.js +4 -3
  241. package/dist/editors/invoice/utils/utils.d.ts.map +1 -1
  242. package/dist/editors/invoice/utils/utils.js +5 -4
  243. package/dist/editors/invoice/validation/validationHandler.d.ts.map +1 -1
  244. package/dist/editors/invoice/validation/validationHandler.js +11 -5
  245. package/dist/editors/invoice/validation/validationManager.d.ts +2 -2
  246. package/dist/editors/invoice/validation/validationManager.d.ts.map +1 -1
  247. package/dist/editors/invoice/validation/validationManager.js +5 -5
  248. package/dist/editors/invoice/validation/validationRules.d.ts.map +1 -1
  249. package/dist/editors/invoice/validation/validationRules.js +178 -178
  250. package/dist/index.d.ts +2 -2
  251. package/dist/index.d.ts.map +1 -1
  252. package/dist/index.js +4 -2
  253. package/dist/old-contributor-billing/components/DriveExplorer.d.ts +7 -0
  254. package/dist/old-contributor-billing/components/DriveExplorer.d.ts.map +1 -0
  255. package/dist/old-contributor-billing/components/DriveExplorer.js +184 -0
  256. package/dist/old-contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +1 -0
  257. package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.d.ts +2 -0
  258. package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.d.ts.map +1 -0
  259. package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.js +73 -0
  260. package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +1 -0
  261. package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +1 -0
  262. package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +1 -0
  263. package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableSection.js +1 -1
  264. package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/RowActionMenu.d.ts +1 -1
  265. package/dist/old-contributor-billing/components/InvoiceTable/RowActionMenu.d.ts.map +1 -0
  266. package/dist/old-contributor-billing/components/InvoiceTable/RowActionMenu.js +2 -0
  267. package/dist/old-contributor-billing/config.d.ts +3 -0
  268. package/dist/old-contributor-billing/config.d.ts.map +1 -0
  269. package/dist/old-contributor-billing/config.js +4 -0
  270. package/dist/old-contributor-billing/editor.d.ts +3 -0
  271. package/dist/old-contributor-billing/editor.d.ts.map +1 -0
  272. package/dist/old-contributor-billing/editor.js +8 -0
  273. package/dist/old-contributor-billing/module.d.ts +3 -0
  274. package/dist/old-contributor-billing/module.d.ts.map +1 -0
  275. package/dist/old-contributor-billing/module.js +9 -0
  276. package/dist/old-contributor-billing/util.d.ts.map +1 -0
  277. package/dist/{editors/contributor-billing → old-contributor-billing}/util.js +11 -9
  278. package/dist/powerhouse.manifest.json +6 -41
  279. package/dist/processors/index.d.ts +1 -6
  280. package/dist/processors/index.d.ts.map +1 -1
  281. package/dist/processors/index.js +1 -18
  282. package/dist/scripts/contributor-billing/createExpenseReportCsv.d.ts.map +1 -1
  283. package/dist/scripts/contributor-billing/createExpenseReportCsv.js +24 -24
  284. package/dist/scripts/contributor-billing/createXeroCsv.d.ts.map +1 -1
  285. package/dist/scripts/contributor-billing/createXeroCsv.js +52 -46
  286. package/dist/scripts/invoice/autoTagging.d.ts +1 -1
  287. package/dist/scripts/invoice/autoTagging.d.ts.map +1 -1
  288. package/dist/scripts/invoice/autoTagging.js +168 -138
  289. package/dist/scripts/invoice/exampleBatchTxn.js +16 -16
  290. package/dist/scripts/invoice/gnosisTransactionBuilder.d.ts.map +1 -1
  291. package/dist/scripts/invoice/gnosisTransactionBuilder.js +32 -25
  292. package/dist/scripts/invoice/pdfToClaudeAI.d.ts.map +1 -1
  293. package/dist/scripts/invoice/pdfToClaudeAI.js +36 -30
  294. package/dist/scripts/invoice/requestFinance.d.ts.map +1 -1
  295. package/dist/scripts/invoice/requestFinance.js +13 -13
  296. package/dist/style.css +407 -13659
  297. package/dist/subgraphs/billing-statement/resolvers.d.ts +1 -1
  298. package/dist/subgraphs/billing-statement/resolvers.d.ts.map +1 -1
  299. package/dist/subgraphs/billing-statement/resolvers.js +16 -5
  300. package/dist/subgraphs/billing-statement/schema.d.ts.map +1 -1
  301. package/dist/subgraphs/billing-statement/schema.js +12 -67
  302. package/dist/subgraphs/expense-report/resolvers.d.ts +1 -1
  303. package/dist/subgraphs/expense-report/resolvers.d.ts.map +1 -1
  304. package/dist/subgraphs/expense-report/resolvers.js +4 -5
  305. package/dist/subgraphs/expense-report/schema.d.ts.map +1 -1
  306. package/dist/subgraphs/expense-report/schema.js +5 -48
  307. package/dist/subgraphs/index.d.ts +1 -0
  308. package/dist/subgraphs/index.d.ts.map +1 -1
  309. package/dist/subgraphs/index.js +1 -0
  310. package/dist/subgraphs/integrations/resolvers.d.ts +1 -1
  311. package/dist/subgraphs/integrations/resolvers.d.ts.map +1 -1
  312. package/dist/subgraphs/integrations/resolvers.js +4 -5
  313. package/dist/subgraphs/integrations/schema.d.ts.map +1 -1
  314. package/dist/subgraphs/integrations/schema.js +3 -43
  315. package/dist/subgraphs/invoice/index.d.ts.map +1 -1
  316. package/dist/subgraphs/invoice/index.js +1 -20
  317. package/dist/subgraphs/invoice/resolvers.d.ts +1 -1
  318. package/dist/subgraphs/invoice/resolvers.d.ts.map +1 -1
  319. package/dist/subgraphs/invoice/resolvers.js +4 -9
  320. package/dist/subgraphs/invoice/schema.d.ts.map +1 -1
  321. package/dist/subgraphs/invoice/schema.js +14 -232
  322. package/dist/subgraphs/{invoice → invoice-addon}/customResolvers.d.ts +1 -1
  323. package/dist/subgraphs/invoice-addon/customResolvers.d.ts.map +1 -0
  324. package/dist/subgraphs/{invoice → invoice-addon}/customResolvers.js +38 -34
  325. package/dist/subgraphs/invoice-addon/index.d.ts +11 -0
  326. package/dist/subgraphs/invoice-addon/index.d.ts.map +1 -0
  327. package/dist/subgraphs/invoice-addon/index.js +11 -0
  328. package/dist/subgraphs/invoice-addon/resolvers.d.ts +3 -0
  329. package/dist/subgraphs/invoice-addon/resolvers.d.ts.map +1 -0
  330. package/dist/subgraphs/invoice-addon/resolvers.js +12 -0
  331. package/dist/subgraphs/invoice-addon/schema.d.ts +3 -0
  332. package/dist/subgraphs/invoice-addon/schema.d.ts.map +1 -0
  333. package/dist/subgraphs/invoice-addon/schema.js +52 -0
  334. package/package.json +9 -21
  335. package/dist/document-models/expense-report/gen/expense-report/actions.d.ts +0 -8
  336. package/dist/document-models/expense-report/gen/expense-report/actions.d.ts.map +0 -1
  337. package/dist/document-models/expense-report/gen/expense-report/actions.js +0 -1
  338. package/dist/document-models/expense-report/gen/expense-report/creators.d.ts +0 -4
  339. package/dist/document-models/expense-report/gen/expense-report/creators.d.ts.map +0 -1
  340. package/dist/document-models/expense-report/gen/expense-report/creators.js +0 -3
  341. package/dist/document-models/expense-report/gen/expense-report/error.d.ts +0 -2
  342. package/dist/document-models/expense-report/gen/expense-report/error.d.ts.map +0 -1
  343. package/dist/document-models/expense-report/gen/expense-report/error.js +0 -1
  344. package/dist/document-models/expense-report/gen/expense-report/operations.d.ts +0 -7
  345. package/dist/document-models/expense-report/gen/expense-report/operations.d.ts.map +0 -1
  346. package/dist/document-models/expense-report/gen/expense-report/operations.js +0 -3
  347. package/dist/document-models/expense-report/src/tests/expense-report.test.d.ts +0 -6
  348. package/dist/document-models/expense-report/src/tests/expense-report.test.d.ts.map +0 -1
  349. package/dist/document-models/expense-report/src/tests/expense-report.test.js +0 -24
  350. package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +0 -1
  351. package/dist/editors/contributor-billing/components/InvoiceTable/HeaderStats.d.ts.map +0 -1
  352. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +0 -1
  353. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +0 -1
  354. package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +0 -1
  355. package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.d.ts.map +0 -1
  356. package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.js +0 -2
  357. package/dist/editors/contributor-billing/util.d.ts.map +0 -1
  358. package/dist/editors/hooks/useBillingStatementDocument.d.ts +0 -4
  359. package/dist/editors/hooks/useBillingStatementDocument.d.ts.map +0 -1
  360. package/dist/editors/hooks/useBillingStatementDocument.js +0 -8
  361. package/dist/editors/hooks/useExpenseReportDocument.d.ts +0 -4
  362. package/dist/editors/hooks/useExpenseReportDocument.d.ts.map +0 -1
  363. package/dist/editors/hooks/useExpenseReportDocument.js +0 -8
  364. package/dist/editors/hooks/useIntegrationsDocument.d.ts +0 -4
  365. package/dist/editors/hooks/useIntegrationsDocument.d.ts.map +0 -1
  366. package/dist/editors/hooks/useIntegrationsDocument.js +0 -8
  367. package/dist/editors/hooks/useInvoiceDocument.d.ts +0 -4
  368. package/dist/editors/hooks/useInvoiceDocument.d.ts.map +0 -1
  369. package/dist/editors/hooks/useInvoiceDocument.js +0 -8
  370. package/dist/editors/integrations/config.d.ts +0 -3
  371. package/dist/editors/integrations/config.d.ts.map +0 -1
  372. package/dist/editors/integrations/config.js +0 -3
  373. package/dist/editors/invoice/exportSAFTPT.d.ts +0 -184
  374. package/dist/editors/invoice/exportSAFTPT.d.ts.map +0 -1
  375. package/dist/editors/invoice/exportSAFTPT.js +0 -548
  376. package/dist/processors/line-item-processor/index.d.ts +0 -11
  377. package/dist/processors/line-item-processor/index.d.ts.map +0 -1
  378. package/dist/processors/line-item-processor/index.js +0 -36
  379. package/dist/subgraphs/invoice/customResolvers.d.ts.map +0 -1
  380. package/editors/invoice/assets/custom.d.ts +0 -4
  381. package/editors/invoice/assets/powerhouseLogo.png +0 -0
  382. /package/dist/editors/contributor-billing/components/{InvoiceTable/HeaderStats.d.ts → HeaderStats.d.ts} +0 -0
  383. /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/HeaderControls.d.ts +0 -0
  384. /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/HeaderControls.js +0 -0
  385. /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTable.d.ts +0 -0
  386. /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTable.js +0 -0
  387. /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableRow.d.ts +0 -0
  388. /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableRow.js +0 -0
  389. /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableSection.d.ts +0 -0
  390. /package/dist/{editors/contributor-billing → old-contributor-billing}/util.d.ts +0 -0
@@ -8,231 +8,259 @@
8
8
  */
9
9
  // Xero expense account options from tagMapping.tsx
10
10
  const XERO_EXPENSE_ACCOUNTS = {
11
- '2001': '2001 - Clearing Account',
12
- '2222': '2222 - Request Finance IC account',
13
- '3000': '3000 - Activities and Events',
14
- '3001': '3001 - Meals',
15
- '3002': '3002 - Airfare',
16
- '3003': '3003 - Hotels',
17
- '3004': '3004 - Transportation (Uber, Taxi etc)',
18
- '3005': '3005 - Other travel cost',
19
- '400': '400 - Advertising',
20
- '4001': '4001 - Legal Fees Abroad',
21
- '4002': '4002 - Legal Fees Switzerland',
22
- '4003': '4003 - Finance Team Fees Abroad',
23
- '4004': '4004 - Finance and Accounting Fees Switzerland',
24
- '4005': '4005 - Software Development Team Fees',
25
- '4006': '4006 - Research Team Fees',
26
- '4007': '4007 - Marketing Team Fees',
27
- '4008': '4008 - Health Care Fees',
28
- '4009': '4009 - Contractor Fees',
29
- '4010': '4010 - Insurance Fees Team',
30
- '4011': '4011 - HR Fees',
31
- '4012': '4012 - Team Bonus',
32
- '4013': '4013 - Refferal Fees',
33
- '416': '416 - Depreciation',
34
- '425': '425 - Freight & Courier',
35
- '437': '437 - Interest Expense',
36
- '453': '453 - Office Expenses',
37
- '469': '469 - Rent',
38
- '485': '485 - Subscriptions',
39
- '505': '505 - Income Tax Expense',
40
- '701': '701 - Software/IT Subscriptions',
41
- '702': '702 - Telephone and Internet Charges',
42
- '8000': '8000 - Bank Fees',
43
- '8001': '8001 - Gas Fees',
44
- '8003': '8003 - Exchange Fees'
11
+ "2001": "2001 - Clearing Account",
12
+ "2222": "2222 - Request Finance IC account",
13
+ "3000": "3000 - Activities and Events",
14
+ "3001": "3001 - Meals",
15
+ "3002": "3002 - Airfare",
16
+ "3003": "3003 - Hotels",
17
+ "3004": "3004 - Transportation (Uber, Taxi etc)",
18
+ "3005": "3005 - Other travel cost",
19
+ "400": "400 - Advertising",
20
+ "4001": "4001 - Legal Fees Abroad",
21
+ "4002": "4002 - Legal Fees Switzerland",
22
+ "4003": "4003 - Finance Team Fees Abroad",
23
+ "4004": "4004 - Finance and Accounting Fees Switzerland",
24
+ "4005": "4005 - Software Development Team Fees",
25
+ "4006": "4006 - Research Team Fees",
26
+ "4007": "4007 - Marketing Team Fees",
27
+ "4008": "4008 - Health Care Fees",
28
+ "4009": "4009 - Contractor Fees",
29
+ "4010": "4010 - Insurance Fees Team",
30
+ "4011": "4011 - HR Fees",
31
+ "4012": "4012 - Team Bonus",
32
+ "4013": "4013 - Refferal Fees",
33
+ "416": "416 - Depreciation",
34
+ "425": "425 - Freight & Courier",
35
+ "437": "437 - Interest Expense",
36
+ "453": "453 - Office Expenses",
37
+ "469": "469 - Rent",
38
+ "485": "485 - Subscriptions",
39
+ "505": "505 - Income Tax Expense",
40
+ "701": "701 - Software/IT Subscriptions",
41
+ "702": "702 - Telephone and Internet Charges",
42
+ "8000": "8000 - Bank Fees",
43
+ "8001": "8001 - Gas Fees",
44
+ "8003": "8003 - Exchange Fees",
45
45
  };
46
46
  // Keyword-based mapping rules (highest confidence)
47
47
  const KEYWORD_RULES = [
48
48
  // Software & Technology
49
49
  {
50
- patterns: ['github', 'gitlab', 'figma', 'slack', 'notion', 'vercel', 'netlify', 'aws', 'google cloud'],
51
- account: '701',
50
+ patterns: [
51
+ "github",
52
+ "gitlab",
53
+ "figma",
54
+ "slack",
55
+ "notion",
56
+ "vercel",
57
+ "netlify",
58
+ "aws",
59
+ "google cloud",
60
+ ],
61
+ account: "701",
52
62
  confidence: 0.95,
53
- reason: 'Known software platform'
63
+ reason: "Known software platform",
54
64
  },
55
65
  {
56
- patterns: ['software', 'saas', 'subscription', 'api', 'hosting', 'cloud'],
57
- account: '701',
66
+ patterns: ["software", "saas", "subscription", "api", "hosting", "cloud"],
67
+ account: "701",
58
68
  confidence: 0.85,
59
- reason: 'Software/SaaS keywords'
69
+ reason: "Software/SaaS keywords",
60
70
  },
61
71
  {
62
- patterns: ['subscription', 'monthly', 'annual'],
63
- account: '485',
72
+ patterns: ["subscription", "monthly", "annual"],
73
+ account: "485",
64
74
  confidence: 0.8,
65
- reason: 'General subscription'
75
+ reason: "General subscription",
66
76
  },
67
77
  // Travel & Transportation
68
78
  {
69
- patterns: ['airline', 'flight', 'airfare', 'airport'],
70
- account: '3002',
79
+ patterns: ["airline", "flight", "airfare", "airport"],
80
+ account: "3002",
71
81
  confidence: 0.95,
72
- reason: 'Air travel'
82
+ reason: "Air travel",
73
83
  },
74
84
  {
75
- patterns: ['hotel', 'accommodation', 'lodging', 'booking.com', 'hotels.com'],
76
- account: '3003',
85
+ patterns: [
86
+ "hotel",
87
+ "accommodation",
88
+ "lodging",
89
+ "booking.com",
90
+ "hotels.com",
91
+ ],
92
+ account: "3003",
77
93
  confidence: 0.95,
78
- reason: 'Hotel accommodation'
94
+ reason: "Hotel accommodation",
79
95
  },
80
96
  {
81
- patterns: ['uber', 'lyft', 'taxi', 'rideshare', 'transport'],
82
- account: '3004',
97
+ patterns: ["uber", "lyft", "taxi", "rideshare", "transport"],
98
+ account: "3004",
83
99
  confidence: 0.9,
84
- reason: 'Transportation services'
100
+ reason: "Transportation services",
85
101
  },
86
102
  {
87
- patterns: ['restaurant', 'meal', 'food', 'catering', 'lunch', 'dinner'],
88
- account: '3001',
103
+ patterns: ["restaurant", "meal", "food", "catering", "lunch", "dinner"],
104
+ account: "3001",
89
105
  confidence: 0.85,
90
- reason: 'Meals & entertainment'
106
+ reason: "Meals & entertainment",
91
107
  },
92
108
  {
93
- patterns: ['travel', 'trip', 'conference'],
94
- account: '3005',
109
+ patterns: ["travel", "trip", "conference"],
110
+ account: "3005",
95
111
  confidence: 0.7,
96
- reason: 'General travel'
112
+ reason: "General travel",
97
113
  },
98
114
  // Professional Services
99
115
  {
100
- patterns: ['contractor', 'freelancer', 'consultant', 'consulting'],
101
- account: '4009',
116
+ patterns: ["contractor", "freelancer", "consultant", "consulting"],
117
+ account: "4009",
102
118
  confidence: 0.9,
103
- reason: 'Contractor services'
119
+ reason: "Contractor services",
104
120
  },
105
121
  {
106
- patterns: ['legal', 'attorney', 'law', 'lawyer'],
107
- account: '4001',
122
+ patterns: ["legal", "attorney", "law", "lawyer"],
123
+ account: "4001",
108
124
  confidence: 0.9,
109
- reason: 'Legal services'
125
+ reason: "Legal services",
110
126
  },
111
127
  {
112
- patterns: ['development', 'developer', 'programming', 'coding'],
113
- account: '4005',
128
+ patterns: ["development", "developer", "programming", "coding"],
129
+ account: "4005",
114
130
  confidence: 0.85,
115
- reason: 'Software development'
131
+ reason: "Software development",
116
132
  },
117
133
  // Office & Operations
118
134
  {
119
- patterns: ['rent', 'lease', 'office space', 'coworking'],
120
- account: '469',
135
+ patterns: ["rent", "lease", "office space", "coworking"],
136
+ account: "469",
121
137
  confidence: 0.9,
122
- reason: 'Rent/office space'
138
+ reason: "Rent/office space",
123
139
  },
124
140
  {
125
- patterns: ['office', 'supplies', 'equipment', 'stationery'],
126
- account: '453',
141
+ patterns: ["office", "supplies", "equipment", "stationery"],
142
+ account: "453",
127
143
  confidence: 0.8,
128
- reason: 'Office expenses'
144
+ reason: "Office expenses",
129
145
  },
130
146
  // Marketing & Advertising
131
147
  {
132
- patterns: ['advertising', 'marketing', 'promotion', 'campaign', 'ads'],
133
- account: '400',
148
+ patterns: ["advertising", "marketing", "promotion", "campaign", "ads"],
149
+ account: "400",
134
150
  confidence: 0.85,
135
- reason: 'Marketing/advertising'
151
+ reason: "Marketing/advertising",
136
152
  },
137
153
  // Fees & Financial
138
154
  {
139
- patterns: ['bank fee', 'transaction fee', 'processing fee'],
140
- account: '8000',
155
+ patterns: ["bank fee", "transaction fee", "processing fee"],
156
+ account: "8000",
141
157
  confidence: 0.9,
142
- reason: 'Bank fees'
158
+ reason: "Bank fees",
143
159
  },
144
160
  {
145
- patterns: ['gas fee', 'ethereum', 'blockchain'],
146
- account: '8001',
161
+ patterns: ["gas fee", "ethereum", "blockchain"],
162
+ account: "8001",
147
163
  confidence: 0.95,
148
- reason: 'Blockchain gas fees'
149
- }
164
+ reason: "Blockchain gas fees",
165
+ },
150
166
  ];
151
167
  // Vendor-specific mapping (very high confidence)
152
168
  const VENDOR_RULES = [
153
169
  // Software platforms
154
- { vendors: ['github.com', 'github'], account: '701', confidence: 0.98 },
155
- { vendors: ['figma.com', 'figma'], account: '701', confidence: 0.98 },
156
- { vendors: ['slack.com', 'slack'], account: '701', confidence: 0.98 },
157
- { vendors: ['notion.so', 'notion'], account: '701', confidence: 0.98 },
158
- { vendors: ['vercel.com', 'vercel'], account: '701', confidence: 0.98 },
159
- { vendors: ['aws.amazon.com', 'amazon web services'], account: '701', confidence: 0.98 },
170
+ { vendors: ["github.com", "github"], account: "701", confidence: 0.98 },
171
+ { vendors: ["figma.com", "figma"], account: "701", confidence: 0.98 },
172
+ { vendors: ["slack.com", "slack"], account: "701", confidence: 0.98 },
173
+ { vendors: ["notion.so", "notion"], account: "701", confidence: 0.98 },
174
+ { vendors: ["vercel.com", "vercel"], account: "701", confidence: 0.98 },
175
+ {
176
+ vendors: ["aws.amazon.com", "amazon web services"],
177
+ account: "701",
178
+ confidence: 0.98,
179
+ },
160
180
  // Travel
161
- { vendors: ['booking.com', 'expedia', 'hotels.com'], account: '3003', confidence: 0.98 },
162
- { vendors: ['uber', 'lyft'], account: '3004', confidence: 0.98 },
163
- { vendors: ['delta', 'american airlines', 'united'], account: '3002', confidence: 0.98 },
181
+ {
182
+ vendors: ["booking.com", "expedia", "hotels.com"],
183
+ account: "3003",
184
+ confidence: 0.98,
185
+ },
186
+ { vendors: ["uber", "lyft"], account: "3004", confidence: 0.98 },
187
+ {
188
+ vendors: ["delta", "american airlines", "united"],
189
+ account: "3002",
190
+ confidence: 0.98,
191
+ },
164
192
  // Professional services
165
- { vendors: ['upwork', 'fiverr'], account: '4009', confidence: 0.95 }
193
+ { vendors: ["upwork", "fiverr"], account: "4009", confidence: 0.95 },
166
194
  ];
167
195
  // Amount-based rules (lower confidence)
168
196
  const AMOUNT_RULES = [
169
197
  {
170
198
  range: { min: 5, max: 50 },
171
- patterns: ['subscription', 'monthly'],
172
- account: '485',
199
+ patterns: ["subscription", "monthly"],
200
+ account: "485",
173
201
  confidence: 0.6,
174
- reason: 'Small subscription amount'
202
+ reason: "Small subscription amount",
175
203
  },
176
204
  {
177
205
  range: { min: 1000, max: 50000 },
178
- patterns: ['consulting', 'development'],
179
- account: '4009',
206
+ patterns: ["consulting", "development"],
207
+ account: "4009",
180
208
  confidence: 0.7,
181
- reason: 'Large professional services amount'
182
- }
209
+ reason: "Large professional services amount",
210
+ },
183
211
  ];
184
212
  /**
185
213
  * Main auto-tagging function using smart hybrid approach
186
214
  */
187
215
  export function autoTagLineItem(description, amount, vendor) {
188
216
  const desc = description.toLowerCase();
189
- const vendorLower = vendor?.toLowerCase() || '';
217
+ const vendorLower = vendor?.toLowerCase() || "";
190
218
  // 1. Try vendor-specific rules first (highest confidence)
191
219
  for (const rule of VENDOR_RULES) {
192
- if (rule.vendors.some(v => desc.includes(v) || vendorLower.includes(v))) {
220
+ if (rule.vendors.some((v) => desc.includes(v) || vendorLower.includes(v))) {
193
221
  const label = XERO_EXPENSE_ACCOUNTS[rule.account];
194
222
  return {
195
223
  tag: {
196
- dimension: 'xero-expense-account',
224
+ dimension: "xero-expense-account",
197
225
  value: rule.account,
198
- label: label
226
+ label: label,
199
227
  },
200
228
  confidence: rule.confidence,
201
- method: 'vendor',
202
- reason: `Matched vendor: ${rule.vendors[0]}`
229
+ method: "vendor",
230
+ reason: `Matched vendor: ${rule.vendors[0]}`,
203
231
  };
204
232
  }
205
233
  }
206
234
  // 2. Try keyword-based rules
207
235
  for (const rule of KEYWORD_RULES) {
208
- if (rule.patterns.some(pattern => desc.includes(pattern))) {
236
+ if (rule.patterns.some((pattern) => desc.includes(pattern))) {
209
237
  const label = XERO_EXPENSE_ACCOUNTS[rule.account];
210
238
  return {
211
239
  tag: {
212
- dimension: 'xero-expense-account',
240
+ dimension: "xero-expense-account",
213
241
  value: rule.account,
214
- label: label
242
+ label: label,
215
243
  },
216
244
  confidence: rule.confidence,
217
- method: 'keyword',
218
- reason: rule.reason
245
+ method: "keyword",
246
+ reason: rule.reason,
219
247
  };
220
248
  }
221
249
  }
222
250
  // 3. Try amount-based rules
223
251
  for (const rule of AMOUNT_RULES) {
224
252
  if (amount >= rule.range.min && amount <= rule.range.max) {
225
- if (rule.patterns.some(pattern => desc.includes(pattern))) {
253
+ if (rule.patterns.some((pattern) => desc.includes(pattern))) {
226
254
  const label = XERO_EXPENSE_ACCOUNTS[rule.account];
227
255
  return {
228
256
  tag: {
229
- dimension: 'xero-expense-account',
257
+ dimension: "xero-expense-account",
230
258
  value: rule.account,
231
- label: label
259
+ label: label,
232
260
  },
233
261
  confidence: rule.confidence,
234
- method: 'amount',
235
- reason: rule.reason
262
+ method: "amount",
263
+ reason: rule.reason,
236
264
  };
237
265
  }
238
266
  }
@@ -244,7 +272,7 @@ export function autoTagLineItem(description, amount, vendor) {
244
272
  * Only used when rule-based matching fails
245
273
  */
246
274
  export async function claudeClassifyExpense(description, amount) {
247
- const apiKey = typeof process !== 'undefined' ? process.env?.CLAUDE_API_KEY : undefined;
275
+ const apiKey = typeof process !== "undefined" ? process.env?.CLAUDE_API_KEY : undefined;
248
276
  if (!apiKey) {
249
277
  return null;
250
278
  }
@@ -263,21 +291,23 @@ Categories:
263
291
 
264
292
  Respond with ONLY the category name: SOFTWARE|TRAVEL|CONTRACTOR|LEGAL|OFFICE|MARKETING|OTHER`;
265
293
  try {
266
- const response = await fetch('https://api.anthropic.com/v1/messages', {
267
- method: 'POST',
294
+ const response = await fetch("https://api.anthropic.com/v1/messages", {
295
+ method: "POST",
268
296
  headers: {
269
- 'Content-Type': 'application/json',
270
- 'x-api-key': apiKey,
271
- 'anthropic-version': '2023-06-01'
297
+ "Content-Type": "application/json",
298
+ "x-api-key": apiKey,
299
+ "anthropic-version": "2023-06-01",
272
300
  },
273
301
  body: JSON.stringify({
274
302
  model: "claude-haiku-4-5-20251001",
275
303
  max_tokens: 10,
276
- messages: [{
304
+ messages: [
305
+ {
277
306
  role: "user",
278
- content: prompt
279
- }]
280
- })
307
+ content: prompt,
308
+ },
309
+ ],
310
+ }),
281
311
  });
282
312
  if (!response.ok) {
283
313
  throw new Error(`Claude API error: ${response.status}`);
@@ -286,25 +316,25 @@ Respond with ONLY the category name: SOFTWARE|TRAVEL|CONTRACTOR|LEGAL|OFFICE|MAR
286
316
  const category = result.content[0]?.text?.trim().toUpperCase();
287
317
  // Map category to Xero account
288
318
  const categoryMapping = {
289
- 'SOFTWARE': '701',
290
- 'TRAVEL': '3005',
291
- 'CONTRACTOR': '4009',
292
- 'LEGAL': '4001',
293
- 'OFFICE': '453',
294
- 'MARKETING': '400',
295
- 'OTHER': '453' // Default to office expenses
319
+ SOFTWARE: "701",
320
+ TRAVEL: "3005",
321
+ CONTRACTOR: "4009",
322
+ LEGAL: "4001",
323
+ OFFICE: "453",
324
+ MARKETING: "400",
325
+ OTHER: "453", // Default to office expenses
296
326
  };
297
- const account = categoryMapping[category] || '453';
327
+ const account = categoryMapping[category] || "453";
298
328
  const label = XERO_EXPENSE_ACCOUNTS[account];
299
329
  return {
300
330
  tag: {
301
- dimension: 'xero-expense-account',
331
+ dimension: "xero-expense-account",
302
332
  value: account,
303
- label: label
333
+ label: label,
304
334
  },
305
335
  confidence: 0.6, // Lower confidence for Claude classifications
306
- method: 'claude',
307
- reason: `Claude classified as ${category}`
336
+ method: "claude",
337
+ reason: `Claude classified as ${category}`,
308
338
  };
309
339
  }
310
340
  catch (error) {
@@ -1,44 +1,44 @@
1
- import { executeTransferProposal } from './gnosisTransactionBuilder.js';
2
- import dotenv from 'dotenv';
1
+ import { executeTransferProposal } from "./gnosisTransactionBuilder.js";
2
+ import dotenv from "dotenv";
3
3
  dotenv.config();
4
4
  async function testBatchTransfer() {
5
5
  try {
6
6
  const payerWallet = {
7
- rpc: 'https://mainnet.base.org', // Base mainnet RPC
8
- chainName: 'Base',
9
- chainId: '8453',
10
- address: '0x1FB6bEF04230d67aF0e3455B997a28AFcCe1F45e',
7
+ rpc: "https://mainnet.base.org", // Base mainnet RPC
8
+ chainName: "Base",
9
+ chainId: "8453",
10
+ address: "0x1FB6bEF04230d67aF0e3455B997a28AFcCe1F45e",
11
11
  };
12
12
  const paymentDetails = [
13
13
  {
14
14
  payeeWallet: {
15
- address: '0x48f208afD0Abeacd4e7C8839Ea19e3CcCF0433DE',
15
+ address: "0x48f208afD0Abeacd4e7C8839Ea19e3CcCF0433DE",
16
16
  },
17
17
  token: {
18
- symbol: 'USDS',
19
- evmAddress: '0x820C137fa70C8691f0e44Dc420a5e53c168921Dc',
18
+ symbol: "USDS",
19
+ evmAddress: "0x820C137fa70C8691f0e44Dc420a5e53c168921Dc",
20
20
  decimals: 6,
21
21
  },
22
- amount: '10',
22
+ amount: "10",
23
23
  },
24
24
  {
25
25
  payeeWallet: {
26
- address: '0x48f208afD0Abeacd4e7C8839Ea19e3CcCF0433DE',
26
+ address: "0x48f208afD0Abeacd4e7C8839Ea19e3CcCF0433DE",
27
27
  },
28
28
  token: {
29
- symbol: 'USDS',
30
- evmAddress: '0x820C137fa70C8691f0e44Dc420a5e53c168921Dc',
29
+ symbol: "USDS",
30
+ evmAddress: "0x820C137fa70C8691f0e44Dc420a5e53c168921Dc",
31
31
  decimals: 6,
32
32
  },
33
- amount: '15.5',
33
+ amount: "15.5",
34
34
  },
35
35
  ];
36
36
  const result = await executeTransferProposal(payerWallet.chainName, paymentDetails);
37
- console.log('\n✅ Batch transaction proposed successfully:');
37
+ console.log("\n✅ Batch transaction proposed successfully:");
38
38
  console.log(result);
39
39
  }
40
40
  catch (err) {
41
- console.error('\n❌ Batch transaction test failed:', err);
41
+ console.error("\n❌ Batch transaction test failed:", err);
42
42
  }
43
43
  }
44
44
  testBatchTransfer();
@@ -1 +1 @@
1
- {"version":3,"file":"gnosisTransactionBuilder.d.ts","sourceRoot":"","sources":["../../../scripts/invoice/gnosisTransactionBuilder.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC;AAuDD,iBAAe,uBAAuB,CACpC,SAAS,EAAE,MAAM,EACjB,mBAAmB,EAAE,aAAa,GAAG,aAAa,EAAE,GACnD,OAAO,CAAC,cAAc,CAAC,CA2GzB;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAA"}
1
+ {"version":3,"file":"gnosisTransactionBuilder.d.ts","sourceRoot":"","sources":["../../../scripts/invoice/gnosisTransactionBuilder.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC;AAwED,iBAAe,uBAAuB,CACpC,SAAS,EAAE,MAAM,EACjB,mBAAmB,EAAE,aAAa,GAAG,aAAa,EAAE,GACnD,OAAO,CAAC,cAAc,CAAC,CAuGzB;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
@@ -1,14 +1,22 @@
1
- import SafeApiKit from '@safe-global/api-kit';
2
- import Safe from '@safe-global/protocol-kit';
3
- import { OperationType } from '@safe-global/types-kit';
4
- import { ethers, AbiCoder } from 'ethers';
5
- import dotenv from 'dotenv';
6
- import { CHAIN_CONFIGS } from '../../editors/invoice/utils/utils.js';
1
+ import SafeApiKit from "@safe-global/api-kit";
2
+ import Safe from "@safe-global/protocol-kit";
3
+ import { OperationType } from "@safe-global/types-kit";
4
+ import { ethers, AbiCoder } from "ethers";
5
+ import dotenv from "dotenv";
6
+ import { CHAIN_CONFIGS } from "../../editors/invoice/utils/utils.js";
7
7
  dotenv.config();
8
- const safeAddress = process.env.PRODUCTION_SAFE_ADDRESS;
8
+ // Determine environment and use appropriate Safe address
9
+ const isProduction = process.env.NODE_ENV === "production";
10
+ const safeAddress = isProduction
11
+ ? process.env.PRODUCTION_SAFE_ADDRESS
12
+ : process.env.DEV_STAGING_SAFE_ADDRESS;
9
13
  if (!safeAddress) {
10
- throw new Error('Missing SAFE_ADDRESS in .env');
14
+ const envVarName = isProduction
15
+ ? "PRODUCTION_SAFE_ADDRESS"
16
+ : "DEV_STAGING_SAFE_ADDRESS";
17
+ throw new Error(`Missing ${envVarName} in .env (NODE_ENV=${process.env.NODE_ENV || "undefined"})`);
11
18
  }
19
+ console.log(`----- GNOSIS TRANSACTION BUILDER ----- Using ${isProduction ? "PRODUCTION" : "DEV/STAGING"} Safe address: ${safeAddress}`);
12
20
  const payerWallets = {
13
21
  BASE: {
14
22
  ...CHAIN_CONFIGS.base,
@@ -33,13 +41,13 @@ async function withRetry(fn, maxRetries = 3, initialDelay = 1000, operationName
33
41
  return await fn();
34
42
  }
35
43
  catch (error) {
36
- const isRateLimit = error?.message?.includes('Too Many Requests') ||
37
- error?.message?.includes('429') ||
44
+ const isRateLimit = error?.message?.includes("Too Many Requests") ||
45
+ error?.message?.includes("429") ||
38
46
  error?.status === 429;
39
47
  if (isRateLimit && attempt < maxRetries - 1) {
40
48
  const waitTime = initialDelay * Math.pow(2, attempt); // Exponential backoff
41
49
  console.log(`[${operationName}] Rate limited, retrying in ${waitTime}ms... (attempt ${attempt + 1}/${maxRetries})`);
42
- await new Promise(resolve => setTimeout(resolve, waitTime));
50
+ await new Promise((resolve) => setTimeout(resolve, waitTime));
43
51
  continue;
44
52
  }
45
53
  // If it's not a rate limit error, or we've exhausted retries, throw
@@ -56,9 +64,9 @@ async function executeTransferProposal(chainName, paymentDetailsInput) {
56
64
  : [paymentDetailsInput];
57
65
  const privateKey = process.env.SIGNER_PRIVATE_KEY;
58
66
  if (!privateKey) {
59
- throw new Error('Missing SIGNER_PRIVATE_KEY in .env');
67
+ throw new Error("Missing SIGNER_PRIVATE_KEY in .env");
60
68
  }
61
- console.log('\n=== Safe Transfer Initialization ===');
69
+ console.log("\n=== Safe Transfer Initialization ===");
62
70
  console.log(`Chain: ${payerWallet.chainName} (${payerWallet.chainId})`);
63
71
  console.log(`Safe Address: ${payerWallet.address}`);
64
72
  // Set up provider and signer
@@ -68,7 +76,7 @@ async function executeTransferProposal(chainName, paymentDetailsInput) {
68
76
  // @ts-ignore - Ignoring constructor error as per requirements
69
77
  const safeApiKit = new SafeApiKit({
70
78
  chainId: BigInt(payerWallet.chainId),
71
- apiKey: process.env.SAFE_API_KEY
79
+ apiKey: process.env.SAFE_API_KEY,
72
80
  });
73
81
  // Get next nonce with retry logic for rate limiting
74
82
  const nextNonce = await withRetry(() => safeApiKit.getNextNonce(safeAddress), 3, 1000, "getNextNonce");
@@ -84,31 +92,30 @@ async function executeTransferProposal(chainName, paymentDetailsInput) {
84
92
  const transactions = paymentDetails.map((pd) => {
85
93
  const { payeeWallet, token, amount } = pd;
86
94
  const amountSmall = ethers.parseUnits(amount.toString(), token.decimals);
87
- console.log('\n--- Preparing transfer ---');
95
+ console.log("\n--- Preparing transfer ---");
88
96
  console.log(`Token: ${token.symbol} @ ${token.evmAddress}`);
89
97
  console.log(`To: ${payeeWallet.address}`);
90
98
  console.log(`Amount: ${amount} → ${amountSmall}`);
91
99
  // a9059cbb is the ERC-20 transfer method ID
92
- const data = '0xa9059cbb' +
93
- coder.encode(['address', 'uint256'], [
94
- payeeWallet.address,
95
- amountSmall,
96
- ]).slice(2);
100
+ const data = "0xa9059cbb" +
101
+ coder
102
+ .encode(["address", "uint256"], [payeeWallet.address, amountSmall])
103
+ .slice(2);
97
104
  return {
98
105
  to: token.evmAddress,
99
- value: '0',
106
+ value: "0",
100
107
  data,
101
108
  operation: OperationType.Call,
102
109
  };
103
110
  });
104
- console.log('\n=== Creating Safe transaction ===');
111
+ console.log("\n=== Creating Safe transaction ===");
105
112
  const safeTx = await protocolKit.createTransaction({
106
113
  transactions,
107
114
  options: {
108
- nonce: nextNonce
109
- }
115
+ nonce: nextNonce,
116
+ },
110
117
  });
111
- console.log('\n=== Signing & proposing ===');
118
+ console.log("\n=== Signing & proposing ===");
112
119
  const safeTxHash = await protocolKit.getTransactionHash(safeTx);
113
120
  const signature = await protocolKit.signHash(safeTxHash);
114
121
  const senderAddress = await signer.getAddress();