@actual-app/api 24.10.1 → 24.11.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.
@@ -86,6 +86,15 @@ type FinanceModals = {
86
86
 
87
87
  'import-actual': null;
88
88
 
89
+ 'out-of-sync-migrations': null;
90
+
91
+ 'files-settings': null;
92
+
93
+ 'confirm-change-document-dir': {
94
+ currentBudgetDirectory: string;
95
+ newDirectory: string;
96
+ };
97
+
89
98
  'create-encryption-key': { recreate?: boolean };
90
99
  'fix-encryption-key': {
91
100
  hasExistingKey?: boolean;
@@ -276,6 +285,8 @@ type FinanceModals = {
276
285
  accountName: string;
277
286
  onUnlink: () => void;
278
287
  };
288
+ 'keyboard-shortcuts': EmptyObject;
289
+ 'goal-templates': EmptyObject;
279
290
  };
280
291
 
281
292
  export type PushModalAction = {
@@ -1,9 +1,6 @@
1
- import { type Transports } from 'electron-log';
2
-
3
1
  export interface Logger {
4
2
  info(...args: unknown[]): void;
5
3
  warn(...args: unknown[]): void;
6
- transports?: Transports;
7
4
  }
8
5
 
9
6
  export const logger: Logger;
@@ -1,3 +1,4 @@
1
+ import { RuleEntity } from '../../types/models';
1
2
  export declare function parseDateString(str: any): {
2
3
  type: string;
3
4
  date: string;
@@ -30,6 +31,7 @@ export declare class Action {
30
31
  rawValue: any;
31
32
  type: any;
32
33
  value: any;
34
+ private handlebarsTemplate?;
33
35
  constructor(op: ActionOperator, field: any, value: any, options: any);
34
36
  exec(object: any): void;
35
37
  serialize(): {
@@ -42,48 +44,42 @@ export declare class Action {
42
44
  }
43
45
  export declare function execActions(actions: Action[], transaction: any): any;
44
46
  export declare class Rule {
45
- actions: any;
46
- conditions: any;
47
+ actions: Action[];
48
+ conditions: Condition[];
47
49
  conditionsOp: any;
48
- id: any;
49
- stage: any;
50
+ id?: string;
51
+ stage: 'pre' | null | 'post';
50
52
  constructor({ id, stage, conditionsOp, conditions, actions, }: {
51
53
  id?: string;
52
- stage?: any;
54
+ stage?: 'pre' | null | 'post';
53
55
  conditionsOp: any;
54
56
  conditions: any;
55
57
  actions: any;
56
58
  });
57
- evalConditions(object: any): any;
59
+ evalConditions(object: any): boolean;
58
60
  execActions<T>(object: T): Partial<T>;
59
61
  exec(object: any): Partial<any>;
60
62
  apply(object: any): any;
61
- getId(): any;
62
- serialize(): {
63
- id: any;
64
- stage: any;
65
- conditionsOp: any;
66
- conditions: any;
67
- actions: any;
68
- };
63
+ getId(): string | undefined;
64
+ serialize(): RuleEntity;
69
65
  }
70
66
  export declare class RuleIndexer {
71
- field: any;
72
- method: any;
73
- rules: any;
67
+ field: string;
68
+ method?: string;
69
+ rules: Map<string, Set<Rule>>;
74
70
  constructor({ field, method }: {
75
71
  field: string;
76
72
  method?: string;
77
73
  });
78
- getIndex(key: any): any;
79
- getIndexForValue(value: any): any;
80
- getKey(value: any): string;
81
- getIndexes(rule: any): any[];
82
- index(rule: any): void;
83
- remove(rule: any): void;
84
- getApplicableRules(object: any): Set<unknown>;
74
+ getIndex(key: string | null): Set<Rule>;
75
+ getIndexForValue(value: unknown): Set<Rule>;
76
+ getKey(value: unknown): string | null;
77
+ getIndexes(rule: Rule): Set<Rule>[];
78
+ index(rule: Rule): void;
79
+ remove(rule: Rule): void;
80
+ getApplicableRules(object: any): Set<Rule>;
85
81
  }
86
- export declare function rankRules(rules: any): any[];
87
- export declare function migrateIds(rule: any, mappings: any): void;
88
- export declare function iterateIds(rules: any, fieldName: any, func: any): void;
82
+ export declare function rankRules(rules: Iterable<Rule>): Rule[];
83
+ export declare function migrateIds(rule: Rule, mappings: Map<string, string>): void;
84
+ export declare function iterateIds(rules: Rule[], fieldName: string, func: (rule: Rule, id: string) => void | boolean): void;
89
85
  export {};
@@ -1,5 +1,5 @@
1
1
  import { type TransactionEntity, type RuleActionEntity, type RuleEntity } from '../../types/models';
2
- import { Action } from './rules';
2
+ import { Action, Rule } from './rules';
3
3
  export { iterateIds } from './rules';
4
4
  export declare function resetState(): void;
5
5
  export declare function parseConditionsOrActions(str: any): any[];
@@ -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): any;
22
+ export declare function runRules(trans: any): Promise<TransactionEntity>;
23
23
  export declare function conditionsToAQL(conditions: any, { recurDateBounds }?: {
24
24
  recurDateBounds?: number;
25
25
  }): {
@@ -39,7 +39,12 @@ export declare function applyActions(transactions: TransactionEntity[], actions:
39
39
  category: any;
40
40
  })[];
41
41
  }>;
42
- export declare function getRulesForPayee(payeeId: any): any[];
42
+ export declare function getRulesForPayee(payeeId: any): Rule[];
43
43
  export declare function updatePayeeRenameRule(fromNames: string[], to: string): Promise<any>;
44
44
  export declare function getProbableCategory(transactions: any): any;
45
45
  export declare function updateCategoryRules(transactions: any): Promise<void>;
46
+ export type TransactionForRules = TransactionEntity & {
47
+ payee_name?: string;
48
+ };
49
+ export declare function prepareTransactionForRules(trans: TransactionEntity): Promise<TransactionForRules>;
50
+ export declare function finalizeTransactionForRules(trans: TransactionEntity | TransactionForRules): Promise<TransactionEntity>;
@@ -0,0 +1,7 @@
1
+ export declare function goalsCopy(template: any, month: any, category: any, limitCheck: any, errors: any, limit: any, hold: any, to_budget: any): Promise<{
2
+ to_budget: any;
3
+ errors: any;
4
+ limit: any;
5
+ limitCheck: any;
6
+ hold: any;
7
+ }>;
@@ -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" | "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" | "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" | "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-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;
8
8
  service(func: any): void;
9
9
  combine(...apps: any[]): void;
10
10
  startServices(): void;
@@ -1,6 +1,8 @@
1
1
  import type { MetadataPrefs } from '../types/prefs';
2
2
  export declare const BUDGET_TYPES: readonly ["report", "rollover"];
3
3
  export type BudgetType = (typeof BUDGET_TYPES)[number];
4
+ export declare const UPCOMING_SCHEDULED_TRANSACTION_LENGTHS: readonly ["1", "7", "14", "30"];
5
+ export type UpcomingScheduledTransactionLength = (typeof UPCOMING_SCHEDULED_TRANSACTION_LENGTHS)[number];
4
6
  export declare function loadPrefs(id?: string): Promise<MetadataPrefs>;
5
7
  export declare function savePrefs(prefsToSet: MetadataPrefs, { avoidSync }?: {
6
8
  avoidSync?: boolean;
@@ -25,7 +25,7 @@ export declare function deserializeField(field: any): {
25
25
  field: any;
26
26
  options?: undefined;
27
27
  };
28
- export declare function getFieldError(type: any): "Invalid date format" | "Value cannot be empty" | "Value must be a string" | "Value must be a boolean" | "Value must be a number" | "Please choose a valid field for this type of rule" | "Internal error, sorry! Please get in touch https://actualbudget.org/contact/ for support";
28
+ export declare function getFieldError(type: any): "Invalid date format" | "Value cannot be empty" | "Value must be a string" | "Value must be a boolean" | "Value must be a number" | "Please choose a valid field for this type of rule" | "Invalid handlebars template" | "Internal error, sorry! Please get in touch https://actualbudget.org/contact/ for support";
29
29
  export declare function sortNumbers(num1: any, num2: any): any[];
30
30
  export declare function parse(item: any): any;
31
31
  export declare function unparse({ error, inputKey, ...item }: {
@@ -1,5 +1,5 @@
1
1
  import type { IRuleOptions } from '@rschedule/core';
2
- export declare function getStatus(nextDate: string, completed: boolean, hasTrans: boolean): "completed" | "paid" | "due" | "upcoming" | "missed" | "scheduled";
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
5
  export declare function recurConfigToRSchedule(config: any): IRuleOptions[] | ({
@@ -20,9 +20,7 @@ export declare function diffItems<T extends {
20
20
  }>(items: T[], newItems: T[]): Diff<T>;
21
21
  export declare function groupById<T extends {
22
22
  id: string;
23
- }>(data: T[]): {
24
- [key: string]: T;
25
- };
23
+ }>(data: T[]): Record<string, T>;
26
24
  export declare function setIn(map: Map<string, unknown>, keys: string[], item: unknown): void;
27
25
  export declare function getIn(map: any, keys: any): any;
28
26
  export declare function fastSetMerge<T>(set1: Set<T>, set2: Set<T>): Set<T>;
@@ -4,6 +4,6 @@ export interface PayeeEntity {
4
4
  id: string;
5
5
  name: string;
6
6
  transfer_acct?: AccountEntity['id'];
7
- favorite?: boolean;
7
+ favorite?: 1 | 0;
8
8
  tombstone?: boolean;
9
9
  }
@@ -1,8 +1,8 @@
1
1
  import { type ScheduleEntity } from './schedule';
2
2
 
3
3
  export interface NewRuleEntity {
4
- stage: string;
5
- conditionsOp: 'any' | 'and';
4
+ stage: 'pre' | null | 'post';
5
+ conditionsOp: 'or' | 'and';
6
6
  conditions: RuleConditionEntity[];
7
7
  actions: RuleActionEntity[];
8
8
  tombstone?: boolean;
@@ -35,6 +35,7 @@ type FieldValueTypes = {
35
35
  date: string;
36
36
  notes: string;
37
37
  payee: string;
38
+ payee_name: string;
38
39
  imported_payee: string;
39
40
  saved: string;
40
41
  cleared: boolean;
@@ -138,6 +139,7 @@ export interface SetRuleActionEntity {
138
139
  op: 'set';
139
140
  value: unknown;
140
141
  options?: {
142
+ template?: string;
141
143
  splitIndex?: number;
142
144
  };
143
145
  type?: string;
@@ -2,7 +2,8 @@ export type FeatureFlag =
2
2
  | 'dashboards'
3
3
  | 'reportBudget'
4
4
  | 'goalTemplatesEnabled'
5
- | 'spendingReport';
5
+ | 'actionTemplating'
6
+ | 'upcomingLengthAdjustment';
6
7
 
7
8
  /**
8
9
  * Cross-device preferences. These sync across devices when they are changed.
@@ -10,6 +11,7 @@ export type FeatureFlag =
10
11
  export type SyncedPrefs = Partial<
11
12
  Record<
12
13
  | 'budgetType'
14
+ | 'upcomingScheduledTransactionLength'
13
15
  | 'firstDayOfWeekIdx'
14
16
  | 'dateFormat'
15
17
  | 'numberFormat'
@@ -24,6 +26,8 @@ export type SyncedPrefs = Partial<
24
26
  | `csv-mappings-${string}`
25
27
  | `csv-delimiter-${string}`
26
28
  | `csv-skip-lines-${string}`
29
+ | `csv-in-out-mode-${string}`
30
+ | `csv-out-value-${string}`
27
31
  | `csv-has-header-${string}`
28
32
  | `ofx-fallback-missing-payee-${string}`
29
33
  | `flip-amount-${string}-${'csv' | 'qif'}`
@@ -1,7 +1,8 @@
1
+ import { type Backup } from '../server/backups';
1
2
  import { type UndoState } from '../server/undo';
2
3
 
3
4
  export interface ServerEvents {
4
- 'backups-updated': unknown;
5
+ 'backups-updated': Backup[];
5
6
  'cells-changed': Array<{ name }>;
6
7
  'fallback-write-error': unknown;
7
8
  'finish-import': unknown;