@powerhousedao/contributor-billing 0.1.29 → 0.1.30
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.
- package/README.md +165 -8
- package/dist/document-models/billing-statement/actions.d.ts +1 -0
- package/dist/document-models/billing-statement/actions.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/document-model.js +58 -47
- package/dist/document-models/billing-statement/gen/document-schema.d.ts +38 -38
- package/dist/document-models/billing-statement/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/line-items/actions.d.ts +6 -2
- package/dist/document-models/billing-statement/gen/line-items/actions.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/line-items/creators.d.ts +3 -2
- package/dist/document-models/billing-statement/gen/line-items/creators.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/line-items/creators.js +2 -1
- package/dist/document-models/billing-statement/gen/line-items/operations.d.ts +2 -1
- package/dist/document-models/billing-statement/gen/line-items/operations.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/ph-factories.js +1 -1
- package/dist/document-models/billing-statement/gen/reducer.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/reducer.js +5 -1
- package/dist/document-models/billing-statement/gen/schema/types.d.ts +3 -0
- package/dist/document-models/billing-statement/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/schema/zod.d.ts +2 -1
- package/dist/document-models/billing-statement/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/billing-statement/gen/schema/zod.js +5 -0
- package/dist/document-models/billing-statement/gen/utils.js +2 -2
- package/dist/document-models/billing-statement/src/reducers/general.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/reducers/general.js +5 -4
- package/dist/document-models/billing-statement/src/reducers/line-items.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/reducers/line-items.js +7 -2
- package/dist/document-models/billing-statement/src/reducers/tags.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/reducers/tags.js +1 -1
- package/dist/document-models/billing-statement/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/billing-statement/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/tests/document-model.test.js +94 -7
- package/dist/document-models/billing-statement/src/tests/general.test.d.ts +2 -1
- package/dist/document-models/billing-statement/src/tests/general.test.d.ts.map +1 -1
- package/dist/document-models/billing-statement/src/tests/general.test.js +33 -88
- package/dist/document-models/billing-statement/src/tests/line-items.test.js +22 -125
- package/dist/document-models/billing-statement/src/tests/tags.test.js +13 -47
- package/dist/document-models/document-models.js +2 -2
- package/dist/document-models/expense-report/gen/document-model.d.ts.map +1 -1
- package/dist/document-models/expense-report/gen/document-model.js +48 -48
- package/dist/document-models/expense-report/gen/document-schema.d.ts +6 -6
- package/dist/document-models/expense-report/gen/utils.js +1 -1
- package/dist/document-models/expense-report/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/expense-report/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/expense-report/src/tests/document-model.test.js +94 -8
- package/dist/document-models/expense-report/src/tests/wallet.test.js +145 -10
- package/dist/document-models/index.d.ts +2 -6
- package/dist/document-models/index.d.ts.map +1 -1
- package/dist/document-models/index.js +2 -6
- package/dist/document-models/integrations/gen/document-model.js +33 -33
- package/dist/document-models/integrations/gen/document-schema.d.ts +6 -6
- package/dist/document-models/integrations/gen/utils.js +1 -1
- package/dist/document-models/integrations/src/reducers/integrations.d.ts.map +1 -1
- package/dist/document-models/integrations/src/reducers/integrations.js +9 -32
- package/dist/document-models/integrations/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/integrations/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/integrations/src/tests/document-model.test.js +91 -5
- package/dist/document-models/integrations/src/tests/integrations.test.js +21 -46
- package/dist/document-models/invoice/gen/document-model.js +147 -147
- package/dist/document-models/invoice/gen/document-schema.d.ts +127 -127
- package/dist/document-models/invoice/gen/document-schema.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/ph-factories.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/ph-factories.js +16 -122
- package/dist/document-models/invoice/gen/schema/types.d.ts +4 -4
- package/dist/document-models/invoice/gen/schema/types.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/schema/zod.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/schema/zod.js +4 -4
- package/dist/document-models/invoice/gen/utils.d.ts.map +1 -1
- package/dist/document-models/invoice/gen/utils.js +17 -123
- package/dist/document-models/invoice/src/reducers/general.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/general.js +34 -10
- package/dist/document-models/invoice/src/reducers/items.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/items.js +7 -7
- package/dist/document-models/invoice/src/reducers/parties.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/parties.js +96 -50
- package/dist/document-models/invoice/src/reducers/transitions.d.ts.map +1 -1
- package/dist/document-models/invoice/src/reducers/transitions.js +69 -53
- package/dist/document-models/invoice/src/tests/document-model.test.d.ts +4 -0
- package/dist/document-models/invoice/src/tests/document-model.test.d.ts.map +1 -1
- package/dist/document-models/invoice/src/tests/document-model.test.js +91 -4
- package/dist/document-models/invoice/src/tests/general.test.js +24 -26
- package/dist/document-models/invoice/src/tests/items.test.js +37 -17
- package/dist/document-models/invoice/src/tests/parties.test.js +32 -26
- package/dist/document-models/invoice/src/tests/transitions.test.js +52 -500
- package/dist/document-models/invoice/utils/statusTransitions.d.ts.map +1 -1
- package/dist/document-models/invoice/utils/statusTransitions.js +10 -10
- package/dist/editors/billing-statement/components/lineItemsTable.d.ts.map +1 -1
- package/dist/editors/billing-statement/components/lineItemsTable.js +32 -23
- package/dist/editors/billing-statement/components/objectSetTable.d.ts.map +1 -1
- package/dist/editors/billing-statement/components/objectSetTable.js +1 -2
- package/dist/editors/billing-statement/editor.d.ts +4 -0
- package/dist/editors/billing-statement/editor.d.ts.map +1 -1
- package/dist/editors/billing-statement/editor.js +34 -16
- package/dist/editors/billing-statement/lineItemTags/lineItemTags.d.ts.map +1 -1
- package/dist/editors/billing-statement/lineItemTags/lineItemTags.js +36 -37
- package/dist/editors/billing-statement/lineItemTags/tagMapping.d.ts.map +1 -1
- package/dist/editors/billing-statement/lineItemTags/tagMapping.js +28 -10
- package/dist/editors/clean-new-editor/components/CreateDocument.d.ts +6 -0
- package/dist/editors/clean-new-editor/components/CreateDocument.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/CreateDocument.js +18 -0
- package/dist/editors/clean-new-editor/components/DriveContents.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/DriveContents.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/DriveContents.js +10 -0
- package/dist/editors/clean-new-editor/components/DriveExplorer.d.ts +7 -0
- package/dist/editors/clean-new-editor/components/DriveExplorer.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/DriveExplorer.js +16 -0
- package/dist/editors/clean-new-editor/components/EmptyState.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/EmptyState.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/EmptyState.js +10 -0
- package/dist/editors/clean-new-editor/components/Files.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/Files.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/Files.js +12 -0
- package/dist/editors/clean-new-editor/components/FolderTree.d.ts +6 -0
- package/dist/editors/clean-new-editor/components/FolderTree.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/FolderTree.js +65 -0
- package/dist/editors/clean-new-editor/components/Folders.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/Folders.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/Folders.js +12 -0
- package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.d.ts +3 -0
- package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/components/NavigationBreadcrumbs.js +6 -0
- package/dist/editors/clean-new-editor/config.d.ts +4 -0
- package/dist/editors/clean-new-editor/config.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/config.js +5 -0
- package/dist/editors/clean-new-editor/editor.d.ts +4 -0
- package/dist/editors/clean-new-editor/editor.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/editor.js +11 -0
- package/dist/editors/clean-new-editor/module.d.ts +3 -0
- package/dist/editors/clean-new-editor/module.d.ts.map +1 -0
- package/dist/editors/clean-new-editor/module.js +10 -0
- package/dist/editors/contributor-billing/components/ConfirmationModal.d.ts +14 -0
- package/dist/editors/contributor-billing/components/ConfirmationModal.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/ConfirmationModal.js +6 -0
- package/dist/editors/contributor-billing/components/CreateDocument.d.ts +6 -0
- package/dist/editors/contributor-billing/components/CreateDocument.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/CreateDocument.js +18 -0
- package/dist/editors/contributor-billing/components/DriveContents.d.ts +3 -0
- package/dist/editors/contributor-billing/components/DriveContents.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/DriveContents.js +10 -0
- package/dist/editors/contributor-billing/components/DriveExplorer.d.ts +3 -3
- package/dist/editors/contributor-billing/components/DriveExplorer.d.ts.map +1 -1
- package/dist/editors/contributor-billing/components/DriveExplorer.js +13 -180
- package/dist/editors/contributor-billing/components/EmptyState.d.ts +3 -0
- package/dist/editors/contributor-billing/components/EmptyState.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/EmptyState.js +10 -0
- package/dist/editors/contributor-billing/components/Files.d.ts +3 -0
- package/dist/editors/contributor-billing/components/Files.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/Files.js +12 -0
- package/dist/editors/contributor-billing/components/FolderTree.d.ts +6 -0
- package/dist/editors/contributor-billing/components/FolderTree.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/FolderTree.js +65 -0
- package/dist/editors/contributor-billing/components/Folders.d.ts +3 -0
- package/dist/editors/contributor-billing/components/Folders.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/Folders.js +12 -0
- package/dist/editors/contributor-billing/components/HeaderControls.d.ts +38 -0
- package/dist/editors/contributor-billing/components/HeaderControls.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/HeaderControls.js +124 -0
- package/dist/editors/contributor-billing/components/HeaderStats.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/{InvoiceTable/HeaderStats.js → HeaderStats.js} +1 -1
- package/dist/editors/contributor-billing/components/InvoiceTable.d.ts +22 -0
- package/dist/editors/contributor-billing/components/InvoiceTable.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTable.js +399 -0
- package/dist/editors/contributor-billing/components/InvoiceTableContainer.d.ts +6 -0
- package/dist/editors/contributor-billing/components/InvoiceTableContainer.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTableContainer.js +111 -0
- package/dist/editors/contributor-billing/components/InvoiceTableRow.d.ts +32 -0
- package/dist/editors/contributor-billing/components/InvoiceTableRow.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTableRow.js +55 -0
- package/dist/editors/contributor-billing/components/InvoiceTableSection.d.ts +13 -0
- package/dist/editors/contributor-billing/components/InvoiceTableSection.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/InvoiceTableSection.js +16 -0
- package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.d.ts +3 -0
- package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.d.ts.map +1 -0
- package/dist/editors/contributor-billing/components/NavigationBreadcrumbs.js +6 -0
- package/dist/editors/contributor-billing/config.d.ts +1 -0
- package/dist/editors/contributor-billing/config.d.ts.map +1 -1
- package/dist/editors/contributor-billing/config.js +4 -1
- package/dist/editors/contributor-billing/editor.d.ts +1 -0
- package/dist/editors/contributor-billing/editor.d.ts.map +1 -1
- package/dist/editors/contributor-billing/editor.js +4 -1
- package/dist/editors/contributor-billing/module.d.ts +1 -1
- package/dist/editors/contributor-billing/module.d.ts.map +1 -1
- package/dist/editors/contributor-billing/module.js +3 -2
- package/dist/editors/contributor-billing/utils/exchangeRate.d.ts +15 -0
- package/dist/editors/contributor-billing/utils/exchangeRate.d.ts.map +1 -0
- package/dist/editors/contributor-billing/utils/exchangeRate.js +122 -0
- package/dist/editors/editors.js +2 -2
- package/dist/editors/expense-report/components/AddBillingStatementModal.d.ts.map +1 -1
- package/dist/editors/expense-report/editor.js +8 -8
- package/dist/editors/index.d.ts +2 -2
- package/dist/editors/index.d.ts.map +1 -1
- package/dist/editors/index.js +2 -2
- package/dist/editors/integrations/components/EditName.d.ts +3 -0
- package/dist/editors/integrations/components/EditName.d.ts.map +1 -0
- package/dist/editors/integrations/components/EditName.js +31 -0
- package/dist/editors/integrations/editor.d.ts +2 -4
- package/dist/editors/integrations/editor.d.ts.map +1 -1
- package/dist/editors/integrations/editor.js +5 -132
- package/dist/editors/integrations/module.d.ts +1 -0
- package/dist/editors/integrations/module.d.ts.map +1 -1
- package/dist/editors/integrations/module.js +3 -2
- package/dist/editors/invoice/components/confirmationModal.js +1 -1
- package/dist/editors/invoice/components/countryForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/countryForm.js +1 -1
- package/dist/editors/invoice/components/currencyForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/currencyForm.js +1 -1
- package/dist/editors/invoice/components/datePicker.d.ts +1 -1
- package/dist/editors/invoice/components/datePicker.d.ts.map +1 -1
- package/dist/editors/invoice/components/datePicker.js +1 -1
- package/dist/editors/invoice/components/inputField.d.ts.map +1 -1
- package/dist/editors/invoice/components/inputField.js +3 -2
- package/dist/editors/invoice/components/lineItemMobileModal.d.ts.map +1 -1
- package/dist/editors/invoice/components/lineItemMobileModal.js +1 -1
- package/dist/editors/invoice/components/numberForm.d.ts.map +1 -1
- package/dist/editors/invoice/components/selectField.js +7 -7
- package/dist/editors/invoice/components/statusModalComponents.d.ts.map +1 -1
- package/dist/editors/invoice/components/statusModalComponents.js +27 -3
- package/dist/editors/invoice/editor.d.ts +1 -4
- package/dist/editors/invoice/editor.d.ts.map +1 -1
- package/dist/editors/invoice/editor.js +102 -40
- package/dist/editors/invoice/exportUBL.d.ts.map +1 -1
- package/dist/editors/invoice/exportUBL.js +35 -18
- package/dist/editors/invoice/ingestPDF.d.ts.map +1 -1
- package/dist/editors/invoice/ingestPDF.js +15 -9
- package/dist/editors/invoice/invoiceToGnosis.js +3 -3
- package/dist/editors/invoice/legalEntity/bankSection.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/legalEntity.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/walletSection.d.ts.map +1 -1
- package/dist/editors/invoice/legalEntity/walletSection.js +3 -3
- package/dist/editors/invoice/lineItemTags/lineItemTags.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/lineItemTags.js +1 -1
- package/dist/editors/invoice/lineItemTags/tagMobileModal.d.ts.map +1 -1
- package/dist/editors/invoice/lineItemTags/tagMobileModal.js +4 -3
- package/dist/editors/invoice/lineItems.d.ts.map +1 -1
- package/dist/editors/invoice/module.d.ts +1 -0
- package/dist/editors/invoice/module.d.ts.map +1 -1
- package/dist/editors/invoice/module.js +2 -1
- package/dist/editors/invoice/requestFinance.js +4 -4
- package/dist/editors/invoice/uploadPdfChunked.d.ts.map +1 -1
- package/dist/editors/invoice/uploadPdfChunked.js +5 -4
- package/dist/editors/invoice/utils/utils.d.ts.map +1 -1
- package/dist/editors/invoice/utils/utils.js +5 -4
- package/dist/editors/invoice/validation/validationHandler.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationHandler.js +11 -5
- package/dist/editors/invoice/validation/validationManager.d.ts +2 -2
- package/dist/editors/invoice/validation/validationManager.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationManager.js +5 -5
- package/dist/editors/invoice/validation/validationRules.d.ts.map +1 -1
- package/dist/editors/invoice/validation/validationRules.js +178 -178
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/old-contributor-billing/components/DriveExplorer.d.ts +7 -0
- package/dist/old-contributor-billing/components/DriveExplorer.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/DriveExplorer.js +184 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.d.ts +2 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/HeaderStats.js +73 -0
- package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +1 -0
- package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableSection.js +1 -1
- package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/RowActionMenu.d.ts +1 -1
- package/dist/old-contributor-billing/components/InvoiceTable/RowActionMenu.d.ts.map +1 -0
- package/dist/old-contributor-billing/components/InvoiceTable/RowActionMenu.js +2 -0
- package/dist/old-contributor-billing/config.d.ts +3 -0
- package/dist/old-contributor-billing/config.d.ts.map +1 -0
- package/dist/old-contributor-billing/config.js +4 -0
- package/dist/old-contributor-billing/editor.d.ts +3 -0
- package/dist/old-contributor-billing/editor.d.ts.map +1 -0
- package/dist/old-contributor-billing/editor.js +8 -0
- package/dist/old-contributor-billing/module.d.ts +3 -0
- package/dist/old-contributor-billing/module.d.ts.map +1 -0
- package/dist/old-contributor-billing/module.js +9 -0
- package/dist/old-contributor-billing/util.d.ts.map +1 -0
- package/dist/{editors/contributor-billing → old-contributor-billing}/util.js +11 -9
- package/dist/powerhouse.manifest.json +6 -41
- package/dist/processors/index.d.ts +1 -6
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +1 -18
- package/dist/scripts/contributor-billing/createExpenseReportCsv.d.ts.map +1 -1
- package/dist/scripts/contributor-billing/createExpenseReportCsv.js +24 -24
- package/dist/scripts/contributor-billing/createXeroCsv.d.ts.map +1 -1
- package/dist/scripts/contributor-billing/createXeroCsv.js +52 -46
- package/dist/scripts/invoice/autoTagging.d.ts +1 -1
- package/dist/scripts/invoice/autoTagging.d.ts.map +1 -1
- package/dist/scripts/invoice/autoTagging.js +168 -138
- package/dist/scripts/invoice/exampleBatchTxn.js +16 -16
- package/dist/scripts/invoice/gnosisTransactionBuilder.d.ts.map +1 -1
- package/dist/scripts/invoice/gnosisTransactionBuilder.js +32 -25
- package/dist/scripts/invoice/pdfToClaudeAI.d.ts.map +1 -1
- package/dist/scripts/invoice/pdfToClaudeAI.js +36 -30
- package/dist/scripts/invoice/requestFinance.d.ts.map +1 -1
- package/dist/scripts/invoice/requestFinance.js +13 -13
- package/dist/style.css +407 -13659
- package/dist/subgraphs/billing-statement/resolvers.d.ts +1 -1
- package/dist/subgraphs/billing-statement/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/billing-statement/resolvers.js +16 -5
- package/dist/subgraphs/billing-statement/schema.d.ts.map +1 -1
- package/dist/subgraphs/billing-statement/schema.js +12 -67
- package/dist/subgraphs/expense-report/resolvers.d.ts +1 -1
- package/dist/subgraphs/expense-report/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/expense-report/resolvers.js +4 -5
- package/dist/subgraphs/expense-report/schema.d.ts.map +1 -1
- package/dist/subgraphs/expense-report/schema.js +5 -48
- package/dist/subgraphs/index.d.ts +1 -0
- package/dist/subgraphs/index.d.ts.map +1 -1
- package/dist/subgraphs/index.js +1 -0
- package/dist/subgraphs/integrations/resolvers.d.ts +1 -1
- package/dist/subgraphs/integrations/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/integrations/resolvers.js +4 -5
- package/dist/subgraphs/integrations/schema.d.ts.map +1 -1
- package/dist/subgraphs/integrations/schema.js +3 -43
- package/dist/subgraphs/invoice/index.d.ts.map +1 -1
- package/dist/subgraphs/invoice/index.js +1 -20
- package/dist/subgraphs/invoice/resolvers.d.ts +1 -1
- package/dist/subgraphs/invoice/resolvers.d.ts.map +1 -1
- package/dist/subgraphs/invoice/resolvers.js +4 -9
- package/dist/subgraphs/invoice/schema.d.ts.map +1 -1
- package/dist/subgraphs/invoice/schema.js +14 -232
- package/dist/subgraphs/{invoice → invoice-addon}/customResolvers.d.ts +1 -1
- package/dist/subgraphs/invoice-addon/customResolvers.d.ts.map +1 -0
- package/dist/subgraphs/{invoice → invoice-addon}/customResolvers.js +38 -34
- package/dist/subgraphs/invoice-addon/index.d.ts +11 -0
- package/dist/subgraphs/invoice-addon/index.d.ts.map +1 -0
- package/dist/subgraphs/invoice-addon/index.js +11 -0
- package/dist/subgraphs/invoice-addon/resolvers.d.ts +3 -0
- package/dist/subgraphs/invoice-addon/resolvers.d.ts.map +1 -0
- package/dist/subgraphs/invoice-addon/resolvers.js +12 -0
- package/dist/subgraphs/invoice-addon/schema.d.ts +3 -0
- package/dist/subgraphs/invoice-addon/schema.d.ts.map +1 -0
- package/dist/subgraphs/invoice-addon/schema.js +52 -0
- package/package.json +9 -20
- package/dist/document-models/expense-report/gen/expense-report/actions.d.ts +0 -8
- package/dist/document-models/expense-report/gen/expense-report/actions.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/actions.js +0 -1
- package/dist/document-models/expense-report/gen/expense-report/creators.d.ts +0 -4
- package/dist/document-models/expense-report/gen/expense-report/creators.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/creators.js +0 -3
- package/dist/document-models/expense-report/gen/expense-report/error.d.ts +0 -2
- package/dist/document-models/expense-report/gen/expense-report/error.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/error.js +0 -1
- package/dist/document-models/expense-report/gen/expense-report/operations.d.ts +0 -7
- package/dist/document-models/expense-report/gen/expense-report/operations.d.ts.map +0 -1
- package/dist/document-models/expense-report/gen/expense-report/operations.js +0 -3
- package/dist/document-models/expense-report/src/tests/expense-report.test.d.ts +0 -6
- package/dist/document-models/expense-report/src/tests/expense-report.test.d.ts.map +0 -1
- package/dist/document-models/expense-report/src/tests/expense-report.test.js +0 -24
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderControls.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/HeaderStats.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTable.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableRow.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/InvoiceTableSection.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.d.ts.map +0 -1
- package/dist/editors/contributor-billing/components/InvoiceTable/RowActionMenu.js +0 -2
- package/dist/editors/contributor-billing/util.d.ts.map +0 -1
- package/dist/editors/hooks/useBillingStatementDocument.d.ts +0 -4
- package/dist/editors/hooks/useBillingStatementDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useBillingStatementDocument.js +0 -8
- package/dist/editors/hooks/useExpenseReportDocument.d.ts +0 -4
- package/dist/editors/hooks/useExpenseReportDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useExpenseReportDocument.js +0 -8
- package/dist/editors/hooks/useIntegrationsDocument.d.ts +0 -4
- package/dist/editors/hooks/useIntegrationsDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useIntegrationsDocument.js +0 -8
- package/dist/editors/hooks/useInvoiceDocument.d.ts +0 -4
- package/dist/editors/hooks/useInvoiceDocument.d.ts.map +0 -1
- package/dist/editors/hooks/useInvoiceDocument.js +0 -8
- package/dist/editors/integrations/config.d.ts +0 -3
- package/dist/editors/integrations/config.d.ts.map +0 -1
- package/dist/editors/integrations/config.js +0 -3
- package/dist/editors/invoice/exportSAFTPT.d.ts +0 -184
- package/dist/editors/invoice/exportSAFTPT.d.ts.map +0 -1
- package/dist/editors/invoice/exportSAFTPT.js +0 -548
- package/dist/processors/line-item-processor/index.d.ts +0 -11
- package/dist/processors/line-item-processor/index.d.ts.map +0 -1
- package/dist/processors/line-item-processor/index.js +0 -36
- package/dist/subgraphs/invoice/customResolvers.d.ts.map +0 -1
- package/editors/invoice/assets/custom.d.ts +0 -4
- package/editors/invoice/assets/powerhouseLogo.png +0 -0
- /package/dist/editors/contributor-billing/components/{InvoiceTable/HeaderStats.d.ts → HeaderStats.d.ts} +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/HeaderControls.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/HeaderControls.js +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTable.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTable.js +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableRow.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableRow.js +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/components/InvoiceTable/InvoiceTableSection.d.ts +0 -0
- /package/dist/{editors/contributor-billing → old-contributor-billing}/util.d.ts +0 -0
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
* This is a scaffold file meant for customization.
|
|
3
|
-
* Delete the file and run the code generator again to have it reset
|
|
4
|
-
*/
|
|
1
|
+
export { Invoice } from "./invoice/module.js";
|
|
5
2
|
export { BillingStatement } from "./billing-statement/module.js";
|
|
6
|
-
export { ExpenseReport } from "./expense-report/module.js";
|
|
7
3
|
export { Integrations } from "./integrations/module.js";
|
|
8
|
-
export {
|
|
4
|
+
export { ExpenseReport } from "./expense-report/module.js";
|
|
9
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../document-models/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../document-models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* This is a scaffold file meant for customization.
|
|
3
|
-
* Delete the file and run the code generator again to have it reset
|
|
4
|
-
*/
|
|
1
|
+
export { Invoice } from "./invoice/module.js";
|
|
5
2
|
export { BillingStatement } from "./billing-statement/module.js";
|
|
6
|
-
export { ExpenseReport } from "./expense-report/module.js";
|
|
7
3
|
export { Integrations } from "./integrations/module.js";
|
|
8
|
-
export {
|
|
4
|
+
export { ExpenseReport } from "./expense-report/module.js";
|
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
export const documentModel = {
|
|
2
|
-
id: "powerhouse/integrations",
|
|
3
|
-
name: "Integrations",
|
|
4
|
-
extension: ".phdm",
|
|
5
|
-
description: "A place where to store different API keys used by other powerhouse packages.",
|
|
6
2
|
author: {
|
|
7
3
|
name: "Liberuum",
|
|
8
4
|
website: "https://powerhouse.inc",
|
|
9
5
|
},
|
|
6
|
+
description: "A place where to store different API keys used by other powerhouse packages.",
|
|
7
|
+
extension: "",
|
|
8
|
+
id: "powerhouse/integrations",
|
|
9
|
+
name: "Integrations",
|
|
10
10
|
specifications: [
|
|
11
11
|
{
|
|
12
|
-
version: 1,
|
|
13
12
|
changeLog: [],
|
|
14
|
-
state: {
|
|
15
|
-
global: {
|
|
16
|
-
schema: "type IntegrationsState {\n requestFinance: RequestFinance\n gnosisSafe: GnosisSafe\n googleCloud: GoogleCloud\n}\n\ntype RequestFinance {\n apiKey: String\n email: String\n}\n\ntype GnosisSafe {\n safeAddress: EthereumAddress\n signerPrivateKey: String\n}\n\ntype GoogleCloud {\n projectId: String\n location: String\n processorId: String\n keyFile: GoogleKeyFile\n}\n\ntype GoogleKeyFile {\n type: String\n project_id: String\n private_key_id: String\n private_key: String\n client_email: String\n client_id: String\n auth_uri: String\n token_uri: String\n auth_provider_x509_cert_url: String\n client_x509_cert_url: String\n universe_domain: String\n}",
|
|
17
|
-
initialValue: '"{}"',
|
|
18
|
-
examples: [],
|
|
19
|
-
},
|
|
20
|
-
local: {
|
|
21
|
-
schema: "",
|
|
22
|
-
initialValue: '""',
|
|
23
|
-
examples: [],
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
13
|
modules: [
|
|
27
14
|
{
|
|
15
|
+
description: "",
|
|
28
16
|
id: "7fbd9402-1079-4909-adec-2679eba37a7e",
|
|
29
17
|
name: "integrations",
|
|
30
|
-
description: "",
|
|
31
18
|
operations: [
|
|
32
19
|
{
|
|
33
|
-
id: "1dc33e69-870b-40d8-bcef-450bf4cf07a4",
|
|
34
|
-
name: "SET_REQUEST_FINANCE",
|
|
35
20
|
description: "",
|
|
36
|
-
schema: "input SetRequestFinanceInput {\n apiKey: String\n email: String\n}",
|
|
37
|
-
template: "",
|
|
38
|
-
reducer: "",
|
|
39
21
|
errors: [],
|
|
40
22
|
examples: [],
|
|
23
|
+
id: "1dc33e69-870b-40d8-bcef-450bf4cf07a4",
|
|
24
|
+
name: "SET_REQUEST_FINANCE",
|
|
25
|
+
reducer: "",
|
|
26
|
+
schema: "input SetRequestFinanceInput {\n apiKey: String\n email: String\n}",
|
|
41
27
|
scope: "global",
|
|
28
|
+
template: "",
|
|
42
29
|
},
|
|
43
30
|
{
|
|
44
|
-
id: "872bbfbb-1f0d-4ee6-9516-ffab5b9fdba7",
|
|
45
|
-
name: "SET_GNOSIS_SAFE",
|
|
46
31
|
description: "",
|
|
47
|
-
schema: "input SetGnosisSafeInput {\n safeAddress: EthereumAddress\n signerPrivateKey: String\n}",
|
|
48
|
-
template: "",
|
|
49
|
-
reducer: "",
|
|
50
32
|
errors: [],
|
|
51
33
|
examples: [],
|
|
34
|
+
id: "872bbfbb-1f0d-4ee6-9516-ffab5b9fdba7",
|
|
35
|
+
name: "SET_GNOSIS_SAFE",
|
|
36
|
+
reducer: "",
|
|
37
|
+
schema: "input SetGnosisSafeInput {\n safeAddress: EthereumAddress\n signerPrivateKey: String\n}",
|
|
52
38
|
scope: "global",
|
|
39
|
+
template: "",
|
|
53
40
|
},
|
|
54
41
|
{
|
|
55
|
-
id: "9adc73ea-3d7f-4e80-afd0-fc25476c569f",
|
|
56
|
-
name: "SET_GOOGLE_CLOUD",
|
|
57
42
|
description: "",
|
|
58
|
-
schema: "input SetGoogleCloudInput {\n projectId: String\n location: String\n processorId: String\n keyFile: GoogleKeyFileInput\n}\n\ninput GoogleKeyFileInput {\n type: String\n project_id: String\n private_key_id: String\n private_key: String\n client_email: String\n client_id: String\n auth_uri: String\n token_uri: String\n auth_provider_x509_cert_url: String\n client_x509_cert_url: String\n universe_domain: String\n}",
|
|
59
|
-
template: "",
|
|
60
|
-
reducer: "",
|
|
61
43
|
errors: [],
|
|
62
44
|
examples: [],
|
|
45
|
+
id: "9adc73ea-3d7f-4e80-afd0-fc25476c569f",
|
|
46
|
+
name: "SET_GOOGLE_CLOUD",
|
|
47
|
+
reducer: "",
|
|
48
|
+
schema: "input SetGoogleCloudInput {\n projectId: String\n location: String\n processorId: String\n keyFile: GoogleKeyFileInput\n}\n\ninput GoogleKeyFileInput {\n type: String\n project_id: String\n private_key_id: String\n private_key: String\n client_email: String\n client_id: String\n auth_uri: String\n token_uri: String\n auth_provider_x509_cert_url: String\n client_x509_cert_url: String\n universe_domain: String\n}",
|
|
63
49
|
scope: "global",
|
|
50
|
+
template: "",
|
|
64
51
|
},
|
|
65
52
|
],
|
|
66
53
|
},
|
|
67
54
|
],
|
|
55
|
+
state: {
|
|
56
|
+
global: {
|
|
57
|
+
examples: [],
|
|
58
|
+
initialValue: '"{}"',
|
|
59
|
+
schema: "type IntegrationsState {\n requestFinance: RequestFinance\n gnosisSafe: GnosisSafe\n googleCloud: GoogleCloud\n}\n\ntype RequestFinance {\n apiKey: String\n email: String\n}\n\ntype GnosisSafe {\n safeAddress: EthereumAddress\n signerPrivateKey: String\n}\n\ntype GoogleCloud {\n projectId: String\n location: String\n processorId: String\n keyFile: GoogleKeyFile\n}\n\ntype GoogleKeyFile {\n type: String\n project_id: String\n private_key_id: String\n private_key: String\n client_email: String\n client_id: String\n auth_uri: String\n token_uri: String\n auth_provider_x509_cert_url: String\n client_x509_cert_url: String\n universe_domain: String\n}",
|
|
60
|
+
},
|
|
61
|
+
local: {
|
|
62
|
+
examples: [],
|
|
63
|
+
initialValue: '""',
|
|
64
|
+
schema: "",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
version: 1,
|
|
68
68
|
},
|
|
69
69
|
],
|
|
70
70
|
};
|
|
@@ -10,14 +10,14 @@ export declare const IntegrationsDocumentHeaderSchema: z.ZodObject<{
|
|
|
10
10
|
documentType: z.ZodLiteral<"powerhouse/integrations">;
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
12
|
id: string;
|
|
13
|
-
documentType: "powerhouse/integrations";
|
|
14
13
|
name: string;
|
|
14
|
+
documentType: "powerhouse/integrations";
|
|
15
15
|
createdAtUtcIso: string;
|
|
16
16
|
lastModifiedAtUtcIso: string;
|
|
17
17
|
}, {
|
|
18
18
|
id: string;
|
|
19
|
-
documentType: "powerhouse/integrations";
|
|
20
19
|
name: string;
|
|
20
|
+
documentType: "powerhouse/integrations";
|
|
21
21
|
createdAtUtcIso: string;
|
|
22
22
|
lastModifiedAtUtcIso: string;
|
|
23
23
|
}>;
|
|
@@ -59,14 +59,14 @@ export declare const IntegrationsDocumentSchema: z.ZodObject<{
|
|
|
59
59
|
documentType: z.ZodLiteral<"powerhouse/integrations">;
|
|
60
60
|
}, "strip", z.ZodTypeAny, {
|
|
61
61
|
id: string;
|
|
62
|
-
documentType: "powerhouse/integrations";
|
|
63
62
|
name: string;
|
|
63
|
+
documentType: "powerhouse/integrations";
|
|
64
64
|
createdAtUtcIso: string;
|
|
65
65
|
lastModifiedAtUtcIso: string;
|
|
66
66
|
}, {
|
|
67
67
|
id: string;
|
|
68
|
-
documentType: "powerhouse/integrations";
|
|
69
68
|
name: string;
|
|
69
|
+
documentType: "powerhouse/integrations";
|
|
70
70
|
createdAtUtcIso: string;
|
|
71
71
|
lastModifiedAtUtcIso: string;
|
|
72
72
|
}>;
|
|
@@ -127,8 +127,8 @@ export declare const IntegrationsDocumentSchema: z.ZodObject<{
|
|
|
127
127
|
}, "strip", z.ZodTypeAny, {
|
|
128
128
|
header: {
|
|
129
129
|
id: string;
|
|
130
|
-
documentType: "powerhouse/integrations";
|
|
131
130
|
name: string;
|
|
131
|
+
documentType: "powerhouse/integrations";
|
|
132
132
|
createdAtUtcIso: string;
|
|
133
133
|
lastModifiedAtUtcIso: string;
|
|
134
134
|
};
|
|
@@ -149,8 +149,8 @@ export declare const IntegrationsDocumentSchema: z.ZodObject<{
|
|
|
149
149
|
}, {
|
|
150
150
|
header: {
|
|
151
151
|
id: string;
|
|
152
|
-
documentType: "powerhouse/integrations";
|
|
153
152
|
name: string;
|
|
153
|
+
documentType: "powerhouse/integrations";
|
|
154
154
|
createdAtUtcIso: string;
|
|
155
155
|
lastModifiedAtUtcIso: string;
|
|
156
156
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../../../document-models/integrations/src/reducers/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,iEAAiE,CAAC;AAE1H,eAAO,MAAM,kCAAkC,EAAE,
|
|
1
|
+
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../../../document-models/integrations/src/reducers/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,iEAAiE,CAAC;AAE1H,eAAO,MAAM,kCAAkC,EAAE,kCAgB9C,CAAC"}
|
|
@@ -1,37 +1,14 @@
|
|
|
1
1
|
export const integrationsIntegrationsOperations = {
|
|
2
|
-
setRequestFinanceOperation(state, action
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
email: action.input.email || '',
|
|
6
|
-
};
|
|
7
|
-
state.requestFinance = requestFinance;
|
|
2
|
+
setRequestFinanceOperation(state, action) {
|
|
3
|
+
// TODO: Implement "setRequestFinanceOperation" reducer
|
|
4
|
+
throw new Error('Reducer "setRequestFinanceOperation" not yet implemented');
|
|
8
5
|
},
|
|
9
|
-
setGnosisSafeOperation(state, action
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
signerPrivateKey: action.input.signerPrivateKey || '',
|
|
13
|
-
};
|
|
14
|
-
state.gnosisSafe = gnosisSafe;
|
|
6
|
+
setGnosisSafeOperation(state, action) {
|
|
7
|
+
// TODO: Implement "setGnosisSafeOperation" reducer
|
|
8
|
+
throw new Error('Reducer "setGnosisSafeOperation" not yet implemented');
|
|
15
9
|
},
|
|
16
|
-
setGoogleCloudOperation(state, action
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
location: action.input.location || '',
|
|
20
|
-
processorId: action.input.processorId || '',
|
|
21
|
-
keyFile: {
|
|
22
|
-
type: action.input.keyFile?.type || '',
|
|
23
|
-
project_id: action.input.keyFile?.project_id || '',
|
|
24
|
-
private_key_id: action.input.keyFile?.private_key_id || '',
|
|
25
|
-
private_key: action.input.keyFile?.private_key || '',
|
|
26
|
-
client_email: action.input.keyFile?.client_email || '',
|
|
27
|
-
client_id: action.input.keyFile?.client_id || '',
|
|
28
|
-
auth_uri: action.input.keyFile?.auth_uri || '',
|
|
29
|
-
token_uri: action.input.keyFile?.token_uri || '',
|
|
30
|
-
auth_provider_x509_cert_url: action.input.keyFile?.auth_provider_x509_cert_url || '',
|
|
31
|
-
client_x509_cert_url: action.input.keyFile?.client_x509_cert_url || '',
|
|
32
|
-
universe_domain: action.input.keyFile?.universe_domain || '',
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
state.googleCloud = googleCloud;
|
|
10
|
+
setGoogleCloudOperation(state, action) {
|
|
11
|
+
// TODO: Implement "setGoogleCloudOperation" reducer
|
|
12
|
+
throw new Error('Reducer "setGoogleCloudOperation" not yet implemented');
|
|
36
13
|
},
|
|
37
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-model.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/integrations/src/tests/document-model.test.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
1
|
+
{"version":3,"file":"document-model.test.d.ts","sourceRoot":"","sources":["../../../../../document-models/integrations/src/tests/document-model.test.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;;;GAGG"}
|
|
@@ -2,17 +2,103 @@
|
|
|
2
2
|
* This is a scaffold file meant for customization:
|
|
3
3
|
* - change it by adding new tests or modifying the existing ones
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* This is a scaffold file meant for customization:
|
|
7
|
+
* - change it by adding new tests or modifying the existing ones
|
|
8
|
+
*/
|
|
9
|
+
import { describe, it, expect } from "vitest";
|
|
10
|
+
import { utils, initialGlobalState, initialLocalState, integrationsDocumentType, isIntegrationsDocument, assertIsIntegrationsDocument, isIntegrationsState, assertIsIntegrationsState, } from "@powerhousedao/contributor-billing/document-models/integrations";
|
|
11
|
+
import { ZodError } from "zod";
|
|
7
12
|
describe("Integrations Document Model", () => {
|
|
8
13
|
it("should create a new Integrations document", () => {
|
|
9
|
-
const document = createDocument();
|
|
14
|
+
const document = utils.createDocument();
|
|
10
15
|
expect(document).toBeDefined();
|
|
11
|
-
expect(document.header.documentType).toBe(
|
|
16
|
+
expect(document.header.documentType).toBe(integrationsDocumentType);
|
|
12
17
|
});
|
|
13
18
|
it("should create a new Integrations document with a valid initial state", () => {
|
|
14
|
-
const document = createDocument();
|
|
19
|
+
const document = utils.createDocument();
|
|
15
20
|
expect(document.state.global).toStrictEqual(initialGlobalState);
|
|
16
21
|
expect(document.state.local).toStrictEqual(initialLocalState);
|
|
22
|
+
expect(isIntegrationsDocument(document)).toBe(true);
|
|
23
|
+
expect(isIntegrationsState(document.state)).toBe(true);
|
|
24
|
+
});
|
|
25
|
+
it("should reject a document that is not a Integrations document", () => {
|
|
26
|
+
const wrongDocumentType = utils.createDocument();
|
|
27
|
+
wrongDocumentType.header.documentType = "the-wrong-thing-1234";
|
|
28
|
+
try {
|
|
29
|
+
expect(assertIsIntegrationsDocument(wrongDocumentType)).toThrow();
|
|
30
|
+
expect(isIntegrationsDocument(wrongDocumentType)).toBe(false);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
expect(error).toBeInstanceOf(ZodError);
|
|
34
|
+
}
|
|
17
35
|
});
|
|
36
|
+
const wrongState = utils.createDocument();
|
|
37
|
+
// @ts-expect-error - we are testing the error case
|
|
38
|
+
wrongState.state.global = {
|
|
39
|
+
...{ notWhat: "you want" },
|
|
40
|
+
};
|
|
41
|
+
try {
|
|
42
|
+
expect(isIntegrationsState(wrongState.state)).toBe(false);
|
|
43
|
+
expect(assertIsIntegrationsState(wrongState.state)).toThrow();
|
|
44
|
+
expect(isIntegrationsDocument(wrongState)).toBe(false);
|
|
45
|
+
expect(assertIsIntegrationsDocument(wrongState)).toThrow();
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
expect(error).toBeInstanceOf(ZodError);
|
|
49
|
+
}
|
|
50
|
+
const wrongInitialState = utils.createDocument();
|
|
51
|
+
// @ts-expect-error - we are testing the error case
|
|
52
|
+
wrongInitialState.initialState.global = {
|
|
53
|
+
...{ notWhat: "you want" },
|
|
54
|
+
};
|
|
55
|
+
try {
|
|
56
|
+
expect(isIntegrationsState(wrongInitialState.state)).toBe(false);
|
|
57
|
+
expect(assertIsIntegrationsState(wrongInitialState.state)).toThrow();
|
|
58
|
+
expect(isIntegrationsDocument(wrongInitialState)).toBe(false);
|
|
59
|
+
expect(assertIsIntegrationsDocument(wrongInitialState)).toThrow();
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
expect(error).toBeInstanceOf(ZodError);
|
|
63
|
+
}
|
|
64
|
+
const missingIdInHeader = utils.createDocument();
|
|
65
|
+
// @ts-expect-error - we are testing the error case
|
|
66
|
+
delete missingIdInHeader.header.id;
|
|
67
|
+
try {
|
|
68
|
+
expect(isIntegrationsDocument(missingIdInHeader)).toBe(false);
|
|
69
|
+
expect(assertIsIntegrationsDocument(missingIdInHeader)).toThrow();
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
expect(error).toBeInstanceOf(ZodError);
|
|
73
|
+
}
|
|
74
|
+
const missingNameInHeader = utils.createDocument();
|
|
75
|
+
// @ts-expect-error - we are testing the error case
|
|
76
|
+
delete missingNameInHeader.header.name;
|
|
77
|
+
try {
|
|
78
|
+
expect(isIntegrationsDocument(missingNameInHeader)).toBe(false);
|
|
79
|
+
expect(assertIsIntegrationsDocument(missingNameInHeader)).toThrow();
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
expect(error).toBeInstanceOf(ZodError);
|
|
83
|
+
}
|
|
84
|
+
const missingCreatedAtUtcIsoInHeader = utils.createDocument();
|
|
85
|
+
// @ts-expect-error - we are testing the error case
|
|
86
|
+
delete missingCreatedAtUtcIsoInHeader.header.createdAtUtcIso;
|
|
87
|
+
try {
|
|
88
|
+
expect(isIntegrationsDocument(missingCreatedAtUtcIsoInHeader)).toBe(false);
|
|
89
|
+
expect(assertIsIntegrationsDocument(missingCreatedAtUtcIsoInHeader)).toThrow();
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
expect(error).toBeInstanceOf(ZodError);
|
|
93
|
+
}
|
|
94
|
+
const missingLastModifiedAtUtcIsoInHeader = utils.createDocument();
|
|
95
|
+
// @ts-expect-error - we are testing the error case
|
|
96
|
+
delete missingLastModifiedAtUtcIsoInHeader.header.lastModifiedAtUtcIso;
|
|
97
|
+
try {
|
|
98
|
+
expect(isIntegrationsDocument(missingLastModifiedAtUtcIsoInHeader)).toBe(false);
|
|
99
|
+
expect(assertIsIntegrationsDocument(missingLastModifiedAtUtcIsoInHeader)).toThrow();
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
expect(error).toBeInstanceOf(ZodError);
|
|
103
|
+
}
|
|
18
104
|
});
|
|
@@ -2,63 +2,38 @@
|
|
|
2
2
|
* This is a scaffold file meant for customization:
|
|
3
3
|
* - change it by adding new tests or modifying the existing ones
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
6
|
-
import {} from "
|
|
7
|
-
import { reducer } from "
|
|
8
|
-
import * as creators from "../../gen/integrations/creators.js";
|
|
5
|
+
import { describe, it, expect } from "vitest";
|
|
6
|
+
import { generateMock } from "@powerhousedao/codegen";
|
|
7
|
+
import { reducer, utils, isIntegrationsDocument, setRequestFinance, SetRequestFinanceInputSchema, setGnosisSafe, SetGnosisSafeInputSchema, setGoogleCloud, SetGoogleCloudInputSchema, } from "@powerhousedao/contributor-billing/document-models/integrations";
|
|
9
8
|
describe("Integrations Operations", () => {
|
|
10
|
-
let document;
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
document = utils.createDocument();
|
|
13
|
-
});
|
|
14
9
|
it("should handle setRequestFinance operation", () => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const updatedDocument = reducer(document, creators.setRequestFinance(input));
|
|
10
|
+
const document = utils.createDocument();
|
|
11
|
+
const input = generateMock(SetRequestFinanceInputSchema());
|
|
12
|
+
const updatedDocument = reducer(document, setRequestFinance(input));
|
|
13
|
+
expect(isIntegrationsDocument(updatedDocument)).toBe(true);
|
|
20
14
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
21
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_REQUEST_FINANCE");
|
|
22
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
15
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_REQUEST_FINANCE");
|
|
16
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
23
17
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
24
|
-
expect(updatedDocument.state.global.requestFinance).toStrictEqual(input);
|
|
25
18
|
});
|
|
26
19
|
it("should handle setGnosisSafe operation", () => {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const updatedDocument = reducer(document, creators.setGnosisSafe(input));
|
|
20
|
+
const document = utils.createDocument();
|
|
21
|
+
const input = generateMock(SetGnosisSafeInputSchema());
|
|
22
|
+
const updatedDocument = reducer(document, setGnosisSafe(input));
|
|
23
|
+
expect(isIntegrationsDocument(updatedDocument)).toBe(true);
|
|
32
24
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
33
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_GNOSIS_SAFE");
|
|
34
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
25
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_GNOSIS_SAFE");
|
|
26
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
35
27
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
36
|
-
expect(updatedDocument.state.global.gnosisSafe).toStrictEqual(input);
|
|
37
28
|
});
|
|
38
29
|
it("should handle setGoogleCloud operation", () => {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
keyFile: {
|
|
44
|
-
type: "service_account",
|
|
45
|
-
project_id: "test-project-123",
|
|
46
|
-
private_key_id: "abcdef1234567890",
|
|
47
|
-
private_key: "-----BEGIN PRIVATE KEY-----\nMIIEv...\n-----END PRIVATE KEY-----\n",
|
|
48
|
-
client_email: "gcloud-user@example.com",
|
|
49
|
-
client_id: "123456789012345678901",
|
|
50
|
-
auth_uri: "https://accounts.google.com/o/oauth2/auth",
|
|
51
|
-
token_uri: "https://oauth2.googleapis.com/token",
|
|
52
|
-
auth_provider_x509_cert_url: "https://www.googleapis.com/oauth2/v1/certs",
|
|
53
|
-
client_x509_cert_url: "https://www.googleapis.com/robot/v1/metadata/x509/gcloud-user%40example.com",
|
|
54
|
-
universe_domain: "googleapis.com",
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
const updatedDocument = reducer(document, creators.setGoogleCloud(input));
|
|
30
|
+
const document = utils.createDocument();
|
|
31
|
+
const input = generateMock(SetGoogleCloudInputSchema());
|
|
32
|
+
const updatedDocument = reducer(document, setGoogleCloud(input));
|
|
33
|
+
expect(isIntegrationsDocument(updatedDocument)).toBe(true);
|
|
58
34
|
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
59
|
-
expect(updatedDocument.operations.global[0].type).toBe("SET_GOOGLE_CLOUD");
|
|
60
|
-
expect(updatedDocument.operations.global[0].input).toStrictEqual(input);
|
|
35
|
+
expect(updatedDocument.operations.global[0].action.type).toBe("SET_GOOGLE_CLOUD");
|
|
36
|
+
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(input);
|
|
61
37
|
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
62
|
-
expect(updatedDocument.state.global.googleCloud).toStrictEqual(input);
|
|
63
38
|
});
|
|
64
39
|
});
|