@actual-app/core 26.3.0
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/.swcrc +11 -0
- package/bin/build-browser +40 -0
- package/bin/copy-migrations +9 -0
- package/db.sqlite +0 -0
- package/default-db.sqlite +0 -0
- package/migrations/.force-copy-windows +0 -0
- package/migrations/1548957970627_remove-db-version.sql +5 -0
- package/migrations/1550601598648_payees.sql +23 -0
- package/migrations/1555786194328_remove_category_group_unique.sql +25 -0
- package/migrations/1561751833510_indexes.sql +7 -0
- package/migrations/1567699552727_budget.sql +38 -0
- package/migrations/1582384163573_cleared.sql +6 -0
- package/migrations/1597756566448_rules.sql +10 -0
- package/migrations/1608652596043_parent_field.sql +13 -0
- package/migrations/1608652596044_trans_views.sql +56 -0
- package/migrations/1612625548236_optimize.sql +7 -0
- package/migrations/1614782639336_trans_views2.sql +33 -0
- package/migrations/1615745967948_meta.sql +10 -0
- package/migrations/1616167010796_accounts_order.sql +5 -0
- package/migrations/1618975177358_schedules.sql +28 -0
- package/migrations/1632571489012_remove_cache.js +136 -0
- package/migrations/1679728867040_rules_conditions.sql +5 -0
- package/migrations/1681115033845_add_schedule_name.sql +5 -0
- package/migrations/1682974838138_remove_payee_rules.sql +5 -0
- package/migrations/1685007876842_add_category_hidden.sql +6 -0
- package/migrations/1686139660866_remove_account_type.sql +5 -0
- package/migrations/1688749527273_transaction_filters.sql +10 -0
- package/migrations/1688841238000_add_account_type.sql +5 -0
- package/migrations/1691233396000_add_schedule_next_date_tombstone.sql +5 -0
- package/migrations/1694438752000_add_goal_targets.sql +7 -0
- package/migrations/1697046240000_add_reconciled.sql +5 -0
- package/migrations/1704572023730_add_account_sync_source.sql +5 -0
- package/migrations/1704572023731_add_missing_goCardless_sync_source.sql +9 -0
- package/migrations/1707267033000_reports.sql +28 -0
- package/migrations/1712784523000_unhide_input_group.sql +8 -0
- package/migrations/1716359441000_include_current.sql +5 -0
- package/migrations/1720310586000_link_transfer_schedules.sql +19 -0
- package/migrations/1720664867241_add_payee_favorite.sql +5 -0
- package/migrations/1720665000000_goal_context.sql +6 -0
- package/migrations/1722717601000_reports_move_selected_categories.js +55 -0
- package/migrations/1722804019000_create_dashboard_table.js +69 -0
- package/migrations/1723665565000_prefs.js +59 -0
- package/migrations/1730744182000_fix_dashboard_table.sql +7 -0
- package/migrations/1736640000000_custom_report_sorting.sql +7 -0
- package/migrations/1737158400000_add_learn_categories_to_payees.sql +5 -0
- package/migrations/1738491452000_sorting_rename.sql +13 -0
- package/migrations/1739139550000_bank_sync_page.sql +7 -0
- package/migrations/1740506588539_add_last_reconciled_at.sql +5 -0
- package/migrations/1745425408000_update_budgetType_pref.sql +7 -0
- package/migrations/1749799110000_add_tags.sql +10 -0
- package/migrations/1749799110001_tags_tombstone.sql +5 -0
- package/migrations/1754611200000_add_category_template_settings.sql +5 -0
- package/migrations/1759260219000_add_trim_interval_report_setting.sql +6 -0
- package/migrations/1759842823172_add_isGlobal_to_preferences.sql +1 -0
- package/migrations/1762178745667_rename_csv_skip_lines_pref.sql +8 -0
- package/migrations/1765518577215_multiple_dashboards.js +30 -0
- package/migrations/1768872504000_add_payee_locations.sql +21 -0
- package/package.json +128 -0
- package/src/mocks/arbitrary-schema.ts +162 -0
- package/src/mocks/budget.ts +901 -0
- package/src/mocks/files/8859-1.qfx +63 -0
- package/src/mocks/files/best.data-ever$.QFX +124 -0
- package/src/mocks/files/big.data.QiF +91 -0
- package/src/mocks/files/budgets/.commit-to-git +0 -0
- package/src/mocks/files/camt/camt.053.payee-memo.xml +127 -0
- package/src/mocks/files/camt/camt.053.xml +463 -0
- package/src/mocks/files/credit-card.ofx +11 -0
- package/src/mocks/files/data-multi-decimal.ofx +64 -0
- package/src/mocks/files/data-payee-memo.ofx +75 -0
- package/src/mocks/files/data-payee-memo.qif +17 -0
- package/src/mocks/files/data.ofx +124 -0
- package/src/mocks/files/data.qfx +124 -0
- package/src/mocks/files/data.qif +91 -0
- package/src/mocks/files/default-budget-template/db.sqlite +0 -0
- package/src/mocks/files/default-budget-template/metadata.json +6 -0
- package/src/mocks/files/html-vals.qfx +17 -0
- package/src/mocks/index.ts +221 -0
- package/src/mocks/migrations/1508717984291_up_add-poop.sql +13 -0
- package/src/mocks/migrations/1508718036311_up_modify-poop.sql +2 -0
- package/src/mocks/migrations/1508727787513_remove-is_income.sql +15 -0
- package/src/mocks/random.ts +16 -0
- package/src/mocks/setup.ts +180 -0
- package/src/mocks/spreadsheet.ts +101 -0
- package/src/mocks/util.ts +82 -0
- package/src/platform/client/connection/README.md +3 -0
- package/src/platform/client/connection/__mocks__/index.ts +67 -0
- package/src/platform/client/connection/index-types.ts +95 -0
- package/src/platform/client/connection/index.browser.ts +213 -0
- package/src/platform/client/connection/index.ts +155 -0
- package/src/platform/client/undo/index.ts +59 -0
- package/src/platform/exceptions/__mocks__/index.ts +7 -0
- package/src/platform/exceptions/index.ts +9 -0
- package/src/platform/server/asyncStorage/__mocks__/index.ts +50 -0
- package/src/platform/server/asyncStorage/index-types.ts +35 -0
- package/src/platform/server/asyncStorage/index.api.ts +2 -0
- package/src/platform/server/asyncStorage/index.electron.ts +88 -0
- package/src/platform/server/asyncStorage/index.ts +126 -0
- package/src/platform/server/connection/README.md +3 -0
- package/src/platform/server/connection/__mocks__/index.ts +15 -0
- package/src/platform/server/connection/index-types.ts +20 -0
- package/src/platform/server/connection/index.api.ts +13 -0
- package/src/platform/server/connection/index.electron.ts +102 -0
- package/src/platform/server/connection/index.ts +154 -0
- package/src/platform/server/fetch/__mocks__/index.ts +3 -0
- package/src/platform/server/fetch/index.api.ts +1 -0
- package/src/platform/server/fetch/index.electron.ts +18 -0
- package/src/platform/server/fetch/index.ts +20 -0
- package/src/platform/server/fs/index.api.ts +198 -0
- package/src/platform/server/fs/index.electron.ts +208 -0
- package/src/platform/server/fs/index.test.ts +117 -0
- package/src/platform/server/fs/index.ts +416 -0
- package/src/platform/server/fs/path-join.api.ts +1 -0
- package/src/platform/server/fs/path-join.electron.ts +1 -0
- package/src/platform/server/fs/path-join.ts +97 -0
- package/src/platform/server/fs/shared.ts +33 -0
- package/src/platform/server/indexeddb/index.ts +115 -0
- package/src/platform/server/log/index.ts +43 -0
- package/src/platform/server/sqlite/index.api.ts +2 -0
- package/src/platform/server/sqlite/index.electron.ts +134 -0
- package/src/platform/server/sqlite/index.test.ts +108 -0
- package/src/platform/server/sqlite/index.ts +241 -0
- package/src/platform/server/sqlite/normalise.ts +9 -0
- package/src/platform/server/sqlite/unicodeLike.test.ts +58 -0
- package/src/platform/server/sqlite/unicodeLike.ts +31 -0
- package/src/server/__mocks__/post.ts +9 -0
- package/src/server/__snapshots__/main.test.ts.snap +199 -0
- package/src/server/__snapshots__/sheet.test.ts.snap +9 -0
- package/src/server/accounts/__snapshots__/sync.test.ts.snap +136 -0
- package/src/server/accounts/app-bank-sync.test.ts +136 -0
- package/src/server/accounts/app.ts +1294 -0
- package/src/server/accounts/link.ts +25 -0
- package/src/server/accounts/payees.ts +36 -0
- package/src/server/accounts/sync.test.ts +679 -0
- package/src/server/accounts/sync.ts +1168 -0
- package/src/server/accounts/title/index.ts +60 -0
- package/src/server/accounts/title/lower-case.ts +93 -0
- package/src/server/accounts/title/specials.ts +21 -0
- package/src/server/admin/app.ts +241 -0
- package/src/server/api-models.ts +244 -0
- package/src/server/api.test.ts +36 -0
- package/src/server/api.ts +1030 -0
- package/src/server/app.ts +91 -0
- package/src/server/aql/compiler.test.ts +966 -0
- package/src/server/aql/compiler.ts +1222 -0
- package/src/server/aql/exec.test.ts +289 -0
- package/src/server/aql/exec.ts +128 -0
- package/src/server/aql/index.ts +41 -0
- package/src/server/aql/schema/executors.test.ts +420 -0
- package/src/server/aql/schema/executors.ts +345 -0
- package/src/server/aql/schema/index.test.ts +67 -0
- package/src/server/aql/schema/index.ts +409 -0
- package/src/server/aql/schema-helpers.test.ts +242 -0
- package/src/server/aql/schema-helpers.ts +208 -0
- package/src/server/aql/views.test.ts +62 -0
- package/src/server/aql/views.ts +57 -0
- package/src/server/auth/app.ts +387 -0
- package/src/server/bench.ts +29 -0
- package/src/server/budget/actions.ts +686 -0
- package/src/server/budget/app.ts +469 -0
- package/src/server/budget/base.test.ts +340 -0
- package/src/server/budget/base.ts +339 -0
- package/src/server/budget/category-template-context.test.ts +1658 -0
- package/src/server/budget/category-template-context.ts +862 -0
- package/src/server/budget/cleanup-template.pegjs +27 -0
- package/src/server/budget/cleanup-template.ts +408 -0
- package/src/server/budget/envelope.ts +403 -0
- package/src/server/budget/goal-template.pegjs +110 -0
- package/src/server/budget/goal-template.ts +309 -0
- package/src/server/budget/report.ts +308 -0
- package/src/server/budget/schedule-template.test.ts +184 -0
- package/src/server/budget/schedule-template.ts +351 -0
- package/src/server/budget/statements.ts +60 -0
- package/src/server/budget/template-notes.test.ts +393 -0
- package/src/server/budget/template-notes.ts +323 -0
- package/src/server/budget/util.ts +25 -0
- package/src/server/budgetfiles/__snapshots__/backups.test.ts.snap +101 -0
- package/src/server/budgetfiles/app.ts +672 -0
- package/src/server/budgetfiles/backups.test.ts +79 -0
- package/src/server/budgetfiles/backups.ts +251 -0
- package/src/server/cloud-storage.ts +467 -0
- package/src/server/dashboard/app.ts +373 -0
- package/src/server/db/__snapshots__/index.test.ts.snap +271 -0
- package/src/server/db/index.test.ts +300 -0
- package/src/server/db/index.ts +855 -0
- package/src/server/db/mappings.ts +59 -0
- package/src/server/db/sort.ts +58 -0
- package/src/server/db/types/index.ts +342 -0
- package/src/server/db/util.ts +36 -0
- package/src/server/encryption/app.ts +133 -0
- package/src/server/encryption/encryption-internals.api.ts +2 -0
- package/src/server/encryption/encryption-internals.electron.ts +89 -0
- package/src/server/encryption/encryption-internals.ts +109 -0
- package/src/server/encryption/encryption.test.ts +19 -0
- package/src/server/encryption/index.test.ts +19 -0
- package/src/server/encryption/index.ts +89 -0
- package/src/server/errors.ts +110 -0
- package/src/server/filters/app.ts +191 -0
- package/src/server/importers/actual.ts +49 -0
- package/src/server/importers/index.ts +58 -0
- package/src/server/importers/ynab4-types.ts +163 -0
- package/src/server/importers/ynab4.ts +470 -0
- package/src/server/importers/ynab5-types.ts +290 -0
- package/src/server/importers/ynab5.ts +1193 -0
- package/src/server/main-app.ts +25 -0
- package/src/server/main.test.ts +392 -0
- package/src/server/main.ts +336 -0
- package/src/server/migrate/__snapshots__/migrations.test.ts.snap +17 -0
- package/src/server/migrate/cli.ts +100 -0
- package/src/server/migrate/migrations.test.ts +81 -0
- package/src/server/migrate/migrations.ts +192 -0
- package/src/server/models.ts +184 -0
- package/src/server/mutators.ts +139 -0
- package/src/server/notes/app.ts +18 -0
- package/src/server/payees/app.ts +351 -0
- package/src/server/polyfills.ts +26 -0
- package/src/server/post.ts +219 -0
- package/src/server/preferences/app.ts +249 -0
- package/src/server/prefs.ts +91 -0
- package/src/server/reports/app.ts +187 -0
- package/src/server/rules/action.ts +344 -0
- package/src/server/rules/app.ts +193 -0
- package/src/server/rules/condition.ts +436 -0
- package/src/server/rules/customFunctions.ts +61 -0
- package/src/server/rules/formula-action.test.ts +175 -0
- package/src/server/rules/handlebars-helpers.ts +131 -0
- package/src/server/rules/index.test.ts +1095 -0
- package/src/server/rules/index.ts +22 -0
- package/src/server/rules/rule-indexer.ts +89 -0
- package/src/server/rules/rule-utils.ts +274 -0
- package/src/server/rules/rule.ts +193 -0
- package/src/server/schedules/app.test.ts +502 -0
- package/src/server/schedules/app.ts +644 -0
- package/src/server/schedules/find-schedules.ts +391 -0
- package/src/server/server-config.ts +59 -0
- package/src/server/sheet.test.ts +101 -0
- package/src/server/sheet.ts +280 -0
- package/src/server/spreadsheet/__snapshots__/spreadsheet.test.ts.snap +5 -0
- package/src/server/spreadsheet/app.ts +54 -0
- package/src/server/spreadsheet/globals.ts +13 -0
- package/src/server/spreadsheet/graph-data-structure.ts +165 -0
- package/src/server/spreadsheet/scratch +60 -0
- package/src/server/spreadsheet/spreadsheet.test.ts +191 -0
- package/src/server/spreadsheet/spreadsheet.ts +523 -0
- package/src/server/spreadsheet/util.ts +15 -0
- package/src/server/sql/init.sql +88 -0
- package/src/server/sync/__snapshots__/sync.test.ts.snap +31 -0
- package/src/server/sync/app.ts +29 -0
- package/src/server/sync/encoder.ts +129 -0
- package/src/server/sync/index.ts +820 -0
- package/src/server/sync/make-test-message.ts +19 -0
- package/src/server/sync/migrate.test.ts +169 -0
- package/src/server/sync/migrate.ts +48 -0
- package/src/server/sync/repair.ts +39 -0
- package/src/server/sync/reset.ts +91 -0
- package/src/server/sync/sync.property.test.ts +385 -0
- package/src/server/sync/sync.test.ts +349 -0
- package/src/server/sync/utils.ts +3 -0
- package/src/server/tags/app.ts +101 -0
- package/src/server/tests/mockData.json +9352 -0
- package/src/server/tests/mockSyncServer.ts +119 -0
- package/src/server/tools/app.ts +152 -0
- package/src/server/transactions/__snapshots__/transaction-rules.test.ts.snap +173 -0
- package/src/server/transactions/__snapshots__/transfer.test.ts.snap +655 -0
- package/src/server/transactions/app.ts +136 -0
- package/src/server/transactions/export/export-to-csv.ts +132 -0
- package/src/server/transactions/import/__snapshots__/parse-file.test.ts.snap +1582 -0
- package/src/server/transactions/import/ofx2json.test.ts +33 -0
- package/src/server/transactions/import/ofx2json.ts +157 -0
- package/src/server/transactions/import/parse-file.test.ts +224 -0
- package/src/server/transactions/import/parse-file.ts +286 -0
- package/src/server/transactions/import/qif2json.ts +110 -0
- package/src/server/transactions/import/xmlcamt2json.ts +168 -0
- package/src/server/transactions/index.ts +196 -0
- package/src/server/transactions/merge.test.ts +370 -0
- package/src/server/transactions/merge.ts +139 -0
- package/src/server/transactions/transaction-rules.test.ts +994 -0
- package/src/server/transactions/transaction-rules.ts +1038 -0
- package/src/server/transactions/transfer.test.ts +221 -0
- package/src/server/transactions/transfer.ts +173 -0
- package/src/server/undo.ts +271 -0
- package/src/server/update.ts +37 -0
- package/src/server/util/budget-name.ts +61 -0
- package/src/server/util/custom-sync-mapping.ts +48 -0
- package/src/server/util/rschedule.ts +9 -0
- package/src/shared/__mocks__/platform.ts +7 -0
- package/src/shared/__snapshots__/months.test.ts.snap +21 -0
- package/src/shared/arithmetic.test.ts +112 -0
- package/src/shared/arithmetic.ts +170 -0
- package/src/shared/async.test.ts +135 -0
- package/src/shared/async.ts +76 -0
- package/src/shared/constants.ts +5 -0
- package/src/shared/currencies.ts +70 -0
- package/src/shared/dashboard.ts +260 -0
- package/src/shared/environment.ts +18 -0
- package/src/shared/errors.ts +195 -0
- package/src/shared/locale.ts +27 -0
- package/src/shared/location-utils.test.ts +69 -0
- package/src/shared/location-utils.ts +49 -0
- package/src/shared/months.test.ts +5 -0
- package/src/shared/months.ts +485 -0
- package/src/shared/normalisation.ts +6 -0
- package/src/shared/platform.electron.ts +21 -0
- package/src/shared/platform.ts +20 -0
- package/src/shared/query.ts +176 -0
- package/src/shared/rules.test.ts +56 -0
- package/src/shared/rules.ts +371 -0
- package/src/shared/schedules.test.ts +570 -0
- package/src/shared/schedules.ts +560 -0
- package/src/shared/test-helpers.ts +156 -0
- package/src/shared/transactions.test.ts +275 -0
- package/src/shared/transactions.ts +433 -0
- package/src/shared/transfer.test.ts +75 -0
- package/src/shared/transfer.ts +16 -0
- package/src/shared/user.ts +4 -0
- package/src/shared/util.test.ts +240 -0
- package/src/shared/util.ts +633 -0
- package/src/types/api-handlers.ts +287 -0
- package/src/types/budget.ts +8 -0
- package/src/types/file.ts +47 -0
- package/src/types/handlers.ts +46 -0
- package/src/types/models/account.ts +24 -0
- package/src/types/models/bank-sync.ts +23 -0
- package/src/types/models/bank.ts +6 -0
- package/src/types/models/category-group.ts +11 -0
- package/src/types/models/category.ts +13 -0
- package/src/types/models/dashboard.ts +199 -0
- package/src/types/models/gocardless.ts +84 -0
- package/src/types/models/import-transaction.ts +56 -0
- package/src/types/models/index.ts +23 -0
- package/src/types/models/nearby-payee.ts +7 -0
- package/src/types/models/note.ts +4 -0
- package/src/types/models/openid.ts +8 -0
- package/src/types/models/payee-location.ts +8 -0
- package/src/types/models/payee.ts +10 -0
- package/src/types/models/pluggyai.ts +19 -0
- package/src/types/models/reports.ts +144 -0
- package/src/types/models/rule.ts +174 -0
- package/src/types/models/schedule.ts +49 -0
- package/src/types/models/simplefin.ts +28 -0
- package/src/types/models/tags.ts +6 -0
- package/src/types/models/templates.ts +135 -0
- package/src/types/models/transaction-filter.ts +9 -0
- package/src/types/models/transaction.ts +39 -0
- package/src/types/models/user-access.ts +10 -0
- package/src/types/models/user.ts +25 -0
- package/src/types/prefs.ts +167 -0
- package/src/types/server-events.ts +86 -0
- package/src/types/server-handlers.ts +27 -0
- package/src/types/util.ts +26 -0
- package/tsconfig.json +34 -0
- package/typings/pegjs.ts +1 -0
- package/typings/process-worker.ts +12 -0
- package/typings/vite-plugin-peggy-loader.ts +1 -0
- package/typings/window.ts +62 -0
- package/vite.config.ts +109 -0
- package/vite.desktop.config.ts +59 -0
- package/vitest.config.ts +43 -0
- package/vitest.web.config.ts +38 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export type GoCardlessToken = {
|
|
2
|
+
id: string;
|
|
3
|
+
accounts: SyncServerGoCardlessAccount[];
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export type GoCardlessInstitution = {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
bic?: string;
|
|
10
|
+
transaction_total_days?: string;
|
|
11
|
+
countries: string[];
|
|
12
|
+
logo: string;
|
|
13
|
+
identification_codes: string[];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type GoCardlessBalance = {
|
|
17
|
+
balanceAmount: GoCardlessAmount;
|
|
18
|
+
balanceType:
|
|
19
|
+
| 'closingBooked'
|
|
20
|
+
| 'expected'
|
|
21
|
+
| 'forwardAvailable'
|
|
22
|
+
| 'interimAvailable'
|
|
23
|
+
| 'interimBooked'
|
|
24
|
+
| 'nonInvoiced'
|
|
25
|
+
| 'openingBooked';
|
|
26
|
+
creditLimitIncluded?: boolean;
|
|
27
|
+
lastChangeDateTime?: string;
|
|
28
|
+
lastCommittedTransaction?: string;
|
|
29
|
+
referenceDate?: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type GoCardlessAmount = {
|
|
33
|
+
amount: string;
|
|
34
|
+
currency: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type GoCardlessTransaction = {
|
|
38
|
+
additionalInformation?: string;
|
|
39
|
+
bookingStatus?: string;
|
|
40
|
+
balanceAfterTransaction?: Pick<
|
|
41
|
+
GoCardlessBalance,
|
|
42
|
+
'balanceType' | 'balanceAmount'
|
|
43
|
+
>;
|
|
44
|
+
bankTransactionCode?: string;
|
|
45
|
+
bookingDate?: string;
|
|
46
|
+
bookingDateTime?: string;
|
|
47
|
+
checkId?: string;
|
|
48
|
+
creditorAccount?: string;
|
|
49
|
+
creditorAgent?: string;
|
|
50
|
+
creditorId?: string;
|
|
51
|
+
creditorName?: string;
|
|
52
|
+
currencyExchange?: string[];
|
|
53
|
+
debtorAccount?: {
|
|
54
|
+
iban: string;
|
|
55
|
+
};
|
|
56
|
+
debtorAgent?: string;
|
|
57
|
+
debtorName?: string;
|
|
58
|
+
endToEndId?: string;
|
|
59
|
+
entryReference?: string;
|
|
60
|
+
internalTransactionId?: string;
|
|
61
|
+
mandateId?: string;
|
|
62
|
+
merchantCategoryCode?: string;
|
|
63
|
+
proprietaryBankTransactionCode?: string;
|
|
64
|
+
purposeCode?: string;
|
|
65
|
+
remittanceInformationStructured?: string;
|
|
66
|
+
remittanceInformationStructuredArray?: string[];
|
|
67
|
+
remittanceInformationUnstructured?: string;
|
|
68
|
+
remittanceInformationUnstructuredArray?: string[];
|
|
69
|
+
transactionAmount: GoCardlessAmount;
|
|
70
|
+
transactionId?: string;
|
|
71
|
+
ultimateCreditor?: string;
|
|
72
|
+
ultimateDebtor?: string;
|
|
73
|
+
valueDate?: string;
|
|
74
|
+
valueDateTime?: string;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export type SyncServerGoCardlessAccount = {
|
|
78
|
+
balance: number;
|
|
79
|
+
institution: string | { name: string };
|
|
80
|
+
account_id: string;
|
|
81
|
+
mask: string;
|
|
82
|
+
name: string;
|
|
83
|
+
official_name: string;
|
|
84
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a transaction object specifically for import operations.
|
|
3
|
+
* This type is used when importing transactions from external sources.
|
|
4
|
+
*/
|
|
5
|
+
export type ImportTransactionEntity = {
|
|
6
|
+
/** Required. The ID of the account this transaction belongs to */
|
|
7
|
+
account: string;
|
|
8
|
+
|
|
9
|
+
/** Required. Transaction date in YYYY-MM-DD format */
|
|
10
|
+
date: string;
|
|
11
|
+
|
|
12
|
+
/** A currency amount as an integer representing the value without decimal places.
|
|
13
|
+
* For example, USD amount of $120.30 would be 12030 */
|
|
14
|
+
amount?: number;
|
|
15
|
+
|
|
16
|
+
/** In a create/import request, this overrides payee_name.
|
|
17
|
+
* Should be an existing payee ID */
|
|
18
|
+
payee?: string | null;
|
|
19
|
+
|
|
20
|
+
/** If given, a payee will be created with this name.
|
|
21
|
+
* If this matches an already existing payee, that payee will be used.
|
|
22
|
+
* Only available in create/import requests */
|
|
23
|
+
payee_name?: string;
|
|
24
|
+
|
|
25
|
+
/** This can be anything. Meant to represent the raw description when importing,
|
|
26
|
+
* allowing the user to see the original value */
|
|
27
|
+
imported_payee?: string;
|
|
28
|
+
|
|
29
|
+
/** The ID of the category to assign to this transaction */
|
|
30
|
+
category?: string;
|
|
31
|
+
|
|
32
|
+
/** Any additional notes for the transaction */
|
|
33
|
+
notes?: string;
|
|
34
|
+
|
|
35
|
+
/** A unique id usually given by the bank, if importing.
|
|
36
|
+
* Use this to avoid duplicate transactions */
|
|
37
|
+
imported_id?: string;
|
|
38
|
+
|
|
39
|
+
/** If a transfer, the id of the corresponding transaction in the other account.
|
|
40
|
+
* You should not change this for existing transfers.
|
|
41
|
+
* Only set this when importing */
|
|
42
|
+
transfer_id?: string;
|
|
43
|
+
|
|
44
|
+
/** A flag indicating if the transaction has cleared or not */
|
|
45
|
+
cleared?: boolean;
|
|
46
|
+
|
|
47
|
+
/** An array of subtransactions for a split transaction.
|
|
48
|
+
* Only available in get or create/import requests.
|
|
49
|
+
* If amounts don't equal total amount, API call will succeed but error will show in app */
|
|
50
|
+
subtransactions?: Array<{
|
|
51
|
+
/** The only required field for subtransactions */
|
|
52
|
+
amount: number;
|
|
53
|
+
category?: string;
|
|
54
|
+
notes?: string;
|
|
55
|
+
}>;
|
|
56
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type * from './account';
|
|
2
|
+
export type * from './bank';
|
|
3
|
+
export type * from './bank-sync';
|
|
4
|
+
export type * from './category';
|
|
5
|
+
export type * from './category-group';
|
|
6
|
+
export type * from './dashboard';
|
|
7
|
+
export type * from './gocardless';
|
|
8
|
+
export type * from './import-transaction';
|
|
9
|
+
export type * from './nearby-payee';
|
|
10
|
+
export type * from './note';
|
|
11
|
+
export type * from './openid';
|
|
12
|
+
export type * from './payee';
|
|
13
|
+
export type * from './payee-location';
|
|
14
|
+
export type * from './pluggyai';
|
|
15
|
+
export type * from './reports';
|
|
16
|
+
export type * from './rule';
|
|
17
|
+
export type * from './schedule';
|
|
18
|
+
export type * from './simplefin';
|
|
19
|
+
export type * from './transaction';
|
|
20
|
+
export type * from './transaction-filter';
|
|
21
|
+
export type * from './user';
|
|
22
|
+
export type * from './user-access';
|
|
23
|
+
export type * from './tags';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type PluggyAiOrganization = {
|
|
2
|
+
name: string;
|
|
3
|
+
domain: string;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export type PluggyAiAccount = {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
org: PluggyAiOrganization;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type SyncServerPluggyAiAccount = {
|
|
13
|
+
balance: number;
|
|
14
|
+
account_id: string;
|
|
15
|
+
institution?: string;
|
|
16
|
+
orgDomain?: string | null;
|
|
17
|
+
orgId?: string;
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { RuleConditionEntity } from './rule';
|
|
2
|
+
|
|
3
|
+
export type CustomReportEntity = {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
startDate: string;
|
|
7
|
+
endDate: string;
|
|
8
|
+
isDateStatic: boolean;
|
|
9
|
+
dateRange: string;
|
|
10
|
+
mode: string;
|
|
11
|
+
groupBy: string;
|
|
12
|
+
interval: string;
|
|
13
|
+
balanceType: string;
|
|
14
|
+
sortBy?: sortByOpType;
|
|
15
|
+
showEmpty: boolean;
|
|
16
|
+
showOffBudget: boolean;
|
|
17
|
+
showHiddenCategories: boolean;
|
|
18
|
+
includeCurrentInterval: boolean;
|
|
19
|
+
showUncategorized: boolean;
|
|
20
|
+
trimIntervals: boolean;
|
|
21
|
+
graphType: string;
|
|
22
|
+
conditions?: RuleConditionEntity[];
|
|
23
|
+
conditionsOp: 'and' | 'or';
|
|
24
|
+
metadata?: GroupedEntity;
|
|
25
|
+
tombstone?: boolean;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type balanceTypeOpType =
|
|
29
|
+
| 'totalAssets'
|
|
30
|
+
| 'totalDebts'
|
|
31
|
+
| 'totalTotals'
|
|
32
|
+
| 'netAssets'
|
|
33
|
+
| 'netDebts';
|
|
34
|
+
|
|
35
|
+
export type sortByOpType = 'asc' | 'desc' | 'name' | 'budget';
|
|
36
|
+
|
|
37
|
+
export type SpendingMonthEntity = Record<
|
|
38
|
+
string | number,
|
|
39
|
+
{
|
|
40
|
+
cumulative: number;
|
|
41
|
+
daily: number;
|
|
42
|
+
date: string;
|
|
43
|
+
month: string;
|
|
44
|
+
}
|
|
45
|
+
>;
|
|
46
|
+
|
|
47
|
+
export type SpendingDataEntity = {
|
|
48
|
+
date: string;
|
|
49
|
+
totalAssets: number;
|
|
50
|
+
totalDebts: number;
|
|
51
|
+
totalTotals: number;
|
|
52
|
+
cumulative: number;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type SpendingEntity = {
|
|
56
|
+
intervalData: {
|
|
57
|
+
months: SpendingMonthEntity;
|
|
58
|
+
day: string;
|
|
59
|
+
average: number;
|
|
60
|
+
compare: number;
|
|
61
|
+
compareTo: number;
|
|
62
|
+
budget: number;
|
|
63
|
+
}[];
|
|
64
|
+
startDate?: string;
|
|
65
|
+
endDate?: string;
|
|
66
|
+
totalDebts: number;
|
|
67
|
+
totalAssets: number;
|
|
68
|
+
totalTotals: number;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export type DataEntity = {
|
|
72
|
+
data?: GroupedEntity[];
|
|
73
|
+
intervalData: IntervalEntity[];
|
|
74
|
+
groupedData?: GroupedEntity[] | null;
|
|
75
|
+
legend?: LegendEntity[];
|
|
76
|
+
startDate?: string;
|
|
77
|
+
endDate?: string;
|
|
78
|
+
totalDebts: number;
|
|
79
|
+
totalAssets: number;
|
|
80
|
+
netAssets: number;
|
|
81
|
+
netDebts: number;
|
|
82
|
+
totalTotals: number;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export type LegendEntity = {
|
|
86
|
+
name: string;
|
|
87
|
+
id: string | null;
|
|
88
|
+
color: string;
|
|
89
|
+
dataKey: string; // Uses id for unique data lookup when categories have same name
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export type IntervalEntity = {
|
|
93
|
+
date?: string;
|
|
94
|
+
change?: number;
|
|
95
|
+
intervalStartDate?: string;
|
|
96
|
+
intervalEndDate?: string;
|
|
97
|
+
totalAssets: number;
|
|
98
|
+
totalDebts: number;
|
|
99
|
+
netAssets: number;
|
|
100
|
+
netDebts: number;
|
|
101
|
+
totalTotals: number;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export type GroupedEntity = {
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
date?: string;
|
|
108
|
+
intervalData: IntervalEntity[];
|
|
109
|
+
totalAssets: number;
|
|
110
|
+
totalDebts: number;
|
|
111
|
+
totalTotals: number;
|
|
112
|
+
netAssets: number;
|
|
113
|
+
netDebts: number;
|
|
114
|
+
categories?: GroupedEntity[];
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export type Interval = {
|
|
118
|
+
interval: string;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export type CustomReportData = {
|
|
122
|
+
id: string;
|
|
123
|
+
name: string;
|
|
124
|
+
start_date: string;
|
|
125
|
+
end_date: string;
|
|
126
|
+
date_static: number;
|
|
127
|
+
date_range: string;
|
|
128
|
+
mode: string;
|
|
129
|
+
group_by: string;
|
|
130
|
+
sort_by: sortByOpType;
|
|
131
|
+
balance_type: string;
|
|
132
|
+
show_empty: number;
|
|
133
|
+
show_offbudget: number;
|
|
134
|
+
show_hidden: number;
|
|
135
|
+
include_current: number;
|
|
136
|
+
show_uncategorized: number;
|
|
137
|
+
trim_intervals: number;
|
|
138
|
+
graph_type: string;
|
|
139
|
+
conditions?: RuleConditionEntity[];
|
|
140
|
+
conditions_op: 'and' | 'or';
|
|
141
|
+
metadata?: GroupedEntity;
|
|
142
|
+
interval: string;
|
|
143
|
+
color_scheme?: string;
|
|
144
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import type { RecurConfig, ScheduleEntity } from './schedule';
|
|
2
|
+
|
|
3
|
+
export type NewRuleEntity = {
|
|
4
|
+
stage: 'pre' | null | 'post';
|
|
5
|
+
conditionsOp: 'or' | 'and';
|
|
6
|
+
conditions: RuleConditionEntity[];
|
|
7
|
+
actions: RuleActionEntity[];
|
|
8
|
+
tombstone?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type RuleEntity = {
|
|
12
|
+
id: string;
|
|
13
|
+
} & NewRuleEntity;
|
|
14
|
+
|
|
15
|
+
export type RuleConditionOp = RuleConditionEntity['op'];
|
|
16
|
+
|
|
17
|
+
export type FieldValueTypes = {
|
|
18
|
+
account: string;
|
|
19
|
+
amount: number;
|
|
20
|
+
category: string;
|
|
21
|
+
category_group: string;
|
|
22
|
+
date: string | RecurConfig;
|
|
23
|
+
notes: string;
|
|
24
|
+
payee: string;
|
|
25
|
+
payee_name: string;
|
|
26
|
+
imported_payee: string;
|
|
27
|
+
saved: string;
|
|
28
|
+
transfer: boolean;
|
|
29
|
+
parent: boolean;
|
|
30
|
+
cleared: boolean;
|
|
31
|
+
reconciled: boolean;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type BaseConditionEntity<
|
|
35
|
+
Field extends keyof FieldValueTypes,
|
|
36
|
+
Op extends RuleConditionOp,
|
|
37
|
+
> = {
|
|
38
|
+
field: Field;
|
|
39
|
+
op: Op;
|
|
40
|
+
value: Op extends 'oneOf' | 'notOneOf'
|
|
41
|
+
? Array<FieldValueTypes[Field]>
|
|
42
|
+
: Op extends 'isbetween'
|
|
43
|
+
? { num1: number; num2: number }
|
|
44
|
+
: FieldValueTypes[Field];
|
|
45
|
+
options?: {
|
|
46
|
+
inflow?: boolean;
|
|
47
|
+
outflow?: boolean;
|
|
48
|
+
month?: boolean;
|
|
49
|
+
year?: boolean;
|
|
50
|
+
};
|
|
51
|
+
conditionsOp?: 'and' | 'or';
|
|
52
|
+
type?: 'id' | 'boolean' | 'date' | 'number' | 'string';
|
|
53
|
+
customName?: string;
|
|
54
|
+
queryFilter?: Record<string, { $oneof: string[] }>;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type RuleConditionEntity =
|
|
58
|
+
| BaseConditionEntity<
|
|
59
|
+
'account',
|
|
60
|
+
| 'is'
|
|
61
|
+
| 'isNot'
|
|
62
|
+
| 'oneOf'
|
|
63
|
+
| 'notOneOf'
|
|
64
|
+
| 'contains'
|
|
65
|
+
| 'doesNotContain'
|
|
66
|
+
| 'matches'
|
|
67
|
+
| 'onBudget'
|
|
68
|
+
| 'offBudget'
|
|
69
|
+
>
|
|
70
|
+
| BaseConditionEntity<
|
|
71
|
+
'category',
|
|
72
|
+
| 'is'
|
|
73
|
+
| 'isNot'
|
|
74
|
+
| 'oneOf'
|
|
75
|
+
| 'notOneOf'
|
|
76
|
+
| 'contains'
|
|
77
|
+
| 'doesNotContain'
|
|
78
|
+
| 'matches'
|
|
79
|
+
>
|
|
80
|
+
| BaseConditionEntity<
|
|
81
|
+
'category_group',
|
|
82
|
+
| 'is'
|
|
83
|
+
| 'isNot'
|
|
84
|
+
| 'oneOf'
|
|
85
|
+
| 'notOneOf'
|
|
86
|
+
| 'contains'
|
|
87
|
+
| 'doesNotContain'
|
|
88
|
+
| 'matches'
|
|
89
|
+
>
|
|
90
|
+
| BaseConditionEntity<
|
|
91
|
+
'amount',
|
|
92
|
+
'is' | 'isapprox' | 'isbetween' | 'gt' | 'gte' | 'lt' | 'lte'
|
|
93
|
+
>
|
|
94
|
+
| BaseConditionEntity<
|
|
95
|
+
'date',
|
|
96
|
+
'is' | 'isapprox' | 'isbetween' | 'gt' | 'gte' | 'lt' | 'lte'
|
|
97
|
+
>
|
|
98
|
+
| BaseConditionEntity<
|
|
99
|
+
'notes',
|
|
100
|
+
'is' | 'isNot' | 'contains' | 'doesNotContain' | 'matches' | 'hasTags'
|
|
101
|
+
>
|
|
102
|
+
| BaseConditionEntity<
|
|
103
|
+
'payee',
|
|
104
|
+
| 'is'
|
|
105
|
+
| 'isNot'
|
|
106
|
+
| 'oneOf'
|
|
107
|
+
| 'notOneOf'
|
|
108
|
+
| 'contains'
|
|
109
|
+
| 'doesNotContain'
|
|
110
|
+
| 'matches'
|
|
111
|
+
>
|
|
112
|
+
| BaseConditionEntity<
|
|
113
|
+
'imported_payee',
|
|
114
|
+
| 'is'
|
|
115
|
+
| 'isNot'
|
|
116
|
+
| 'oneOf'
|
|
117
|
+
| 'notOneOf'
|
|
118
|
+
| 'contains'
|
|
119
|
+
| 'doesNotContain'
|
|
120
|
+
| 'matches'
|
|
121
|
+
>
|
|
122
|
+
| BaseConditionEntity<'saved', 'is'>
|
|
123
|
+
| BaseConditionEntity<'cleared', 'is'>
|
|
124
|
+
| BaseConditionEntity<'reconciled', 'is'>
|
|
125
|
+
| BaseConditionEntity<'transfer', 'is'>;
|
|
126
|
+
|
|
127
|
+
export type RuleActionEntity =
|
|
128
|
+
| SetRuleActionEntity
|
|
129
|
+
| SetSplitAmountRuleActionEntity
|
|
130
|
+
| LinkScheduleRuleActionEntity
|
|
131
|
+
| PrependNoteRuleActionEntity
|
|
132
|
+
| AppendNoteRuleActionEntity
|
|
133
|
+
| DeleteTransactionRuleActionEntity;
|
|
134
|
+
|
|
135
|
+
export type SetRuleActionEntity = {
|
|
136
|
+
field: string;
|
|
137
|
+
op: 'set';
|
|
138
|
+
value: unknown;
|
|
139
|
+
options?: {
|
|
140
|
+
template?: string;
|
|
141
|
+
formula?: string;
|
|
142
|
+
splitIndex?: number;
|
|
143
|
+
};
|
|
144
|
+
type?: string;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export type SetSplitAmountRuleActionEntity = {
|
|
148
|
+
op: 'set-split-amount';
|
|
149
|
+
value: number;
|
|
150
|
+
options?: {
|
|
151
|
+
splitIndex?: number;
|
|
152
|
+
method: 'fixed-amount' | 'fixed-percent' | 'remainder';
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export type LinkScheduleRuleActionEntity = {
|
|
157
|
+
op: 'link-schedule';
|
|
158
|
+
value: ScheduleEntity;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export type PrependNoteRuleActionEntity = {
|
|
162
|
+
op: 'prepend-notes';
|
|
163
|
+
value: string;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export type AppendNoteRuleActionEntity = {
|
|
167
|
+
op: 'append-notes';
|
|
168
|
+
value: string;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export type DeleteTransactionRuleActionEntity = {
|
|
172
|
+
op: 'delete-transaction';
|
|
173
|
+
value: string;
|
|
174
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { AccountEntity } from './account';
|
|
2
|
+
import type { PayeeEntity } from './payee';
|
|
3
|
+
import type { RuleConditionEntity, RuleEntity } from './rule';
|
|
4
|
+
|
|
5
|
+
export type RecurPattern = {
|
|
6
|
+
value: number;
|
|
7
|
+
type: 'SU' | 'MO' | 'TU' | 'WE' | 'TH' | 'FR' | 'SA' | 'day';
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type RecurConfig = {
|
|
11
|
+
frequency: 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
12
|
+
interval?: number;
|
|
13
|
+
patterns?: RecurPattern[];
|
|
14
|
+
skipWeekend?: boolean;
|
|
15
|
+
start: string;
|
|
16
|
+
endMode?: 'never' | 'after_n_occurrences' | 'on_date';
|
|
17
|
+
endOccurrences?: number;
|
|
18
|
+
endDate?: string;
|
|
19
|
+
weekendSolveMode?: 'before' | 'after';
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type ScheduleEntity = {
|
|
23
|
+
id: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
rule: RuleEntity['id'];
|
|
26
|
+
next_date: string;
|
|
27
|
+
completed: boolean;
|
|
28
|
+
posts_transaction: boolean;
|
|
29
|
+
tombstone: boolean;
|
|
30
|
+
|
|
31
|
+
// These are special fields that are actually pulled from the
|
|
32
|
+
// underlying rule
|
|
33
|
+
_payee: PayeeEntity['id'];
|
|
34
|
+
_account: AccountEntity['id'];
|
|
35
|
+
_amount: number | { num1: number; num2: number };
|
|
36
|
+
_amountOp: string;
|
|
37
|
+
_date: RecurConfig | string;
|
|
38
|
+
_conditions: RuleConditionEntity[];
|
|
39
|
+
_actions: Array<{ op: unknown }>;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type DiscoverScheduleEntity = {
|
|
43
|
+
id: ScheduleEntity['id'];
|
|
44
|
+
account: AccountEntity['id'];
|
|
45
|
+
payee: PayeeEntity['id'];
|
|
46
|
+
date: RecurConfig;
|
|
47
|
+
amount: ScheduleEntity['_amount'];
|
|
48
|
+
_conditions: ScheduleEntity['_conditions'];
|
|
49
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AccountEntity } from './account';
|
|
2
|
+
import type { BankSyncResponse } from './bank-sync';
|
|
3
|
+
|
|
4
|
+
export type SimpleFinOrganization = {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
domain: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type SimpleFinAccount = {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
balance: number;
|
|
14
|
+
org: SimpleFinOrganization;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type SimpleFinBatchSyncResponse = {
|
|
18
|
+
[accountId: NonNullable<AccountEntity['account_id']>]: BankSyncResponse;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type SyncServerSimpleFinAccount = {
|
|
22
|
+
balance: number;
|
|
23
|
+
account_id: string;
|
|
24
|
+
institution?: string;
|
|
25
|
+
orgDomain?: string;
|
|
26
|
+
orgId?: string;
|
|
27
|
+
name: string;
|
|
28
|
+
};
|