@actual-app/api 24.11.0 → 25.1.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/state-types/app.d.ts +6 -1
- package/@types/loot-core/client/state-types/modals.d.ts +50 -0
- package/@types/loot-core/client/state-types/queries.d.ts +9 -10
- package/@types/loot-core/server/accounts/sync.d.ts +5 -0
- package/@types/loot-core/server/accounts/transaction-rules.d.ts +4 -3
- package/@types/loot-core/server/admin/app.d.ts +12 -0
- package/@types/loot-core/server/admin/types/handlers.d.ts +41 -0
- package/@types/loot-core/server/budget/actions.d.ts +1 -0
- package/@types/loot-core/server/budget/app.d.ts +1 -1
- package/@types/loot-core/server/budget/categoryTemplate.d.ts +47 -0
- package/@types/loot-core/server/budget/goalsSchedule.d.ts +8 -0
- package/@types/loot-core/server/budget/goaltemplates.d.ts +4 -0
- package/@types/loot-core/server/budget/types/handlers.d.ts +5 -0
- package/@types/loot-core/server/budget/types/templates.d.ts +7 -1
- package/@types/loot-core/server/cloud-storage.d.ts +9 -0
- package/@types/loot-core/server/db/index.d.ts +1 -0
- package/@types/loot-core/server/main-app.d.ts +1 -1
- package/@types/loot-core/server/post.d.ts +2 -0
- package/@types/loot-core/server/server-config.d.ts +1 -0
- package/@types/loot-core/server/tools/types/handlers.d.ts +3 -0
- package/@types/loot-core/server/util/budget-name.d.ts +6 -2
- package/@types/loot-core/shared/errors.d.ts +3 -0
- package/@types/loot-core/shared/months.d.ts +1 -1
- package/@types/loot-core/shared/query.d.ts +37 -22
- package/@types/loot-core/shared/rules.d.ts +2 -2
- package/@types/loot-core/shared/schedules.d.ts +4 -1
- package/@types/loot-core/shared/util.d.ts +7 -1
- package/@types/loot-core/types/budget.d.ts +1 -0
- package/@types/loot-core/types/file.d.ts +7 -0
- package/@types/loot-core/types/handlers.d.ts +2 -0
- package/@types/loot-core/types/models/bank-sync.d.ts +21 -0
- package/@types/loot-core/types/models/dashboard.d.ts +40 -1
- package/@types/loot-core/types/models/gocardless.d.ts +61 -0
- package/@types/loot-core/types/models/index.d.ts +2 -0
- package/@types/loot-core/types/models/openid.d.ts +7 -0
- package/@types/loot-core/types/models/rule.d.ts +8 -1
- package/@types/loot-core/types/models/schedule.d.ts +1 -1
- package/@types/loot-core/types/models/simplefin.d.ts +7 -0
- package/@types/loot-core/types/models/user.d.ts +26 -0
- package/@types/loot-core/types/models/userAccess.d.ts +9 -0
- package/@types/loot-core/types/prefs.d.ts +5 -3
- package/@types/loot-core/types/server-handlers.d.ts +103 -13
- package/dist/app/bundle.api.js +5384 -1958
- package/dist/methods.js +4 -1
- package/dist/migrations/1730744182000_fix_dashboard_table.sql +7 -0
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/@types/loot-core/server/budget/goals/goalsAverage.d.ts +0 -4
- package/@types/loot-core/server/budget/goals/goalsBy.d.ts +0 -5
- package/@types/loot-core/server/budget/goals/goalsCopy.d.ts +0 -7
- package/@types/loot-core/server/budget/goals/goalsPercentage.d.ts +0 -4
- package/@types/loot-core/server/budget/goals/goalsRemainder.d.ts +0 -8
- package/@types/loot-core/server/budget/goals/goalsSchedule.d.ts +0 -6
- package/@types/loot-core/server/budget/goals/goalsSimple.d.ts +0 -7
- package/@types/loot-core/server/budget/goals/goalsSpend.d.ts +0 -4
- package/@types/loot-core/server/budget/goals/goalsWeek.d.ts +0 -7
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { UndoState } from '../../server/undo';
|
|
2
2
|
import type * as constants from '../constants';
|
|
3
3
|
|
|
4
|
-
export type
|
|
4
|
+
export type SplitMode = 'collapse' | 'expand';
|
|
5
|
+
export type SplitState = {
|
|
6
|
+
ids: Set<string>;
|
|
7
|
+
mode: SplitMode;
|
|
8
|
+
transitionId: string | null;
|
|
9
|
+
};
|
|
5
10
|
|
|
6
11
|
export type AppState = {
|
|
7
12
|
loadingText: string | null;
|
|
@@ -8,6 +8,8 @@ import type {
|
|
|
8
8
|
TransactionEntity,
|
|
9
9
|
} from '../../types/models';
|
|
10
10
|
import type { NewRuleEntity, RuleEntity } from '../../types/models/rule';
|
|
11
|
+
import { type NewUserEntity, type UserEntity } from '../../types/models/user';
|
|
12
|
+
import { type UserAccessEntity } from '../../types/models/userAccess';
|
|
11
13
|
import type { EmptyObject, StripNever } from '../../types/util';
|
|
12
14
|
import type * as constants from '../constants';
|
|
13
15
|
export type ModalType = keyof FinanceModals;
|
|
@@ -78,6 +80,37 @@ type FinanceModals = {
|
|
|
78
80
|
|
|
79
81
|
'delete-budget': { file: File };
|
|
80
82
|
|
|
83
|
+
'duplicate-budget': {
|
|
84
|
+
/** The budget file to be duplicated */
|
|
85
|
+
file: File;
|
|
86
|
+
/**
|
|
87
|
+
* Indicates whether the duplication is initiated from the budget
|
|
88
|
+
* management page. This may affect the behavior or UI of the
|
|
89
|
+
* duplication process.
|
|
90
|
+
*/
|
|
91
|
+
managePage?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* loadBudget indicates whether to open the 'original' budget, the
|
|
94
|
+
* new duplicated 'copy' budget, or no budget ('none'). If 'none'
|
|
95
|
+
* duplicate-budget stays on the same page.
|
|
96
|
+
*/
|
|
97
|
+
loadBudget?: 'none' | 'original' | 'copy';
|
|
98
|
+
/**
|
|
99
|
+
* onComplete is called when the DuplicateFileModal is closed.
|
|
100
|
+
* @param event the event object will pass back the status of the
|
|
101
|
+
* duplicate process.
|
|
102
|
+
* 'success' if the budget was duplicated.
|
|
103
|
+
* 'failed' if the budget could not be duplicated. This will also
|
|
104
|
+
* pass an error on the event object.
|
|
105
|
+
* 'canceled' if the DuplicateFileModal was canceled.
|
|
106
|
+
* @returns
|
|
107
|
+
*/
|
|
108
|
+
onComplete?: (event: {
|
|
109
|
+
status: 'success' | 'failed' | 'canceled';
|
|
110
|
+
error?: Error;
|
|
111
|
+
}) => void;
|
|
112
|
+
};
|
|
113
|
+
|
|
81
114
|
import: null;
|
|
82
115
|
|
|
83
116
|
'import-ynab4': null;
|
|
@@ -281,6 +314,23 @@ type FinanceModals = {
|
|
|
281
314
|
message?: string;
|
|
282
315
|
onConfirm: () => void;
|
|
283
316
|
};
|
|
317
|
+
'edit-user': {
|
|
318
|
+
user: UserEntity | NewUserEntity;
|
|
319
|
+
onSave: (rule: UserEntity) => void;
|
|
320
|
+
};
|
|
321
|
+
'edit-access': {
|
|
322
|
+
access: UserAccessEntity | NewUserAccessEntity;
|
|
323
|
+
onSave: (rule: UserEntity) => void;
|
|
324
|
+
};
|
|
325
|
+
'transfer-ownership': {
|
|
326
|
+
onSave: () => void;
|
|
327
|
+
};
|
|
328
|
+
'enable-openid': {
|
|
329
|
+
onSave: () => void;
|
|
330
|
+
};
|
|
331
|
+
'enable-password-auth': {
|
|
332
|
+
onSave: () => void;
|
|
333
|
+
};
|
|
284
334
|
'confirm-unlink-account': {
|
|
285
335
|
accountName: string;
|
|
286
336
|
onUnlink: () => void;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Handlers } from '../../types/handlers';
|
|
2
|
-
import { type AccountEntity } from '../../types/models';
|
|
2
|
+
import { type TransactionEntity, type AccountEntity } from '../../types/models';
|
|
3
3
|
import type * as constants from '../constants';
|
|
4
4
|
|
|
5
5
|
export type QueriesState = {
|
|
6
|
-
newTransactions:
|
|
7
|
-
matchedTransactions:
|
|
8
|
-
lastTransaction:
|
|
9
|
-
updatedAccounts:
|
|
6
|
+
newTransactions: Array<TransactionEntity['id']>;
|
|
7
|
+
matchedTransactions: Array<TransactionEntity['id']>;
|
|
8
|
+
lastTransaction: TransactionEntity | null;
|
|
9
|
+
updatedAccounts: Array<AccountEntity['id']>;
|
|
10
10
|
accounts: AccountEntity[];
|
|
11
11
|
accountsLoaded: boolean;
|
|
12
12
|
categories: Awaited<ReturnType<Handlers['get-categories']>>;
|
|
@@ -15,14 +15,13 @@ export type QueriesState = {
|
|
|
15
15
|
commonPayees: Awaited<ReturnType<Handlers['common-payees-get']>>;
|
|
16
16
|
payees: Awaited<ReturnType<Handlers['payees-get']>>;
|
|
17
17
|
payeesLoaded: boolean;
|
|
18
|
-
earliestTransaction: unknown | null;
|
|
19
18
|
};
|
|
20
19
|
|
|
21
20
|
type SetNewTransactionsAction = {
|
|
22
21
|
type: typeof constants.SET_NEW_TRANSACTIONS;
|
|
23
|
-
newTransactions?:
|
|
24
|
-
matchedTransactions?:
|
|
25
|
-
updatedAccounts?:
|
|
22
|
+
newTransactions?: Array<TransactionEntity['id']>;
|
|
23
|
+
matchedTransactions?: Array<TransactionEntity['id']>;
|
|
24
|
+
updatedAccounts?: Array<AccountEntity['id']>;
|
|
26
25
|
};
|
|
27
26
|
|
|
28
27
|
type UpdateNewTransactionsAction = {
|
|
@@ -32,7 +31,7 @@ type UpdateNewTransactionsAction = {
|
|
|
32
31
|
|
|
33
32
|
type SetLastTransactionAction = {
|
|
34
33
|
type: typeof constants.SET_LAST_TRANSACTION;
|
|
35
|
-
transaction:
|
|
34
|
+
transaction: TransactionEntity;
|
|
36
35
|
};
|
|
37
36
|
|
|
38
37
|
type MarkAccountReadAction = {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AccountEntity } from '../../types/models';
|
|
1
2
|
export declare function getGoCardlessAccounts(userId: any, userKey: any, id: any): Promise<any>;
|
|
2
3
|
export declare function reconcileTransactions(acctId: any, transactions: any, isBankSyncAccount?: boolean, strictIdChecking?: boolean, isPreview?: boolean): Promise<{
|
|
3
4
|
added: any[];
|
|
@@ -22,3 +23,7 @@ export declare function syncAccount(userId: string, userKey: string, id: string,
|
|
|
22
23
|
added: any[];
|
|
23
24
|
updated: any[];
|
|
24
25
|
}>;
|
|
26
|
+
export declare function SimpleFinBatchSync(accounts: {
|
|
27
|
+
id: AccountEntity['id'];
|
|
28
|
+
accountId: AccountEntity['account_id'];
|
|
29
|
+
}[]): Promise<any[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TransactionEntity, type RuleActionEntity, type RuleEntity } from '../../types/models';
|
|
1
|
+
import { type TransactionEntity, type RuleActionEntity, type RuleEntity, AccountEntity } from '../../types/models';
|
|
2
2
|
import { Action, Rule } from './rules';
|
|
3
3
|
export { iterateIds } from './rules';
|
|
4
4
|
export declare function resetState(): void;
|
|
@@ -19,7 +19,7 @@ export declare function insertRule(rule: Omit<RuleEntity, 'id'> & {
|
|
|
19
19
|
}): Promise<any>;
|
|
20
20
|
export declare function updateRule(rule: any): Promise<void>;
|
|
21
21
|
export declare function deleteRule(id: string): Promise<boolean>;
|
|
22
|
-
export declare function runRules(trans: any): Promise<TransactionEntity>;
|
|
22
|
+
export declare function runRules(trans: any, accounts?: Map<string, AccountEntity> | null): Promise<TransactionEntity>;
|
|
23
23
|
export declare function conditionsToAQL(conditions: any, { recurDateBounds }?: {
|
|
24
24
|
recurDateBounds?: number;
|
|
25
25
|
}): {
|
|
@@ -45,6 +45,7 @@ export declare function getProbableCategory(transactions: any): any;
|
|
|
45
45
|
export declare function updateCategoryRules(transactions: any): Promise<void>;
|
|
46
46
|
export type TransactionForRules = TransactionEntity & {
|
|
47
47
|
payee_name?: string;
|
|
48
|
+
_account?: AccountEntity;
|
|
48
49
|
};
|
|
49
|
-
export declare function prepareTransactionForRules(trans: TransactionEntity): Promise<TransactionForRules>;
|
|
50
|
+
export declare function prepareTransactionForRules(trans: TransactionEntity, accounts?: Map<string, AccountEntity> | null): Promise<TransactionForRules>;
|
|
50
51
|
export declare function finalizeTransactionForRules(trans: TransactionEntity | TransactionForRules): Promise<TransactionEntity>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AdminHandlers } from './types/handlers';
|
|
2
|
+
export declare const app: {
|
|
3
|
+
events: any;
|
|
4
|
+
handlers: AdminHandlers;
|
|
5
|
+
services: any;
|
|
6
|
+
unlistenServices: any;
|
|
7
|
+
method<Name extends "users-get" | "user-delete-all" | "user-add" | "user-update" | "access-add" | "access-delete-all" | "access-get-available-users" | "transfer-ownership" | "owner-created">(name: Name, func: AdminHandlers[Name]): void;
|
|
8
|
+
service(func: any): void;
|
|
9
|
+
combine(...apps: any[]): void;
|
|
10
|
+
startServices(): void;
|
|
11
|
+
stopServices(): void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { UserAvailable, UserEntity } from '../../../types/models/user';
|
|
2
|
+
import { NewUserAccessEntity } from '../../../types/models/userAccess';
|
|
3
|
+
export interface AdminHandlers {
|
|
4
|
+
'users-get': () => Promise<UserEntity[] | null | {
|
|
5
|
+
error: string;
|
|
6
|
+
}>;
|
|
7
|
+
'user-delete-all': (ids: string[]) => Promise<{
|
|
8
|
+
someDeletionsFailed: boolean;
|
|
9
|
+
ids?: number[];
|
|
10
|
+
}>;
|
|
11
|
+
'user-add': (user: Omit<UserEntity, 'id'>) => Promise<{
|
|
12
|
+
error?: string;
|
|
13
|
+
} | {
|
|
14
|
+
id: string;
|
|
15
|
+
}>;
|
|
16
|
+
'user-update': (user: Omit<UserEntity, 'id'>) => Promise<{
|
|
17
|
+
error?: string;
|
|
18
|
+
} | {
|
|
19
|
+
id: string;
|
|
20
|
+
}>;
|
|
21
|
+
'access-add': (user: NewUserAccessEntity) => Promise<{
|
|
22
|
+
error?: string;
|
|
23
|
+
} | Record<string, never>>;
|
|
24
|
+
'access-delete-all': ({ fileId, ids, }: {
|
|
25
|
+
fileId: string;
|
|
26
|
+
ids: string[];
|
|
27
|
+
}) => Promise<{
|
|
28
|
+
someDeletionsFailed: boolean;
|
|
29
|
+
ids?: number[];
|
|
30
|
+
}>;
|
|
31
|
+
'access-get-available-users': (fileId: string) => Promise<UserAvailable[] | {
|
|
32
|
+
error: string;
|
|
33
|
+
}>;
|
|
34
|
+
'transfer-ownership': ({ fileId, newUserId, }: {
|
|
35
|
+
fileId: string;
|
|
36
|
+
newUserId: string;
|
|
37
|
+
}) => Promise<{
|
|
38
|
+
error?: string;
|
|
39
|
+
} | Record<string, never>>;
|
|
40
|
+
'owner-created': () => Promise<boolean>;
|
|
41
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function getSheetValue(sheetName: string, cell: string): Promise<number>;
|
|
2
|
+
export declare function getSheetBoolean(sheetName: string, cell: string): Promise<boolean>;
|
|
2
3
|
export declare function isReflectBudget(): boolean;
|
|
3
4
|
export declare function getBudget({ category, month, }: {
|
|
4
5
|
category: string;
|
|
@@ -4,7 +4,7 @@ export declare const app: {
|
|
|
4
4
|
handlers: BudgetHandlers;
|
|
5
5
|
services: any;
|
|
6
6
|
unlistenServices: any;
|
|
7
|
-
method<Name extends "budget/budget-amount" | "budget/copy-previous-month" | "budget/set-zero" | "budget/set-3month-avg" | "budget/check-templates" | "budget/apply-goal-template" | "budget/overwrite-goal-template" | "budget/cleanup-goal-template" | "budget/hold-for-next-month" | "budget/reset-hold" | "budget/cover-overspending" | "budget/transfer-available" | "budget/cover-overbudgeted" | "budget/transfer-category" | "budget/set-carryover" | "budget/apply-single-template" | "budget/set-n-month-avg" | "budget/copy-single-month">(name: Name, func: BudgetHandlers[Name]): void;
|
|
7
|
+
method<Name extends "budget/budget-amount" | "budget/copy-previous-month" | "budget/set-zero" | "budget/set-3month-avg" | "budget/check-templates" | "budget/apply-goal-template" | "budget/overwrite-goal-template" | "budget/cleanup-goal-template" | "budget/hold-for-next-month" | "budget/reset-hold" | "budget/cover-overspending" | "budget/transfer-available" | "budget/cover-overbudgeted" | "budget/transfer-category" | "budget/set-carryover" | "budget/apply-single-template" | "budget/set-n-month-avg" | "budget/copy-single-month" | "budget/apply-multiple-templates">(name: Name, func: BudgetHandlers[Name]): void;
|
|
8
8
|
service(func: any): void;
|
|
9
9
|
combine(...apps: any[]): void;
|
|
10
10
|
startServices(): void;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CategoryEntity } from '../../types/models';
|
|
2
|
+
import { Template } from './types/templates';
|
|
3
|
+
export declare class CategoryTemplate {
|
|
4
|
+
static init(templates: Template[], category: CategoryEntity, month: any): Promise<CategoryTemplate>;
|
|
5
|
+
getPriorities(): number[];
|
|
6
|
+
getRemainderWeight(): number;
|
|
7
|
+
getLimitExcess(): number;
|
|
8
|
+
runAll(available: number): Promise<number>;
|
|
9
|
+
runTemplatesForPriority(priority: number, budgetAvail: number, availStart: number): Promise<number>;
|
|
10
|
+
runRemainder(budgetAvail: number, perWeight: number): number;
|
|
11
|
+
getValues(): {
|
|
12
|
+
budgeted: any;
|
|
13
|
+
goal: any;
|
|
14
|
+
longGoal: any;
|
|
15
|
+
};
|
|
16
|
+
readonly category: CategoryEntity;
|
|
17
|
+
private month;
|
|
18
|
+
private templates;
|
|
19
|
+
private remainder;
|
|
20
|
+
private goals;
|
|
21
|
+
private priorities;
|
|
22
|
+
private remainderWeight;
|
|
23
|
+
private toBudgetAmount;
|
|
24
|
+
private fullAmount;
|
|
25
|
+
private isLongGoal;
|
|
26
|
+
private goalAmount;
|
|
27
|
+
private fromLastMonth;
|
|
28
|
+
private limitMet;
|
|
29
|
+
private limitExcess;
|
|
30
|
+
private limitAmount;
|
|
31
|
+
private limitCheck;
|
|
32
|
+
private limitHold;
|
|
33
|
+
private constructor();
|
|
34
|
+
private runGoal;
|
|
35
|
+
static checkByAndScheduleAndSpend(templates: any, month: any): Promise<void>;
|
|
36
|
+
static checkPercentage(templates: any): Promise<void>;
|
|
37
|
+
private checkLimit;
|
|
38
|
+
private checkSpend;
|
|
39
|
+
private checkGoal;
|
|
40
|
+
private runSimple;
|
|
41
|
+
private runCopy;
|
|
42
|
+
private runWeek;
|
|
43
|
+
private runSpend;
|
|
44
|
+
private runPercentage;
|
|
45
|
+
private runAverage;
|
|
46
|
+
private runBy;
|
|
47
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CategoryEntity } from '../../types/models';
|
|
2
|
+
import { Template } from './types/templates';
|
|
3
|
+
export declare function goalsSchedule(scheduleFlag: boolean, template_lines: Template[], current_month: string, balance: number, remainder: number, last_month_balance: number, to_budget: number, errors: string[], category: CategoryEntity): Promise<{
|
|
4
|
+
to_budget: number;
|
|
5
|
+
errors: string[];
|
|
6
|
+
remainder: number;
|
|
7
|
+
scheduleFlag: true;
|
|
8
|
+
}>;
|
|
@@ -5,6 +5,10 @@ export declare function applyTemplate({ month }: {
|
|
|
5
5
|
export declare function overwriteTemplate({ month }: {
|
|
6
6
|
month: any;
|
|
7
7
|
}): Promise<Notification>;
|
|
8
|
+
export declare function applyMultipleCategoryTemplates({ month, categoryIds }: {
|
|
9
|
+
month: any;
|
|
10
|
+
categoryIds: any;
|
|
11
|
+
}): Promise<Notification>;
|
|
8
12
|
export declare function applySingleCategoryTemplate({ month, category }: {
|
|
9
13
|
month: any;
|
|
10
14
|
category: any;
|
|
@@ -55,7 +55,7 @@ interface RemainderTemplate extends BaseTemplate {
|
|
|
55
55
|
|
|
56
56
|
interface AverageTemplate extends BaseTemplate {
|
|
57
57
|
type: 'average';
|
|
58
|
-
|
|
58
|
+
numMonths: number;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
interface GoalTemplate extends BaseTemplate {
|
|
@@ -63,6 +63,11 @@ interface GoalTemplate extends BaseTemplate {
|
|
|
63
63
|
amount: number;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
interface CopyTemplate extends BaseTemplate {
|
|
67
|
+
type: 'copy';
|
|
68
|
+
lookBack: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
66
71
|
interface ErrorTemplate extends BaseTemplate {
|
|
67
72
|
type: 'error';
|
|
68
73
|
line: string;
|
|
@@ -79,4 +84,5 @@ export type Template =
|
|
|
79
84
|
| RemainderTemplate
|
|
80
85
|
| AverageTemplate
|
|
81
86
|
| GoalTemplate
|
|
87
|
+
| CopyTemplate
|
|
82
88
|
| ErrorTemplate;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export interface UsersWithAccess {
|
|
2
|
+
userId: string;
|
|
3
|
+
userName: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
owner: boolean;
|
|
6
|
+
}
|
|
1
7
|
export interface RemoteFile {
|
|
2
8
|
deleted: boolean;
|
|
3
9
|
fileId: string;
|
|
@@ -5,6 +11,8 @@ export interface RemoteFile {
|
|
|
5
11
|
name: string;
|
|
6
12
|
encryptKeyId: string;
|
|
7
13
|
hasKey: boolean;
|
|
14
|
+
owner: string;
|
|
15
|
+
usersWithAccess: UsersWithAccess[];
|
|
8
16
|
}
|
|
9
17
|
export declare function checkKey(): Promise<{
|
|
10
18
|
valid: boolean;
|
|
@@ -27,6 +35,7 @@ export declare function upload(): Promise<void>;
|
|
|
27
35
|
export declare function possiblyUpload(): Promise<void>;
|
|
28
36
|
export declare function removeFile(fileId: any): Promise<void>;
|
|
29
37
|
export declare function listRemoteFiles(): Promise<RemoteFile[] | null>;
|
|
38
|
+
export declare function getRemoteFile(fileId: string): Promise<RemoteFile | null>;
|
|
30
39
|
export declare function download(fileId: any): Promise<{
|
|
31
40
|
id: any;
|
|
32
41
|
}>;
|
|
@@ -80,6 +80,7 @@ export declare function updateCategory(category: any): Promise<void>;
|
|
|
80
80
|
export declare function moveCategory(id: any, groupId: any, targetId?: string): Promise<void>;
|
|
81
81
|
export declare function deleteCategory(category: any, transferId?: string): Promise<void>;
|
|
82
82
|
export declare function getPayee(id: any): Promise<any>;
|
|
83
|
+
export declare function getAccount(id: any): Promise<any>;
|
|
83
84
|
export declare function insertPayee(payee: any): Promise<any>;
|
|
84
85
|
export declare function deletePayee(payee: any): Promise<void>;
|
|
85
86
|
export declare function deleteTransferPayee(payee: any): Promise<void>;
|
|
@@ -4,7 +4,7 @@ export declare const app: {
|
|
|
4
4
|
handlers: Handlers;
|
|
5
5
|
services: any;
|
|
6
6
|
unlistenServices: any;
|
|
7
|
-
method<Name extends "sync" | "transaction-update" | "undo" | "redo" | "transactions-batch-update" | "transaction-add" | "transaction-delete" | "transactions-parse-file" | "transactions-export" | "transactions-export-query" | "get-categories" | "get-earliest-transaction" | "get-budget-bounds" | "envelope-budget-month" | "tracking-budget-month" | "category-create" | "category-update" | "category-move" | "category-delete" | "category-group-create" | "category-group-update" | "category-group-move" | "category-group-delete" | "must-category-transfer" | "payee-create" | "common-payees-get" | "payees-get" | "payees-get-rule-counts" | "payees-merge" | "payees-batch-change" | "payees-check-orphaned" | "payees-get-rules" | "make-filters-from-conditions" | "getCell" | "getCells" | "getCellNamesInSheet" | "debugCell" | "create-query" | "query" | "account-update" | "accounts-get" | "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-status" | "simplefin-status" | "simplefin-accounts" | "gocardless-get-banks" | "gocardless-poll-web-token-stop" | "gocardless-create-web-token" | "accounts-bank-sync" | "transactions-import" | "account-unlink" | "save-global-prefs" | "load-global-prefs" | "save-prefs" | "load-prefs" | "sync-reset" | "sync-repair" | "key-make" | "key-test" | "get-did-bootstrap" | "subscribe-needs-bootstrap" | "subscribe-bootstrap" | "subscribe-get-user" | "subscribe-change-password" | "subscribe-sign-in" | "subscribe-sign-out" | "get-server-version" | "get-server-url" | "set-server-url" | "get-budgets" | "get-remote-files" | "reset-budget-cache" | "upload-budget" | "download-budget" | "sync-budget" | "load-budget" | "create-demo-budget" | "close-budget" | "delete-budget" | "create-budget" | "import-budget" | "export-budget" | "upload-file-web" | "backups-get" | "backup-load" | "backup-make" | "get-last-opened-backup" | "app-focused" | "api/batch-budget-start" | "api/batch-budget-end" | "api/load-budget" | "api/download-budget" | "api/get-budgets" | "api/start-import" | "api/finish-import" | "api/abort-import" | "api/query" | "api/budget-months" | "api/budget-month" | "api/budget-set-amount" | "api/budget-set-carryover" | "api/budget-hold-for-next-month" | "api/budget-reset-hold" | "api/transactions-export" | "api/transactions-import" | "api/transactions-add" | "api/transactions-get" | "api/transaction-update" | "api/transaction-delete" | "api/sync" | "api/bank-sync" | "api/accounts-get" | "api/account-create" | "api/account-update" | "api/account-close" | "api/account-reopen" | "api/account-delete" | "api/account-balance" | "api/categories-get" | "api/category-groups-get" | "api/category-group-create" | "api/category-group-update" | "api/category-group-delete" | "api/category-create" | "api/category-update" | "api/category-delete" | "api/payees-get" | "api/common-payees-get" | "api/payee-create" | "api/payee-update" | "api/payee-delete" | "api/payees-merge" | "api/rules-get" | "api/payee-rules-get" | "api/rule-create" | "api/rule-update" | "api/rule-delete" | "budget/budget-amount" | "budget/copy-previous-month" | "budget/set-zero" | "budget/set-3month-avg" | "budget/check-templates" | "budget/apply-goal-template" | "budget/overwrite-goal-template" | "budget/cleanup-goal-template" | "budget/hold-for-next-month" | "budget/reset-hold" | "budget/cover-overspending" | "budget/transfer-available" | "budget/cover-overbudgeted" | "budget/transfer-category" | "budget/set-carryover" | "budget/apply-single-template" | "budget/set-n-month-avg" | "budget/copy-single-month" | "dashboard-update" | "dashboard-update-widget" | "dashboard-reset" | "dashboard-add-widget" | "dashboard-remove-widget" | "dashboard-import" | "filter-create" | "filter-update" | "filter-delete" | "notes-save" | "preferences/save" | "preferences/get" | "report/create" | "report/update" | "report/delete" | "rule-validate" | "rule-add" | "rule-update" | "rule-delete" | "rule-delete-all" | "rule-apply-actions" | "rule-add-payee-rename" | "rules-get" | "rule-get" | "rules-run" | "schedule/create" | "schedule/update" | "schedule/delete" | "schedule/skip-next-date" | "schedule/post-transaction" | "schedule/force-run-service" | "schedule/discover" | "schedule/get-upcoming-dates" | "tools/fix-split-transactions">(name: Name, func: Handlers[Name]): void;
|
|
7
|
+
method<Name extends "sync" | "transaction-update" | "undo" | "redo" | "transactions-batch-update" | "transaction-add" | "transaction-delete" | "transactions-parse-file" | "transactions-export" | "transactions-export-query" | "get-categories" | "get-earliest-transaction" | "get-budget-bounds" | "envelope-budget-month" | "tracking-budget-month" | "category-create" | "category-update" | "category-move" | "category-delete" | "category-group-create" | "category-group-update" | "category-group-move" | "category-group-delete" | "must-category-transfer" | "payee-create" | "common-payees-get" | "payees-get" | "payees-get-rule-counts" | "payees-merge" | "payees-batch-change" | "payees-check-orphaned" | "payees-get-orphaned" | "payees-get-rules" | "make-filters-from-conditions" | "getCell" | "getCells" | "getCellNamesInSheet" | "debugCell" | "create-query" | "query" | "account-update" | "accounts-get" | "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-status" | "simplefin-status" | "simplefin-accounts" | "simplefin-batch-sync" | "gocardless-get-banks" | "gocardless-poll-web-token-stop" | "gocardless-create-web-token" | "accounts-bank-sync" | "transactions-import" | "account-unlink" | "save-global-prefs" | "load-global-prefs" | "save-prefs" | "load-prefs" | "sync-reset" | "sync-repair" | "key-make" | "key-test" | "get-did-bootstrap" | "subscribe-needs-bootstrap" | "subscribe-get-login-methods" | "subscribe-bootstrap" | "subscribe-get-user" | "subscribe-change-password" | "subscribe-sign-in" | "subscribe-sign-out" | "subscribe-set-token" | "get-server-version" | "get-server-url" | "set-server-url" | "validate-budget-name" | "unique-budget-name" | "get-budgets" | "get-remote-files" | "get-user-file-info" | "reset-budget-cache" | "upload-budget" | "download-budget" | "sync-budget" | "load-budget" | "create-demo-budget" | "close-budget" | "delete-budget" | "duplicate-budget" | "create-budget" | "import-budget" | "export-budget" | "upload-file-web" | "backups-get" | "backup-load" | "backup-make" | "get-last-opened-backup" | "app-focused" | "enable-openid" | "enable-password" | "get-openid-config" | "api/batch-budget-start" | "api/batch-budget-end" | "api/load-budget" | "api/download-budget" | "api/get-budgets" | "api/start-import" | "api/finish-import" | "api/abort-import" | "api/query" | "api/budget-months" | "api/budget-month" | "api/budget-set-amount" | "api/budget-set-carryover" | "api/budget-hold-for-next-month" | "api/budget-reset-hold" | "api/transactions-export" | "api/transactions-import" | "api/transactions-add" | "api/transactions-get" | "api/transaction-update" | "api/transaction-delete" | "api/sync" | "api/bank-sync" | "api/accounts-get" | "api/account-create" | "api/account-update" | "api/account-close" | "api/account-reopen" | "api/account-delete" | "api/account-balance" | "api/categories-get" | "api/category-groups-get" | "api/category-group-create" | "api/category-group-update" | "api/category-group-delete" | "api/category-create" | "api/category-update" | "api/category-delete" | "api/payees-get" | "api/common-payees-get" | "api/payee-create" | "api/payee-update" | "api/payee-delete" | "api/payees-merge" | "api/rules-get" | "api/payee-rules-get" | "api/rule-create" | "api/rule-update" | "api/rule-delete" | "budget/budget-amount" | "budget/copy-previous-month" | "budget/set-zero" | "budget/set-3month-avg" | "budget/check-templates" | "budget/apply-goal-template" | "budget/overwrite-goal-template" | "budget/cleanup-goal-template" | "budget/hold-for-next-month" | "budget/reset-hold" | "budget/cover-overspending" | "budget/transfer-available" | "budget/cover-overbudgeted" | "budget/transfer-category" | "budget/set-carryover" | "budget/apply-single-template" | "budget/set-n-month-avg" | "budget/copy-single-month" | "budget/apply-multiple-templates" | "dashboard-update" | "dashboard-update-widget" | "dashboard-reset" | "dashboard-add-widget" | "dashboard-remove-widget" | "dashboard-import" | "filter-create" | "filter-update" | "filter-delete" | "notes-save" | "preferences/save" | "preferences/get" | "report/create" | "report/update" | "report/delete" | "rule-validate" | "rule-add" | "rule-update" | "rule-delete" | "rule-delete-all" | "rule-apply-actions" | "rule-add-payee-rename" | "rules-get" | "rule-get" | "rules-run" | "schedule/create" | "schedule/update" | "schedule/delete" | "schedule/skip-next-date" | "schedule/post-transaction" | "schedule/force-run-service" | "schedule/discover" | "schedule/get-upcoming-dates" | "users-get" | "user-delete-all" | "user-add" | "user-update" | "access-add" | "access-delete-all" | "access-get-available-users" | "transfer-ownership" | "owner-created" | "tools/fix-split-transactions">(name: Name, func: Handlers[Name]): void;
|
|
8
8
|
service(func: any): void;
|
|
9
9
|
combine(...apps: any[]): void;
|
|
10
10
|
startServices(): void;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export declare function post(url: any, data: any, headers?: {}, timeout?: any): Promise<any>;
|
|
2
|
+
export declare function del(url: any, data: any, headers?: {}, timeout?: any): Promise<any>;
|
|
3
|
+
export declare function patch(url: any, data: any, headers?: {}, timeout?: any): Promise<any>;
|
|
2
4
|
export declare function postBinary(url: any, data: any, headers: any): Promise<any>;
|
|
3
5
|
export declare function get(url: any, opts?: any): Promise<string>;
|
|
@@ -5,6 +5,7 @@ type ServerConfig = {
|
|
|
5
5
|
GOCARDLESS_SERVER: string;
|
|
6
6
|
SIMPLEFIN_SERVER: string;
|
|
7
7
|
};
|
|
8
|
+
export declare function isValidBaseURL(base: string): boolean;
|
|
8
9
|
export declare function setServer(url: string): void;
|
|
9
10
|
export declare function getServer(url?: string): ServerConfig | null;
|
|
10
11
|
export {};
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export declare function
|
|
2
|
-
export declare function
|
|
1
|
+
export declare function uniqueBudgetName(initialName?: string): Promise<string>;
|
|
2
|
+
export declare function validateBudgetName(name: string): Promise<{
|
|
3
|
+
valid: boolean;
|
|
4
|
+
message?: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function idFromBudgetName(name: string): Promise<string>;
|
|
@@ -20,3 +20,6 @@ export declare class LazyLoadFailedError extends Error {
|
|
|
20
20
|
meta: {};
|
|
21
21
|
constructor(name: string, cause: unknown);
|
|
22
22
|
}
|
|
23
|
+
export declare function getUserAccessErrors(reason: string): string;
|
|
24
|
+
export declare function getSecretsError(error: string, reason: string): string;
|
|
25
|
+
export declare function getOpenIdErrors(reason: string): string;
|
|
@@ -54,7 +54,7 @@ export declare function getYearStart(month: string): string;
|
|
|
54
54
|
export declare function getYearEnd(month: string): string;
|
|
55
55
|
export declare function sheetForMonth(month: string): string;
|
|
56
56
|
export declare function nameForMonth(month: DateLike): string;
|
|
57
|
-
export declare function format(month: DateLike,
|
|
57
|
+
export declare function format(month: DateLike, format: string): string;
|
|
58
58
|
export declare const getDateFormatRegex: import("memoize-one").MemoizedFn<(format: string) => RegExp>;
|
|
59
59
|
export declare const getDayMonthFormat: import("memoize-one").MemoizedFn<(format: string) => string>;
|
|
60
60
|
export declare const getDayMonthRegex: import("memoize-one").MemoizedFn<(format: string) => RegExp>;
|
|
@@ -1,31 +1,46 @@
|
|
|
1
|
+
import { WithRequired } from '../types/util';
|
|
2
|
+
type ObjectExpression = {
|
|
3
|
+
[key: string]: ObjectExpression | unknown;
|
|
4
|
+
};
|
|
1
5
|
export type QueryState = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
get table(): string;
|
|
7
|
+
get tableOptions(): Readonly<Record<string, unknown>>;
|
|
8
|
+
get filterExpressions(): ReadonlyArray<ObjectExpression>;
|
|
9
|
+
get selectExpressions(): ReadonlyArray<ObjectExpression | string | '*'>;
|
|
10
|
+
get groupExpressions(): ReadonlyArray<ObjectExpression | string>;
|
|
11
|
+
get orderExpressions(): ReadonlyArray<ObjectExpression | string>;
|
|
12
|
+
get calculation(): boolean;
|
|
13
|
+
get rawMode(): boolean;
|
|
14
|
+
get withDead(): boolean;
|
|
15
|
+
get validateRefs(): boolean;
|
|
16
|
+
get limit(): number | null;
|
|
17
|
+
get offset(): number | null;
|
|
12
18
|
};
|
|
13
19
|
export declare class Query {
|
|
14
20
|
state: QueryState;
|
|
15
|
-
constructor(state:
|
|
16
|
-
filter(expr:
|
|
17
|
-
unfilter(exprs
|
|
18
|
-
select(exprs?: Array<
|
|
19
|
-
calculate(expr:
|
|
20
|
-
groupBy(exprs:
|
|
21
|
-
orderBy(exprs:
|
|
22
|
-
limit(num:
|
|
23
|
-
offset(num:
|
|
21
|
+
constructor(state: WithRequired<Partial<QueryState>, 'table'>);
|
|
22
|
+
filter(expr: ObjectExpression): Query;
|
|
23
|
+
unfilter(exprs?: Array<keyof ObjectExpression>): Query;
|
|
24
|
+
select(exprs?: Array<ObjectExpression | string> | ObjectExpression | string | '*' | ['*']): Query;
|
|
25
|
+
calculate(expr: ObjectExpression | string): Query;
|
|
26
|
+
groupBy(exprs: ObjectExpression | string | Array<ObjectExpression | string>): Query;
|
|
27
|
+
orderBy(exprs: ObjectExpression | string | Array<ObjectExpression | string>): Query;
|
|
28
|
+
limit(num: number): Query;
|
|
29
|
+
offset(num: number): Query;
|
|
24
30
|
raw(): Query;
|
|
25
31
|
withDead(): Query;
|
|
26
32
|
withoutValidatedRefs(): Query;
|
|
27
|
-
options(opts:
|
|
33
|
+
options(opts: Record<string, unknown>): Query;
|
|
34
|
+
reset(): Query;
|
|
28
35
|
serialize(): QueryState;
|
|
36
|
+
serializeAsString(): string;
|
|
29
37
|
}
|
|
30
|
-
export declare function getPrimaryOrderBy(query:
|
|
31
|
-
|
|
38
|
+
export declare function getPrimaryOrderBy(query: Query, defaultOrderBy: ObjectExpression | null): {
|
|
39
|
+
order: string;
|
|
40
|
+
field?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
field: string;
|
|
43
|
+
order: unknown;
|
|
44
|
+
};
|
|
45
|
+
export declare function q(table: QueryState['table']): Query;
|
|
46
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FieldValueTypes, RuleConditionOp } from '../types/models';
|
|
2
2
|
export declare const FIELD_TYPES: Map<keyof FieldValueTypes, string>;
|
|
3
|
-
export declare function isValidOp(field: keyof FieldValueTypes, op: RuleConditionOp):
|
|
3
|
+
export declare function isValidOp(field: keyof FieldValueTypes, op: RuleConditionOp): any;
|
|
4
4
|
export declare function getValidOps(field: keyof FieldValueTypes): any;
|
|
5
5
|
export declare const ALLOCATION_METHODS: {
|
|
6
6
|
'fixed-amount': string;
|
|
@@ -8,7 +8,7 @@ export declare const ALLOCATION_METHODS: {
|
|
|
8
8
|
remainder: string;
|
|
9
9
|
};
|
|
10
10
|
export declare function mapField(field: any, opts?: any): any;
|
|
11
|
-
export declare function friendlyOp(op: any, type?: any):
|
|
11
|
+
export declare function friendlyOp(op: any, type?: any): string;
|
|
12
12
|
export declare function deserializeField(field: any): {
|
|
13
13
|
field: string;
|
|
14
14
|
options: {
|
|
@@ -39,5 +39,8 @@ export declare function extractScheduleConds(conditions: any): {
|
|
|
39
39
|
amount: any;
|
|
40
40
|
date: any;
|
|
41
41
|
};
|
|
42
|
-
export declare function getScheduledAmount(amount:
|
|
42
|
+
export declare function getScheduledAmount(amount: number | {
|
|
43
|
+
num1: number;
|
|
44
|
+
num2: number;
|
|
45
|
+
}, inverse?: boolean): number;
|
|
43
46
|
export declare function describeSchedule(schedule: any, payee: any): string;
|
|
@@ -28,7 +28,6 @@ export declare function titleFirst(str: string): string;
|
|
|
28
28
|
export declare function appendDecimals(amountText: string, hideDecimals?: boolean): string;
|
|
29
29
|
declare const NUMBER_FORMATS: readonly ["comma-dot", "dot-comma", "space-comma", "apostrophe-dot", "comma-dot", "comma-dot-in"];
|
|
30
30
|
type NumberFormats = (typeof NUMBER_FORMATS)[number];
|
|
31
|
-
export declare function isNumberFormat(input?: string): input is NumberFormats;
|
|
32
31
|
export declare const numberFormats: Array<{
|
|
33
32
|
value: NumberFormats;
|
|
34
33
|
label: string;
|
|
@@ -38,6 +37,13 @@ declare let numberFormatConfig: {
|
|
|
38
37
|
format: NumberFormats;
|
|
39
38
|
hideFraction: boolean;
|
|
40
39
|
};
|
|
40
|
+
export declare function parseNumberFormat({ format, hideFraction, }: {
|
|
41
|
+
format?: string;
|
|
42
|
+
hideFraction?: string | boolean;
|
|
43
|
+
}): {
|
|
44
|
+
format: "comma-dot" | "dot-comma" | "space-comma" | "apostrophe-dot" | "comma-dot-in";
|
|
45
|
+
hideFraction: boolean;
|
|
46
|
+
};
|
|
41
47
|
export declare function setNumberFormat(config: typeof numberFormatConfig): void;
|
|
42
48
|
export declare function getNumberFormat({ format, hideFraction, }?: {
|
|
43
49
|
format?: NumberFormats;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { UsersWithAccess } from '../server/cloud-storage';
|
|
2
|
+
|
|
1
3
|
import { Budget } from './budget';
|
|
2
4
|
|
|
3
5
|
export type FileState =
|
|
@@ -18,6 +20,7 @@ export type SyncableLocalFile = Budget & {
|
|
|
18
20
|
groupId: string;
|
|
19
21
|
state: 'broken' | 'unknown';
|
|
20
22
|
hasKey: boolean;
|
|
23
|
+
owner: string;
|
|
21
24
|
};
|
|
22
25
|
|
|
23
26
|
export type SyncedLocalFile = Budget & {
|
|
@@ -26,6 +29,8 @@ export type SyncedLocalFile = Budget & {
|
|
|
26
29
|
encryptKeyId?: string;
|
|
27
30
|
hasKey: boolean;
|
|
28
31
|
state: 'synced' | 'detached';
|
|
32
|
+
owner: string;
|
|
33
|
+
usersWithAccess: UsersWithAccess[];
|
|
29
34
|
};
|
|
30
35
|
|
|
31
36
|
export type RemoteFile = {
|
|
@@ -35,6 +40,8 @@ export type RemoteFile = {
|
|
|
35
40
|
encryptKeyId?: string;
|
|
36
41
|
hasKey: boolean;
|
|
37
42
|
state: 'remote';
|
|
43
|
+
owner: string;
|
|
44
|
+
usersWithAccess: UsersWithAccess[];
|
|
38
45
|
};
|
|
39
46
|
|
|
40
47
|
export type File = LocalFile | SyncableLocalFile | SyncedLocalFile | RemoteFile;
|