@actual-app/api 25.1.0 → 25.2.1
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/constants.d.ts +0 -11
- package/@types/loot-core/client/state-types/index.d.ts +0 -14
- package/@types/loot-core/client/state-types/modals.d.ts +7 -2
- package/@types/loot-core/mocks/index.d.ts +9 -20
- package/@types/loot-core/platform/client/fetch/index.d.ts +10 -1
- package/@types/loot-core/platform/client/undo/index.d.ts +8 -4
- package/@types/loot-core/platform/server/connection/index.d.ts +1 -1
- package/@types/loot-core/server/accounts/sync.d.ts +1 -1
- package/@types/loot-core/server/accounts/transaction-rules.d.ts +0 -3
- package/@types/loot-core/server/accounts/transactions.d.ts +0 -3
- package/@types/loot-core/server/accounts/transfer.d.ts +0 -11
- package/@types/loot-core/server/admin/app.d.ts +9 -4
- package/@types/loot-core/server/admin/types/handlers.d.ts +4 -2
- package/@types/loot-core/server/app.d.ts +14 -4
- package/@types/loot-core/server/aql/compiler.d.ts +4 -6
- package/@types/loot-core/server/aql/schema/index.d.ts +3 -0
- package/@types/loot-core/server/budget/actions.d.ts +6 -0
- package/@types/loot-core/server/budget/app.d.ts +10 -5
- package/@types/loot-core/server/budget/types/handlers.d.ts +4 -0
- package/@types/loot-core/server/dashboard/app.d.ts +9 -4
- package/@types/loot-core/server/filters/app.d.ts +9 -4
- package/@types/loot-core/server/importers/ynab4-types.d.ts +0 -2
- package/@types/loot-core/server/importers/ynab5-types.d.ts +0 -2
- package/@types/loot-core/server/main-app.d.ts +10 -5
- package/@types/loot-core/server/main.d.ts +2 -2
- package/@types/loot-core/server/notes/app.d.ts +9 -4
- package/@types/loot-core/server/preferences/app.d.ts +9 -4
- package/@types/loot-core/server/reports/app.d.ts +11 -4
- package/@types/loot-core/server/rules/app.d.ts +9 -4
- package/@types/loot-core/server/rules/types/handlers.d.ts +4 -4
- package/@types/loot-core/server/schedules/app.d.ts +10 -7
- package/@types/loot-core/server/schedules/types/handlers.d.ts +5 -5
- package/@types/loot-core/server/tools/app.d.ts +9 -4
- package/@types/loot-core/server/tools/types/handlers.d.ts +2 -1
- package/@types/loot-core/shared/schedules.d.ts +5 -31
- package/@types/loot-core/shared/transactions.d.ts +101 -17
- package/@types/loot-core/shared/util.d.ts +23 -9
- package/@types/loot-core/types/api-handlers.d.ts +3 -0
- package/@types/loot-core/types/models/dashboard.d.ts +1 -1
- package/@types/loot-core/types/models/payee.d.ts +1 -0
- package/@types/loot-core/types/models/reports.d.ts +4 -0
- package/@types/loot-core/types/models/rule.d.ts +6 -4
- package/@types/loot-core/types/models/schedule.d.ts +5 -18
- package/@types/loot-core/types/models/simplefin.d.ts +2 -0
- package/@types/loot-core/types/models/transaction.d.ts +6 -0
- package/@types/loot-core/types/prefs.d.ts +3 -2
- package/@types/loot-core/types/server-events.d.ts +80 -17
- package/@types/loot-core/types/server-handlers.d.ts +19 -7
- package/@types/loot-core/types/util.d.ts +5 -0
- package/@types/methods.d.ts +4 -4
- package/dist/app/bundle.api.js +334 -187
- package/dist/methods.js +4 -1
- package/dist/migrations/1736640000000__custom_report_sorting.sql +7 -0
- package/dist/migrations/1737158400000_add_learn_categories_to_payees.sql +5 -0
- package/dist/migrations/1738491452000__sorting_rename.sql +13 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/@types/loot-core/client/actions/types.d.ts +0 -6
- package/@types/loot-core/client/state-types/account.d.ts +0 -27
- package/@types/loot-core/client/state-types/app.d.ts +0 -42
- package/@types/loot-core/client/state-types/queries.d.ts +0 -76
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { RulesHandlers } from './types/handlers';
|
|
2
2
|
export declare const app: {
|
|
3
|
-
events:
|
|
3
|
+
events: import("mitt").Emitter<{
|
|
4
|
+
sync: import("../../types/server-events").ServerEvents["sync-event"];
|
|
5
|
+
'load-budget': {
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
}>;
|
|
4
9
|
handlers: RulesHandlers;
|
|
5
|
-
services:
|
|
6
|
-
unlistenServices:
|
|
10
|
+
services: (() => () => void)[];
|
|
11
|
+
unlistenServices: (() => void)[];
|
|
7
12
|
method<Name extends "rule-validate" | "rule-add" | "rule-update" | "rule-delete" | "rule-delete-all" | "rule-apply-actions" | "rule-add-payee-rename" | "rules-get" | "rule-get" | "rules-run">(name: Name, func: RulesHandlers[Name]): void;
|
|
8
|
-
service(func:
|
|
13
|
+
service(func: () => () => void): void;
|
|
9
14
|
combine(...apps: any[]): void;
|
|
10
15
|
startServices(): void;
|
|
11
16
|
stopServices(): void;
|
|
@@ -31,10 +31,10 @@ export interface RulesHandlers {
|
|
|
31
31
|
}) => Promise<string>;
|
|
32
32
|
'rules-get': () => Promise<RuleEntity[]>;
|
|
33
33
|
'rule-get': (arg: {
|
|
34
|
-
id:
|
|
35
|
-
}) => Promise<
|
|
34
|
+
id: RuleEntity['id'];
|
|
35
|
+
}) => Promise<RuleEntity>;
|
|
36
36
|
'rules-run': (arg: {
|
|
37
|
-
transaction:
|
|
38
|
-
}) => Promise<
|
|
37
|
+
transaction: TransactionEntity;
|
|
38
|
+
}) => Promise<TransactionEntity>;
|
|
39
39
|
}
|
|
40
40
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Rule } from '../accounts/rules';
|
|
2
2
|
import { SchedulesHandlers } from './types/handlers';
|
|
3
3
|
export declare function updateConditions(conditions: any, newConditions: any): any;
|
|
4
|
-
export declare function getNextDate(dateCond: any, start?: Date, noSkipWeekend?: boolean): any;
|
|
5
4
|
export declare function getRuleForSchedule(id: string | null): Promise<Rule>;
|
|
6
5
|
export declare function setNextDate({ id, start, conditions, reset, }: {
|
|
7
6
|
id: string;
|
|
@@ -17,19 +16,23 @@ export declare function updateSchedule({ schedule, conditions, resetNextDate, }:
|
|
|
17
16
|
schedule: any;
|
|
18
17
|
conditions?: any;
|
|
19
18
|
resetNextDate?: boolean;
|
|
20
|
-
}): Promise<
|
|
19
|
+
}): Promise<any>;
|
|
21
20
|
export declare function deleteSchedule({ id }: {
|
|
22
21
|
id: any;
|
|
23
22
|
}): Promise<void>;
|
|
24
23
|
export declare const app: {
|
|
25
|
-
events:
|
|
24
|
+
events: import("mitt").Emitter<{
|
|
25
|
+
sync: import("../../types/server-events").ServerEvents["sync-event"];
|
|
26
|
+
'load-budget': {
|
|
27
|
+
id: string;
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
26
30
|
handlers: SchedulesHandlers;
|
|
27
|
-
services:
|
|
28
|
-
unlistenServices:
|
|
31
|
+
services: (() => () => void)[];
|
|
32
|
+
unlistenServices: (() => void)[];
|
|
29
33
|
method<Name extends "schedule/create" | "schedule/update" | "schedule/delete" | "schedule/skip-next-date" | "schedule/post-transaction" | "schedule/force-run-service" | "schedule/discover" | "schedule/get-upcoming-dates">(name: Name, func: SchedulesHandlers[Name]): void;
|
|
30
|
-
service(func:
|
|
34
|
+
service(func: () => () => void): void;
|
|
31
35
|
combine(...apps: any[]): void;
|
|
32
36
|
startServices(): void;
|
|
33
37
|
stopServices(): void;
|
|
34
38
|
};
|
|
35
|
-
export declare function getDateWithSkippedWeekend(date: Date, solveMode: 'after' | 'before'): Date;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DiscoverScheduleEntity } from '../../../types/models';
|
|
1
|
+
import { DiscoverScheduleEntity, ScheduleEntity } from '../../../types/models';
|
|
2
2
|
export interface SchedulesHandlers {
|
|
3
3
|
'schedule/create': (arg: {
|
|
4
4
|
schedule: {
|
|
@@ -12,15 +12,15 @@ export interface SchedulesHandlers {
|
|
|
12
12
|
schedule: any;
|
|
13
13
|
conditions?: any;
|
|
14
14
|
resetNextDate?: boolean;
|
|
15
|
-
}) => Promise<
|
|
15
|
+
}) => Promise<ScheduleEntity['id']>;
|
|
16
16
|
'schedule/delete': (arg: {
|
|
17
|
-
id:
|
|
17
|
+
id: ScheduleEntity['id'];
|
|
18
18
|
}) => Promise<void>;
|
|
19
19
|
'schedule/skip-next-date': (arg: {
|
|
20
|
-
id:
|
|
20
|
+
id: ScheduleEntity['id'];
|
|
21
21
|
}) => Promise<void>;
|
|
22
22
|
'schedule/post-transaction': (arg: {
|
|
23
|
-
id:
|
|
23
|
+
id: ScheduleEntity['id'];
|
|
24
24
|
}) => Promise<void>;
|
|
25
25
|
'schedule/force-run-service': () => Promise<unknown>;
|
|
26
26
|
'schedule/discover': () => Promise<DiscoverScheduleEntity[]>;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { ToolsHandlers } from './types/handlers';
|
|
2
2
|
export declare const app: {
|
|
3
|
-
events:
|
|
3
|
+
events: import("mitt").Emitter<{
|
|
4
|
+
sync: import("../../types/server-events").ServerEvents["sync-event"];
|
|
5
|
+
'load-budget': {
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
}>;
|
|
4
9
|
handlers: ToolsHandlers;
|
|
5
|
-
services:
|
|
6
|
-
unlistenServices:
|
|
10
|
+
services: (() => () => void)[];
|
|
11
|
+
unlistenServices: (() => void)[];
|
|
7
12
|
method<Name extends "tools/fix-split-transactions">(name: Name, func: ToolsHandlers[Name]): void;
|
|
8
|
-
service(func:
|
|
13
|
+
service(func: () => () => void): void;
|
|
9
14
|
combine(...apps: any[]): void;
|
|
10
15
|
startServices(): void;
|
|
11
16
|
stopServices(): void;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { TransactionEntity } from '
|
|
1
|
+
import { TransactionEntity } from '../../../types/models';
|
|
2
2
|
|
|
3
3
|
export interface ToolsHandlers {
|
|
4
4
|
'tools/fix-split-transactions': () => Promise<{
|
|
5
5
|
numBlankPayees: number;
|
|
6
6
|
numCleared: number;
|
|
7
7
|
numDeleted: number;
|
|
8
|
+
numTransfersFixed: number;
|
|
8
9
|
mismatchedSplits: TransactionEntity[];
|
|
9
10
|
}>;
|
|
10
11
|
}
|
|
@@ -2,45 +2,19 @@ import type { IRuleOptions } from '@rschedule/core';
|
|
|
2
2
|
export declare function getStatus(nextDate: string, completed: boolean, hasTrans: boolean, upcomingLength: string): "completed" | "paid" | "due" | "upcoming" | "missed" | "scheduled";
|
|
3
3
|
export declare function getHasTransactionsQuery(schedules: any): import("./query").Query;
|
|
4
4
|
export declare function getRecurringDescription(config: any, dateFormat: any): string;
|
|
5
|
-
export declare function recurConfigToRSchedule(config: any): IRuleOptions[]
|
|
6
|
-
byDayOfMonth: any;
|
|
7
|
-
start: import("@rschedule/core").RuleOption.Start;
|
|
8
|
-
end?: import("@rschedule/core").RuleOption.End;
|
|
9
|
-
duration?: import("@rschedule/core").RuleOption.Duration;
|
|
10
|
-
count?: import("@rschedule/core").RuleOption.Count;
|
|
11
|
-
frequency: import("@rschedule/core").RuleOption.Frequency;
|
|
12
|
-
interval?: import("@rschedule/core").RuleOption.Interval;
|
|
13
|
-
weekStart?: import("@rschedule/core").RuleOption.WeekStart;
|
|
14
|
-
byDayOfWeek?: import("@rschedule/core").RuleOption.ByDayOfWeek[];
|
|
15
|
-
byHourOfDay?: import("@rschedule/core").RuleOption.ByHourOfDay[];
|
|
16
|
-
byMillisecondOfSecond?: import("@rschedule/core").RuleOption.ByMillisecondOfSecond[];
|
|
17
|
-
byMinuteOfHour?: import("@rschedule/core").RuleOption.ByMinuteOfHour[];
|
|
18
|
-
byMonthOfYear?: import("@rschedule/core").RuleOption.ByMonthOfYear[];
|
|
19
|
-
bySecondOfMinute?: import("@rschedule/core").RuleOption.BySecondOfMinute[];
|
|
20
|
-
} | {
|
|
21
|
-
byDayOfWeek: any;
|
|
22
|
-
start: import("@rschedule/core").RuleOption.Start;
|
|
23
|
-
end?: import("@rschedule/core").RuleOption.End;
|
|
24
|
-
duration?: import("@rschedule/core").RuleOption.Duration;
|
|
25
|
-
count?: import("@rschedule/core").RuleOption.Count;
|
|
26
|
-
frequency: import("@rschedule/core").RuleOption.Frequency;
|
|
27
|
-
interval?: import("@rschedule/core").RuleOption.Interval;
|
|
28
|
-
weekStart?: import("@rschedule/core").RuleOption.WeekStart;
|
|
29
|
-
byDayOfMonth?: import("@rschedule/core").RuleOption.ByDayOfMonth[];
|
|
30
|
-
byHourOfDay?: import("@rschedule/core").RuleOption.ByHourOfDay[];
|
|
31
|
-
byMillisecondOfSecond?: import("@rschedule/core").RuleOption.ByMillisecondOfSecond[];
|
|
32
|
-
byMinuteOfHour?: import("@rschedule/core").RuleOption.ByMinuteOfHour[];
|
|
33
|
-
byMonthOfYear?: import("@rschedule/core").RuleOption.ByMonthOfYear[];
|
|
34
|
-
bySecondOfMinute?: import("@rschedule/core").RuleOption.BySecondOfMinute[];
|
|
35
|
-
})[];
|
|
5
|
+
export declare function recurConfigToRSchedule(config: any): IRuleOptions[];
|
|
36
6
|
export declare function extractScheduleConds(conditions: any): {
|
|
37
7
|
payee: any;
|
|
38
8
|
account: any;
|
|
39
9
|
amount: any;
|
|
40
10
|
date: any;
|
|
41
11
|
};
|
|
12
|
+
export declare function getNextDate(dateCond: any, start?: Date, noSkipWeekend?: boolean): any;
|
|
13
|
+
export declare function getDateWithSkippedWeekend(date: Date, solveMode: 'after' | 'before'): Date;
|
|
42
14
|
export declare function getScheduledAmount(amount: number | {
|
|
43
15
|
num1: number;
|
|
44
16
|
num2: number;
|
|
45
17
|
}, inverse?: boolean): number;
|
|
46
18
|
export declare function describeSchedule(schedule: any, payee: any): string;
|
|
19
|
+
export declare function getUpcomingDays(upcomingLength?: string): number;
|
|
20
|
+
export declare function scheduleIsRecurring(dateCond: any): boolean;
|
|
@@ -1,41 +1,119 @@
|
|
|
1
1
|
import { type TransactionEntity } from '../types/models';
|
|
2
2
|
import { diffItems, applyChanges } from './util';
|
|
3
|
-
interface TransactionEntityWithError extends TransactionEntity {
|
|
4
|
-
error: ReturnType<typeof SplitTransactionError> | null;
|
|
5
|
-
_deleted?: boolean;
|
|
6
|
-
}
|
|
7
3
|
export declare function isTemporaryId(id: string): boolean;
|
|
8
4
|
export declare function isPreviewId(id: string): boolean;
|
|
9
|
-
|
|
10
|
-
type: string;
|
|
11
|
-
version: number;
|
|
12
|
-
difference: number;
|
|
13
|
-
};
|
|
14
|
-
type GenericTransactionEntity = TransactionEntity | TransactionEntityWithError;
|
|
5
|
+
type GenericTransactionEntity = TransactionEntity;
|
|
15
6
|
export declare function makeChild<T extends GenericTransactionEntity>(parent: T, data?: object): T;
|
|
16
|
-
export declare function recalculateSplit(trans: TransactionEntity):
|
|
7
|
+
export declare function recalculateSplit(trans: TransactionEntity): {
|
|
8
|
+
error: {
|
|
9
|
+
type: "SplitTransactionError";
|
|
10
|
+
version: 1;
|
|
11
|
+
difference: number;
|
|
12
|
+
};
|
|
13
|
+
id: string;
|
|
14
|
+
is_parent?: boolean;
|
|
15
|
+
is_child?: boolean;
|
|
16
|
+
parent_id?: TransactionEntity["id"];
|
|
17
|
+
account: import("../types/models").AccountEntity["id"];
|
|
18
|
+
category?: import("../types/models").CategoryEntity["id"];
|
|
19
|
+
amount: number;
|
|
20
|
+
payee?: import("../types/models").PayeeEntity["id"];
|
|
21
|
+
notes?: string;
|
|
22
|
+
date: string;
|
|
23
|
+
imported_id?: string;
|
|
24
|
+
imported_payee?: string;
|
|
25
|
+
starting_balance_flag?: boolean;
|
|
26
|
+
transfer_id?: TransactionEntity["id"];
|
|
27
|
+
sort_order?: number;
|
|
28
|
+
cleared?: boolean;
|
|
29
|
+
reconciled?: boolean;
|
|
30
|
+
tombstone?: boolean;
|
|
31
|
+
forceUpcoming?: boolean;
|
|
32
|
+
schedule?: import("../types/models").ScheduleEntity["id"];
|
|
33
|
+
subtransactions?: TransactionEntity[];
|
|
34
|
+
_unmatched?: boolean;
|
|
35
|
+
_deleted?: boolean;
|
|
36
|
+
};
|
|
17
37
|
export declare function ungroupTransactions(transactions: TransactionEntity[]): TransactionEntity[];
|
|
18
|
-
export declare function groupTransaction(split: TransactionEntity[]):
|
|
38
|
+
export declare function groupTransaction(split: TransactionEntity[]): {
|
|
39
|
+
subtransactions: TransactionEntity[];
|
|
40
|
+
id: string;
|
|
41
|
+
is_parent?: boolean;
|
|
42
|
+
is_child?: boolean;
|
|
43
|
+
parent_id?: TransactionEntity["id"];
|
|
44
|
+
account: import("../types/models").AccountEntity["id"];
|
|
45
|
+
category?: import("../types/models").CategoryEntity["id"];
|
|
46
|
+
amount: number;
|
|
47
|
+
payee?: import("../types/models").PayeeEntity["id"];
|
|
48
|
+
notes?: string;
|
|
49
|
+
date: string;
|
|
50
|
+
imported_id?: string;
|
|
51
|
+
imported_payee?: string;
|
|
52
|
+
starting_balance_flag?: boolean;
|
|
53
|
+
transfer_id?: TransactionEntity["id"];
|
|
54
|
+
sort_order?: number;
|
|
55
|
+
cleared?: boolean;
|
|
56
|
+
reconciled?: boolean;
|
|
57
|
+
tombstone?: boolean;
|
|
58
|
+
forceUpcoming?: boolean;
|
|
59
|
+
schedule?: import("../types/models").ScheduleEntity["id"];
|
|
60
|
+
_unmatched?: boolean;
|
|
61
|
+
_deleted?: boolean;
|
|
62
|
+
error?: {
|
|
63
|
+
type: "SplitTransactionError";
|
|
64
|
+
version: 1;
|
|
65
|
+
difference: number;
|
|
66
|
+
} | null;
|
|
67
|
+
};
|
|
19
68
|
export declare function ungroupTransaction(split: TransactionEntity | null): TransactionEntity[];
|
|
20
|
-
export declare function applyTransactionDiff(groupedTrans: Parameters<typeof ungroupTransaction>[0], diff: Parameters<typeof applyChanges>[0]):
|
|
69
|
+
export declare function applyTransactionDiff(groupedTrans: Parameters<typeof ungroupTransaction>[0], diff: Parameters<typeof applyChanges>[0]): {
|
|
70
|
+
subtransactions: TransactionEntity[];
|
|
71
|
+
id: string;
|
|
72
|
+
is_parent?: boolean;
|
|
73
|
+
is_child?: boolean;
|
|
74
|
+
parent_id?: TransactionEntity["id"];
|
|
75
|
+
account: import("../types/models").AccountEntity["id"];
|
|
76
|
+
category?: import("../types/models").CategoryEntity["id"];
|
|
77
|
+
amount: number;
|
|
78
|
+
payee?: import("../types/models").PayeeEntity["id"];
|
|
79
|
+
notes?: string;
|
|
80
|
+
date: string;
|
|
81
|
+
imported_id?: string;
|
|
82
|
+
imported_payee?: string;
|
|
83
|
+
starting_balance_flag?: boolean;
|
|
84
|
+
transfer_id?: TransactionEntity["id"];
|
|
85
|
+
sort_order?: number;
|
|
86
|
+
cleared?: boolean;
|
|
87
|
+
reconciled?: boolean;
|
|
88
|
+
tombstone?: boolean;
|
|
89
|
+
forceUpcoming?: boolean;
|
|
90
|
+
schedule?: import("../types/models").ScheduleEntity["id"];
|
|
91
|
+
_unmatched?: boolean;
|
|
92
|
+
_deleted?: boolean;
|
|
93
|
+
error?: {
|
|
94
|
+
type: "SplitTransactionError";
|
|
95
|
+
version: 1;
|
|
96
|
+
difference: number;
|
|
97
|
+
} | null;
|
|
98
|
+
};
|
|
21
99
|
export declare function addSplitTransaction(transactions: TransactionEntity[], id: string): {
|
|
22
100
|
data: TransactionEntity[];
|
|
23
|
-
newTransaction: TransactionEntity |
|
|
101
|
+
newTransaction: TransactionEntity | null;
|
|
24
102
|
diff: ReturnType<typeof diffItems<TransactionEntity>>;
|
|
25
103
|
};
|
|
26
104
|
export declare function updateTransaction(transactions: TransactionEntity[], transaction: TransactionEntity): {
|
|
27
105
|
data: TransactionEntity[];
|
|
28
|
-
newTransaction: TransactionEntity |
|
|
106
|
+
newTransaction: TransactionEntity | null;
|
|
29
107
|
diff: ReturnType<typeof diffItems<TransactionEntity>>;
|
|
30
108
|
};
|
|
31
109
|
export declare function deleteTransaction(transactions: TransactionEntity[], id: string): {
|
|
32
110
|
data: TransactionEntity[];
|
|
33
|
-
newTransaction: TransactionEntity |
|
|
111
|
+
newTransaction: TransactionEntity | null;
|
|
34
112
|
diff: ReturnType<typeof diffItems<TransactionEntity>>;
|
|
35
113
|
};
|
|
36
114
|
export declare function splitTransaction(transactions: TransactionEntity[], id: string, createSubtransactions?: (parentTransaction: TransactionEntity) => TransactionEntity[]): {
|
|
37
115
|
data: TransactionEntity[];
|
|
38
|
-
newTransaction: TransactionEntity |
|
|
116
|
+
newTransaction: TransactionEntity | null;
|
|
39
117
|
diff: ReturnType<typeof diffItems<TransactionEntity>>;
|
|
40
118
|
};
|
|
41
119
|
export declare function realizeTempTransactions(transactions: TransactionEntity[]): TransactionEntity[];
|
|
@@ -60,10 +138,16 @@ export declare function makeAsNonChildTransactions(childTransactionsToUpdate: Tr
|
|
|
60
138
|
cleared?: boolean;
|
|
61
139
|
reconciled?: boolean;
|
|
62
140
|
tombstone?: boolean;
|
|
141
|
+
forceUpcoming?: boolean;
|
|
63
142
|
schedule?: import("../types/models").ScheduleEntity["id"];
|
|
64
143
|
subtransactions?: TransactionEntity[];
|
|
65
144
|
_unmatched?: boolean;
|
|
66
145
|
_deleted?: boolean;
|
|
146
|
+
error?: {
|
|
147
|
+
type: "SplitTransactionError";
|
|
148
|
+
version: 1;
|
|
149
|
+
difference: number;
|
|
150
|
+
} | null;
|
|
67
151
|
}[];
|
|
68
152
|
};
|
|
69
153
|
export {};
|
|
@@ -55,16 +55,30 @@ export declare function getNumberFormat({ format, hideFraction, }?: {
|
|
|
55
55
|
regex: any;
|
|
56
56
|
separatorRegex: any;
|
|
57
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* The exact amount.
|
|
60
|
+
*/
|
|
61
|
+
export type Amount = number;
|
|
62
|
+
/**
|
|
63
|
+
* The exact amount that is formatted based on the configured number format.
|
|
64
|
+
* For example, 123.45 would be '123.45' or '123,45'.
|
|
65
|
+
*/
|
|
66
|
+
export type CurrencyAmount = string;
|
|
67
|
+
/**
|
|
68
|
+
* The amount with the decimal point removed.
|
|
69
|
+
* For example, 123.45 would be 12345.
|
|
70
|
+
*/
|
|
71
|
+
export type IntegerAmount = number;
|
|
58
72
|
export declare function safeNumber(value: number): number;
|
|
59
|
-
export declare function toRelaxedNumber(
|
|
60
|
-
export declare function integerToCurrency(
|
|
61
|
-
export declare function amountToCurrency(
|
|
62
|
-
export declare function amountToCurrencyNoDecimal(
|
|
63
|
-
export declare function currencyToAmount(
|
|
64
|
-
export declare function currencyToInteger(
|
|
65
|
-
export declare function stringToInteger(str: string): number;
|
|
66
|
-
export declare function amountToInteger(
|
|
67
|
-
export declare function integerToAmount(
|
|
73
|
+
export declare function toRelaxedNumber(currencyAmount: CurrencyAmount): Amount;
|
|
74
|
+
export declare function integerToCurrency(integerAmount: IntegerAmount, formatter?: Intl.NumberFormat): string;
|
|
75
|
+
export declare function amountToCurrency(amount: Amount): CurrencyAmount;
|
|
76
|
+
export declare function amountToCurrencyNoDecimal(amount: Amount): CurrencyAmount;
|
|
77
|
+
export declare function currencyToAmount(currencyAmount: CurrencyAmount): Amount | null;
|
|
78
|
+
export declare function currencyToInteger(currencyAmount: CurrencyAmount): IntegerAmount | null;
|
|
79
|
+
export declare function stringToInteger(str: string): number | null;
|
|
80
|
+
export declare function amountToInteger(amount: Amount): IntegerAmount;
|
|
81
|
+
export declare function integerToAmount(integerAmount: IntegerAmount): Amount;
|
|
68
82
|
export declare function looselyParseAmount(amount: string): number;
|
|
69
83
|
export declare function sortByKey<T>(arr: T[], key: keyof T): T[];
|
|
70
84
|
export {};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ImportTransactionsOpts } from '@actual-app/api';
|
|
2
|
+
|
|
1
3
|
import { type batchUpdateTransactions } from '../server/accounts/transactions';
|
|
2
4
|
import type {
|
|
3
5
|
APIAccountEntity,
|
|
@@ -80,6 +82,7 @@ export interface ApiHandlers {
|
|
|
80
82
|
accountId;
|
|
81
83
|
transactions;
|
|
82
84
|
isPreview?;
|
|
85
|
+
opts?: ImportTransactionsOpts;
|
|
83
86
|
}) => Promise<{
|
|
84
87
|
errors?: { message: string }[];
|
|
85
88
|
added;
|
|
@@ -11,6 +11,7 @@ export interface CustomReportEntity {
|
|
|
11
11
|
groupBy: string;
|
|
12
12
|
interval: string;
|
|
13
13
|
balanceType: string;
|
|
14
|
+
sortBy?: sortByOpType;
|
|
14
15
|
showEmpty: boolean;
|
|
15
16
|
showOffBudget: boolean;
|
|
16
17
|
showHiddenCategories: boolean;
|
|
@@ -30,6 +31,8 @@ export type balanceTypeOpType =
|
|
|
30
31
|
| 'netAssets'
|
|
31
32
|
| 'netDebts';
|
|
32
33
|
|
|
34
|
+
export type sortByOpType = 'asc' | 'desc' | 'name' | 'budget';
|
|
35
|
+
|
|
33
36
|
export type SpendingMonthEntity = Record<
|
|
34
37
|
string | number,
|
|
35
38
|
{
|
|
@@ -122,6 +125,7 @@ export interface CustomReportData {
|
|
|
122
125
|
date_range: string;
|
|
123
126
|
mode: string;
|
|
124
127
|
group_by: string;
|
|
128
|
+
sort_by: sortByOpType;
|
|
125
129
|
balance_type: string;
|
|
126
130
|
show_empty: number;
|
|
127
131
|
show_offbudget: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ScheduleEntity } from './schedule';
|
|
1
|
+
import { type RecurConfig, type ScheduleEntity } from './schedule';
|
|
2
2
|
|
|
3
3
|
export interface NewRuleEntity {
|
|
4
4
|
stage: 'pre' | null | 'post';
|
|
@@ -31,11 +31,11 @@ export type RuleConditionOp =
|
|
|
31
31
|
| 'onBudget'
|
|
32
32
|
| 'offBudget';
|
|
33
33
|
|
|
34
|
-
type FieldValueTypes = {
|
|
34
|
+
export type FieldValueTypes = {
|
|
35
35
|
account: string;
|
|
36
36
|
amount: number;
|
|
37
37
|
category: string;
|
|
38
|
-
date: string;
|
|
38
|
+
date: string | RecurConfig;
|
|
39
39
|
notes: string;
|
|
40
40
|
payee: string;
|
|
41
41
|
payee_name: string;
|
|
@@ -55,7 +55,9 @@ type BaseConditionEntity<
|
|
|
55
55
|
op: Op;
|
|
56
56
|
value: Op extends 'oneOf' | 'notOneOf'
|
|
57
57
|
? Array<FieldValueTypes[Field]>
|
|
58
|
-
:
|
|
58
|
+
: Op extends 'isbetween'
|
|
59
|
+
? { num1: number; num2: number }
|
|
60
|
+
: FieldValueTypes[Field];
|
|
59
61
|
options?: {
|
|
60
62
|
inflow?: boolean;
|
|
61
63
|
outflow?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AccountEntity } from './account';
|
|
2
2
|
import type { PayeeEntity } from './payee';
|
|
3
|
-
import type { RuleEntity } from './rule';
|
|
3
|
+
import type { RuleConditionEntity, RuleEntity } from './rule';
|
|
4
4
|
|
|
5
5
|
export interface RecurPattern {
|
|
6
6
|
value: number;
|
|
@@ -9,7 +9,7 @@ export interface RecurPattern {
|
|
|
9
9
|
|
|
10
10
|
export interface RecurConfig {
|
|
11
11
|
frequency: 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
12
|
-
interval
|
|
12
|
+
interval?: number;
|
|
13
13
|
patterns?: RecurPattern[];
|
|
14
14
|
skipWeekend?: boolean;
|
|
15
15
|
start: string;
|
|
@@ -35,8 +35,8 @@ export interface ScheduleEntity {
|
|
|
35
35
|
_amount: number | { num1: number; num2: number };
|
|
36
36
|
_amountOp: string;
|
|
37
37
|
_date: RecurConfig;
|
|
38
|
-
_conditions:
|
|
39
|
-
_actions: unknown
|
|
38
|
+
_conditions: RuleConditionEntity[];
|
|
39
|
+
_actions: Array<{ op: unknown }>;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export type DiscoverScheduleEntity = {
|
|
@@ -45,18 +45,5 @@ export type DiscoverScheduleEntity = {
|
|
|
45
45
|
payee: PayeeEntity['id'];
|
|
46
46
|
date: ScheduleEntity['_date'];
|
|
47
47
|
amount: ScheduleEntity['_amount'];
|
|
48
|
-
_conditions:
|
|
49
|
-
| { op: 'is'; field: 'account'; value: AccountEntity['id'] }
|
|
50
|
-
| { op: 'is'; field: 'payee'; value: PayeeEntity['id'] }
|
|
51
|
-
| {
|
|
52
|
-
op: 'is' | 'isapprox';
|
|
53
|
-
field: 'date';
|
|
54
|
-
value: ScheduleEntity['_date'];
|
|
55
|
-
}
|
|
56
|
-
| {
|
|
57
|
-
op: 'is' | 'isapprox';
|
|
58
|
-
field: 'amount';
|
|
59
|
-
value: ScheduleEntity['_amount'];
|
|
60
|
-
}
|
|
61
|
-
>;
|
|
48
|
+
_conditions: ScheduleEntity['_conditions'];
|
|
62
49
|
};
|
|
@@ -2,6 +2,7 @@ import { AccountEntity } from './account';
|
|
|
2
2
|
import { BankSyncResponse } from './bank-sync';
|
|
3
3
|
|
|
4
4
|
export type SimpleFinOrganization = {
|
|
5
|
+
id: string;
|
|
5
6
|
name: string;
|
|
6
7
|
domain: string;
|
|
7
8
|
};
|
|
@@ -9,6 +10,7 @@ export type SimpleFinOrganization = {
|
|
|
9
10
|
export type SimpleFinAccount = {
|
|
10
11
|
id: string;
|
|
11
12
|
name: string;
|
|
13
|
+
balance: number;
|
|
12
14
|
org: SimpleFinOrganization;
|
|
13
15
|
};
|
|
14
16
|
|
|
@@ -22,8 +22,14 @@ export interface TransactionEntity {
|
|
|
22
22
|
cleared?: boolean;
|
|
23
23
|
reconciled?: boolean;
|
|
24
24
|
tombstone?: boolean;
|
|
25
|
+
forceUpcoming?: boolean;
|
|
25
26
|
schedule?: ScheduleEntity['id'];
|
|
26
27
|
subtransactions?: TransactionEntity[];
|
|
27
28
|
_unmatched?: boolean;
|
|
28
29
|
_deleted?: boolean;
|
|
30
|
+
error?: {
|
|
31
|
+
type: 'SplitTransactionError';
|
|
32
|
+
version: 1;
|
|
33
|
+
difference: number;
|
|
34
|
+
} | null;
|
|
29
35
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export type FeatureFlag =
|
|
2
2
|
| 'goalTemplatesEnabled'
|
|
3
3
|
| 'actionTemplating'
|
|
4
|
-
| 'upcomingLengthAdjustment'
|
|
5
4
|
| 'contextMenus'
|
|
6
5
|
| 'openidAuth';
|
|
7
6
|
|
|
@@ -31,7 +30,8 @@ export type SyncedPrefs = Partial<
|
|
|
31
30
|
| `csv-has-header-${string}`
|
|
32
31
|
| `ofx-fallback-missing-payee-${string}`
|
|
33
32
|
| `flip-amount-${string}-${'csv' | 'qif'}`
|
|
34
|
-
| `flags.${FeatureFlag}
|
|
33
|
+
| `flags.${FeatureFlag}`
|
|
34
|
+
| `learn-categories`,
|
|
35
35
|
string
|
|
36
36
|
>
|
|
37
37
|
>;
|
|
@@ -77,6 +77,7 @@ export type GlobalPrefs = Partial<{
|
|
|
77
77
|
floatingSidebar: boolean;
|
|
78
78
|
maxMonths: number;
|
|
79
79
|
keyId?: string;
|
|
80
|
+
language: string;
|
|
80
81
|
theme: Theme;
|
|
81
82
|
preferredDarkTheme: DarkTheme;
|
|
82
83
|
documentDir: string; // Electron only
|