@actual-app/api 25.3.0 → 25.4.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/loot-core/client/accounts/accountsSlice.d.ts +175 -0
- package/@types/loot-core/client/app/appSlice.d.ts +175 -0
- package/@types/loot-core/client/budgets/budgetsSlice.d.ts +401 -0
- package/@types/loot-core/client/modals/modalsSlice.d.ts +486 -0
- package/@types/loot-core/client/notifications/notificationsSlice.d.ts +47 -0
- package/@types/loot-core/client/platform.d.ts +1 -0
- package/@types/loot-core/client/prefs/prefsSlice.d.ts +186 -0
- package/@types/loot-core/client/queries/queriesSlice.d.ts +692 -0
- package/@types/loot-core/client/redux.d.ts +18546 -0
- package/@types/loot-core/client/store/index.d.ts +133 -0
- package/@types/loot-core/client/users/usersSlice.d.ts +89 -0
- package/@types/loot-core/platform/client/fetch/index.d.ts +1 -10
- package/@types/loot-core/platform/client/undo/index.d.ts +19 -31
- package/@types/loot-core/platform/exceptions/index.d.ts +2 -5
- package/@types/loot-core/platform/server/connection/index.d.ts +0 -3
- package/@types/loot-core/platform/server/fetch/index.d.ts +1 -4
- package/@types/loot-core/platform/server/log/index.d.ts +4 -6
- package/@types/loot-core/server/accounts/app.d.ts +19 -5
- package/@types/loot-core/server/accounts/link.d.ts +6 -1
- package/@types/loot-core/server/admin/app.d.ts +54 -1
- package/@types/loot-core/server/api-models.d.ts +22 -22
- package/@types/loot-core/server/aql/exec.d.ts +1 -1
- package/@types/loot-core/server/aql/schema/index.d.ts +9 -0
- package/@types/loot-core/server/budget/actions.d.ts +6 -5
- package/@types/loot-core/server/budget/app.d.ts +103 -2
- package/@types/loot-core/server/budget/cleanup-template.d.ts +1 -1
- package/@types/loot-core/server/budget/goaltemplates.d.ts +1 -1
- package/@types/loot-core/server/budget/statements.d.ts +2 -2
- package/@types/loot-core/server/budget/template-notes.d.ts +1 -1
- package/@types/loot-core/server/budget/types/templates.d.ts +2 -1
- package/@types/loot-core/server/cloud-storage.d.ts +1 -1
- package/@types/loot-core/server/dashboard/app.d.ts +35 -1
- package/@types/loot-core/server/db/index.d.ts +38 -31
- package/@types/loot-core/server/db/sort.d.ts +1 -1
- package/@types/loot-core/server/encryption-internals.d.ts +5 -5
- package/@types/loot-core/server/encryption-internals.web.d.ts +2 -2
- package/@types/loot-core/server/encryption.d.ts +3 -3
- package/@types/loot-core/server/filters/app.d.ts +10 -1
- package/@types/loot-core/server/main-app.d.ts +1 -1
- package/@types/loot-core/server/models.d.ts +24 -23
- package/@types/loot-core/server/notes/app.d.ts +6 -1
- package/@types/loot-core/server/payees/app.d.ts +48 -0
- package/@types/loot-core/server/preferences/app.d.ts +1 -10
- package/@types/loot-core/server/reports/app.d.ts +9 -1
- package/@types/loot-core/server/rules/app.d.ts +50 -1
- package/@types/loot-core/server/schedules/app.d.ts +25 -2
- package/@types/loot-core/server/schedules/find-schedules.d.ts +1 -1
- package/@types/loot-core/server/server-config.d.ts +1 -0
- package/@types/loot-core/server/sheet.d.ts +1 -1
- package/@types/loot-core/server/spreadsheet/app.d.ts +38 -0
- package/@types/loot-core/server/spreadsheet/graph-data-structure.d.ts +4 -4
- package/@types/loot-core/server/spreadsheet/spreadsheet.d.ts +3 -2
- package/@types/loot-core/server/sync/app.d.ts +38 -0
- package/@types/loot-core/server/sync/make-test-message.d.ts +1 -1
- package/@types/loot-core/server/tools/app.d.ts +13 -1
- package/@types/loot-core/server/transactions/transaction-rules.d.ts +5 -4
- package/@types/loot-core/server/undo.d.ts +1 -1
- package/@types/loot-core/shared/async.d.ts +4 -3
- package/@types/loot-core/shared/locale.d.ts +1 -0
- package/@types/loot-core/shared/months.d.ts +2 -2
- package/@types/loot-core/shared/schedules.d.ts +5 -3
- package/@types/loot-core/shared/util.d.ts +4 -1
- package/@types/loot-core/types/handlers.d.ts +16 -10
- package/@types/loot-core/types/models/account.d.ts +2 -1
- package/@types/loot-core/types/models/bank-sync.d.ts +1 -1
- package/@types/loot-core/types/models/index.d.ts +5 -1
- package/@types/loot-core/types/models/openid.d.ts +2 -1
- package/@types/loot-core/types/models/payee.d.ts +2 -2
- package/@types/loot-core/types/models/pluggyai.d.ts +18 -0
- package/@types/loot-core/types/models/user-access.d.ts +10 -0
- package/@types/loot-core/types/models/user.d.ts +17 -18
- package/@types/loot-core/types/prefs.d.ts +13 -1
- package/@types/loot-core/types/server-handlers.d.ts +0 -99
- package/@types/loot-core/types/util.d.ts +7 -0
- package/dist/app/bundle.api.js +93477 -49658
- package/dist/index.js +17 -7
- package/dist/jest.config.js +0 -2
- package/dist/methods.js +17 -7
- package/dist/migrations/1740506588539_add_last_reconciled_at.sql +5 -0
- package/dist/package.json +8 -8
- package/dist/validateNodeVersion.js +17 -7
- package/package.json +8 -8
- package/@types/loot-core/client/constants.d.ts +0 -21
- package/@types/loot-core/client/state-types/budgets.d.ts +0 -36
- package/@types/loot-core/client/state-types/index.d.ts +0 -27
- package/@types/loot-core/client/state-types/modals.d.ts +0 -392
- package/@types/loot-core/client/state-types/notifications.d.ts +0 -57
- package/@types/loot-core/client/state-types/prefs.d.ts +0 -40
- package/@types/loot-core/client/state-types/user.d.ts +0 -13
- package/@types/loot-core/server/admin/types/handlers.d.ts +0 -43
- package/@types/loot-core/server/budget/types/handlers.d.ts +0 -91
- package/@types/loot-core/server/dashboard/types/handlers.d.ts +0 -24
- package/@types/loot-core/server/filters/types/handlers.d.ts +0 -7
- package/@types/loot-core/server/notes/types/handlers.d.ts +0 -3
- package/@types/loot-core/server/reports/types/handlers.d.ts +0 -6
- package/@types/loot-core/server/rules/types/handlers.d.ts +0 -40
- package/@types/loot-core/server/schedules/types/handlers.d.ts +0 -31
- package/@types/loot-core/server/tools/types/handlers.d.ts +0 -11
- package/@types/loot-core/types/models/userAccess.d.ts +0 -9
- package/dist/methods.test.js +0 -541
- /package/@types/{methods.test.d.ts → loot-core/server/api.test.d.ts} +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
|
|
2
|
+
account: {
|
|
3
|
+
failedAccounts: {
|
|
4
|
+
[key: import("../../types/models").AccountEntity["id"]]: {
|
|
5
|
+
type: string;
|
|
6
|
+
code: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
accountsSyncing: Array<import("../../types/models").AccountEntity["id"]>;
|
|
10
|
+
};
|
|
11
|
+
app: {
|
|
12
|
+
loadingText: string | null;
|
|
13
|
+
updateInfo: {
|
|
14
|
+
version: string;
|
|
15
|
+
releaseDate: string;
|
|
16
|
+
releaseNotes: string;
|
|
17
|
+
} | null;
|
|
18
|
+
showUpdateNotification: boolean;
|
|
19
|
+
managerHasInitialized: boolean;
|
|
20
|
+
};
|
|
21
|
+
budgets: {
|
|
22
|
+
budgets: import("../../types/budget").Budget[];
|
|
23
|
+
remoteFiles: import("../../server/cloud-storage").RemoteFile[] | null;
|
|
24
|
+
allFiles: import("../../types/file").File[] | null;
|
|
25
|
+
};
|
|
26
|
+
modals: {
|
|
27
|
+
modalStack: import("../modals/modalsSlice").Modal[];
|
|
28
|
+
isHidden: boolean;
|
|
29
|
+
};
|
|
30
|
+
notifications: {
|
|
31
|
+
notifications: import("../notifications/notificationsSlice").NotificationWithId[];
|
|
32
|
+
inset?: {
|
|
33
|
+
bottom?: number;
|
|
34
|
+
top?: number;
|
|
35
|
+
right?: number;
|
|
36
|
+
left?: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
prefs: {
|
|
40
|
+
local: import("../../types/prefs").MetadataPrefs;
|
|
41
|
+
global: import("../../types/prefs").GlobalPrefs;
|
|
42
|
+
synced: import("../../types/prefs").SyncedPrefs;
|
|
43
|
+
};
|
|
44
|
+
queries: {
|
|
45
|
+
newTransactions: Array<import("../../types/models").TransactionEntity["id"]>;
|
|
46
|
+
matchedTransactions: Array<import("../../types/models").TransactionEntity["id"]>;
|
|
47
|
+
lastTransaction: import("../../types/models").TransactionEntity | null;
|
|
48
|
+
updatedAccounts: Array<import("../../types/models").AccountEntity["id"]>;
|
|
49
|
+
accounts: import("../../types/models").AccountEntity[];
|
|
50
|
+
accountsLoaded: boolean;
|
|
51
|
+
categories: {
|
|
52
|
+
grouped: import("../../types/models").CategoryGroupEntity[];
|
|
53
|
+
list: import("../../types/models").CategoryEntity[];
|
|
54
|
+
};
|
|
55
|
+
categoriesLoaded: boolean;
|
|
56
|
+
commonPayeesLoaded: boolean;
|
|
57
|
+
commonPayees: import("../../types/models").PayeeEntity[];
|
|
58
|
+
payees: import("../../types/models").PayeeEntity[];
|
|
59
|
+
payeesLoaded: boolean;
|
|
60
|
+
};
|
|
61
|
+
user: {
|
|
62
|
+
data: Awaited<ReturnType<import("../../types/handlers").Handlers["subscribe-get-user"]>>;
|
|
63
|
+
};
|
|
64
|
+
}, import("redux").UnknownAction, import("@reduxjs/toolkit").Tuple<[import("redux").StoreEnhancer<{
|
|
65
|
+
dispatch: ((action: import("redux").Action<"listenerMiddleware/add">) => import("@reduxjs/toolkit").UnsubscribeListener) & import("redux-thunk").ThunkDispatch<{
|
|
66
|
+
account: {
|
|
67
|
+
failedAccounts: {
|
|
68
|
+
[key: import("../../types/models").AccountEntity["id"]]: {
|
|
69
|
+
type: string;
|
|
70
|
+
code: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
accountsSyncing: Array<import("../../types/models").AccountEntity["id"]>;
|
|
74
|
+
};
|
|
75
|
+
app: {
|
|
76
|
+
loadingText: string | null;
|
|
77
|
+
updateInfo: {
|
|
78
|
+
version: string;
|
|
79
|
+
releaseDate: string;
|
|
80
|
+
releaseNotes: string;
|
|
81
|
+
} | null;
|
|
82
|
+
showUpdateNotification: boolean;
|
|
83
|
+
managerHasInitialized: boolean;
|
|
84
|
+
};
|
|
85
|
+
budgets: {
|
|
86
|
+
budgets: import("../../types/budget").Budget[];
|
|
87
|
+
remoteFiles: import("../../server/cloud-storage").RemoteFile[] | null;
|
|
88
|
+
allFiles: import("../../types/file").File[] | null;
|
|
89
|
+
};
|
|
90
|
+
modals: {
|
|
91
|
+
modalStack: import("../modals/modalsSlice").Modal[];
|
|
92
|
+
isHidden: boolean;
|
|
93
|
+
};
|
|
94
|
+
notifications: {
|
|
95
|
+
notifications: import("../notifications/notificationsSlice").NotificationWithId[];
|
|
96
|
+
inset?: {
|
|
97
|
+
bottom?: number;
|
|
98
|
+
top?: number;
|
|
99
|
+
right?: number;
|
|
100
|
+
left?: number;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
prefs: {
|
|
104
|
+
local: import("../../types/prefs").MetadataPrefs;
|
|
105
|
+
global: import("../../types/prefs").GlobalPrefs;
|
|
106
|
+
synced: import("../../types/prefs").SyncedPrefs;
|
|
107
|
+
};
|
|
108
|
+
queries: {
|
|
109
|
+
newTransactions: Array<import("../../types/models").TransactionEntity["id"]>;
|
|
110
|
+
matchedTransactions: Array<import("../../types/models").TransactionEntity["id"]>;
|
|
111
|
+
lastTransaction: import("../../types/models").TransactionEntity | null;
|
|
112
|
+
updatedAccounts: Array<import("../../types/models").AccountEntity["id"]>;
|
|
113
|
+
accounts: import("../../types/models").AccountEntity[];
|
|
114
|
+
accountsLoaded: boolean;
|
|
115
|
+
categories: {
|
|
116
|
+
grouped: import("../../types/models").CategoryGroupEntity[];
|
|
117
|
+
list: import("../../types/models").CategoryEntity[];
|
|
118
|
+
};
|
|
119
|
+
categoriesLoaded: boolean;
|
|
120
|
+
commonPayeesLoaded: boolean;
|
|
121
|
+
commonPayees: import("../../types/models").PayeeEntity[];
|
|
122
|
+
payees: import("../../types/models").PayeeEntity[];
|
|
123
|
+
payeesLoaded: boolean;
|
|
124
|
+
};
|
|
125
|
+
user: {
|
|
126
|
+
data: Awaited<ReturnType<import("../../types/handlers").Handlers["subscribe-get-user"]>>;
|
|
127
|
+
};
|
|
128
|
+
}, undefined, import("redux").UnknownAction>;
|
|
129
|
+
}>, import("redux").StoreEnhancer]>>;
|
|
130
|
+
export type AppStore = typeof store;
|
|
131
|
+
export type RootState = ReturnType<typeof store.getState>;
|
|
132
|
+
export type AppDispatch = typeof store.dispatch;
|
|
133
|
+
export type GetRootState = typeof store.getState;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { type Handlers } from '../../types/handlers';
|
|
2
|
+
export declare const getUserData: import("@reduxjs/toolkit").AsyncThunk<{
|
|
3
|
+
offline: boolean;
|
|
4
|
+
userName?: string;
|
|
5
|
+
userId?: string;
|
|
6
|
+
displayName?: string;
|
|
7
|
+
permission?: string;
|
|
8
|
+
loginMethod?: string;
|
|
9
|
+
tokenExpired?: boolean;
|
|
10
|
+
}, void, {
|
|
11
|
+
state: import("../store").RootState;
|
|
12
|
+
dispatch: import("../store").AppDispatch;
|
|
13
|
+
extra?: unknown;
|
|
14
|
+
rejectValue?: unknown;
|
|
15
|
+
serializedErrorType?: unknown;
|
|
16
|
+
pendingMeta?: unknown;
|
|
17
|
+
fulfilledMeta?: unknown;
|
|
18
|
+
rejectedMeta?: unknown;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const loggedIn: import("@reduxjs/toolkit").AsyncThunk<void, void, {
|
|
21
|
+
state: import("../store").RootState;
|
|
22
|
+
dispatch: import("../store").AppDispatch;
|
|
23
|
+
extra?: unknown;
|
|
24
|
+
rejectValue?: unknown;
|
|
25
|
+
serializedErrorType?: unknown;
|
|
26
|
+
pendingMeta?: unknown;
|
|
27
|
+
fulfilledMeta?: unknown;
|
|
28
|
+
rejectedMeta?: unknown;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const signOut: import("@reduxjs/toolkit").AsyncThunk<void, void, {
|
|
31
|
+
state: import("../store").RootState;
|
|
32
|
+
dispatch: import("../store").AppDispatch;
|
|
33
|
+
extra?: unknown;
|
|
34
|
+
rejectValue?: unknown;
|
|
35
|
+
serializedErrorType?: unknown;
|
|
36
|
+
pendingMeta?: unknown;
|
|
37
|
+
fulfilledMeta?: unknown;
|
|
38
|
+
rejectedMeta?: unknown;
|
|
39
|
+
}>;
|
|
40
|
+
type UsersState = {
|
|
41
|
+
data: Awaited<ReturnType<Handlers['subscribe-get-user']>>;
|
|
42
|
+
};
|
|
43
|
+
type GetUserDataPayload = {
|
|
44
|
+
data: UsersState['data'];
|
|
45
|
+
};
|
|
46
|
+
export declare const name: "user", reducer: import("redux").Reducer<UsersState>, getInitialState: () => UsersState;
|
|
47
|
+
export declare const actions: {
|
|
48
|
+
getUserData: import("@reduxjs/toolkit").AsyncThunk<{
|
|
49
|
+
offline: boolean;
|
|
50
|
+
userName?: string;
|
|
51
|
+
userId?: string;
|
|
52
|
+
displayName?: string;
|
|
53
|
+
permission?: string;
|
|
54
|
+
loginMethod?: string;
|
|
55
|
+
tokenExpired?: boolean;
|
|
56
|
+
}, void, {
|
|
57
|
+
state: import("../store").RootState;
|
|
58
|
+
dispatch: import("../store").AppDispatch;
|
|
59
|
+
extra?: unknown;
|
|
60
|
+
rejectValue?: unknown;
|
|
61
|
+
serializedErrorType?: unknown;
|
|
62
|
+
pendingMeta?: unknown;
|
|
63
|
+
fulfilledMeta?: unknown;
|
|
64
|
+
rejectedMeta?: unknown;
|
|
65
|
+
}>;
|
|
66
|
+
loggedIn: import("@reduxjs/toolkit").AsyncThunk<void, void, {
|
|
67
|
+
state: import("../store").RootState;
|
|
68
|
+
dispatch: import("../store").AppDispatch;
|
|
69
|
+
extra?: unknown;
|
|
70
|
+
rejectValue?: unknown;
|
|
71
|
+
serializedErrorType?: unknown;
|
|
72
|
+
pendingMeta?: unknown;
|
|
73
|
+
fulfilledMeta?: unknown;
|
|
74
|
+
rejectedMeta?: unknown;
|
|
75
|
+
}>;
|
|
76
|
+
signOut: import("@reduxjs/toolkit").AsyncThunk<void, void, {
|
|
77
|
+
state: import("../store").RootState;
|
|
78
|
+
dispatch: import("../store").AppDispatch;
|
|
79
|
+
extra?: unknown;
|
|
80
|
+
rejectValue?: unknown;
|
|
81
|
+
serializedErrorType?: unknown;
|
|
82
|
+
pendingMeta?: unknown;
|
|
83
|
+
fulfilledMeta?: unknown;
|
|
84
|
+
rejectedMeta?: unknown;
|
|
85
|
+
}>;
|
|
86
|
+
loadUserData: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<GetUserDataPayload, "user/loadUserData">;
|
|
87
|
+
};
|
|
88
|
+
export declare const loadUserData: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<GetUserDataPayload, "user/loadUserData">;
|
|
89
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Handlers } from '../../../types/handlers';
|
|
2
|
-
import type { CategoryGroupEntity } from '../../../types/models';
|
|
3
2
|
import type { ServerEvents } from '../../../types/server-events';
|
|
4
3
|
|
|
5
4
|
export function init(socketName: string): Promise<unknown>;
|
|
@@ -45,15 +44,7 @@ export function unlisten(name: string): void;
|
|
|
45
44
|
export type Unlisten = typeof unlisten;
|
|
46
45
|
|
|
47
46
|
/** Mock functions */
|
|
48
|
-
export function initServer(handlers:
|
|
49
|
-
query: (query: { table: string; selectExpressions: unknown }) => Promise<{
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
51
|
-
data: any;
|
|
52
|
-
dependencies: string[];
|
|
53
|
-
}>;
|
|
54
|
-
getCell?: () => { value: number };
|
|
55
|
-
'get-categories'?: () => { grouped: CategoryGroupEntity[] };
|
|
56
|
-
}): void;
|
|
47
|
+
export function initServer(handlers: Partial<Handlers>): void;
|
|
57
48
|
export type InitServer = typeof initServer;
|
|
58
49
|
|
|
59
50
|
export function serverPush(name: string, args: unknown): void;
|
|
@@ -1,33 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
+
import { Modal } from '../../../client/modals/modalsSlice';
|
|
2
3
|
import { UndoState as ServerUndoState } from '../../../server/undo';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
name: string;
|
|
12
|
-
items: Set<string>;
|
|
13
|
-
} | null;
|
|
14
|
-
undoEvent: ServerUndoState | null;
|
|
4
|
+
type UndoState = {
|
|
5
|
+
url: string | null;
|
|
6
|
+
openModal: Modal | null;
|
|
7
|
+
selectedItems: {
|
|
8
|
+
name: string;
|
|
9
|
+
items: Set<string>;
|
|
10
|
+
} | null;
|
|
11
|
+
undoEvent: ServerUndoState | null;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
export function getTaggedState(id: string): UndoState | undefined;
|
|
27
|
-
export type GetTaggedState = typeof getTaggedState;
|
|
28
|
-
|
|
29
|
-
export function snapshot(): string;
|
|
30
|
-
export type Snapshot = typeof snapshot;
|
|
31
|
-
|
|
32
|
-
export function gc(id: string): void;
|
|
33
|
-
export type Gc = typeof gc;
|
|
13
|
+
type UndoStateWithId = UndoState & {
|
|
14
|
+
id?: ReturnType<typeof uuidv4>;
|
|
15
|
+
};
|
|
16
|
+
export declare const setUndoState: <K extends keyof Omit<UndoState, "id">>(name: K, value: UndoState[K]) => void;
|
|
17
|
+
export declare const getUndoState: <K extends keyof UndoState>(name: K) => UndoStateWithId[K];
|
|
18
|
+
export declare const getTaggedState: (id: string) => UndoStateWithId;
|
|
19
|
+
export declare const snapshot: () => string;
|
|
20
|
+
export declare const gc: (id: string) => void;
|
|
21
|
+
export {};
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
export function captureBreadcrumb(breadcrumb: unknown): void;
|
|
5
|
-
export type CaptureBreadcrumb = typeof captureBreadcrumb;
|
|
1
|
+
export declare const captureException: (exc: Error) => void;
|
|
2
|
+
export declare const captureBreadcrumb: (crumb: unknown) => void;
|
|
@@ -13,9 +13,6 @@ export function send<K extends keyof ServerEvents>(
|
|
|
13
13
|
): void;
|
|
14
14
|
export type Send = typeof send;
|
|
15
15
|
|
|
16
|
-
export function getEvents(): unknown[];
|
|
17
|
-
export type GetEvents = typeof getEvents;
|
|
18
|
-
|
|
19
16
|
export function getNumClients(): number;
|
|
20
17
|
export type GetNumClients = typeof getNumClients;
|
|
21
18
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AccountEntity, CategoryEntity, SyncServerGoCardlessAccount, TransactionEntity, SyncServerSimpleFinAccount } from '../../types/models';
|
|
1
|
+
import { AccountEntity, CategoryEntity, SyncServerGoCardlessAccount, TransactionEntity, SyncServerSimpleFinAccount, SyncServerPluggyAiAccount } from '../../types/models';
|
|
2
|
+
import * as db from '../db';
|
|
2
3
|
import * as bankSync from './sync';
|
|
3
4
|
export type AccountHandlers = {
|
|
4
5
|
'account-update': typeof updateAccount;
|
|
@@ -7,6 +8,7 @@ export type AccountHandlers = {
|
|
|
7
8
|
'account-properties': typeof getAccountProperties;
|
|
8
9
|
'gocardless-accounts-link': typeof linkGoCardlessAccount;
|
|
9
10
|
'simplefin-accounts-link': typeof linkSimpleFinAccount;
|
|
11
|
+
'pluggyai-accounts-link': typeof linkPluggyAiAccount;
|
|
10
12
|
'account-create': typeof createAccount;
|
|
11
13
|
'account-close': typeof closeAccount;
|
|
12
14
|
'account-reopen': typeof reopenAccount;
|
|
@@ -17,7 +19,9 @@ export type AccountHandlers = {
|
|
|
17
19
|
'gocardless-poll-web-token-stop': typeof stopGoCardlessWebTokenPolling;
|
|
18
20
|
'gocardless-status': typeof goCardlessStatus;
|
|
19
21
|
'simplefin-status': typeof simpleFinStatus;
|
|
22
|
+
'pluggyai-status': typeof pluggyAiStatus;
|
|
20
23
|
'simplefin-accounts': typeof simpleFinAccounts;
|
|
24
|
+
'pluggyai-accounts': typeof pluggyAiAccounts;
|
|
21
25
|
'gocardless-get-banks': typeof getGoCardlessBanks;
|
|
22
26
|
'gocardless-create-web-token': typeof createGoCardlessWebToken;
|
|
23
27
|
'accounts-bank-sync': typeof accountsBankSync;
|
|
@@ -25,8 +29,11 @@ export type AccountHandlers = {
|
|
|
25
29
|
'transactions-import': typeof importTransactions;
|
|
26
30
|
'account-unlink': typeof unlinkAccount;
|
|
27
31
|
};
|
|
28
|
-
declare function updateAccount({ id, name }: Pick<AccountEntity, 'id' | 'name'>): Promise<{}>;
|
|
29
|
-
declare function getAccounts(): Promise<
|
|
32
|
+
declare function updateAccount({ id, name, last_reconciled, }: Pick<AccountEntity, 'id' | 'name'> & Partial<Pick<AccountEntity, 'last_reconciled'>>): Promise<{}>;
|
|
33
|
+
declare function getAccounts(): Promise<(db.DbAccount & {
|
|
34
|
+
bankName: db.DbBank["name"];
|
|
35
|
+
bankId: db.DbBank["id"];
|
|
36
|
+
})[]>;
|
|
30
37
|
declare function getAccountBalance({ id, cutoff, }: {
|
|
31
38
|
id: string;
|
|
32
39
|
cutoff: string | Date;
|
|
@@ -48,6 +55,11 @@ declare function linkSimpleFinAccount({ externalAccount, upgradingId, offBudget,
|
|
|
48
55
|
upgradingId?: AccountEntity['id'] | undefined;
|
|
49
56
|
offBudget?: boolean | undefined;
|
|
50
57
|
}): Promise<string>;
|
|
58
|
+
declare function linkPluggyAiAccount({ externalAccount, upgradingId, offBudget, }: {
|
|
59
|
+
externalAccount: SyncServerPluggyAiAccount;
|
|
60
|
+
upgradingId?: AccountEntity['id'] | undefined;
|
|
61
|
+
offBudget?: boolean | undefined;
|
|
62
|
+
}): Promise<string>;
|
|
51
63
|
declare function createAccount({ name, balance, offBudget, closed, }: {
|
|
52
64
|
name: string;
|
|
53
65
|
balance?: number | undefined;
|
|
@@ -65,7 +77,7 @@ declare function reopenAccount({ id }: {
|
|
|
65
77
|
}): Promise<void>;
|
|
66
78
|
declare function moveAccount({ id, targetId, }: {
|
|
67
79
|
id: AccountEntity['id'];
|
|
68
|
-
targetId: AccountEntity['id'];
|
|
80
|
+
targetId: AccountEntity['id'] | null;
|
|
69
81
|
}): Promise<void>;
|
|
70
82
|
declare function setSecret({ name, value, }: {
|
|
71
83
|
name: string;
|
|
@@ -80,7 +92,9 @@ declare function pollGoCardlessWebToken({ requisitionId, }: {
|
|
|
80
92
|
declare function stopGoCardlessWebTokenPolling(): Promise<string>;
|
|
81
93
|
declare function goCardlessStatus(): Promise<any>;
|
|
82
94
|
declare function simpleFinStatus(): Promise<any>;
|
|
95
|
+
declare function pluggyAiStatus(): Promise<any>;
|
|
83
96
|
declare function simpleFinAccounts(): Promise<any>;
|
|
97
|
+
declare function pluggyAiAccounts(): Promise<any>;
|
|
84
98
|
declare function getGoCardlessBanks(country: string): Promise<any>;
|
|
85
99
|
declare function createGoCardlessWebToken({ institutionId, accessValidForDays, }: {
|
|
86
100
|
institutionId: string;
|
|
@@ -140,7 +154,7 @@ export declare const app: {
|
|
|
140
154
|
handlers: AccountHandlers;
|
|
141
155
|
services: (() => () => void)[];
|
|
142
156
|
unlistenServices: (() => void)[];
|
|
143
|
-
method<Name extends "account-update" | "accounts-get" | "account-balance" | "account-properties" | "gocardless-accounts-link" | "simplefin-accounts-link" | "account-create" | "account-close" | "account-reopen" | "account-move" | "secret-set" | "secret-check" | "gocardless-poll-web-token" | "gocardless-poll-web-token-stop" | "gocardless-status" | "simplefin-status" | "simplefin-accounts" | "gocardless-get-banks" | "gocardless-create-web-token" | "accounts-bank-sync" | "simplefin-batch-sync" | "transactions-import" | "account-unlink">(name: Name, func: AccountHandlers[Name]): void;
|
|
157
|
+
method<Name extends "account-update" | "accounts-get" | "account-balance" | "account-properties" | "gocardless-accounts-link" | "simplefin-accounts-link" | "pluggyai-accounts-link" | "account-create" | "account-close" | "account-reopen" | "account-move" | "secret-set" | "secret-check" | "gocardless-poll-web-token" | "gocardless-poll-web-token-stop" | "gocardless-status" | "simplefin-status" | "pluggyai-status" | "simplefin-accounts" | "pluggyai-accounts" | "gocardless-get-banks" | "gocardless-create-web-token" | "accounts-bank-sync" | "simplefin-batch-sync" | "transactions-import" | "account-unlink">(name: Name, func: AccountHandlers[Name]): void;
|
|
144
158
|
service(func: () => () => void): void;
|
|
145
159
|
combine(...apps: any[]): void;
|
|
146
160
|
startServices(): void;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import * as db from '../db';
|
|
2
|
+
export declare function findOrCreateBank(institution: any, requisitionId: any): Promise<Pick<db.DbBank, "id" | "bank_id"> | {
|
|
3
|
+
id: string;
|
|
4
|
+
bank_id: any;
|
|
5
|
+
name: any;
|
|
6
|
+
}>;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UserAvailable, UserEntity, NewUserAccessEntity } from '../../types/models';
|
|
2
|
+
export type AdminHandlers = {
|
|
3
|
+
'users-get': typeof getUsers;
|
|
4
|
+
'user-delete-all': typeof deleteAllUsers;
|
|
5
|
+
'user-add': typeof addUser;
|
|
6
|
+
'user-update': typeof updateUser;
|
|
7
|
+
'access-add': typeof addAccess;
|
|
8
|
+
'access-delete-all': typeof deleteAllAccess;
|
|
9
|
+
'access-get-available-users': typeof accessGetAvailableUsers;
|
|
10
|
+
'transfer-ownership': typeof transferOwnership;
|
|
11
|
+
'owner-created': typeof ownerCreated;
|
|
12
|
+
};
|
|
2
13
|
export declare const app: {
|
|
3
14
|
events: import("mitt").Emitter<{
|
|
4
15
|
sync: import("../../types/server-events").ServerEvents["sync-event"];
|
|
@@ -15,3 +26,45 @@ export declare const app: {
|
|
|
15
26
|
startServices(): void;
|
|
16
27
|
stopServices(): void;
|
|
17
28
|
};
|
|
29
|
+
declare function getUsers(): Promise<UserEntity[] | {
|
|
30
|
+
error: string;
|
|
31
|
+
}>;
|
|
32
|
+
declare function deleteAllUsers(ids: Array<UserEntity['id']>): Promise<{
|
|
33
|
+
someDeletionsFailed: boolean;
|
|
34
|
+
ids?: number[];
|
|
35
|
+
} | {
|
|
36
|
+
error: string;
|
|
37
|
+
}>;
|
|
38
|
+
declare function addUser(user: Omit<UserEntity, 'id'>): Promise<{
|
|
39
|
+
error: string;
|
|
40
|
+
} | {
|
|
41
|
+
id: string;
|
|
42
|
+
}>;
|
|
43
|
+
declare function updateUser(user: Omit<UserEntity, 'id'>): Promise<{
|
|
44
|
+
error: string;
|
|
45
|
+
} | {
|
|
46
|
+
id: string;
|
|
47
|
+
}>;
|
|
48
|
+
declare function addAccess(access: NewUserAccessEntity): Promise<{
|
|
49
|
+
error?: string;
|
|
50
|
+
} | Record<string, never>>;
|
|
51
|
+
declare function deleteAllAccess({ fileId, ids, }: {
|
|
52
|
+
fileId: string;
|
|
53
|
+
ids: string[];
|
|
54
|
+
}): Promise<{
|
|
55
|
+
someDeletionsFailed: boolean;
|
|
56
|
+
ids?: number[];
|
|
57
|
+
} | {
|
|
58
|
+
error: unknown;
|
|
59
|
+
}>;
|
|
60
|
+
declare function accessGetAvailableUsers(fileId: string): Promise<UserAvailable[] | {
|
|
61
|
+
error: string;
|
|
62
|
+
}>;
|
|
63
|
+
declare function transferOwnership({ fileId, newUserId, }: {
|
|
64
|
+
fileId: string;
|
|
65
|
+
newUserId: string;
|
|
66
|
+
}): Promise<{
|
|
67
|
+
error?: string;
|
|
68
|
+
} | Record<string, never>>;
|
|
69
|
+
declare function ownerCreated(): Promise<boolean>;
|
|
70
|
+
export {};
|
|
@@ -8,9 +8,9 @@ export type APIAccountEntity = Pick<AccountEntity, 'id' | 'name'> & {
|
|
|
8
8
|
export declare const accountModel: {
|
|
9
9
|
toExternal(account: AccountEntity): APIAccountEntity;
|
|
10
10
|
fromExternal(account: APIAccountEntity): AccountEntity;
|
|
11
|
-
validate(account:
|
|
11
|
+
validate(account: Partial<import("./db").DbAccount>, { update }?: {
|
|
12
12
|
update?: boolean;
|
|
13
|
-
}):
|
|
13
|
+
}): import("./db").DbAccount;
|
|
14
14
|
};
|
|
15
15
|
export type APICategoryEntity = Pick<CategoryEntity, 'id' | 'name' | 'is_income' | 'hidden'> & {
|
|
16
16
|
group_id?: string;
|
|
@@ -26,16 +26,13 @@ export declare const categoryModel: {
|
|
|
26
26
|
tombstone?: boolean;
|
|
27
27
|
hidden?: boolean;
|
|
28
28
|
};
|
|
29
|
-
validate(category:
|
|
29
|
+
validate(category: Partial<import("./db").DbCategory>, { update }?: {
|
|
30
30
|
update?: boolean;
|
|
31
|
-
}):
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
cat_group?: CategoryGroupEntity["id"];
|
|
37
|
-
tombstone?: boolean;
|
|
38
|
-
};
|
|
31
|
+
}): import("./db").DbCategory;
|
|
32
|
+
toDb(category: CategoryEntity, { update }?: {
|
|
33
|
+
update?: boolean;
|
|
34
|
+
}): import("./db").DbCategory;
|
|
35
|
+
fromDb(category: import("./db").DbCategory): CategoryEntity;
|
|
39
36
|
};
|
|
40
37
|
export type APICategoryGroupEntity = Pick<CategoryGroupEntity, 'id' | 'name' | 'is_income' | 'hidden'> & {
|
|
41
38
|
categories: APICategoryEntity[];
|
|
@@ -43,16 +40,15 @@ export type APICategoryGroupEntity = Pick<CategoryGroupEntity, 'id' | 'name' | '
|
|
|
43
40
|
export declare const categoryGroupModel: {
|
|
44
41
|
toExternal(group: CategoryGroupEntity): APICategoryGroupEntity;
|
|
45
42
|
fromExternal(group: APICategoryGroupEntity): CategoryGroupEntity;
|
|
46
|
-
validate(categoryGroup:
|
|
43
|
+
validate(categoryGroup: Partial<import("./db").DbCategoryGroup>, { update }?: {
|
|
47
44
|
update?: boolean;
|
|
48
|
-
}):
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
};
|
|
45
|
+
}): import("./db").DbCategoryGroup;
|
|
46
|
+
toDb(categoryGroup: CategoryGroupEntity, { update }?: {
|
|
47
|
+
update?: boolean;
|
|
48
|
+
}): import("./db").DbCategoryGroup;
|
|
49
|
+
fromDb(categoryGroup: import("./db").DbCategoryGroup & {
|
|
50
|
+
categories: import("./db").DbCategory[];
|
|
51
|
+
}): CategoryGroupEntity;
|
|
56
52
|
};
|
|
57
53
|
export type APIPayeeEntity = Pick<PayeeEntity, 'id' | 'name' | 'transfer_acct'>;
|
|
58
54
|
export declare const payeeModel: {
|
|
@@ -62,9 +58,13 @@ export declare const payeeModel: {
|
|
|
62
58
|
transfer_acct: string;
|
|
63
59
|
};
|
|
64
60
|
fromExternal(payee: APIPayeeEntity): PayeeEntity;
|
|
65
|
-
validate(payee:
|
|
61
|
+
validate(payee: Partial<import("./db").DbPayee>, { update }?: {
|
|
62
|
+
update?: boolean;
|
|
63
|
+
}): import("./db").DbPayee;
|
|
64
|
+
toDb(payee: PayeeEntity, { update }?: {
|
|
66
65
|
update?: boolean;
|
|
67
|
-
}):
|
|
66
|
+
}): import("./db").DbPayee;
|
|
67
|
+
fromDb(payee: import("./db").DbPayee): PayeeEntity;
|
|
68
68
|
};
|
|
69
69
|
export type APIFileEntity = Omit<RemoteFile, 'deleted' | 'fileId'> & {
|
|
70
70
|
id?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function execQuery(queryState: any, state: any, sqlPieces: any, params: any, outputTypes: any): Promise<
|
|
1
|
+
export declare function execQuery(queryState: any, state: any, sqlPieces: any, params: any, outputTypes: any): Promise<unknown[]>;
|
|
2
2
|
export declare function runCompiledQuery(query: any, pieces: any, state: any, { params, executors }?: {
|
|
3
3
|
params?: {};
|
|
4
4
|
executors?: {};
|
|
@@ -81,6 +81,9 @@ export declare const schema: {
|
|
|
81
81
|
favorite: {
|
|
82
82
|
type: string;
|
|
83
83
|
};
|
|
84
|
+
learn_categories: {
|
|
85
|
+
type: string;
|
|
86
|
+
};
|
|
84
87
|
};
|
|
85
88
|
accounts: {
|
|
86
89
|
id: {
|
|
@@ -110,6 +113,9 @@ export declare const schema: {
|
|
|
110
113
|
account_sync_source: {
|
|
111
114
|
type: string;
|
|
112
115
|
};
|
|
116
|
+
last_reconciled: {
|
|
117
|
+
type: string;
|
|
118
|
+
};
|
|
113
119
|
last_sync: {
|
|
114
120
|
type: string;
|
|
115
121
|
};
|
|
@@ -130,6 +136,9 @@ export declare const schema: {
|
|
|
130
136
|
group: {
|
|
131
137
|
type: string;
|
|
132
138
|
};
|
|
139
|
+
goal_def: {
|
|
140
|
+
type: string;
|
|
141
|
+
};
|
|
133
142
|
sort_order: {
|
|
134
143
|
type: string;
|
|
135
144
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CategoryEntity } from '../../types/models';
|
|
1
2
|
export declare function getSheetValue(sheetName: string, cell: string): Promise<number>;
|
|
2
3
|
export declare function getSheetBoolean(sheetName: string, cell: string): Promise<boolean>;
|
|
3
4
|
export declare function isReflectBudget(): boolean;
|
|
@@ -6,7 +7,7 @@ export declare function getBudget({ category, month, }: {
|
|
|
6
7
|
month: string;
|
|
7
8
|
}): number;
|
|
8
9
|
export declare function setBudget({ category, month, amount, }: {
|
|
9
|
-
category:
|
|
10
|
+
category: CategoryEntity['id'];
|
|
10
11
|
month: string;
|
|
11
12
|
amount: unknown;
|
|
12
13
|
}): Promise<void>;
|
|
@@ -50,8 +51,8 @@ export declare function resetHold({ month }: {
|
|
|
50
51
|
}): Promise<void>;
|
|
51
52
|
export declare function coverOverspending({ month, to, from, }: {
|
|
52
53
|
month: string;
|
|
53
|
-
to:
|
|
54
|
-
from:
|
|
54
|
+
to: CategoryEntity['id'] | 'to-budget';
|
|
55
|
+
from: CategoryEntity['id'] | 'to-budget' | 'overbudgeted';
|
|
55
56
|
}): Promise<void>;
|
|
56
57
|
export declare function transferAvailable({ month, amount, category, }: {
|
|
57
58
|
month: string;
|
|
@@ -65,8 +66,8 @@ export declare function coverOverbudgeted({ month, category, }: {
|
|
|
65
66
|
export declare function transferCategory({ month, amount, from, to, }: {
|
|
66
67
|
month: string;
|
|
67
68
|
amount: number;
|
|
68
|
-
to:
|
|
69
|
-
from:
|
|
69
|
+
to: CategoryEntity['id'] | 'to-budget';
|
|
70
|
+
from: CategoryEntity['id'] | 'to-budget';
|
|
70
71
|
}): Promise<void>;
|
|
71
72
|
export declare function setCategoryCarryover({ startMonth, category, flag, }: {
|
|
72
73
|
startMonth: string;
|