@actual-app/api 6.7.0 → 6.8.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/@types/app/bundle.api.d.ts +6 -0
- package/@types/app/query.d.ts +19 -0
- package/@types/index.d.ts +7 -0
- package/@types/injected.d.ts +2 -0
- package/@types/jest.config.d.ts +9 -0
- package/@types/loot-core/client/actions/types.d.ts +6 -0
- package/@types/loot-core/client/constants.d.ts +29 -0
- package/@types/loot-core/client/platform.d.ts +4 -0
- package/@types/loot-core/client/state-types/account.d.ts +27 -0
- package/@types/loot-core/client/state-types/app.d.ts +37 -0
- package/@types/loot-core/client/state-types/budgets.d.ts +36 -0
- package/@types/loot-core/client/state-types/index.d.ts +41 -0
- package/@types/loot-core/client/state-types/modals.d.ts +292 -0
- package/@types/loot-core/client/state-types/notifications.d.ts +38 -0
- package/@types/loot-core/client/state-types/prefs.d.ts +28 -0
- package/@types/loot-core/client/state-types/queries.d.ts +69 -0
- package/@types/loot-core/client/state-types/user.d.ts +13 -0
- package/@types/loot-core/mocks/budget.d.ts +2 -0
- package/@types/loot-core/mocks/index.d.ts +26 -0
- package/@types/loot-core/mocks/random.d.ts +1 -0
- package/@types/loot-core/mocks/util.d.ts +7 -0
- package/@types/loot-core/platform/client/fetch/index.d.ts +48 -0
- package/@types/loot-core/platform/client/undo/index.d.ts +29 -0
- package/@types/loot-core/platform/exceptions/index.d.ts +5 -0
- package/@types/loot-core/platform/server/asyncStorage/index.d.ts +20 -0
- package/@types/loot-core/platform/server/connection/index.d.ts +23 -0
- package/@types/loot-core/platform/server/fetch/index.d.ts +4 -0
- package/@types/loot-core/platform/server/fs/index.d.ts +71 -0
- package/@types/loot-core/platform/server/fs/path-join.d.ts +2 -0
- package/@types/loot-core/platform/server/indexeddb/index.d.ts +24 -0
- package/@types/loot-core/platform/server/log/index.d.ts +9 -0
- package/@types/loot-core/platform/server/sqlite/index.d.ts +35 -0
- package/@types/loot-core/server/accounts/export-to-csv.d.ts +2 -0
- package/@types/loot-core/server/accounts/link.d.ts +1 -0
- package/@types/loot-core/server/accounts/ofx2json.d.ts +14 -0
- package/@types/loot-core/server/accounts/parse-file.d.ts +15 -0
- package/@types/loot-core/server/accounts/payees.d.ts +5 -0
- package/@types/loot-core/server/accounts/qif2json.d.ts +26 -0
- package/@types/loot-core/server/accounts/rules.d.ts +90 -0
- package/@types/loot-core/server/accounts/sync.d.ts +13 -0
- package/@types/loot-core/server/accounts/title/index.d.ts +3 -0
- package/@types/loot-core/server/accounts/title/lower-case.d.ts +1 -0
- package/@types/loot-core/server/accounts/title/specials.d.ts +1 -0
- package/@types/loot-core/server/accounts/transaction-rules.d.ts +47 -0
- package/@types/loot-core/server/accounts/transactions.d.ts +33 -0
- package/@types/loot-core/server/accounts/transfer.d.ts +37 -0
- package/@types/loot-core/server/accounts/xmlcamt2json.d.ts +10 -0
- package/@types/loot-core/server/api-models.d.ts +66 -0
- package/@types/loot-core/server/api.d.ts +3 -0
- package/@types/loot-core/server/app.d.ts +14 -0
- package/@types/loot-core/server/aql/compiler.d.ts +56 -0
- package/@types/loot-core/server/aql/exec.d.ts +9 -0
- package/@types/loot-core/server/aql/index.d.ts +5 -0
- package/@types/loot-core/server/aql/schema/executors.d.ts +6 -0
- package/@types/loot-core/server/aql/schema/index.d.ts +340 -0
- package/@types/loot-core/server/aql/schema/run-query.d.ts +6 -0
- package/@types/loot-core/server/aql/schema-helpers.d.ts +8 -0
- package/@types/loot-core/server/aql/views.d.ts +1 -0
- package/@types/loot-core/server/backups.d.ts +16 -0
- package/@types/loot-core/server/backups.test.d.ts +1 -0
- package/@types/loot-core/server/budget/actions.d.ts +63 -0
- package/@types/loot-core/server/budget/app.d.ts +12 -0
- package/@types/loot-core/server/budget/base.d.ts +17 -0
- package/@types/loot-core/server/budget/cleanup-template.d.ts +4 -0
- package/@types/loot-core/server/budget/goals/goalsAverage.d.ts +4 -0
- package/@types/loot-core/server/budget/goals/goalsBy.d.ts +5 -0
- package/@types/loot-core/server/budget/goals/goalsPercentage.d.ts +4 -0
- package/@types/loot-core/server/budget/goals/goalsRemainder.d.ts +8 -0
- package/@types/loot-core/server/budget/goals/goalsSchedule.d.ts +6 -0
- package/@types/loot-core/server/budget/goals/goalsSimple.d.ts +7 -0
- package/@types/loot-core/server/budget/goals/goalsSpend.d.ts +4 -0
- package/@types/loot-core/server/budget/goals/goalsWeek.d.ts +7 -0
- package/@types/loot-core/server/budget/goaltemplates.d.ts +12 -0
- package/@types/loot-core/server/budget/report.d.ts +2 -0
- package/@types/loot-core/server/budget/rollover.d.ts +4 -0
- package/@types/loot-core/server/budget/types/handlers.d.ts +77 -0
- package/@types/loot-core/server/budget/util.d.ts +4 -0
- package/@types/loot-core/server/cloud-storage.d.ts +33 -0
- package/@types/loot-core/server/db/index.d.ts +60 -0
- package/@types/loot-core/server/db/mappings.d.ts +3 -0
- package/@types/loot-core/server/db/sort.d.ts +11 -0
- package/@types/loot-core/server/db/util.d.ts +2 -0
- package/@types/loot-core/server/encryption-internals.d.ts +24 -0
- package/@types/loot-core/server/encryption-internals.web.d.ts +24 -0
- package/@types/loot-core/server/encryption.d.ts +41 -0
- package/@types/loot-core/server/encryption.test.d.ts +1 -0
- package/@types/loot-core/server/errors.d.ts +73 -0
- package/@types/loot-core/server/filters/app.d.ts +12 -0
- package/@types/loot-core/server/filters/types/handlers.d.ts +7 -0
- package/@types/loot-core/server/importers/actual.d.ts +4 -0
- package/@types/loot-core/server/importers/index.d.ts +6 -0
- package/@types/loot-core/server/importers/ynab4-types.d.ts +167 -0
- package/@types/loot-core/server/importers/ynab4.d.ts +5 -0
- package/@types/loot-core/server/importers/ynab5-types.d.ts +79 -0
- package/@types/loot-core/server/importers/ynab5.d.ts +5 -0
- package/@types/loot-core/server/main-app.d.ts +12 -0
- package/@types/loot-core/server/main.d.ts +28 -0
- package/@types/loot-core/server/main.test.d.ts +1 -0
- package/@types/loot-core/server/migrate/migrations.d.ts +9 -0
- package/@types/loot-core/server/models.d.ts +38 -0
- package/@types/loot-core/server/mutators.d.ts +17 -0
- package/@types/loot-core/server/notes/app.d.ts +12 -0
- package/@types/loot-core/server/notes/types/handlers.d.ts +3 -0
- package/@types/loot-core/server/platform.d.ts +3 -0
- package/@types/loot-core/server/platform.web.d.ts +3 -0
- package/@types/loot-core/server/polyfills.d.ts +0 -0
- package/@types/loot-core/server/post.d.ts +3 -0
- package/@types/loot-core/server/prefs.d.ts +10 -0
- package/@types/loot-core/server/reports/app.d.ts +12 -0
- package/@types/loot-core/server/reports/types/handlers.d.ts +6 -0
- package/@types/loot-core/server/rules/app.d.ts +12 -0
- package/@types/loot-core/server/rules/types/handlers.d.ts +42 -0
- package/@types/loot-core/server/schedules/app.d.ts +35 -0
- package/@types/loot-core/server/schedules/find-schedules.d.ts +1 -0
- package/@types/loot-core/server/schedules/types/handlers.d.ts +31 -0
- package/@types/loot-core/server/server-config.d.ts +10 -0
- package/@types/loot-core/server/sheet.d.ts +11 -0
- package/@types/loot-core/server/sheet.test.d.ts +1 -0
- package/@types/loot-core/server/spreadsheet/globals.d.ts +1 -0
- package/@types/loot-core/server/spreadsheet/graph-data-structure.d.ts +15 -0
- package/@types/loot-core/server/spreadsheet/spreadsheet.d.ts +79 -0
- package/@types/loot-core/server/spreadsheet/util.d.ts +5 -0
- package/@types/loot-core/server/sync/encoder.d.ts +9 -0
- package/@types/loot-core/server/sync/index.d.ts +47 -0
- package/@types/loot-core/server/sync/make-test-message.d.ts +10 -0
- package/@types/loot-core/server/sync/migrate.d.ts +2 -0
- package/@types/loot-core/server/sync/repair.d.ts +6 -0
- package/@types/loot-core/server/sync/reset.d.ts +6 -0
- package/@types/loot-core/server/sync/utils.d.ts +3 -0
- package/@types/loot-core/server/tools/app.d.ts +12 -0
- package/@types/loot-core/server/tools/types/handlers.d.ts +7 -0
- package/@types/loot-core/server/undo.d.ts +14 -0
- package/@types/loot-core/server/update.d.ts +1 -0
- package/@types/loot-core/server/util/budget-name.d.ts +2 -0
- package/@types/loot-core/server/util/rschedule.d.ts +5 -0
- package/@types/loot-core/shared/async.d.ts +3 -0
- package/@types/loot-core/shared/environment.d.ts +4 -0
- package/@types/loot-core/shared/errors.d.ts +22 -0
- package/@types/loot-core/shared/months.d.ts +62 -0
- package/@types/loot-core/shared/query.d.ts +31 -0
- package/@types/loot-core/shared/rules.d.ts +62 -0
- package/@types/loot-core/shared/schedules.d.ts +43 -0
- package/@types/loot-core/shared/transactions.d.ts +91 -0
- package/@types/loot-core/shared/util.d.ts +67 -0
- package/@types/loot-core/types/api-handlers.d.ts +158 -0
- package/@types/loot-core/types/budget.d.ts +7 -0
- package/@types/loot-core/types/file.d.ts +38 -0
- package/@types/loot-core/types/handlers.d.ts +23 -0
- package/@types/loot-core/types/models/account.d.ts +21 -0
- package/@types/loot-core/types/models/category-group.d.ts +11 -0
- package/@types/loot-core/types/models/category.d.ts +9 -0
- package/@types/loot-core/types/models/gocardless.d.ts +14 -0
- package/@types/loot-core/types/models/index.d.ts +12 -0
- package/@types/loot-core/types/models/note.d.ts +4 -0
- package/@types/loot-core/types/models/payee.d.ts +10 -0
- package/@types/loot-core/types/models/reports.d.ts +123 -0
- package/@types/loot-core/types/models/rule.d.ts +71 -0
- package/@types/loot-core/types/models/schedule.d.ts +58 -0
- package/@types/loot-core/types/models/simplefin.d.ts +10 -0
- package/@types/loot-core/types/models/transaction-filter.d.ts +7 -0
- package/@types/loot-core/types/models/transaction.d.ts +40 -0
- package/@types/loot-core/types/prefs.d.ts +69 -0
- package/@types/loot-core/types/server-events.d.ts +21 -0
- package/@types/loot-core/types/server-handlers.d.ts +344 -0
- package/@types/loot-core/types/util.d.ts +5 -0
- package/@types/methods.d.ts +85 -0
- package/@types/methods.test.d.ts +1 -0
- package/@types/migrations/1632571489012_remove_cache.d.ts +1 -0
- package/@types/utils.d.ts +2 -0
- package/@types/validateNodeVersion.d.ts +1 -0
- package/dist/app/bundle.api.js +1649 -6538
- package/dist/methods.js +25 -1
- package/dist/methods.test.js +205 -5
- package/dist/migrations/1712784523000_unhide_input_group.sql +8 -0
- package/dist/package.json +7 -5
- package/package.json +7 -5
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function q(table: any): Query;
|
|
2
|
+
declare class Query {
|
|
3
|
+
constructor(state: any);
|
|
4
|
+
state: any;
|
|
5
|
+
filter(expr: any): Query;
|
|
6
|
+
unfilter(exprs: any): Query;
|
|
7
|
+
select(exprs?: any[]): Query;
|
|
8
|
+
calculate(expr: any): Query;
|
|
9
|
+
groupBy(exprs: any): Query;
|
|
10
|
+
orderBy(exprs: any): Query;
|
|
11
|
+
limit(num: any): Query;
|
|
12
|
+
offset(num: any): Query;
|
|
13
|
+
raw(): Query;
|
|
14
|
+
withDead(): Query;
|
|
15
|
+
withoutValidatedRefs(): Query;
|
|
16
|
+
options(opts: any): Query;
|
|
17
|
+
serialize(): any;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InitConfig } from './loot-core/server/main';
|
|
2
|
+
export declare const internal: any;
|
|
3
|
+
export * as methods from './methods';
|
|
4
|
+
export * from './methods';
|
|
5
|
+
export * as utils from './utils';
|
|
6
|
+
export declare function init(config?: InitConfig): Promise<any>;
|
|
7
|
+
export declare function shutdown(): Promise<void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const moduleFileExtensions: string[];
|
|
2
|
+
export const testEnvironment: string;
|
|
3
|
+
export const testPathIgnorePatterns: string[];
|
|
4
|
+
export const watchPathIgnorePatterns: string[];
|
|
5
|
+
export const setupFilesAfterEnv: string[];
|
|
6
|
+
export const transformIgnorePatterns: string[];
|
|
7
|
+
export const transform: {
|
|
8
|
+
'^.+\\.(t|j)sx?$': string;
|
|
9
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const SET_NEW_TRANSACTIONS = "SET_NEW_TRANSACTIONS";
|
|
2
|
+
export declare const UPDATE_NEW_TRANSACTIONS = "UPDATE_NEW_TRANSACTIONS";
|
|
3
|
+
export declare const SET_LAST_TRANSACTION = "SET_LAST_TRANSACTION";
|
|
4
|
+
export declare const MARK_ACCOUNT_READ = "MARK_ACCOUNT_READ";
|
|
5
|
+
export declare const LOAD_ACCOUNTS = "LOAD_ACCOUNTS";
|
|
6
|
+
export declare const UPDATE_ACCOUNT = "UPDATE_ACCOUNT";
|
|
7
|
+
export declare const LOAD_CATEGORIES = "LOAD_CATEGORIES";
|
|
8
|
+
export declare const LOAD_PAYEES = "LOAD_PAYEES";
|
|
9
|
+
export declare const SET_PREFS = "SET_PREFS";
|
|
10
|
+
export declare const MERGE_LOCAL_PREFS = "MERGE_LOCAL_PREFS";
|
|
11
|
+
export declare const MERGE_GLOBAL_PREFS = "MERGE_GLOBAL_PREFS";
|
|
12
|
+
export declare const SET_BUDGETS = "SET_BUDGETS";
|
|
13
|
+
export declare const SET_REMOTE_FILES = "SET_REMOTE_FILES";
|
|
14
|
+
export declare const SET_ALL_FILES = "SET_ALL_FILES";
|
|
15
|
+
export declare const CLOSE_BUDGET = "CLOSE_BUDGET";
|
|
16
|
+
export declare const SET_APP_STATE = "SET_APP_STATE";
|
|
17
|
+
export declare const PUSH_MODAL = "PUSH_MODAL";
|
|
18
|
+
export declare const REPLACE_MODAL = "REPLACE_MODAL";
|
|
19
|
+
export declare const CLOSE_MODAL = "CLOSE_MODAL";
|
|
20
|
+
export declare const COLLAPSE_MODALS = "COLLAPSE_MODALS";
|
|
21
|
+
export declare const POP_MODAL = "POP_MODAL";
|
|
22
|
+
export declare const ADD_NOTIFICATION = "ADD_NOTIFICATION";
|
|
23
|
+
export declare const REMOVE_NOTIFICATION = "REMOVE_NOTIFICATION";
|
|
24
|
+
export declare const GET_USER_DATA = "GET_USER_DATA";
|
|
25
|
+
export declare const SET_LAST_UNDO_STATE = "SET_LAST_UNDO_STATE";
|
|
26
|
+
export declare const SET_LAST_SPLIT_STATE = "SET_LAST_SPLIT_STATE";
|
|
27
|
+
export declare const SET_ACCOUNTS_SYNCING = "SET_ACCOUNTS_SYNCING";
|
|
28
|
+
export declare const ACCOUNT_SYNC_STATUS = "ACCOUNT_SYNC_STATUS";
|
|
29
|
+
export declare const SIGN_OUT = "SIGN_OUT";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type * as constants from '../constants';
|
|
2
|
+
|
|
3
|
+
export type AccountState = {
|
|
4
|
+
failedAccounts: Map<string, { type: string; code: string }>;
|
|
5
|
+
accountsSyncing: string[];
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type SetAccountsSyncingAction = {
|
|
9
|
+
type: typeof constants.SET_ACCOUNTS_SYNCING;
|
|
10
|
+
ids: string[];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type AccountSyncStatusAction = {
|
|
14
|
+
type: typeof constants.ACCOUNT_SYNC_STATUS;
|
|
15
|
+
id: string;
|
|
16
|
+
} & (
|
|
17
|
+
| {
|
|
18
|
+
failed: false;
|
|
19
|
+
}
|
|
20
|
+
| {
|
|
21
|
+
failed: true;
|
|
22
|
+
errorType: string;
|
|
23
|
+
errorCode: string;
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export type AccountActions = SetAccountsSyncingAction | AccountSyncStatusAction;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { UndoState } from '../../server/undo';
|
|
2
|
+
import type * as constants from '../constants';
|
|
3
|
+
|
|
4
|
+
export type SplitState = { ids: Set<string>; mode: 'collapse' | 'expand' };
|
|
5
|
+
|
|
6
|
+
export type AppState = {
|
|
7
|
+
loadingText: string | null;
|
|
8
|
+
updateInfo: {
|
|
9
|
+
version: string;
|
|
10
|
+
releaseDate: string;
|
|
11
|
+
releaseNotes: string;
|
|
12
|
+
} | null;
|
|
13
|
+
showUpdateNotification: boolean;
|
|
14
|
+
managerHasInitialized: boolean;
|
|
15
|
+
lastUndoState: { current: UndoState | null };
|
|
16
|
+
lastSplitState: { current: SplitState | null };
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type SetAppStateAction = {
|
|
20
|
+
type: typeof constants.SET_APP_STATE;
|
|
21
|
+
state: Partial<AppState>;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type SetLastUndoStateAction = {
|
|
25
|
+
type: typeof constants.SET_LAST_UNDO_STATE;
|
|
26
|
+
undoState: UndoState | null;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type SetLastSplitStateAction = {
|
|
30
|
+
type: typeof constants.SET_LAST_SPLIT_STATE;
|
|
31
|
+
splitState: SplitState | null;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type AppActions =
|
|
35
|
+
| SetAppStateAction
|
|
36
|
+
| SetLastUndoStateAction
|
|
37
|
+
| SetLastSplitStateAction;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { RemoteFile } from '../../server/cloud-storage';
|
|
2
|
+
import type { Budget } from '../../types/budget';
|
|
3
|
+
import type { File } from '../../types/file';
|
|
4
|
+
import type * as constants from '../constants';
|
|
5
|
+
|
|
6
|
+
export type BudgetsState = {
|
|
7
|
+
budgets: Budget[];
|
|
8
|
+
remoteFiles: RemoteFile[] | null;
|
|
9
|
+
allFiles: File[] | null;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type SetBudgetsAction = {
|
|
13
|
+
type: typeof constants.SET_BUDGETS;
|
|
14
|
+
budgets: Budget[];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type SetRemoteFilesAction = {
|
|
18
|
+
type: typeof constants.SET_REMOTE_FILES;
|
|
19
|
+
files: RemoteFile[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type SetAllFilesAction = {
|
|
23
|
+
type: typeof constants.SET_ALL_FILES;
|
|
24
|
+
budgets: Budget[];
|
|
25
|
+
remoteFiles: RemoteFile[];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type SignOutAction = {
|
|
29
|
+
type: typeof constants.SIGN_OUT;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type BudgetsActions =
|
|
33
|
+
| SetBudgetsAction
|
|
34
|
+
| SetRemoteFilesAction
|
|
35
|
+
| SetAllFilesAction
|
|
36
|
+
| SignOutAction;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type * as constants from '../constants';
|
|
2
|
+
|
|
3
|
+
import type { AccountActions, AccountState } from './account';
|
|
4
|
+
import type { AppActions, AppState } from './app';
|
|
5
|
+
import type { BudgetsActions, BudgetsState } from './budgets';
|
|
6
|
+
import type { ModalsActions, ModalsState } from './modals';
|
|
7
|
+
import type { NotificationsActions, NotificationsState } from './notifications';
|
|
8
|
+
import type { PrefsActions, PrefsState } from './prefs';
|
|
9
|
+
import type { QueriesActions, QueriesState } from './queries';
|
|
10
|
+
import type { UserActions, UserState } from './user';
|
|
11
|
+
|
|
12
|
+
export type CloseBudgetAction = {
|
|
13
|
+
type: typeof constants.CLOSE_BUDGET;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type Action =
|
|
17
|
+
| AccountActions
|
|
18
|
+
| AppActions
|
|
19
|
+
| BudgetsActions
|
|
20
|
+
| ModalsActions
|
|
21
|
+
| NotificationsActions
|
|
22
|
+
| PrefsActions
|
|
23
|
+
| QueriesActions
|
|
24
|
+
| UserActions
|
|
25
|
+
| CloseBudgetAction;
|
|
26
|
+
|
|
27
|
+
export type State = {
|
|
28
|
+
account: AccountState;
|
|
29
|
+
app: AppState;
|
|
30
|
+
budgets: BudgetsState;
|
|
31
|
+
modals: ModalsState;
|
|
32
|
+
notifications: NotificationsState;
|
|
33
|
+
prefs: PrefsState;
|
|
34
|
+
queries: QueriesState;
|
|
35
|
+
user: UserState;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
declare module 'react-redux' {
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions, @typescript-eslint/no-empty-interface
|
|
40
|
+
export interface DefaultRootState extends State {}
|
|
41
|
+
}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { type File } from '../../types/file';
|
|
2
|
+
import type {
|
|
3
|
+
AccountEntity,
|
|
4
|
+
CategoryEntity,
|
|
5
|
+
CategoryGroupEntity,
|
|
6
|
+
GoCardlessToken,
|
|
7
|
+
} from '../../types/models';
|
|
8
|
+
import type { NewRuleEntity, RuleEntity } from '../../types/models/rule';
|
|
9
|
+
import type { EmptyObject, StripNever } from '../../types/util';
|
|
10
|
+
import type * as constants from '../constants';
|
|
11
|
+
export type ModalType = keyof FinanceModals;
|
|
12
|
+
|
|
13
|
+
export type OptionlessModal = {
|
|
14
|
+
[K in ModalType]: EmptyObject extends FinanceModals[K] ? K : never;
|
|
15
|
+
}[ModalType];
|
|
16
|
+
|
|
17
|
+
export type ModalWithOptions = StripNever<{
|
|
18
|
+
[K in ModalType]: keyof FinanceModals[K] extends never
|
|
19
|
+
? never
|
|
20
|
+
: FinanceModals[K];
|
|
21
|
+
}>;
|
|
22
|
+
|
|
23
|
+
// There is a separate (overlapping!) set of modals for the management app. Fun!
|
|
24
|
+
type FinanceModals = {
|
|
25
|
+
'import-transactions': {
|
|
26
|
+
accountId: string;
|
|
27
|
+
filename: string;
|
|
28
|
+
onImported: (didChange: boolean) => void;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
'add-account': EmptyObject;
|
|
32
|
+
'add-local-account': EmptyObject;
|
|
33
|
+
'close-account': {
|
|
34
|
+
account: AccountEntity;
|
|
35
|
+
balance: number;
|
|
36
|
+
canDelete: boolean;
|
|
37
|
+
};
|
|
38
|
+
'select-linked-accounts': {
|
|
39
|
+
accounts: unknown[];
|
|
40
|
+
requisitionId: string;
|
|
41
|
+
upgradingAccountId?: string;
|
|
42
|
+
syncSource?: AccountSyncSource;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
'confirm-category-delete': { onDelete: (categoryId: string) => void } & (
|
|
46
|
+
| { category: string }
|
|
47
|
+
| { group: string }
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
'load-backup': EmptyObject;
|
|
51
|
+
|
|
52
|
+
'manage-rules': { payeeId?: string };
|
|
53
|
+
'edit-rule': {
|
|
54
|
+
rule: RuleEntity | NewRuleEntity;
|
|
55
|
+
onSave: (rule: RuleEntity) => void;
|
|
56
|
+
};
|
|
57
|
+
'merge-unused-payees': {
|
|
58
|
+
payeeIds: string[];
|
|
59
|
+
targetPayeeId: string;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
'gocardless-init': {
|
|
63
|
+
onSuccess: () => void;
|
|
64
|
+
};
|
|
65
|
+
'simplefin-init': {
|
|
66
|
+
onSuccess: () => void;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
'gocardless-external-msg': {
|
|
70
|
+
onMoveExternal: (arg: {
|
|
71
|
+
institutionId: string;
|
|
72
|
+
}) => Promise<{ error: string } | { data: unknown }>;
|
|
73
|
+
onClose?: () => void;
|
|
74
|
+
onSuccess: (data: GoCardlessToken) => Promise<void>;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
'delete-budget': { file: File };
|
|
78
|
+
|
|
79
|
+
import: null;
|
|
80
|
+
|
|
81
|
+
'import-ynab4': null;
|
|
82
|
+
|
|
83
|
+
'import-ynab5': null;
|
|
84
|
+
|
|
85
|
+
'import-actual': null;
|
|
86
|
+
|
|
87
|
+
'create-encryption-key': { recreate?: boolean };
|
|
88
|
+
'fix-encryption-key': {
|
|
89
|
+
hasExistingKey?: boolean;
|
|
90
|
+
cloudFileId?: string;
|
|
91
|
+
onSuccess?: () => void;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
'edit-field': {
|
|
95
|
+
name: string;
|
|
96
|
+
month: string;
|
|
97
|
+
onSubmit: (name: string, value: string) => void;
|
|
98
|
+
onClose: () => void;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
'category-autocomplete': {
|
|
102
|
+
categoryGroups: CategoryGroupEntity[];
|
|
103
|
+
onSelect: (categoryId: string, categoryName: string) => void;
|
|
104
|
+
month?: string;
|
|
105
|
+
showHiddenCategories?: boolean;
|
|
106
|
+
onClose?: () => void;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
'account-autocomplete': {
|
|
110
|
+
onSelect: (accountId: string, accountName: string) => void;
|
|
111
|
+
includeClosedAccounts?: boolean;
|
|
112
|
+
onClose?: () => void;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
'payee-autocomplete': {
|
|
116
|
+
onSelect: (payeeId: string) => void;
|
|
117
|
+
onClose?: () => void;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
'budget-summary': {
|
|
121
|
+
month: string;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
'schedule-edit': { id: string } | null;
|
|
125
|
+
|
|
126
|
+
'schedule-link': { transactionIds: string[] } | null;
|
|
127
|
+
|
|
128
|
+
'schedules-discover': null;
|
|
129
|
+
|
|
130
|
+
'schedule-posts-offline-notification': null;
|
|
131
|
+
'switch-budget-type': { onSwitch: () => void };
|
|
132
|
+
'account-menu': {
|
|
133
|
+
accountId: string;
|
|
134
|
+
onSave: (account: AccountEntity) => void;
|
|
135
|
+
onCloseAccount: (accountId: string) => void;
|
|
136
|
+
onReopenAccount: (accountId: string) => void;
|
|
137
|
+
onEditNotes: (id: string) => void;
|
|
138
|
+
onClose?: () => void;
|
|
139
|
+
};
|
|
140
|
+
'category-menu': {
|
|
141
|
+
categoryId: string;
|
|
142
|
+
onSave: (category: CategoryEntity) => void;
|
|
143
|
+
onEditNotes: (id: string) => void;
|
|
144
|
+
onDelete: (categoryId: string) => void;
|
|
145
|
+
onBudgetAction: (month: string, action: string, args?: unknown) => void;
|
|
146
|
+
onClose?: () => void;
|
|
147
|
+
};
|
|
148
|
+
'rollover-budget-menu': {
|
|
149
|
+
categoryId: string;
|
|
150
|
+
month: string;
|
|
151
|
+
onUpdateBudget: (amount: number) => void;
|
|
152
|
+
onCopyLastMonthAverage: () => void;
|
|
153
|
+
onSetMonthsAverage: (numberOfMonths: number) => void;
|
|
154
|
+
onApplyBudgetTemplate: () => void;
|
|
155
|
+
};
|
|
156
|
+
'report-budget-menu': {
|
|
157
|
+
categoryId: string;
|
|
158
|
+
month: string;
|
|
159
|
+
onUpdateBudget: (amount: number) => void;
|
|
160
|
+
onCopyLastMonthAverage: () => void;
|
|
161
|
+
onSetMonthsAverage: (numberOfMonths: number) => void;
|
|
162
|
+
onApplyBudgetTemplate: () => void;
|
|
163
|
+
};
|
|
164
|
+
'category-group-menu': {
|
|
165
|
+
groupId: string;
|
|
166
|
+
onSave: (group: CategoryGroupEntity) => void;
|
|
167
|
+
onAddCategory: (groupId: string, isIncome: boolean) => void;
|
|
168
|
+
onEditNotes: (id: string) => void;
|
|
169
|
+
onDelete: (groupId: string) => void;
|
|
170
|
+
onClose?: () => void;
|
|
171
|
+
};
|
|
172
|
+
notes: {
|
|
173
|
+
id: string;
|
|
174
|
+
name: string;
|
|
175
|
+
onSave: (id: string, notes: string) => void;
|
|
176
|
+
};
|
|
177
|
+
'report-budget-summary': { month: string };
|
|
178
|
+
'rollover-budget-summary': {
|
|
179
|
+
month: string;
|
|
180
|
+
onBudgetAction: (
|
|
181
|
+
month: string,
|
|
182
|
+
type: string,
|
|
183
|
+
args: unknown,
|
|
184
|
+
) => Promise<void>;
|
|
185
|
+
};
|
|
186
|
+
'new-category-group': {
|
|
187
|
+
onValidate?: (value: string) => string;
|
|
188
|
+
onSubmit: (value: string) => Promise<void>;
|
|
189
|
+
};
|
|
190
|
+
'new-category': {
|
|
191
|
+
onValidate?: (value: string) => string;
|
|
192
|
+
onSubmit: (value: string) => Promise<void>;
|
|
193
|
+
};
|
|
194
|
+
'rollover-balance-menu': {
|
|
195
|
+
categoryId: string;
|
|
196
|
+
month: string;
|
|
197
|
+
onCarryover: (carryover: boolean) => void;
|
|
198
|
+
onTransfer: () => void;
|
|
199
|
+
onCover: () => void;
|
|
200
|
+
};
|
|
201
|
+
'rollover-summary-to-budget-menu': {
|
|
202
|
+
month: string;
|
|
203
|
+
onTransfer: () => void;
|
|
204
|
+
onHoldBuffer: () => void;
|
|
205
|
+
onResetHoldBuffer: () => void;
|
|
206
|
+
};
|
|
207
|
+
'report-balance-menu': {
|
|
208
|
+
categoryId: string;
|
|
209
|
+
month: string;
|
|
210
|
+
onCarryover: (carryover: boolean) => void;
|
|
211
|
+
};
|
|
212
|
+
transfer: {
|
|
213
|
+
title: string;
|
|
214
|
+
month: string;
|
|
215
|
+
amount: number;
|
|
216
|
+
onSubmit: (amount: number, toCategoryId: string) => void;
|
|
217
|
+
showToBeBudgeted?: boolean;
|
|
218
|
+
};
|
|
219
|
+
cover: {
|
|
220
|
+
categoryId: string;
|
|
221
|
+
month: string;
|
|
222
|
+
onSubmit: (fromCategoryId: string) => void;
|
|
223
|
+
};
|
|
224
|
+
'hold-buffer': {
|
|
225
|
+
month: string;
|
|
226
|
+
onSubmit: (amount: number) => void;
|
|
227
|
+
};
|
|
228
|
+
'scheduled-transaction-menu': {
|
|
229
|
+
transactionId: string;
|
|
230
|
+
onPost: (transactionId: string) => void;
|
|
231
|
+
onSkip: (transactionId: string) => void;
|
|
232
|
+
};
|
|
233
|
+
'budget-page-menu': {
|
|
234
|
+
onAddCategoryGroup: () => void;
|
|
235
|
+
onToggleHiddenCategories: () => void;
|
|
236
|
+
onSwitchBudgetFile: () => void;
|
|
237
|
+
onSwitchBudgetType: () => void;
|
|
238
|
+
};
|
|
239
|
+
'rollover-budget-month-menu': {
|
|
240
|
+
month: string;
|
|
241
|
+
onBudgetAction: (month: string, action: string, arg?: unknown) => void;
|
|
242
|
+
onEditNotes: (month: string) => void;
|
|
243
|
+
};
|
|
244
|
+
'report-budget-month-menu': {
|
|
245
|
+
month: string;
|
|
246
|
+
onBudgetAction: (month: string, action: string, arg?: unknown) => void;
|
|
247
|
+
onEditNotes: (month: string) => void;
|
|
248
|
+
};
|
|
249
|
+
'budget-list';
|
|
250
|
+
'confirm-transaction-edit': {
|
|
251
|
+
onConfirm: () => void;
|
|
252
|
+
confirmReason: string;
|
|
253
|
+
};
|
|
254
|
+
'confirm-transaction-delete': {
|
|
255
|
+
onConfirm: () => void;
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export type PushModalAction = {
|
|
260
|
+
type: typeof constants.PUSH_MODAL;
|
|
261
|
+
modal: Modal;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export type ReplaceModalAction = {
|
|
265
|
+
type: typeof constants.REPLACE_MODAL;
|
|
266
|
+
modal: Modal;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
export type PopModalAction = {
|
|
270
|
+
type: typeof constants.POP_MODAL;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export type CloseModalAction = {
|
|
274
|
+
type: typeof constants.CLOSE_MODAL;
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
export type CollapseModalsAction = {
|
|
278
|
+
type: typeof constants.COLLAPSE_MODALS;
|
|
279
|
+
rootModalName: string;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
export type ModalsActions =
|
|
283
|
+
| PushModalAction
|
|
284
|
+
| ReplaceModalAction
|
|
285
|
+
| PopModalAction
|
|
286
|
+
| CloseModalAction
|
|
287
|
+
| CollapseModalsAction;
|
|
288
|
+
|
|
289
|
+
export type ModalsState = {
|
|
290
|
+
modalStack: Modal[];
|
|
291
|
+
isHidden: boolean;
|
|
292
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type * as constants from '../constants';
|
|
2
|
+
|
|
3
|
+
export type Notification = {
|
|
4
|
+
id?: string;
|
|
5
|
+
// 'warning' is unhandled??
|
|
6
|
+
type?: 'message' | 'error' | 'warning';
|
|
7
|
+
pre?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
message: string;
|
|
10
|
+
sticky?: boolean;
|
|
11
|
+
timeout?: number;
|
|
12
|
+
button?: {
|
|
13
|
+
title: string;
|
|
14
|
+
action: () => void | Promise<void>;
|
|
15
|
+
};
|
|
16
|
+
messageActions?: Record<string, () => void>;
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
internal?: string;
|
|
19
|
+
};
|
|
20
|
+
type NotificationWithId = Notification & { id: string };
|
|
21
|
+
|
|
22
|
+
export type NotificationsState = {
|
|
23
|
+
notifications: NotificationWithId[];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type AddNotificationAction = {
|
|
27
|
+
type: typeof constants.ADD_NOTIFICATION;
|
|
28
|
+
notification: NotificationWithId;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type RemoveNotificationAction = {
|
|
32
|
+
type: typeof constants.REMOVE_NOTIFICATION;
|
|
33
|
+
id: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type NotificationsActions =
|
|
37
|
+
| AddNotificationAction
|
|
38
|
+
| RemoveNotificationAction;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { LocalPrefs, GlobalPrefs } from '../../types/prefs';
|
|
2
|
+
import type * as constants from '../constants';
|
|
3
|
+
|
|
4
|
+
export type PrefsState = {
|
|
5
|
+
local: LocalPrefs;
|
|
6
|
+
global: GlobalPrefs;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type SetPrefsAction = {
|
|
10
|
+
type: typeof constants.SET_PREFS;
|
|
11
|
+
prefs: LocalPrefs;
|
|
12
|
+
globalPrefs: GlobalPrefs;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type MergeLocalPrefsAction = {
|
|
16
|
+
type: typeof constants.MERGE_LOCAL_PREFS;
|
|
17
|
+
prefs: LocalPrefs;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type MergeGlobalPrefsAction = {
|
|
21
|
+
type: typeof constants.MERGE_GLOBAL_PREFS;
|
|
22
|
+
globalPrefs: GlobalPrefs;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type PrefsActions =
|
|
26
|
+
| SetPrefsAction
|
|
27
|
+
| MergeLocalPrefsAction
|
|
28
|
+
| MergeGlobalPrefsAction;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Handlers } from '../../types/handlers';
|
|
2
|
+
import { type AccountEntity } from '../../types/models';
|
|
3
|
+
import type * as constants from '../constants';
|
|
4
|
+
|
|
5
|
+
export type QueriesState = {
|
|
6
|
+
newTransactions: unknown[];
|
|
7
|
+
matchedTransactions: unknown[];
|
|
8
|
+
lastTransaction: unknown | null;
|
|
9
|
+
updatedAccounts: string[];
|
|
10
|
+
accounts: AccountEntity[];
|
|
11
|
+
accountsLoaded: boolean;
|
|
12
|
+
categories: Awaited<ReturnType<Handlers['get-categories']>>;
|
|
13
|
+
categoriesLoaded: boolean;
|
|
14
|
+
payees: Awaited<ReturnType<Handlers['payees-get']>>;
|
|
15
|
+
payeesLoaded: boolean;
|
|
16
|
+
earliestTransaction: unknown | null;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type SetNewTransactionsAction = {
|
|
20
|
+
type: typeof constants.SET_NEW_TRANSACTIONS;
|
|
21
|
+
newTransactions?: unknown[];
|
|
22
|
+
matchedTransactions?: unknown[];
|
|
23
|
+
updatedAccounts?: string[];
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
type UpdateNewTransactionsAction = {
|
|
27
|
+
type: typeof constants.UPDATE_NEW_TRANSACTIONS;
|
|
28
|
+
changedId: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type SetLastTransactionAction = {
|
|
32
|
+
type: typeof constants.SET_LAST_TRANSACTION;
|
|
33
|
+
transaction: unknown;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
type MarkAccountReadAction = {
|
|
37
|
+
type: typeof constants.MARK_ACCOUNT_READ;
|
|
38
|
+
accountId: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
type LoadAccountsAction = {
|
|
42
|
+
type: typeof constants.LOAD_ACCOUNTS;
|
|
43
|
+
accounts: AccountEntity[];
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
type UpdateAccountAction = {
|
|
47
|
+
type: typeof constants.UPDATE_ACCOUNT;
|
|
48
|
+
account: AccountEntity;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
type LoadCategoriesAction = {
|
|
52
|
+
type: typeof constants.LOAD_CATEGORIES;
|
|
53
|
+
categories: State['categories'];
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
type LoadPayeesAction = {
|
|
57
|
+
type: typeof constants.LOAD_PAYEES;
|
|
58
|
+
payees: State['payees'];
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type QueriesActions =
|
|
62
|
+
| SetNewTransactionsAction
|
|
63
|
+
| UpdateNewTransactionsAction
|
|
64
|
+
| SetLastTransactionAction
|
|
65
|
+
| MarkAccountReadAction
|
|
66
|
+
| LoadAccountsAction
|
|
67
|
+
| UpdateAccountAction
|
|
68
|
+
| LoadCategoriesAction
|
|
69
|
+
| LoadPayeesAction;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Handlers } from '../../types/handlers';
|
|
2
|
+
import type * as constants from '../constants';
|
|
3
|
+
|
|
4
|
+
export type UserState = {
|
|
5
|
+
data: Awaited<ReturnType<Handlers['subscribe-get-user']>>;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export type GetUserDataAction = {
|
|
9
|
+
type: typeof constants.GET_USER_DATA;
|
|
10
|
+
data: State['data'];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type UserActions = GetUserDataAction;
|