@actual-app/api 6.9.0 → 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.
Files changed (70) hide show
  1. package/@types/jest.config.d.ts +7 -7
  2. package/@types/loot-core/client/constants.d.ts +1 -0
  3. package/@types/loot-core/client/state-types/index.d.ts +1 -1
  4. package/@types/loot-core/client/state-types/modals.d.ts +18 -6
  5. package/@types/loot-core/client/state-types/notifications.d.ts +18 -1
  6. package/@types/loot-core/client/state-types/prefs.d.ts +9 -4
  7. package/@types/loot-core/server/accounts/parse-file.d.ts +1 -0
  8. package/@types/loot-core/server/accounts/rules.d.ts +2 -2
  9. package/@types/loot-core/server/accounts/sync.d.ts +2 -2
  10. package/@types/loot-core/server/accounts/transaction-rules.d.ts +1 -3
  11. package/@types/loot-core/server/accounts/transactions.d.ts +3 -5
  12. package/@types/loot-core/server/api-models.d.ts +6 -6
  13. package/@types/loot-core/server/aql/schema/index.d.ts +26 -3
  14. package/@types/loot-core/server/budget/statements.d.ts +9 -0
  15. package/@types/loot-core/server/budget/template-notes.d.ts +5 -0
  16. package/@types/loot-core/server/budget/types/templates.d.ts +82 -0
  17. package/@types/loot-core/server/cloud-storage.d.ts +0 -1
  18. package/@types/loot-core/server/dashboard/app.d.ts +12 -0
  19. package/@types/loot-core/server/dashboard/types/handlers.d.ts +24 -0
  20. package/@types/loot-core/server/db/index.d.ts +3 -2
  21. package/@types/loot-core/server/db/types.d.ts +9 -0
  22. package/@types/loot-core/server/encryption-internals.d.ts +0 -1
  23. package/@types/loot-core/server/encryption-internals.web.d.ts +0 -1
  24. package/@types/loot-core/server/encryption.d.ts +0 -1
  25. package/@types/loot-core/server/errors.d.ts +2 -0
  26. package/@types/loot-core/server/importers/actual.d.ts +0 -1
  27. package/@types/loot-core/server/importers/index.d.ts +0 -1
  28. package/@types/loot-core/server/importers/ynab4.d.ts +0 -1
  29. package/@types/loot-core/server/importers/ynab5.d.ts +0 -1
  30. package/@types/loot-core/server/main-app.d.ts +1 -1
  31. package/@types/loot-core/server/models.d.ts +4 -4
  32. package/@types/loot-core/server/prefs.d.ts +7 -2
  33. package/@types/loot-core/server/reports/app.d.ts +46 -0
  34. package/@types/loot-core/server/rules/types/handlers.d.ts +4 -6
  35. package/@types/loot-core/server/sync/make-test-message.d.ts +0 -1
  36. package/@types/loot-core/shared/dashboard.d.ts +2 -0
  37. package/@types/loot-core/shared/months.d.ts +7 -6
  38. package/@types/loot-core/shared/rules.d.ts +5 -1
  39. package/@types/loot-core/shared/schedules.d.ts +22 -22
  40. package/@types/loot-core/shared/transactions.d.ts +24 -73
  41. package/@types/loot-core/shared/util.d.ts +9 -12
  42. package/@types/loot-core/types/api-handlers.d.ts +14 -3
  43. package/@types/loot-core/types/handlers.d.ts +2 -0
  44. package/@types/loot-core/types/models/category-group.d.ts +6 -2
  45. package/@types/loot-core/types/models/category.d.ts +4 -2
  46. package/@types/loot-core/types/models/dashboard.d.ts +56 -0
  47. package/@types/loot-core/types/models/index.d.ts +1 -0
  48. package/@types/loot-core/types/models/payee.d.ts +5 -7
  49. package/@types/loot-core/types/models/reports.d.ts +2 -5
  50. package/@types/loot-core/types/models/rule.d.ts +100 -7
  51. package/@types/loot-core/types/models/transaction.d.ts +12 -25
  52. package/@types/loot-core/types/prefs.d.ts +44 -22
  53. package/@types/loot-core/types/server-handlers.d.ts +5 -7
  54. package/@types/loot-core/types/util.d.ts +4 -0
  55. package/@types/methods.d.ts +4 -11
  56. package/@types/migrations/1722717601000_reports_move_selected_categories.d.ts +1 -0
  57. package/@types/migrations/1722804019000_create_dashboard_table.d.ts +1 -0
  58. package/dist/app/bundle.api.js +4620 -1320
  59. package/dist/app/query.js +1 -2
  60. package/dist/index.js +3 -3
  61. package/dist/injected.js +2 -2
  62. package/dist/methods.js +53 -45
  63. package/dist/methods.test.js +8 -14
  64. package/dist/migrations/1632571489012_remove_cache.js +1 -1
  65. package/dist/migrations/1722717601000_reports_move_selected_categories.js +39 -0
  66. package/dist/migrations/1722804019000_create_dashboard_table.js +38 -0
  67. package/dist/package.json +2 -2
  68. package/dist/utils.js +2 -3
  69. package/dist/validateNodeVersion.js +1 -2
  70. package/package.json +2 -2
