@actual-app/api 6.8.2 → 6.10.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/jest.config.d.ts +7 -7
- package/@types/loot-core/client/constants.d.ts +2 -0
- package/@types/loot-core/client/state-types/index.d.ts +1 -1
- package/@types/loot-core/client/state-types/modals.d.ts +27 -8
- package/@types/loot-core/client/state-types/notifications.d.ts +18 -1
- package/@types/loot-core/client/state-types/prefs.d.ts +9 -4
- package/@types/loot-core/client/state-types/queries.d.ts +8 -0
- package/@types/loot-core/server/accounts/parse-file.d.ts +1 -0
- package/@types/loot-core/server/accounts/rules.d.ts +2 -2
- package/@types/loot-core/server/accounts/sync.d.ts +12 -1
- package/@types/loot-core/server/accounts/transaction-rules.d.ts +1 -3
- package/@types/loot-core/server/accounts/transactions.d.ts +3 -5
- package/@types/loot-core/server/api-models.d.ts +21 -6
- package/@types/loot-core/server/aql/schema/index.d.ts +41 -3
- package/@types/loot-core/server/budget/actions.d.ts +2 -1
- package/@types/loot-core/server/budget/statements.d.ts +9 -0
- package/@types/loot-core/server/budget/template-notes.d.ts +5 -0
- package/@types/loot-core/server/budget/types/templates.d.ts +82 -0
- package/@types/loot-core/server/cloud-storage.d.ts +0 -1
- package/@types/loot-core/server/dashboard/app.d.ts +12 -0
- package/@types/loot-core/server/dashboard/types/handlers.d.ts +24 -0
- package/@types/loot-core/server/db/index.d.ts +4 -2
- package/@types/loot-core/server/db/types.d.ts +9 -0
- package/@types/loot-core/server/encryption-internals.d.ts +0 -1
- package/@types/loot-core/server/encryption-internals.web.d.ts +0 -1
- package/@types/loot-core/server/encryption.d.ts +0 -1
- package/@types/loot-core/server/errors.d.ts +2 -0
- package/@types/loot-core/server/importers/actual.d.ts +0 -1
- package/@types/loot-core/server/importers/index.d.ts +0 -1
- package/@types/loot-core/server/importers/ynab4.d.ts +0 -1
- package/@types/loot-core/server/importers/ynab5.d.ts +0 -1
- package/@types/loot-core/server/main-app.d.ts +1 -1
- package/@types/loot-core/server/models.d.ts +4 -4
- package/@types/loot-core/server/prefs.d.ts +7 -2
- package/@types/loot-core/server/reports/app.d.ts +46 -0
- package/@types/loot-core/server/rules/types/handlers.d.ts +4 -6
- package/@types/loot-core/server/sync/make-test-message.d.ts +0 -1
- package/@types/loot-core/shared/dashboard.d.ts +2 -0
- package/@types/loot-core/shared/months.d.ts +7 -6
- package/@types/loot-core/shared/normalisation.d.ts +1 -0
- package/@types/loot-core/shared/rules.d.ts +5 -1
- package/@types/loot-core/shared/schedules.d.ts +22 -22
- package/@types/loot-core/shared/transactions.d.ts +26 -75
- package/@types/loot-core/shared/util.d.ts +10 -13
- package/@types/loot-core/types/api-handlers.d.ts +29 -3
- package/@types/loot-core/types/file.d.ts +2 -0
- package/@types/loot-core/types/handlers.d.ts +2 -0
- package/@types/loot-core/types/models/category-group.d.ts +6 -2
- package/@types/loot-core/types/models/category.d.ts +4 -2
- package/@types/loot-core/types/models/dashboard.d.ts +56 -0
- package/@types/loot-core/types/models/index.d.ts +1 -0
- package/@types/loot-core/types/models/payee.d.ts +6 -7
- package/@types/loot-core/types/models/reports.d.ts +12 -5
- package/@types/loot-core/types/models/rule.d.ts +100 -7
- package/@types/loot-core/types/models/transaction.d.ts +12 -25
- package/@types/loot-core/types/prefs.d.ts +50 -26
- package/@types/loot-core/types/server-handlers.d.ts +13 -8
- package/@types/loot-core/types/util.d.ts +4 -0
- package/@types/methods.d.ts +8 -11
- package/@types/migrations/1722717601000_reports_move_selected_categories.d.ts +1 -0
- package/@types/migrations/1722804019000_create_dashboard_table.d.ts +1 -0
- package/dist/app/bundle.api.js +5544 -1857
- package/dist/app/query.js +1 -2
- package/dist/index.js +3 -3
- package/dist/injected.js +2 -2
- package/dist/methods.js +65 -41
- package/dist/methods.test.js +23 -15
- package/dist/migrations/1632571489012_remove_cache.js +1 -1
- package/dist/migrations/1720310586000_link_transfer_schedules.sql +19 -0
- package/dist/migrations/1720664867241_add_payee_favorite.sql +5 -0
- package/dist/migrations/1720665000000_goal_context.sql +6 -0
- package/dist/migrations/1722717601000_reports_move_selected_categories.js +39 -0
- package/dist/migrations/1722804019000_create_dashboard_table.js +38 -0
- package/dist/package.json +2 -2
- package/dist/utils.js +2 -3
- package/dist/validateNodeVersion.js +1 -2
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ export declare const app: {
|
|
|
4
4
|
handlers: Handlers;
|
|
5
5
|
services: any;
|
|
6
6
|
unlistenServices: any;
|
|
7
|
-
method<Name extends "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" | "rollover-budget-month" | "report-budget-month" | "budget-set-type" | "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" | "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" | "
|
|
7
|
+
method<Name extends "sync" | "query" | "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" | "rollover-budget-month" | "report-budget-month" | "budget-set-type" | "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" | "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" | "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;
|
|
8
8
|
service(func: any): void;
|
|
9
9
|
combine(...apps: any[]): void;
|
|
10
10
|
startServices(): void;
|
|
@@ -12,10 +12,10 @@ export declare const categoryModel: {
|
|
|
12
12
|
update?: boolean;
|
|
13
13
|
}): {
|
|
14
14
|
hidden: number;
|
|
15
|
-
id
|
|
15
|
+
id: string;
|
|
16
16
|
name: string;
|
|
17
17
|
is_income?: boolean;
|
|
18
|
-
cat_group?:
|
|
18
|
+
cat_group?: CategoryGroupEntity["id"];
|
|
19
19
|
tombstone?: boolean;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
@@ -24,11 +24,11 @@ export declare const categoryGroupModel: {
|
|
|
24
24
|
update?: boolean;
|
|
25
25
|
}): {
|
|
26
26
|
hidden: number;
|
|
27
|
-
id
|
|
27
|
+
id: string;
|
|
28
|
+
categories?: CategoryEntity[];
|
|
28
29
|
name: string;
|
|
29
30
|
is_income?: boolean;
|
|
30
31
|
tombstone?: boolean;
|
|
31
|
-
categories?: CategoryEntity[];
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
export declare const payeeModel: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MetadataPrefs, SyncedPrefs } from '../types/prefs';
|
|
2
|
+
type LocalPrefs = MetadataPrefs & Pick<SyncedPrefs, 'budgetType'>;
|
|
2
3
|
export declare const BUDGET_TYPES: readonly ["report", "rollover"];
|
|
3
4
|
export type BudgetType = (typeof BUDGET_TYPES)[number];
|
|
4
5
|
export declare function loadPrefs(id?: string): Promise<LocalPrefs>;
|
|
@@ -7,4 +8,8 @@ export declare function savePrefs(prefsToSet: LocalPrefs, { avoidSync }?: {
|
|
|
7
8
|
}): Promise<void>;
|
|
8
9
|
export declare function unloadPrefs(): void;
|
|
9
10
|
export declare function getPrefs(): LocalPrefs;
|
|
10
|
-
export declare function getDefaultPrefs(id: string, budgetName: string):
|
|
11
|
+
export declare function getDefaultPrefs(id: string, budgetName: string): {
|
|
12
|
+
id: string;
|
|
13
|
+
budgetName: string;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -1,4 +1,50 @@
|
|
|
1
|
+
import { type CustomReportData, type CustomReportEntity } from '../../types/models';
|
|
1
2
|
import { ReportsHandlers } from './types/handlers';
|
|
3
|
+
export declare const reportModel: {
|
|
4
|
+
validate(report: Omit<CustomReportEntity, "tombstone">, { update }?: {
|
|
5
|
+
update?: boolean;
|
|
6
|
+
}): Omit<CustomReportEntity, "tombstone">;
|
|
7
|
+
toJS(row: CustomReportData): {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
startDate: string;
|
|
11
|
+
endDate: string;
|
|
12
|
+
isDateStatic: boolean;
|
|
13
|
+
dateRange: string;
|
|
14
|
+
mode: string;
|
|
15
|
+
groupBy: string;
|
|
16
|
+
interval: string;
|
|
17
|
+
balanceType: string;
|
|
18
|
+
showEmpty: boolean;
|
|
19
|
+
showOffBudget: boolean;
|
|
20
|
+
showHiddenCategories: boolean;
|
|
21
|
+
showUncategorized: boolean;
|
|
22
|
+
includeCurrentInterval: boolean;
|
|
23
|
+
graphType: string;
|
|
24
|
+
conditions: import("../../types/models").RuleConditionEntity[];
|
|
25
|
+
conditionsOp: "and" | "or";
|
|
26
|
+
};
|
|
27
|
+
fromJS(report: CustomReportEntity): {
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
start_date: string;
|
|
31
|
+
end_date: string;
|
|
32
|
+
date_static: number;
|
|
33
|
+
date_range: string;
|
|
34
|
+
mode: string;
|
|
35
|
+
group_by: string;
|
|
36
|
+
interval: string;
|
|
37
|
+
balance_type: string;
|
|
38
|
+
show_empty: number;
|
|
39
|
+
show_offbudget: number;
|
|
40
|
+
show_hidden: number;
|
|
41
|
+
show_uncategorized: number;
|
|
42
|
+
include_current: number;
|
|
43
|
+
graph_type: string;
|
|
44
|
+
conditions: import("../../types/models").RuleConditionEntity[];
|
|
45
|
+
conditions_op: "and" | "or";
|
|
46
|
+
};
|
|
47
|
+
};
|
|
2
48
|
export declare const app: {
|
|
3
49
|
events: any;
|
|
4
50
|
handlers: ReportsHandlers;
|
|
@@ -10,13 +10,11 @@ export interface RulesHandlers {
|
|
|
10
10
|
}>;
|
|
11
11
|
'rule-add': (rule: Omit<RuleEntity, 'id'>) => Promise<{
|
|
12
12
|
error: ValidationError;
|
|
13
|
-
} |
|
|
14
|
-
|
|
15
|
-
}>;
|
|
16
|
-
'rule-update': (rule: Partial<RuleEntity>) => Promise<{
|
|
13
|
+
} | RuleEntity>;
|
|
14
|
+
'rule-update': <PartialRule extends Partial<Omit<RuleEntity, 'id'>> & Pick<RuleEntity, 'id'>>(rule: PartialRule) => Promise<{
|
|
17
15
|
error: ValidationError;
|
|
18
|
-
} |
|
|
19
|
-
'rule-delete': (
|
|
16
|
+
} | PartialRule>;
|
|
17
|
+
'rule-delete': (id: string) => Promise<boolean>;
|
|
20
18
|
'rule-delete-all': (ids: string[]) => Promise<{
|
|
21
19
|
someDeletionsFailed: boolean;
|
|
22
20
|
}>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type SyncedPrefs } from '../types/prefs';
|
|
2
2
|
type DateLike = string | Date;
|
|
3
3
|
export declare function _parse(value: DateLike): Date;
|
|
4
4
|
export declare const parseDate: typeof _parse;
|
|
5
5
|
export declare function yearFromDate(date: DateLike): string;
|
|
6
6
|
export declare function monthFromDate(date: DateLike): string;
|
|
7
|
-
export declare function weekFromDate(date: DateLike, firstDayOfWeekIdx:
|
|
7
|
+
export declare function weekFromDate(date: DateLike, firstDayOfWeekIdx: SyncedPrefs['firstDayOfWeekIdx']): string;
|
|
8
8
|
export declare function dayFromDate(date: DateLike): string;
|
|
9
9
|
export declare function currentMonth(): string;
|
|
10
|
-
export declare function currentWeek(firstDayOfWeekIdx?:
|
|
10
|
+
export declare function currentWeek(firstDayOfWeekIdx?: SyncedPrefs['firstDayOfWeekIdx']): string;
|
|
11
11
|
export declare function currentYear(): string;
|
|
12
12
|
export declare function currentDate(): Date;
|
|
13
13
|
export declare function currentDay(): string;
|
|
@@ -26,14 +26,15 @@ export declare function addDays(day: DateLike, n: number): string;
|
|
|
26
26
|
export declare function subDays(day: DateLike, n: number): string;
|
|
27
27
|
export declare function isBefore(month1: DateLike, month2: DateLike): boolean;
|
|
28
28
|
export declare function isAfter(month1: DateLike, month2: DateLike): boolean;
|
|
29
|
+
export declare function isCurrentMonth(month: DateLike): boolean;
|
|
29
30
|
export declare function bounds(month: DateLike): {
|
|
30
31
|
start: number;
|
|
31
32
|
end: number;
|
|
32
33
|
};
|
|
33
34
|
export declare function _yearRange(start: DateLike, end: DateLike, inclusive?: boolean): string[];
|
|
34
35
|
export declare function yearRangeInclusive(start: DateLike, end: DateLike): string[];
|
|
35
|
-
export declare function _weekRange(start: DateLike, end: DateLike, inclusive?: boolean, firstDayOfWeekIdx?:
|
|
36
|
-
export declare function weekRangeInclusive(start: DateLike, end: DateLike, firstDayOfWeekIdx?:
|
|
36
|
+
export declare function _weekRange(start: DateLike, end: DateLike, inclusive?: boolean, firstDayOfWeekIdx?: SyncedPrefs['firstDayOfWeekIdx']): string[];
|
|
37
|
+
export declare function weekRangeInclusive(start: DateLike, end: DateLike, firstDayOfWeekIdx?: SyncedPrefs['firstDayOfWeekIdx']): string[];
|
|
37
38
|
export declare function _range(start: DateLike, end: DateLike, inclusive?: boolean): string[];
|
|
38
39
|
export declare function range(start: DateLike, end: DateLike): string[];
|
|
39
40
|
export declare function rangeInclusive(start: DateLike, end: DateLike): string[];
|
|
@@ -46,7 +47,7 @@ export declare function getYear(month: string): string;
|
|
|
46
47
|
export declare function getMonth(day: string): string;
|
|
47
48
|
export declare function getDay(day: string): number;
|
|
48
49
|
export declare function getMonthEnd(day: string): string;
|
|
49
|
-
export declare function getWeekEnd(date: DateLike, firstDayOfWeekIdx?:
|
|
50
|
+
export declare function getWeekEnd(date: DateLike, firstDayOfWeekIdx?: SyncedPrefs['firstDayOfWeekIdx']): string;
|
|
50
51
|
export declare function getYearStart(month: string): string;
|
|
51
52
|
export declare function getYearEnd(month: string): string;
|
|
52
53
|
export declare function sheetForMonth(month: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getNormalisedString(value: string): string;
|
|
@@ -15,6 +15,10 @@ export declare const TYPE_INFO: {
|
|
|
15
15
|
ops: string[];
|
|
16
16
|
nullable: boolean;
|
|
17
17
|
};
|
|
18
|
+
imported_payee: {
|
|
19
|
+
ops: string[];
|
|
20
|
+
nullable: boolean;
|
|
21
|
+
};
|
|
18
22
|
number: {
|
|
19
23
|
ops: string[];
|
|
20
24
|
nullable: boolean;
|
|
@@ -31,7 +35,7 @@ export declare const ALLOCATION_METHODS: {
|
|
|
31
35
|
remainder: string;
|
|
32
36
|
};
|
|
33
37
|
export declare function mapField(field: any, opts?: any): any;
|
|
34
|
-
export declare function friendlyOp(op: any, type?: any): "" | "is" | "contains" | "matches" | "one of" | "not one of" | "is not" | "is approx" | "is between" | "does not contain" | "is after" | "is greater than" | "is after or equals" | "is greater than or equals" | "is before" | "is less than" | "is before or equals" | "is less than or equals" | "is true" | "is false" | "set" | "allocate" | "link schedule" | "and" | "or";
|
|
38
|
+
export declare function friendlyOp(op: any, type?: any): "" | "is" | "contains" | "matches" | "one of" | "not one of" | "is not" | "is approx" | "is between" | "has tag(s)" | "does not contain" | "is after" | "is greater than" | "is after or equals" | "is greater than or equals" | "is before" | "is less than" | "is before or equals" | "is less than or equals" | "is true" | "is false" | "set" | "allocate" | "link schedule" | "prepend to notes" | "append to notes" | "and" | "or";
|
|
35
39
|
export declare function deserializeField(field: any): {
|
|
36
40
|
field: string;
|
|
37
41
|
options: {
|
|
@@ -4,34 +4,34 @@ export declare function getHasTransactionsQuery(schedules: any): import("./query
|
|
|
4
4
|
export declare function getRecurringDescription(config: any, dateFormat: any): string;
|
|
5
5
|
export declare function recurConfigToRSchedule(config: any): IRuleOptions[] | ({
|
|
6
6
|
byDayOfMonth: any;
|
|
7
|
-
start: import("@rschedule/core").
|
|
8
|
-
end?: import("@rschedule/core").
|
|
9
|
-
duration?:
|
|
10
|
-
count?:
|
|
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
11
|
frequency: import("@rschedule/core").RuleOption.Frequency;
|
|
12
|
-
interval?:
|
|
13
|
-
weekStart?: import("@rschedule/core").
|
|
12
|
+
interval?: import("@rschedule/core").RuleOption.Interval;
|
|
13
|
+
weekStart?: import("@rschedule/core").RuleOption.WeekStart;
|
|
14
14
|
byDayOfWeek?: import("@rschedule/core").RuleOption.ByDayOfWeek[];
|
|
15
|
-
byHourOfDay?: import("@rschedule/core").
|
|
16
|
-
byMillisecondOfSecond?:
|
|
17
|
-
byMinuteOfHour?: import("@rschedule/core").
|
|
18
|
-
byMonthOfYear?: import("@rschedule/core").
|
|
19
|
-
bySecondOfMinute?: import("@rschedule/core").
|
|
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
20
|
} | {
|
|
21
21
|
byDayOfWeek: any;
|
|
22
|
-
start: import("@rschedule/core").
|
|
23
|
-
end?: import("@rschedule/core").
|
|
24
|
-
duration?:
|
|
25
|
-
count?:
|
|
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
26
|
frequency: import("@rschedule/core").RuleOption.Frequency;
|
|
27
|
-
interval?:
|
|
28
|
-
weekStart?: import("@rschedule/core").
|
|
27
|
+
interval?: import("@rschedule/core").RuleOption.Interval;
|
|
28
|
+
weekStart?: import("@rschedule/core").RuleOption.WeekStart;
|
|
29
29
|
byDayOfMonth?: import("@rschedule/core").RuleOption.ByDayOfMonth[];
|
|
30
|
-
byHourOfDay?: import("@rschedule/core").
|
|
31
|
-
byMillisecondOfSecond?:
|
|
32
|
-
byMinuteOfHour?: import("@rschedule/core").
|
|
33
|
-
byMonthOfYear?: import("@rschedule/core").
|
|
34
|
-
bySecondOfMinute?: import("@rschedule/core").
|
|
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
35
|
})[];
|
|
36
36
|
export declare function extractScheduleConds(conditions: any): {
|
|
37
37
|
payee: any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type TransactionEntity
|
|
2
|
-
import { applyChanges } from './util';
|
|
1
|
+
import { type TransactionEntity } from '../types/models';
|
|
2
|
+
import { diffItems, applyChanges } from './util';
|
|
3
3
|
interface TransactionEntityWithError extends TransactionEntity {
|
|
4
4
|
error: ReturnType<typeof SplitTransactionError> | null;
|
|
5
5
|
_deleted?: boolean;
|
|
@@ -11,7 +11,7 @@ declare function SplitTransactionError(total: number, parent: TransactionEntity)
|
|
|
11
11
|
version: number;
|
|
12
12
|
difference: number;
|
|
13
13
|
};
|
|
14
|
-
type GenericTransactionEntity =
|
|
14
|
+
type GenericTransactionEntity = TransactionEntity | TransactionEntityWithError;
|
|
15
15
|
export declare function makeChild<T extends GenericTransactionEntity>(parent: T, data?: object): T;
|
|
16
16
|
export declare function recalculateSplit(trans: TransactionEntity): TransactionEntityWithError;
|
|
17
17
|
export declare function ungroupTransactions(transactions: TransactionEntity[]): TransactionEntity[];
|
|
@@ -19,98 +19,49 @@ export declare function groupTransaction(split: TransactionEntity[]): Transactio
|
|
|
19
19
|
export declare function ungroupTransaction(split: TransactionEntity | null): TransactionEntity[];
|
|
20
20
|
export declare function applyTransactionDiff(groupedTrans: Parameters<typeof ungroupTransaction>[0], diff: Parameters<typeof applyChanges>[0]): TransactionEntity;
|
|
21
21
|
export declare function addSplitTransaction(transactions: TransactionEntity[], id: string): {
|
|
22
|
-
data: any[];
|
|
23
|
-
diff: {
|
|
24
|
-
deleted: any[];
|
|
25
|
-
updated: any[];
|
|
26
|
-
};
|
|
27
|
-
newTransaction?: undefined;
|
|
28
|
-
} | {
|
|
29
22
|
data: TransactionEntity[];
|
|
30
|
-
newTransaction: TransactionEntityWithError |
|
|
31
|
-
diff:
|
|
23
|
+
newTransaction: TransactionEntity | TransactionEntityWithError | null;
|
|
24
|
+
diff: ReturnType<typeof diffItems<TransactionEntity>>;
|
|
32
25
|
};
|
|
33
26
|
export declare function updateTransaction(transactions: TransactionEntity[], transaction: TransactionEntity): {
|
|
34
|
-
data: any[];
|
|
35
|
-
diff: {
|
|
36
|
-
deleted: any[];
|
|
37
|
-
updated: any[];
|
|
38
|
-
};
|
|
39
|
-
newTransaction?: undefined;
|
|
40
|
-
} | {
|
|
41
27
|
data: TransactionEntity[];
|
|
42
|
-
newTransaction: TransactionEntityWithError |
|
|
43
|
-
diff:
|
|
28
|
+
newTransaction: TransactionEntity | TransactionEntityWithError | null;
|
|
29
|
+
diff: ReturnType<typeof diffItems<TransactionEntity>>;
|
|
44
30
|
};
|
|
45
31
|
export declare function deleteTransaction(transactions: TransactionEntity[], id: string): {
|
|
46
|
-
data: any[];
|
|
47
|
-
diff: {
|
|
48
|
-
deleted: any[];
|
|
49
|
-
updated: any[];
|
|
50
|
-
};
|
|
51
|
-
newTransaction?: undefined;
|
|
52
|
-
} | {
|
|
53
32
|
data: TransactionEntity[];
|
|
54
|
-
newTransaction: TransactionEntityWithError |
|
|
55
|
-
diff:
|
|
33
|
+
newTransaction: TransactionEntity | TransactionEntityWithError | null;
|
|
34
|
+
diff: ReturnType<typeof diffItems<TransactionEntity>>;
|
|
56
35
|
};
|
|
57
36
|
export declare function splitTransaction(transactions: TransactionEntity[], id: string, createSubtransactions?: (parentTransaction: TransactionEntity) => TransactionEntity[]): {
|
|
58
|
-
data: any[];
|
|
59
|
-
diff: {
|
|
60
|
-
deleted: any[];
|
|
61
|
-
updated: any[];
|
|
62
|
-
};
|
|
63
|
-
newTransaction?: undefined;
|
|
64
|
-
} | {
|
|
65
37
|
data: TransactionEntity[];
|
|
66
|
-
newTransaction: TransactionEntityWithError |
|
|
67
|
-
diff:
|
|
38
|
+
newTransaction: TransactionEntity | TransactionEntityWithError | null;
|
|
39
|
+
diff: ReturnType<typeof diffItems<TransactionEntity>>;
|
|
68
40
|
};
|
|
69
|
-
export declare function realizeTempTransactions(transactions: TransactionEntity[]):
|
|
70
|
-
id: string;
|
|
71
|
-
account: import("../types/models").AccountEntity;
|
|
72
|
-
category?: import("../types/models").CategoryEntity;
|
|
73
|
-
payee?: import("../types/models").PayeeEntity;
|
|
74
|
-
schedule?: import("../types/models").ScheduleEntity;
|
|
75
|
-
subtransactions?: TransactionEntity[];
|
|
76
|
-
sort_order?: number;
|
|
77
|
-
tombstone?: boolean;
|
|
78
|
-
imported_payee?: string;
|
|
79
|
-
date: string;
|
|
80
|
-
notes?: string;
|
|
81
|
-
amount: number;
|
|
82
|
-
cleared?: boolean;
|
|
83
|
-
reconciled?: boolean;
|
|
84
|
-
is_parent?: boolean;
|
|
85
|
-
is_child?: boolean;
|
|
86
|
-
parent_id?: string;
|
|
87
|
-
imported_id?: string;
|
|
88
|
-
starting_balance_flag?: boolean;
|
|
89
|
-
transfer_id?: string;
|
|
90
|
-
}[];
|
|
41
|
+
export declare function realizeTempTransactions(transactions: TransactionEntity[]): TransactionEntity[];
|
|
91
42
|
export declare function makeAsNonChildTransactions(childTransactionsToUpdate: TransactionEntity[], transactions: TransactionEntity[]): {
|
|
92
43
|
updated: TransactionEntity[];
|
|
93
44
|
deleted: {
|
|
94
45
|
amount: number;
|
|
95
46
|
id: string;
|
|
96
|
-
account: import("../types/models").AccountEntity;
|
|
97
|
-
category?: import("../types/models").CategoryEntity;
|
|
98
|
-
payee?: import("../types/models").PayeeEntity;
|
|
99
|
-
schedule?: import("../types/models").ScheduleEntity;
|
|
100
|
-
subtransactions?: TransactionEntity[];
|
|
101
|
-
sort_order?: number;
|
|
102
|
-
tombstone?: boolean;
|
|
103
|
-
imported_payee?: string;
|
|
104
|
-
date: string;
|
|
105
|
-
notes?: string;
|
|
106
|
-
cleared?: boolean;
|
|
107
|
-
reconciled?: boolean;
|
|
108
47
|
is_parent?: boolean;
|
|
109
48
|
is_child?: boolean;
|
|
110
|
-
parent_id?:
|
|
49
|
+
parent_id?: TransactionEntity["id"];
|
|
50
|
+
account: import("../types/models").AccountEntity["id"];
|
|
51
|
+
category?: import("../types/models").CategoryEntity["id"];
|
|
52
|
+
payee?: import("../types/models").PayeeEntity["id"];
|
|
53
|
+
notes?: string;
|
|
54
|
+
date: string;
|
|
111
55
|
imported_id?: string;
|
|
56
|
+
imported_payee?: string;
|
|
112
57
|
starting_balance_flag?: boolean;
|
|
113
|
-
transfer_id?:
|
|
58
|
+
transfer_id?: TransactionEntity["id"];
|
|
59
|
+
sort_order?: number;
|
|
60
|
+
cleared?: boolean;
|
|
61
|
+
reconciled?: boolean;
|
|
62
|
+
tombstone?: boolean;
|
|
63
|
+
schedule?: import("../types/models").ScheduleEntity["id"];
|
|
64
|
+
subtransactions?: TransactionEntity[];
|
|
114
65
|
}[];
|
|
115
66
|
};
|
|
116
67
|
export {};
|
|
@@ -3,24 +3,21 @@ export declare function getChangedValues<T extends {
|
|
|
3
3
|
id?: string;
|
|
4
4
|
}>(obj1: T, obj2: T): Partial<T>;
|
|
5
5
|
export declare function hasFieldsChanged<T extends object>(obj1: T, obj2: T, fields: Array<keyof T>): boolean;
|
|
6
|
+
export type Diff<T extends {
|
|
7
|
+
id: string;
|
|
8
|
+
}> = {
|
|
9
|
+
added: T[];
|
|
10
|
+
updated: Partial<T>[];
|
|
11
|
+
deleted: Partial<T>[];
|
|
12
|
+
};
|
|
6
13
|
export declare function applyChanges<T extends {
|
|
7
14
|
id: string;
|
|
8
|
-
}>(changes:
|
|
9
|
-
added?: T[];
|
|
10
|
-
updated?: T[];
|
|
11
|
-
deleted?: T[];
|
|
12
|
-
}, items: T[]): T[];
|
|
15
|
+
}>(changes: Diff<T>, items: T[]): T[];
|
|
13
16
|
export declare function partitionByField<T, K extends keyof T>(data: T[], field: K): Map<any, any>;
|
|
14
17
|
export declare function groupBy<T, K extends keyof T>(data: T[], field: K): Map<T[K], T[]>;
|
|
15
18
|
export declare function diffItems<T extends {
|
|
16
19
|
id: string;
|
|
17
|
-
}>(items: T[], newItems: T[]):
|
|
18
|
-
added: T[];
|
|
19
|
-
updated: Partial<T>[];
|
|
20
|
-
deleted: {
|
|
21
|
-
id: string;
|
|
22
|
-
}[];
|
|
23
|
-
};
|
|
20
|
+
}>(items: T[], newItems: T[]): Diff<T>;
|
|
24
21
|
export declare function groupById<T extends {
|
|
25
22
|
id: string;
|
|
26
23
|
}>(data: T[]): {
|
|
@@ -31,7 +28,7 @@ export declare function getIn(map: any, keys: any): any;
|
|
|
31
28
|
export declare function fastSetMerge<T>(set1: Set<T>, set2: Set<T>): Set<T>;
|
|
32
29
|
export declare function titleFirst(str: string): string;
|
|
33
30
|
export declare function appendDecimals(amountText: string, hideDecimals?: boolean): string;
|
|
34
|
-
type NumberFormats = 'comma-dot' | 'dot-comma' | 'space-comma' | '
|
|
31
|
+
type NumberFormats = 'comma-dot' | 'dot-comma' | 'space-comma' | 'apostrophe-dot' | 'comma-dot-in';
|
|
35
32
|
export declare const numberFormats: Array<{
|
|
36
33
|
value: NumberFormats;
|
|
37
34
|
label: string;
|
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
APIAccountEntity,
|
|
4
4
|
APICategoryEntity,
|
|
5
5
|
APICategoryGroupEntity,
|
|
6
|
+
APIFileEntity,
|
|
6
7
|
APIPayeeEntity,
|
|
7
8
|
} from '../server/api-models';
|
|
8
9
|
|
|
@@ -23,6 +24,8 @@ export interface ApiHandlers {
|
|
|
23
24
|
password?: string;
|
|
24
25
|
}) => Promise<void>;
|
|
25
26
|
|
|
27
|
+
'api/get-budgets': () => Promise<APIFileEntity[]>;
|
|
28
|
+
|
|
26
29
|
'api/start-import': (arg: { budgetName: string }) => Promise<void>;
|
|
27
30
|
|
|
28
31
|
'api/finish-import': () => Promise<void>;
|
|
@@ -60,13 +63,24 @@ export interface ApiHandlers {
|
|
|
60
63
|
flag: boolean;
|
|
61
64
|
}) => Promise<void>;
|
|
62
65
|
|
|
66
|
+
'api/budget-hold-for-next-month': (arg: {
|
|
67
|
+
month: string;
|
|
68
|
+
amount: number;
|
|
69
|
+
}) => Promise<boolean>;
|
|
70
|
+
|
|
71
|
+
'api/budget-reset-hold': (arg: { month: string }) => Promise<void>;
|
|
72
|
+
|
|
63
73
|
'api/transactions-export': (arg: {
|
|
64
74
|
transactions;
|
|
65
75
|
categoryGroups;
|
|
66
76
|
payees;
|
|
67
77
|
}) => Promise<unknown>;
|
|
68
78
|
|
|
69
|
-
'api/transactions-import': (arg: {
|
|
79
|
+
'api/transactions-import': (arg: {
|
|
80
|
+
accountId;
|
|
81
|
+
transactions;
|
|
82
|
+
isPreview?;
|
|
83
|
+
}) => Promise<{
|
|
70
84
|
errors?: { message: string }[];
|
|
71
85
|
added;
|
|
72
86
|
updated;
|
|
@@ -92,7 +106,7 @@ export interface ApiHandlers {
|
|
|
92
106
|
|
|
93
107
|
'api/transaction-delete': (arg: {
|
|
94
108
|
id;
|
|
95
|
-
}) => Promise<Awaited<ReturnType<typeof batchUpdateTransactions>>['
|
|
109
|
+
}) => Promise<Awaited<ReturnType<typeof batchUpdateTransactions>>['deleted']>;
|
|
96
110
|
|
|
97
111
|
'api/sync': () => Promise<void>;
|
|
98
112
|
|
|
@@ -114,6 +128,11 @@ export interface ApiHandlers {
|
|
|
114
128
|
|
|
115
129
|
'api/account-delete': (arg: { id }) => Promise<unknown>;
|
|
116
130
|
|
|
131
|
+
'api/account-balance': (arg: {
|
|
132
|
+
id: string;
|
|
133
|
+
cutoff?: Date;
|
|
134
|
+
}) => Promise<number>;
|
|
135
|
+
|
|
117
136
|
'api/categories-get': (arg: {
|
|
118
137
|
grouped;
|
|
119
138
|
}) => Promise<Array<APICategoryGroupEntity | APICategoryEntity>>;
|
|
@@ -140,12 +159,19 @@ export interface ApiHandlers {
|
|
|
140
159
|
|
|
141
160
|
'api/payees-get': () => Promise<APIPayeeEntity[]>;
|
|
142
161
|
|
|
162
|
+
'api/common-payees-get': () => Promise<APIPayeeEntity[]>;
|
|
163
|
+
|
|
143
164
|
'api/payee-create': (arg: { payee }) => Promise<string>;
|
|
144
165
|
|
|
145
166
|
'api/payee-update': (arg: { id; fields }) => Promise<unknown>;
|
|
146
167
|
|
|
147
168
|
'api/payee-delete': (arg: { id }) => Promise<unknown>;
|
|
148
169
|
|
|
170
|
+
'api/payees-merge': (arg: {
|
|
171
|
+
targetId: string;
|
|
172
|
+
mergeIds: string[];
|
|
173
|
+
}) => Promise<void>;
|
|
174
|
+
|
|
149
175
|
'api/rules-get': () => Promise<RuleEntity[]>;
|
|
150
176
|
|
|
151
177
|
'api/payee-rules-get': (arg: { id: string }) => Promise<RuleEntity[]>;
|
|
@@ -154,5 +180,5 @@ export interface ApiHandlers {
|
|
|
154
180
|
|
|
155
181
|
'api/rule-update': (arg: { rule: RuleEntity }) => Promise<RuleEntity>;
|
|
156
182
|
|
|
157
|
-
'api/rule-delete': (
|
|
183
|
+
'api/rule-delete': (id: string) => Promise<boolean>;
|
|
158
184
|
}
|
|
@@ -10,12 +10,14 @@ export type FileState =
|
|
|
10
10
|
|
|
11
11
|
export type LocalFile = Omit<Budget, 'cloudFileId' | 'groupId'> & {
|
|
12
12
|
state: 'local';
|
|
13
|
+
hasKey: boolean;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export type SyncableLocalFile = Budget & {
|
|
16
17
|
cloudFileId: string;
|
|
17
18
|
groupId: string;
|
|
18
19
|
state: 'broken' | 'unknown';
|
|
20
|
+
hasKey: boolean;
|
|
19
21
|
};
|
|
20
22
|
|
|
21
23
|
export type SyncedLocalFile = Budget & {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BudgetHandlers } from '../server/budget/types/handlers';
|
|
2
|
+
import type { DashboardHandlers } from '../server/dashboard/types/handlers';
|
|
2
3
|
import type { FiltersHandlers } from '../server/filters/types/handlers';
|
|
3
4
|
import type { NotesHandlers } from '../server/notes/types/handlers';
|
|
4
5
|
import type { ReportsHandlers } from '../server/reports/types/handlers';
|
|
@@ -13,6 +14,7 @@ export interface Handlers
|
|
|
13
14
|
extends ServerHandlers,
|
|
14
15
|
ApiHandlers,
|
|
15
16
|
BudgetHandlers,
|
|
17
|
+
DashboardHandlers,
|
|
16
18
|
FiltersHandlers,
|
|
17
19
|
NotesHandlers,
|
|
18
20
|
ReportsHandlers,
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { CategoryEntity } from './category';
|
|
2
2
|
|
|
3
|
-
export interface
|
|
4
|
-
id?: string;
|
|
3
|
+
export interface NewCategoryGroupEntity {
|
|
5
4
|
name: string;
|
|
6
5
|
is_income?: boolean;
|
|
7
6
|
sort_order?: number;
|
|
8
7
|
tombstone?: boolean;
|
|
9
8
|
hidden?: boolean;
|
|
9
|
+
categories?: Omit<CategoryEntity, 'id'>[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface CategoryGroupEntity extends NewCategoryGroupEntity {
|
|
13
|
+
id: string;
|
|
10
14
|
categories?: CategoryEntity[];
|
|
11
15
|
}
|