@actual-app/api 25.4.0 → 25.6.0-edge.23

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 (102) hide show
  1. package/@types/app/bundle.api.d.ts +1 -5
  2. package/@types/loot-core/mocks/index.d.ts +5 -2
  3. package/@types/loot-core/mocks/util.d.ts +1 -0
  4. package/@types/loot-core/platform/server/asyncStorage/index.d.ts +7 -6
  5. package/@types/loot-core/platform/server/indexeddb/index.d.ts +15 -24
  6. package/@types/loot-core/server/accounts/sync.d.ts +1 -9
  7. package/@types/loot-core/server/api-models.d.ts +2 -10
  8. package/@types/loot-core/server/aql/compiler.d.ts +40 -38
  9. package/@types/loot-core/server/aql/exec.d.ts +15 -7
  10. package/@types/loot-core/server/aql/index.d.ts +8 -1
  11. package/@types/loot-core/server/aql/schema/executors.d.ts +2 -5
  12. package/@types/loot-core/server/auth/app.d.ts +142 -0
  13. package/@types/loot-core/server/budget/app.d.ts +1 -1
  14. package/@types/loot-core/server/budget/base.d.ts +2 -1
  15. package/@types/loot-core/server/budget/category-template-context.d.ts +49 -0
  16. package/@types/loot-core/server/budget/cleanup-template.d.ts +8 -1
  17. package/@types/loot-core/server/budget/envelope.d.ts +3 -0
  18. package/@types/loot-core/server/budget/goal-template.d.ts +29 -0
  19. package/@types/loot-core/server/budget/report.d.ts +4 -1
  20. package/@types/loot-core/server/budget/schedule-template.d.ts +7 -0
  21. package/@types/loot-core/server/budget/template-notes.d.ts +7 -1
  22. package/@types/loot-core/server/budget/types/templates.d.ts +20 -4
  23. package/@types/loot-core/server/budgetfiles/app.d.ts +139 -0
  24. package/@types/loot-core/server/cloud-storage.d.ts +2 -2
  25. package/@types/loot-core/server/db/index.d.ts +3 -2
  26. package/@types/loot-core/server/encryption/app.d.ts +40 -0
  27. package/@types/loot-core/server/{encryption-internals.d.ts → encryption/encryption-internals.d.ts} +0 -1
  28. package/@types/loot-core/server/errors.d.ts +4 -0
  29. package/@types/loot-core/server/importers/index.d.ts +1 -2
  30. package/@types/loot-core/server/main-app.d.ts +1 -1
  31. package/@types/loot-core/server/prefs.d.ts +1 -1
  32. package/@types/loot-core/server/reports/app.d.ts +2 -2
  33. package/@types/loot-core/server/spreadsheet/spreadsheet.d.ts +9 -2
  34. package/@types/loot-core/server/tools/app.d.ts +1 -0
  35. package/@types/loot-core/server/transactions/app.d.ts +4 -1
  36. package/@types/loot-core/server/transactions/import/ofx2json.d.ts +1 -0
  37. package/@types/loot-core/server/transactions/import/parse-file.d.ts +1 -0
  38. package/@types/loot-core/server/transactions/index.d.ts +1 -0
  39. package/@types/loot-core/server/transactions/merge.d.ts +2 -0
  40. package/@types/loot-core/server/transactions/transaction-rules.d.ts +1 -0
  41. package/@types/loot-core/server/transactions/transfer.d.ts +2 -2
  42. package/@types/loot-core/shared/errors.d.ts +4 -4
  43. package/@types/loot-core/shared/locale.d.ts +2 -1
  44. package/@types/loot-core/shared/months.d.ts +6 -0
  45. package/@types/loot-core/shared/schedules.d.ts +2 -1
  46. package/@types/loot-core/shared/transactions.d.ts +7 -67
  47. package/@types/loot-core/shared/util.d.ts +3 -2
  48. package/@types/loot-core/types/api-handlers.d.ts +170 -183
  49. package/@types/loot-core/types/budget.d.ts +6 -6
  50. package/@types/loot-core/types/handlers.d.ts +5 -21
  51. package/@types/loot-core/types/models/bank-sync.d.ts +10 -17
  52. package/@types/loot-core/types/models/category-group.d.ts +8 -13
  53. package/@types/loot-core/types/models/category.d.ts +8 -8
  54. package/@types/loot-core/types/models/dashboard.d.ts +43 -88
  55. package/@types/loot-core/types/models/gocardless.d.ts +56 -71
  56. package/@types/loot-core/types/models/note.d.ts +2 -2
  57. package/@types/loot-core/types/models/openid.d.ts +6 -6
  58. package/@types/loot-core/types/models/payee.d.ts +6 -7
  59. package/@types/loot-core/types/models/reports.d.ts +98 -118
  60. package/@types/loot-core/types/models/rule.d.ts +62 -161
  61. package/@types/loot-core/types/models/schedule.d.ts +36 -38
  62. package/@types/loot-core/types/models/simplefin.d.ts +13 -17
  63. package/@types/loot-core/types/models/transaction-filter.d.ts +5 -6
  64. package/@types/loot-core/types/models/transaction.d.ts +30 -30
  65. package/@types/loot-core/types/prefs.d.ts +2 -5
  66. package/@types/loot-core/types/server-events.d.ts +43 -68
  67. package/@types/loot-core/types/server-handlers.d.ts +26 -198
  68. package/@types/loot-core/types/util.d.ts +7 -18
  69. package/@types/methods.d.ts +6 -1
  70. package/@types/vitest.config.d.ts +7 -0
  71. package/dist/app/bundle.api.js +16159 -110865
  72. package/dist/methods.js +8 -0
  73. package/dist/migrations/1745425408000_update_budgetType_pref.sql +7 -0
  74. package/dist/package.json +8 -10
  75. package/dist/vitest.config.js +11 -0
  76. package/package.json +8 -10
  77. package/@types/jest.config.d.ts +0 -9
  78. package/@types/loot-core/client/accounts/accountsSlice.d.ts +0 -175
  79. package/@types/loot-core/client/app/appSlice.d.ts +0 -175
  80. package/@types/loot-core/client/budgets/budgetsSlice.d.ts +0 -401
  81. package/@types/loot-core/client/modals/modalsSlice.d.ts +0 -486
  82. package/@types/loot-core/client/notifications/notificationsSlice.d.ts +0 -47
  83. package/@types/loot-core/client/prefs/prefsSlice.d.ts +0 -186
  84. package/@types/loot-core/client/queries/queriesSlice.d.ts +0 -692
  85. package/@types/loot-core/client/redux.d.ts +0 -18546
  86. package/@types/loot-core/client/store/index.d.ts +0 -133
  87. package/@types/loot-core/client/users/usersSlice.d.ts +0 -89
  88. package/@types/loot-core/platform/client/undo/index.d.ts +0 -21
  89. package/@types/loot-core/server/aql/schema/run-query.d.ts +0 -6
  90. package/@types/loot-core/server/backups.test.d.ts +0 -1
  91. package/@types/loot-core/server/budget/categoryTemplate.d.ts +0 -49
  92. package/@types/loot-core/server/budget/goalsSchedule.d.ts +0 -8
  93. package/@types/loot-core/server/budget/goaltemplates.d.ts +0 -16
  94. package/@types/loot-core/server/encryption-internals.web.d.ts +0 -23
  95. package/@types/loot-core/server/encryption.test.d.ts +0 -1
  96. package/@types/loot-core/server/platform.d.ts +0 -3
  97. package/@types/loot-core/server/platform.web.d.ts +0 -3
  98. package/@types/loot-core/types/file.d.ts +0 -47
  99. package/dist/jest.config.js +0 -22
  100. /package/@types/loot-core/server/{backups.d.ts → budgetfiles/backups.d.ts} +0 -0
  101. /package/@types/loot-core/server/{encryption.d.ts → encryption/index.d.ts} +0 -0
  102. /package/@types/loot-core/{client → shared}/platform.d.ts +0 -0