@@ -1,9 +1,9 @@
1
- export const moduleFileExtensions: string[];
2
- export const testEnvironment: string;
3
- export const testPathIgnorePatterns: string[];
4
- export const watchPathIgnorePatterns: string[];
5
- export const setupFilesAfterEnv: string[];
6
- export const transformIgnorePatterns: string[];
7
- export const transform: {
1
+ export let moduleFileExtensions: string[];
2
+ export let testEnvironment: string;
3
+ export let testPathIgnorePatterns: string[];
4
+ export let watchPathIgnorePatterns: string[];
5
+ export let setupFilesAfterEnv: string[];
6
+ export let transformIgnorePatterns: string[];
7
+ export let transform: {
8
8
  '^.+\\.(t|j)sx?$': string;
9
9
  };
@@ -22,6 +22,7 @@ export declare const COLLAPSE_MODALS = "COLLAPSE_MODALS";
22
22
  export declare const POP_MODAL = "POP_MODAL";
23
23
  export declare const ADD_NOTIFICATION = "ADD_NOTIFICATION";
24
24
  export declare const REMOVE_NOTIFICATION = "REMOVE_NOTIFICATION";
25
+ export declare const SET_NOTIFICATION_INSET = "SET_NOTIFICATION_INSET";
25
26
  export declare const GET_USER_DATA = "GET_USER_DATA";
26
27
  export declare const SET_LAST_UNDO_STATE = "SET_LAST_UNDO_STATE";
27
28
  export declare const SET_LAST_SPLIT_STATE = "SET_LAST_SPLIT_STATE";
@@ -36,6 +36,6 @@ export type State = {
36
36
  };
37
37
 
38
38
  declare module 'react-redux' {
39
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions, @typescript-eslint/no-empty-interface
39
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/consistent-type-definitions
40
40
  export interface DefaultRootState extends State {}
41
41
  }
@@ -4,6 +4,7 @@ import type {
4
4
  CategoryEntity,
5
5
  CategoryGroupEntity,
6
6
  GoCardlessToken,
7
+ ScheduleEntity,
7
8
  TransactionEntity,
8
9
  } from '../../types/models';
9
10
  import type { NewRuleEntity, RuleEntity } from '../../types/models/rule';
@@ -93,14 +94,17 @@ type FinanceModals = {
93
94
  };
94
95
 
95
96
  'edit-field': {
96
- name: string;
97
- month: string;
98
- onSubmit: (name: string, value: string) => void;
99
- onClose: () => void;
97
+ name: keyof Pick<TransactionEntity, 'date' | 'amount' | 'notes'>;
98
+ onSubmit: (
99
+ name: keyof Pick<TransactionEntity, 'date' | 'amount' | 'notes'>,
100
+ value: string | number,
101
+ mode?: 'prepend' | 'append' | 'replace' | null,
102
+ ) => void;
103
+ onClose?: () => void;
100
104
  };
101
105
 
102
106
  'category-autocomplete': {
103
- categoryGroups: CategoryGroupEntity[];
107
+ categoryGroups?: CategoryGroupEntity[];
104
108
  onSelect: (categoryId: string, categoryName: string) => void;
105
109
  month?: string;
106
110
  showHiddenCategories?: boolean;
@@ -124,7 +128,14 @@ type FinanceModals = {
124
128
 
125
129
  'schedule-edit': { id: string; transaction?: TransactionEntity } | null;
126
130
 
127
- 'schedule-link': { transactionIds: string[] } | null;
131
+ 'schedule-link': {
132
+ transactionIds: string[];
133
+ getTransaction: (
134
+ transactionId: TransactionEntity['id'],
135
+ ) => TransactionEntity;
136
+ accountName?: string;
137
+ onScheduleLinked?: (schedule: ScheduleEntity) => void;
138
+ };
128
139
 
129
140
  'schedules-discover': null;
130
141
 
@@ -256,6 +267,7 @@ type FinanceModals = {
256
267
  confirmReason: string;
257
268
  };
258
269
  'confirm-transaction-delete': {
270
+ message?: string;
259
271
  onConfirm: () => void;
260
272
  };
261
273
  };
@@ -21,6 +21,12 @@ type NotificationWithId = Notification & { id: string };
21
21
 
22
22
  export type NotificationsState = {
23
23
  notifications: NotificationWithId[];
24
+ inset?: {
25
+ bottom?: number;
26
+ top?: number;
27
+ right?: number;
28
+ left?: number;
29
+ };
24
30
  };
25
31
 
26
32
  type AddNotificationAction = {
@@ -33,6 +39,17 @@ type RemoveNotificationAction = {
33
39
  id: string;
34
40
  };
35
41
 
42
+ type SetNotificationInsetAction = {
43
+ type: typeof constants.SET_NOTIFICATION_INSET;
44
+ inset: {
45
+ bottom?: number;
46
+ top?: number;
47
+ right?: number;
48
+ left?: number;
49
+ };
50
+ };
51
+
36
52
  export type NotificationsActions =
37
53
  | AddNotificationAction
38
- | RemoveNotificationAction;
54
+ | RemoveNotificationAction
55
+ | SetNotificationInsetAction;
@@ -1,20 +1,25 @@
1
- import type { LocalPrefs, GlobalPrefs } from '../../types/prefs';
1
+ import type {
2
+ GlobalPrefs,
3
+ LocalPrefs,
4
+ MetadataPrefs,
5
+ SyncedPrefs,
6
+ } from '../../types/prefs';
2
7
  import type * as constants from '../constants';
3
8
 
4
9
  export type PrefsState = {
5
- local: LocalPrefs;
10
+ local: LocalPrefs & MetadataPrefs & SyncedPrefs;
6
11
  global: GlobalPrefs;
7
12
  };
8
13
 
9
14
  export type SetPrefsAction = {
10
15
  type: typeof constants.SET_PREFS;
11
- prefs: LocalPrefs;
16
+ prefs: LocalPrefs & MetadataPrefs & SyncedPrefs;
12
17
  globalPrefs: GlobalPrefs;
13
18
  };
14
19
 
15
20
  export type MergeLocalPrefsAction = {
16
21
  type: typeof constants.MERGE_LOCAL_PREFS;
17
- prefs: LocalPrefs;
22
+ prefs: LocalPrefs & MetadataPrefs & SyncedPrefs;
18
23
  };
19
24
 
20
25
  export type MergeGlobalPrefsAction = {
@@ -10,6 +10,7 @@ type ParseFileOptions = {
10
10
  hasHeaderRow?: boolean;
11
11
  delimiter?: string;
12
12
  fallbackMissingPayeeToMemo?: boolean;
13
+ skipLines?: number;
13
14
  };
14
15
  export declare function parseFile(filepath: string, options?: ParseFileOptions): Promise<ParseFileResult>;
15
16
  export {};
@@ -21,7 +21,7 @@ export declare class Condition {
21
21
  type: any;
22
22
  };
23
23
  }
24
- declare const ACTION_OPS: readonly ["set", "set-split-amount", "link-schedule"];
24
+ declare const ACTION_OPS: readonly ["set", "set-split-amount", "link-schedule", "prepend-notes", "append-notes"];
25
25
  type ActionOperator = (typeof ACTION_OPS)[number];
26
26
  export declare class Action {
27
27
  field: any;
@@ -34,7 +34,7 @@ export declare class Action {
34
34
  exec(object: any): void;
35
35
  serialize(): {
36
36
  options: any;
37
- op: "set" | "set-split-amount" | "link-schedule";
37
+ op: "set" | "set-split-amount" | "link-schedule" | "prepend-notes" | "append-notes";
38
38
  field: any;
39
39
  value: any;
40
40
  type: any;
@@ -1,10 +1,10 @@
1
1
  export declare function getGoCardlessAccounts(userId: any, userKey: any, id: any): Promise<any>;
2
- export declare function reconcileTransactions(acctId: any, transactions: any, isBankSyncAccount?: boolean, isPreview?: boolean): Promise<{
2
+ export declare function reconcileTransactions(acctId: any, transactions: any, isBankSyncAccount?: boolean, strictIdChecking?: boolean, isPreview?: boolean): Promise<{
3
3
  added: any[];
4
4
  updated: any[];
5
5
  updatedPreview: any[];
6
6
  }>;
7
- export declare function matchTransactions(acctId: any, transactions: any, isBankSyncAccount?: boolean): Promise<{
7
+ export declare function matchTransactions(acctId: any, transactions: any, isBankSyncAccount?: boolean, strictIdChecking?: boolean): Promise<{
8
8
  payeesToCreate: Map<any, any>;
9
9
  transactionsStep1: any[];
10
10
  transactionsStep2: any[];
@@ -18,9 +18,7 @@ export declare function insertRule(rule: Omit<RuleEntity, 'id'> & {
18
18
  id?: string;
19
19
  }): Promise<any>;
20
20
  export declare function updateRule(rule: any): Promise<void>;
21
- export declare function deleteRule<T extends {
22
- id: string;
23
- }>(rule: T): Promise<false | void>;
21
+ export declare function deleteRule(id: string): Promise<boolean>;
24
22
  export declare function runRules(trans: any): any;
25
23
  export declare function conditionsToAQL(conditions: any, { recurDateBounds }?: {
26
24
  recurDateBounds?: number;
@@ -1,8 +1,6 @@
1
- import { NewTransactionEntity, TransactionEntity } from '../../types/models';
2
- export declare function batchUpdateTransactions({ added, deleted, updated, learnCategories, detectOrphanPayees, runTransfers, }: {
3
- added?: Array<Partial<NewTransactionEntity | TransactionEntity>>;
4
- deleted?: Array<Partial<NewTransactionEntity | TransactionEntity>>;
5
- updated?: Array<Partial<NewTransactionEntity | TransactionEntity>>;
1
+ import { Diff } from '../../shared/util';
2
+ import { TransactionEntity } from '../../types/models';
3
+ export declare function batchUpdateTransactions({ added, deleted, updated, learnCategories, detectOrphanPayees, runTransfers, }: Partial<Diff<TransactionEntity>> & {
6
4
  learnCategories?: boolean;
7
5
  detectOrphanPayees?: boolean;
8
6
  runTransfers?: boolean;
@@ -18,10 +18,10 @@ export type APICategoryEntity = Pick<CategoryEntity, 'id' | 'name' | 'is_income'
18
18
  export declare const categoryModel: {
19
19
  toExternal(category: CategoryEntity): APICategoryEntity;
20
20
  fromExternal(category: APICategoryEntity): {
21
- id?: string;
21
+ id: string;
22
22
  name: string;
23
23
  is_income?: boolean;
24
- cat_group?: string;
24
+ cat_group?: CategoryGroupEntity["id"];
25
25
  sort_order?: number;
26
26
  tombstone?: boolean;
27
27
  hidden?: boolean;
@@ -30,10 +30,10 @@ export declare const categoryModel: {
30
30
  update?: boolean;
31
31
  }): {
32
32
  hidden: number;
33
- id?: string;
33
+ id: string;
34
34
  name: string;
35
35
  is_income?: boolean;
36
- cat_group?: string;
36
+ cat_group?: CategoryGroupEntity["id"];
37
37
  tombstone?: boolean;
38
38
  };
39
39
  };
@@ -47,11 +47,11 @@ export declare const categoryGroupModel: {
47
47
  update?: boolean;
48
48
  }): {
49
49
  hidden: number;
50
- id?: string;
50
+ id: string;
51
+ categories?: CategoryEntity[];
51
52
  name: string;
52
53
  is_income?: boolean;
53
54
  tombstone?: boolean;
54
- categories?: CategoryEntity[];
55
55
  };
56
56
  };
57
57
  export type APIPayeeEntity = Pick<PayeeEntity, 'id' | 'name' | 'transfer_acct'>;
@@ -283,9 +283,6 @@ export declare const schema: {
283
283
  include_current: {
284
284
  type: string;
285
285
  };
286
- selected_categories: {
287
- type: string;
288
- };
289
286
  graph_type: {
290
287
  type: string;
291
288
  };
@@ -354,5 +351,31 @@ export declare const schema: {
354
351
  type: string;
355
352
  };
356
353
  };
354
+ dashboard: {
355
+ id: {
356
+ type: string;
357
+ };
358
+ type: {
359
+ type: string;
360
+ };
361
+ width: {
362
+ type: string;
363
+ };
364
+ height: {
365
+ type: string;
366
+ };
367
+ x: {
368
+ type: string;
369
+ };
370
+ y: {
371
+ type: string;
372
+ };
373
+ meta: {
374
+ type: string;
375
+ };
376
+ tombstone: {
377
+ type: string;
378
+ };
379
+ };
357
380
  };
358
381
  export declare const schemaConfig: SchemaConfig;
@@ -0,0 +1,9 @@
1
+ import { Schedule } from '../db/types';
2
+ export declare function resetCategoryGoalDefsWithNoTemplates(): Promise<void>;
3
+ export type CategoryWithTemplateNote = {
4
+ id: string;
5
+ name: string;
6
+ note: string;
7
+ };
8
+ export declare function getCategoriesWithTemplateNotes(): Promise<CategoryWithTemplateNote[]>;
9
+ export declare function getActiveSchedules(): Promise<Schedule[]>;
@@ -0,0 +1,5 @@
1
+ import { Notification } from '../../client/state-types/notifications';
2
+ export declare const TEMPLATE_PREFIX = "#template";
3
+ export declare const GOAL_PREFIX = "#goal";
4
+ export declare function storeTemplates(): Promise<void>;
5
+ export declare function checkTemplates(): Promise<Notification>;
@@ -0,0 +1,82 @@
1
+ interface BaseTemplate {
2
+ type: string;
3
+ priority?: number;
4
+ directive: string;
5
+ }
6
+
7
+ interface PercentageTemplate extends BaseTemplate {
8
+ type: 'percentage';
9
+ percent: number;
10
+ previous: boolean;
11
+ category: string;
12
+ }
13
+
14
+ interface WeekTemplate extends BaseTemplate {
15
+ type: 'week';
16
+ amount: number;
17
+ weeks: number | null;
18
+ starting: string;
19
+ limit?: { amount: number; hold: boolean };
20
+ }
21
+
22
+ interface ByTemplate extends BaseTemplate {
23
+ type: 'by';
24
+ amount: number;
25
+ month: string;
26
+ repeat?: { annual: boolean; repeat?: number };
27
+ from?: string;
28
+ }
29
+
30
+ interface SpendTemplate extends BaseTemplate {
31
+ type: 'spend';
32
+ amount: number;
33
+ month: string;
34
+ from: string;
35
+ repeat?: { annual: boolean; repeat?: number };
36
+ }
37
+
38
+ interface SimpleTemplate extends BaseTemplate {
39
+ type: 'simple';
40
+ monthly?: number;
41
+ limit?: { amount: number; hold: boolean };
42
+ }
43
+
44
+ interface ScheduleTemplate extends BaseTemplate {
45
+ type: 'schedule';
46
+ name: string;
47
+ full?: boolean;
48
+ }
49
+
50
+ interface RemainderTemplate extends BaseTemplate {
51
+ type: 'remainder';
52
+ weight: number;
53
+ limit?: { amount: number; hold: boolean };
54
+ }
55
+
56
+ interface AverageTemplate extends BaseTemplate {
57
+ type: 'average';
58
+ amount: number;
59
+ }
60
+
61
+ interface GoalTemplate extends BaseTemplate {
62
+ type: 'simple';
63
+ amount: number;
64
+ }
65
+
66
+ interface ErrorTemplate extends BaseTemplate {
67
+ type: 'error';
68
+ line: string;
69
+ error: string;
70
+ }
71
+
72
+ export type Template =
73
+ | PercentageTemplate
74
+ | WeekTemplate
75
+ | ByTemplate
76
+ | SpendTemplate
77
+ | SimpleTemplate
78
+ | ScheduleTemplate
79
+ | RemainderTemplate
80
+ | AverageTemplate
81
+ | GoalTemplate
82
+ | ErrorTemplate;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  export interface RemoteFile {
3
2
  deleted: boolean;
4
3
  fileId: string;
@@ -0,0 +1,12 @@
1
+ import { DashboardHandlers } from './types/handlers';
2
+ export declare const app: {
3
+ events: any;
4
+ handlers: DashboardHandlers;
5
+ services: any;
6
+ unlistenServices: any;
7
+ method<Name extends "dashboard-update" | "dashboard-update-widget" | "dashboard-reset" | "dashboard-add-widget" | "dashboard-remove-widget" | "dashboard-import">(name: Name, func: DashboardHandlers[Name]): void;
8
+ service(func: any): void;
9
+ combine(...apps: any[]): void;
10
+ startServices(): void;
11
+ stopServices(): void;
12
+ };
@@ -0,0 +1,24 @@
1
+ import { type Widget } from '../../../types/models';
2
+ import { type EverythingButIdOptional } from '../../../types/util';
3
+
4
+ export interface DashboardHandlers {
5
+ 'dashboard-update': (
6
+ widgets: EverythingButIdOptional<Omit<Widget, 'tombstone'>>[],
7
+ ) => Promise<void>;
8
+ 'dashboard-update-widget': (
9
+ widget: EverythingButIdOptional<Omit<Widget, 'tombstone'>>,
10
+ ) => Promise<void>;
11
+ 'dashboard-reset': () => Promise<void>;
12
+ 'dashboard-add-widget': (
13
+ widget: Omit<Widget, 'id' | 'x' | 'y' | 'tombstone'> &
14
+ Partial<Pick<Widget, 'x' | 'y'>>,
15
+ ) => Promise<void>;
16
+ 'dashboard-remove-widget': (widgetId: string) => Promise<void>;
17
+ 'dashboard-import': (args: {
18
+ filepath: string;
19
+ }) => Promise<
20
+ | { status: 'ok' }
21
+ | { error: 'json-parse-error' | 'internal-error' }
22
+ | { error: 'validation-error'; message: string }
23
+ >;
24
+ }
@@ -13,7 +13,7 @@ export declare function getDatabase(): {
13
13
  exec(sql: string, params?: import("@jlongster/sql.js").BindParams): import("@jlongster/sql.js").QueryExecResult[];
14
14
  export(): Uint8Array;
15
15
  getRowsModified(): number;
16
- handleError(): null;
16
+ handleError(): null | never;
17
17
  iterateStatements(sql: string): {
18
18
  getRemainingSql(): string;
19
19
  next(): import("@jlongster/sql.js").StatementIteratorResult;
@@ -29,7 +29,7 @@ export declare function getDatabase(): {
29
29
  reset(): void;
30
30
  run(values?: import("@jlongster/sql.js").BindParams): void;
31
31
  step(): boolean;
32
- }, any, undefined>;
32
+ }>;
33
33
  };
34
34
  prepare(sql: string, params?: import("@jlongster/sql.js").BindParams): {
35
35
  bind(values?: import("@jlongster/sql.js").BindParams): boolean;
@@ -62,6 +62,7 @@ export declare function update(table: any, params: any): Promise<void>;
62
62
  export declare function insertWithUUID(table: any, row: any): Promise<any>;
63
63
  export declare function insert(table: any, row: any): Promise<void>;
64
64
  export declare function delete_(table: any, id: any): Promise<void>;
65
+ export declare function deleteAll(table: string): Promise<void>;
65
66
  export declare function selectWithSchema(table: any, sql: any, params: any): Promise<any>;
66
67
  export declare function selectFirstWithSchema(table: any, sql: any, params: any): Promise<any>;
67
68
  export declare function insertWithSchema(table: any, row: any): Promise<any>;
@@ -0,0 +1,9 @@
1
+ export type Schedule = {
2
+ id: string;
3
+ rule: string;
4
+ active: number;
5
+ completed: number;
6
+ posts_transaction: number;
7
+ tombstone: number;
8
+ name: string | null;
9
+ };
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  export declare function sha256String(str: any): Promise<string>;
3
2
  export declare function randomBytes(n: any): Buffer;
4
3
  export declare function encrypt(masterKey: any, value: any): {
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  export declare function sha256String(str: any): Promise<string>;
3
2
  export declare function randomBytes(n: any): Buffer;
4
3
  export declare function encrypt(masterKey: any, value: any): Promise<{
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  declare class Key {
3
2
  id: any;
4
3
  value: any;
@@ -40,6 +40,8 @@ export declare class SyncError extends Error {
40
40
  };
41
41
  });
42
42
  }
43
+ export declare class ValidationError extends Error {
44
+ }
43
45
  export declare class TransactionError extends Error {
44
46
  }
45
47
  export declare class RuleError extends Error {
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  export declare function importActual(_filepath: string, buffer: Buffer): Promise<{
3
2
  error: any;
4
3
  }>;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  type ImportableBudgetType = 'ynab4' | 'ynab5' | 'actual';
3
2
  export declare function handleBudgetImport(type: ImportableBudgetType, filepath: string, buffer: Buffer): Promise<{
4
3
  error: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { YNAB4 } from './ynab4-types';
3
2
  export declare function doImport(data: YNAB4.YFull): Promise<void>;
4
3
  export declare function getBudgetName(filepath: any): string;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { YNAB5 } from './ynab5-types';
3
2
  export declare function doImport(data: YNAB5.Budget): Promise<void>;
4
3
  export declare function parseFile(buffer: Buffer): YNAB5.Budget;
@@ -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" | "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/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" | "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;
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?: string;
15
+ id: string;
16
16
  name: string;
17
17
  is_income?: boolean;
18
- cat_group?: string;
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?: string;
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 { LocalPrefs } from '../types/prefs';
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): LocalPrefs;
11
+ export declare function getDefaultPrefs(id: string, budgetName: string): {
12
+ id: string;
13
+ budgetName: string;
14
+ };
15
+ export {};