@@ -1,179 +1,80 @@
1
1
  import { type RecurConfig, type ScheduleEntity } from './schedule';
2
-
3
2
  export interface NewRuleEntity {
4
- stage: 'pre' | null | 'post';
5
- conditionsOp: 'or' | 'and';
6
- conditions: RuleConditionEntity[];
7
- actions: RuleActionEntity[];
8
- tombstone?: boolean;
3
+ stage: 'pre' | null | 'post';
4
+ conditionsOp: 'or' | 'and';
5
+ conditions: RuleConditionEntity[];
6
+ actions: RuleActionEntity[];
7
+ tombstone?: boolean;
9
8
  }
10
-
11
9
  export interface RuleEntity extends NewRuleEntity {
12
- id: string;
10
+ id: string;
13
11
  }
14
-
15
- export type RuleConditionOp =
16
- | 'is'
17
- | 'isNot'
18
- | 'oneOf'
19
- | 'notOneOf'
20
- | 'isapprox'
21
- | 'isbetween'
22
- | 'gt'
23
- | 'gte'
24
- | 'lt'
25
- | 'lte'
26
- | 'contains'
27
- | 'doesNotContain'
28
- | 'hasTags'
29
- | 'and'
30
- | 'matches'
31
- | 'onBudget'
32
- | 'offBudget';
33
-
12
+ export type RuleConditionOp = 'is' | 'isNot' | 'oneOf' | 'notOneOf' | 'isapprox' | 'isbetween' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'doesNotContain' | 'hasTags' | 'and' | 'matches' | 'onBudget' | 'offBudget';
34
13
  export type FieldValueTypes = {
35
- account: string;
36
- amount: number;
37
- category: string;
38
- date: string | RecurConfig;
39
- notes: string;
40
- payee: string;
41
- payee_name: string;
42
- imported_payee: string;
43
- saved: string;
44
- transfer: boolean;
45
- parent: boolean;
46
- cleared: boolean;
47
- reconciled: boolean;
14
+ account: string;
15
+ amount: number;
16
+ category: string;
17
+ date: string | RecurConfig;
18
+ notes: string;
19
+ payee: string;
20
+ payee_name: string;
21
+ imported_payee: string;
22
+ saved: string;
23
+ transfer: boolean;
24
+ parent: boolean;
25
+ cleared: boolean;
26
+ reconciled: boolean;
48
27
  };
49
-
50
- type BaseConditionEntity<
51
- Field extends keyof FieldValueTypes,
52
- Op extends RuleConditionOp,
53
- > = {
54
- field: Field;
55
- op: Op;
56
- value: Op extends 'oneOf' | 'notOneOf'
57
- ? Array<FieldValueTypes[Field]>
58
- : Op extends 'isbetween'
59
- ? { num1: number; num2: number }
60
- : FieldValueTypes[Field];
61
- options?: {
62
- inflow?: boolean;
63
- outflow?: boolean;
64
- month?: boolean;
65
- year?: boolean;
66
- };
67
- conditionsOp?: string;
68
- type?: 'id' | 'boolean' | 'date' | 'number' | 'string';
69
- customName?: string;
70
- queryFilter?: Record<string, { $oneof: string[] }>;
28
+ type BaseConditionEntity<Field extends keyof FieldValueTypes, Op extends RuleConditionOp> = {
29
+ field: Field;
30
+ op: Op;
31
+ value: Op extends 'oneOf' | 'notOneOf' ? Array<FieldValueTypes[Field]> : Op extends 'isbetween' ? {
32
+ num1: number;
33
+ num2: number;
34
+ } : FieldValueTypes[Field];
35
+ options?: {
36
+ inflow?: boolean;
37
+ outflow?: boolean;
38
+ month?: boolean;
39
+ year?: boolean;
40
+ };
41
+ conditionsOp?: string;
42
+ type?: 'id' | 'boolean' | 'date' | 'number' | 'string';
43
+ customName?: string;
44
+ queryFilter?: Record<string, {
45
+ $oneof: string[];
46
+ }>;
71
47
  };
72
-
73
- export type RuleConditionEntity =
74
- | BaseConditionEntity<
75
- 'account',
76
- | 'is'
77
- | 'isNot'
78
- | 'oneOf'
79
- | 'notOneOf'
80
- | 'contains'
81
- | 'doesNotContain'
82
- | 'matches'
83
- | 'onBudget'
84
- | 'offBudget'
85
- >
86
- | BaseConditionEntity<
87
- 'category',
88
- | 'is'
89
- | 'isNot'
90
- | 'oneOf'
91
- | 'notOneOf'
92
- | 'contains'
93
- | 'doesNotContain'
94
- | 'matches'
95
- >
96
- | BaseConditionEntity<
97
- 'amount',
98
- 'is' | 'isapprox' | 'isbetween' | 'gt' | 'gte' | 'lt' | 'lte'
99
- >
100
- | BaseConditionEntity<
101
- 'date',
102
- 'is' | 'isapprox' | 'isbetween' | 'gt' | 'gte' | 'lt' | 'lte'
103
- >
104
- | BaseConditionEntity<
105
- 'notes',
106
- | 'is'
107
- | 'isNot'
108
- | 'oneOf'
109
- | 'notOneOf'
110
- | 'contains'
111
- | 'doesNotContain'
112
- | 'matches'
113
- | 'hasTags'
114
- >
115
- | BaseConditionEntity<
116
- 'payee',
117
- | 'is'
118
- | 'isNot'
119
- | 'oneOf'
120
- | 'notOneOf'
121
- | 'contains'
122
- | 'doesNotContain'
123
- | 'matches'
124
- >
125
- | BaseConditionEntity<
126
- 'imported_payee',
127
- | 'is'
128
- | 'isNot'
129
- | 'oneOf'
130
- | 'notOneOf'
131
- | 'contains'
132
- | 'doesNotContain'
133
- | 'matches'
134
- >
135
- | BaseConditionEntity<'saved', 'is'>
136
- | BaseConditionEntity<'cleared', 'is'>
137
- | BaseConditionEntity<'reconciled', 'is'>;
138
-
139
- export type RuleActionEntity =
140
- | SetRuleActionEntity
141
- | SetSplitAmountRuleActionEntity
142
- | LinkScheduleRuleActionEntity
143
- | PrependNoteRuleActionEntity
144
- | AppendNoteRuleActionEntity;
145
-
48
+ export type RuleConditionEntity = BaseConditionEntity<'account', 'is' | 'isNot' | 'oneOf' | 'notOneOf' | 'contains' | 'doesNotContain' | 'matches' | 'onBudget' | 'offBudget'> | BaseConditionEntity<'category', 'is' | 'isNot' | 'oneOf' | 'notOneOf' | 'contains' | 'doesNotContain' | 'matches'> | BaseConditionEntity<'amount', 'is' | 'isapprox' | 'isbetween' | 'gt' | 'gte' | 'lt' | 'lte'> | BaseConditionEntity<'date', 'is' | 'isapprox' | 'isbetween' | 'gt' | 'gte' | 'lt' | 'lte'> | BaseConditionEntity<'notes', 'is' | 'isNot' | 'oneOf' | 'notOneOf' | 'contains' | 'doesNotContain' | 'matches' | 'hasTags'> | BaseConditionEntity<'payee', 'is' | 'isNot' | 'oneOf' | 'notOneOf' | 'contains' | 'doesNotContain' | 'matches'> | BaseConditionEntity<'imported_payee', 'is' | 'isNot' | 'oneOf' | 'notOneOf' | 'contains' | 'doesNotContain' | 'matches'> | BaseConditionEntity<'saved', 'is'> | BaseConditionEntity<'cleared', 'is'> | BaseConditionEntity<'reconciled', 'is'>;
49
+ export type RuleActionEntity = SetRuleActionEntity | SetSplitAmountRuleActionEntity | LinkScheduleRuleActionEntity | PrependNoteRuleActionEntity | AppendNoteRuleActionEntity;
146
50
  export interface SetRuleActionEntity {
147
- field: string;
148
- op: 'set';
149
- value: unknown;
150
- options?: {
151
- template?: string;
152
- splitIndex?: number;
153
- };
154
- type?: string;
51
+ field: string;
52
+ op: 'set';
53
+ value: unknown;
54
+ options?: {
55
+ template?: string;
56
+ splitIndex?: number;
57
+ };
58
+ type?: string;
155
59
  }
156
-
157
60
  export interface SetSplitAmountRuleActionEntity {
158
- op: 'set-split-amount';
159
- value: number;
160
- options?: {
161
- splitIndex?: number;
162
- method: 'fixed-amount' | 'fixed-percent' | 'remainder';
163
- };
61
+ op: 'set-split-amount';
62
+ value: number;
63
+ options?: {
64
+ splitIndex?: number;
65
+ method: 'fixed-amount' | 'fixed-percent' | 'remainder';
66
+ };
164
67
  }
165
-
166
68
  export interface LinkScheduleRuleActionEntity {
167
- op: 'link-schedule';
168
- value: ScheduleEntity;
69
+ op: 'link-schedule';
70
+ value: ScheduleEntity;
169
71
  }
170
-
171
72
  export interface PrependNoteRuleActionEntity {
172
- op: 'prepend-notes';
173
- value: string;
73
+ op: 'prepend-notes';
74
+ value: string;
174
75
  }
175
-
176
76
  export interface AppendNoteRuleActionEntity {
177
- op: 'append-notes';
178
- value: string;
77
+ op: 'append-notes';
78
+ value: string;
179
79
  }
80
+ export {};
@@ -1,49 +1,47 @@
1
1
  import type { AccountEntity } from './account';
2
2
  import type { PayeeEntity } from './payee';
3
3
  import type { RuleConditionEntity, RuleEntity } from './rule';
4
-
5
4
  export interface RecurPattern {
6
- value: number;
7
- type: 'SU' | 'MO' | 'TU' | 'WE' | 'TH' | 'FR' | 'SA' | 'day';
5
+ value: number;
6
+ type: 'SU' | 'MO' | 'TU' | 'WE' | 'TH' | 'FR' | 'SA' | 'day';
8
7
  }
9
-
10
8
  export interface RecurConfig {
11
- frequency: 'daily' | 'weekly' | 'monthly' | 'yearly';
12
- interval?: number;
13
- patterns?: RecurPattern[];
14
- skipWeekend?: boolean;
15
- start: string;
16
- endMode: 'never' | 'after_n_occurrences' | 'on_date';
17
- endOccurrences?: number;
18
- endDate?: string;
19
- weekendSolveMode?: 'before' | 'after';
9
+ frequency: 'daily' | 'weekly' | 'monthly' | 'yearly';
10
+ interval?: number;
11
+ patterns?: RecurPattern[];
12
+ skipWeekend?: boolean;
13
+ start: string;
14
+ endMode: 'never' | 'after_n_occurrences' | 'on_date';
15
+ endOccurrences?: number;
16
+ endDate?: string;
17
+ weekendSolveMode?: 'before' | 'after';
20
18
  }
21
-
22
19
  export interface ScheduleEntity {
23
- id: string;
24
- name?: string;
25
- rule: RuleEntity['id'];
26
- next_date: string;
27
- completed: boolean;
28
- posts_transaction: boolean;
29
- tombstone: boolean;
30
-
31
- // These are special fields that are actually pulled from the
32
- // underlying rule
33
- _payee: PayeeEntity['id'];
34
- _account: AccountEntity['id'];
35
- _amount: number | { num1: number; num2: number };
36
- _amountOp: string;
37
- _date: RecurConfig;
38
- _conditions: RuleConditionEntity[];
39
- _actions: Array<{ op: unknown }>;
20
+ id: string;
21
+ name?: string;
22
+ rule: RuleEntity['id'];
23
+ next_date: string;
24
+ completed: boolean;
25
+ posts_transaction: boolean;
26
+ tombstone: boolean;
27
+ _payee: PayeeEntity['id'];
28
+ _account: AccountEntity['id'];
29
+ _amount: number | {
30
+ num1: number;
31
+ num2: number;
32
+ };
33
+ _amountOp: string;
34
+ _date: RecurConfig;
35
+ _conditions: RuleConditionEntity[];
36
+ _actions: Array<{
37
+ op: unknown;
38
+ }>;
40
39
  }
41
-
42
40
  export type DiscoverScheduleEntity = {
43
- id: ScheduleEntity['id'];
44
- account: AccountEntity['id'];
45
- payee: PayeeEntity['id'];
46
- date: ScheduleEntity['_date'];
47
- amount: ScheduleEntity['_amount'];
48
- _conditions: ScheduleEntity['_conditions'];
41
+ id: ScheduleEntity['id'];
42
+ account: AccountEntity['id'];
43
+ payee: PayeeEntity['id'];
44
+ date: ScheduleEntity['_date'];
45
+ amount: ScheduleEntity['_amount'];
46
+ _conditions: ScheduleEntity['_conditions'];
49
47
  };
@@ -1,27 +1,23 @@
1
1
  import { AccountEntity } from './account';
2
2
  import { BankSyncResponse } from './bank-sync';
3
-
4
3
  export type SimpleFinOrganization = {
5
- id: string;
6
- name: string;
7
- domain: string;
4
+ id: string;
5
+ name: string;
6
+ domain: string;
8
7
  };
9
-
10
8
  export type SimpleFinAccount = {
11
- id: string;
12
- name: string;
13
- balance: number;
14
- org: SimpleFinOrganization;
9
+ id: string;
10
+ name: string;
11
+ balance: number;
12
+ org: SimpleFinOrganization;
15
13
  };
16
-
17
14
  export interface SimpleFinBatchSyncResponse {
18
- [accountId: AccountEntity['account_id']]: BankSyncResponse;
15
+ [accountId: NonNullable<AccountEntity['account_id']>]: BankSyncResponse;
19
16
  }
20
-
21
17
  export type SyncServerSimpleFinAccount = {
22
- account_id: string;
23
- institution?: string;
24
- orgDomain?: string;
25
- orgId?: string;
26
- name: string;
18
+ account_id: string;
19
+ institution?: string;
20
+ orgDomain?: string;
21
+ orgId?: string;
22
+ name: string;
27
23
  };
@@ -1,9 +1,8 @@
1
1
  import { type RuleConditionEntity } from './rule';
2
-
3
2
  export interface TransactionFilterEntity {
4
- id: string;
5
- name: string;
6
- conditionsOp: 'and' | 'or';
7
- conditions: RuleConditionEntity[];
8
- tombstone: boolean;
3
+ id: string;
4
+ name: string;
5
+ conditionsOp: 'and' | 'or';
6
+ conditions: RuleConditionEntity[];
7
+ tombstone: boolean;
9
8
  }
@@ -1,36 +1,36 @@
1
+ import { IntegerAmount } from '../../shared/util';
1
2
  import { AccountEntity } from './account';
2
3
  import { CategoryEntity } from './category';
3
4
  import { PayeeEntity } from './payee';
4
5
  import { ScheduleEntity } from './schedule';
5
-
6
6
  export interface TransactionEntity {
7
- id: string;
8
- is_parent?: boolean;
9
- is_child?: boolean;
10
- parent_id?: TransactionEntity['id'];
11
- account: AccountEntity['id'];
12
- category?: CategoryEntity['id'];
13
- amount: number;
14
- payee?: PayeeEntity['id'];
15
- notes?: string;
16
- date: string;
17
- imported_id?: string;
18
- imported_payee?: string;
19
- starting_balance_flag?: boolean;
20
- transfer_id?: TransactionEntity['id'];
21
- sort_order?: number;
22
- cleared?: boolean;
23
- reconciled?: boolean;
24
- tombstone?: boolean;
25
- forceUpcoming?: boolean;
26
- schedule?: ScheduleEntity['id'];
27
- subtransactions?: TransactionEntity[];
28
- _unmatched?: boolean;
29
- _deleted?: boolean;
30
- error?: {
31
- type: 'SplitTransactionError';
32
- version: 1;
33
- difference: number;
34
- } | null;
35
- raw_synced_data?: string | undefined;
7
+ id: string;
8
+ is_parent?: boolean;
9
+ is_child?: boolean;
10
+ parent_id?: TransactionEntity['id'];
11
+ account: AccountEntity['id'];
12
+ category?: CategoryEntity['id'];
13
+ amount: IntegerAmount;
14
+ payee?: PayeeEntity['id'];
15
+ notes?: string;
16
+ date: string;
17
+ imported_id?: string;
18
+ imported_payee?: string;
19
+ starting_balance_flag?: boolean;
20
+ transfer_id?: TransactionEntity['id'];
21
+ sort_order?: number;
22
+ cleared?: boolean;
23
+ reconciled?: boolean;
24
+ tombstone?: boolean;
25
+ forceUpcoming?: boolean;
26
+ schedule?: ScheduleEntity['id'];
27
+ subtransactions?: TransactionEntity[];
28
+ _unmatched?: boolean;
29
+ _deleted?: boolean;
30
+ error?: {
31
+ type: 'SplitTransactionError';
32
+ version: 1;
33
+ difference: number;
34
+ } | null;
35
+ raw_synced_data?: string | undefined;
36
36
  }
@@ -3,7 +3,6 @@ export type FeatureFlag =
3
3
  | 'goalTemplatesUIEnabled'
4
4
  | 'actionTemplating'
5
5
  | 'contextMenus'
6
- | 'openidAuth'
7
6
  | 'pluggyAiBankSync';
8
7
 
9
8
  /**
@@ -84,6 +83,7 @@ export type DarkTheme = 'dark' | 'midnight';
84
83
  export type GlobalPrefs = Partial<{
85
84
  floatingSidebar: boolean;
86
85
  maxMonths: number;
86
+ categoryExpandedState: number;
87
87
  keyId?: string;
88
88
  language: string;
89
89
  theme: Theme;
@@ -94,10 +94,6 @@ export type GlobalPrefs = Partial<{
94
94
  // Electron only
95
95
  autoStart?: boolean;
96
96
  port?: number;
97
- ngrokConfig?: {
98
- domain?: string;
99
- authToken?: string;
100
- };
101
97
  };
102
98
  }>;
103
99
 
@@ -113,6 +109,7 @@ export type GlobalPrefsJson = Partial<{
113
109
  'user-token'?: string;
114
110
  'floating-sidebar'?: string; // "true" or "false"
115
111
  'max-months'?: string; // e.g. "2" or "3"
112
+ 'category-expanded-state'?: string; // "0" or "1" or "2"
116
113
  'document-dir'?: GlobalPrefs['documentDir'];
117
114
  'encrypt-key'?: string;
118
115
  language?: GlobalPrefs['language'];
@@ -1,86 +1,61 @@
1
- import { type Backup } from '../server/backups';
1
+ import { type Backup } from '../server/budgetfiles/backups';
2
2
  import { type UndoState } from '../server/undo';
3
-
4
- type SyncSubtype =
5
- | 'out-of-sync'
6
- | 'apply-failure'
7
- | 'decrypt-failure'
8
- | 'encrypt-failure'
9
- | 'invalid-schema'
10
- | 'network'
11
- | 'file-old-version'
12
- | 'file-key-mismatch'
13
- | 'file-not-found'
14
- | 'file-needs-upload'
15
- | 'file-has-reset'
16
- | 'file-has-new-key'
17
- | 'token-expired'
18
- | string;
19
-
3
+ type SyncSubtype = 'out-of-sync' | 'apply-failure' | 'decrypt-failure' | 'encrypt-failure' | 'invalid-schema' | 'network' | 'file-old-version' | 'file-key-mismatch' | 'file-not-found' | 'file-needs-upload' | 'file-has-reset' | 'file-has-new-key' | 'token-expired' | string;
20
4
  type SyncEvent = {
21
- meta?: Record<string, unknown>;
22
- } & (
23
- | {
24
- type: 'applied';
25
- tables: string[];
26
- data?: Map<string, unknown>;
27
- prevData?: Map<string, unknown>;
28
- }
29
- | {
30
- type: 'success';
31
- tables: string[];
32
- syncDisabled?: boolean;
33
- }
34
- | {
35
- type: 'error';
36
- subtype?: SyncSubtype;
37
- }
38
- | {
39
- type: 'start';
40
- }
41
- | {
42
- type: 'unauthorized';
43
- }
44
- );
45
-
5
+ meta?: Record<string, unknown>;
6
+ } & ({
7
+ type: 'applied';
8
+ tables: string[];
9
+ data?: Map<string, unknown>;
10
+ prevData?: Map<string, unknown>;
11
+ } | {
12
+ type: 'success';
13
+ tables: string[];
14
+ syncDisabled?: boolean;
15
+ } | {
16
+ type: 'error';
17
+ subtype?: SyncSubtype;
18
+ } | {
19
+ type: 'start';
20
+ } | {
21
+ type: 'unauthorized';
22
+ });
46
23
  type BackupUpdatedEvent = Backup[];
47
-
48
24
  type CellsChangedEvent = Array<{
49
- name: string;
50
- value: string | number | boolean;
25
+ name: string;
26
+ value: string | number | boolean;
51
27
  }>;
52
-
53
28
  type FallbackWriteErrorEvent = undefined;
54
29
  type FinishImportEvent = undefined;
55
30
  type FinishLoadEvent = undefined;
56
-
57
31
  type OrphanedPayeesEvent = {
58
- orphanedIds: string[];
59
- updatedPayeeIds: string[];
32
+ orphanedIds: string[];
33
+ updatedPayeeIds: string[];
60
34
  };
61
-
62
35
  type PrefsUpdatedEvent = undefined;
63
36
  type SchedulesOfflineEvent = undefined;
64
37
  type ServerErrorEvent = undefined;
65
38
  type ShowBudgetsEvent = undefined;
66
- type StartImportEvent = { budgetName: string };
39
+ type StartImportEvent = {
40
+ budgetName: string;
41
+ };
67
42
  type StartLoadEvent = undefined;
68
43
  type ApiFetchRedirectedEvent = undefined;
69
-
70
44
  export interface ServerEvents {
71
- 'backups-updated': BackupUpdatedEvent;
72
- 'cells-changed': CellsChangedEvent;
73
- 'fallback-write-error': FallbackWriteErrorEvent;
74
- 'finish-import': FinishImportEvent;
75
- 'finish-load': FinishLoadEvent;
76
- 'orphaned-payees': OrphanedPayeesEvent;
77
- 'prefs-updated': PrefsUpdatedEvent;
78
- 'schedules-offline': SchedulesOfflineEvent;
79
- 'server-error': ServerErrorEvent;
80
- 'show-budgets': ShowBudgetsEvent;
81
- 'start-import': StartImportEvent;
82
- 'start-load': StartLoadEvent;
83
- 'sync-event': SyncEvent;
84
- 'undo-event': UndoState;
85
- 'api-fetch-redirected': ApiFetchRedirectedEvent;
45
+ 'backups-updated': BackupUpdatedEvent;
46
+ 'cells-changed': CellsChangedEvent;
47
+ 'fallback-write-error': FallbackWriteErrorEvent;
48
+ 'finish-import': FinishImportEvent;
49
+ 'finish-load': FinishLoadEvent;
50
+ 'orphaned-payees': OrphanedPayeesEvent;
51
+ 'prefs-updated': PrefsUpdatedEvent;
52
+ 'schedules-offline': SchedulesOfflineEvent;
53
+ 'server-error': ServerErrorEvent;
54
+ 'show-budgets': ShowBudgetsEvent;
55
+ 'start-import': StartImportEvent;
56
+ 'start-load': StartLoadEvent;
57
+ 'sync-event': SyncEvent;
58
+ 'undo-event': UndoState;
59
+ 'api-fetch-redirected': ApiFetchRedirectedEvent;
86
60
  }
61
+ export {};