@actual-app/api 6.10.0 → 24.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 (34) hide show
  1. package/@types/loot-core/client/state-types/modals.d.ts +17 -11
  2. package/@types/loot-core/client/state-types/prefs.d.ts +4 -9
  3. package/@types/loot-core/client/state-types/queries.d.ts +4 -4
  4. package/@types/loot-core/mocks/index.d.ts +2 -7
  5. package/@types/loot-core/server/accounts/rules.d.ts +3 -4
  6. package/@types/loot-core/server/aql/schema/index.d.ts +8 -0
  7. package/@types/loot-core/server/db/index.d.ts +2 -2
  8. package/@types/loot-core/server/main-app.d.ts +1 -1
  9. package/@types/loot-core/server/preferences/app.d.ts +12 -0
  10. package/@types/loot-core/server/preferences/types/handlers.d.ts +8 -0
  11. package/@types/loot-core/server/prefs.d.ts +4 -6
  12. package/@types/loot-core/server/util/rschedule.d.ts +0 -1
  13. package/@types/loot-core/shared/errors.d.ts +1 -1
  14. package/@types/loot-core/shared/months.d.ts +2 -0
  15. package/@types/loot-core/shared/rules.d.ts +5 -32
  16. package/@types/loot-core/shared/transactions.d.ts +2 -0
  17. package/@types/loot-core/shared/util.d.ts +4 -2
  18. package/@types/loot-core/types/handlers.d.ts +2 -0
  19. package/@types/loot-core/types/models/dashboard.d.ts +37 -4
  20. package/@types/loot-core/types/models/reports.d.ts +3 -13
  21. package/@types/loot-core/types/models/rule.d.ts +4 -1
  22. package/@types/loot-core/types/models/schedule.d.ts +18 -14
  23. package/@types/loot-core/types/models/transaction-filter.d.ts +4 -2
  24. package/@types/loot-core/types/models/transaction.d.ts +2 -0
  25. package/@types/loot-core/types/prefs.d.ts +38 -50
  26. package/@types/loot-core/types/server-events.d.ts +1 -0
  27. package/@types/loot-core/types/server-handlers.d.ts +4 -6
  28. package/@types/loot-core/types/util.d.ts +2 -0
  29. package/@types/migrations/1723665565000_prefs.d.ts +4 -0
  30. package/dist/app/bundle.api.js +1164 -781
  31. package/dist/migrations/1723665565000_prefs.js +51 -0
  32. package/dist/package.json +1 -1
  33. package/package.json +1 -1
  34. /package/@types/loot-core/server/budget/{rollover.d.ts → envelope.d.ts} +0 -0
@@ -1,42 +1,35 @@
1
- import { type numberFormats } from '../shared/util';
2
-
3
- import { spendingReportTimeType } from './models/reports';
4
-
5
1
  export type FeatureFlag =
6
2
  | 'dashboards'
7
3
  | 'reportBudget'
8
4
  | 'goalTemplatesEnabled'
9
- | 'spendingReport'
10
- | 'simpleFinSync';
5
+ | 'spendingReport';
11
6
 
12
7
  /**
13
8
  * Cross-device preferences. These sync across devices when they are changed.
14
9
  */
15
10
  export type SyncedPrefs = Partial<
16
- {
17
- firstDayOfWeekIdx: `${0 | 1 | 2 | 3 | 4 | 5 | 6}`;
18
- dateFormat:
19
- | 'MM/dd/yyyy'
20
- | 'dd/MM/yyyy'
21
- | 'yyyy-MM-dd'
22
- | 'MM.dd.yyyy'
23
- | 'dd.MM.yyyy';
24
- numberFormat: (typeof numberFormats)[number]['value'];
25
- hideFraction: boolean;
26
- isPrivacyEnabled: boolean;
27
- [key: `show-extra-balances-${string}`]: boolean;
28
- [key: `hide-cleared-${string}`]: boolean;
29
- [key: `hide-reconciled-${string}`]: boolean;
11
+ Record<
12
+ | 'budgetType'
13
+ | 'firstDayOfWeekIdx'
14
+ | 'dateFormat'
15
+ | 'numberFormat'
16
+ | 'hideFraction'
17
+ | 'isPrivacyEnabled'
18
+ | `show-balances-${string}`
19
+ | `show-extra-balances-${string}`
20
+ | `hide-cleared-${string}`
21
+ | `hide-reconciled-${string}`
30
22
  // TODO: pull from src/components/modals/ImportTransactions.js
31
- [key: `parse-date-${string}-${'csv' | 'qif'}`]: string;
32
- [key: `csv-mappings-${string}`]: string;
33
- [key: `csv-delimiter-${string}`]: ',' | ';' | '\t';
34
- [key: `csv-skip-lines-${string}`]: number;
35
- [key: `csv-has-header-${string}`]: boolean;
36
- [key: `ofx-fallback-missing-payee-${string}`]: boolean;
37
- [key: `flip-amount-${string}-${'csv' | 'qif'}`]: boolean;
38
- budgetType: 'report' | 'rollover';
39
- } & Record<`flags.${FeatureFlag}`, boolean>
23
+ | `parse-date-${string}-${'csv' | 'qif'}`
24
+ | `csv-mappings-${string}`
25
+ | `csv-delimiter-${string}`
26
+ | `csv-skip-lines-${string}`
27
+ | `csv-has-header-${string}`
28
+ | `ofx-fallback-missing-payee-${string}`
29
+ | `flip-amount-${string}-${'csv' | 'qif'}`
30
+ | `flags.${FeatureFlag}`,
31
+ string
32
+ >
40
33
  >;
41
34
 
42
35
  /**
@@ -58,35 +51,30 @@ export type MetadataPrefs = Partial<{
58
51
 
59
52
  /**
60
53
  * Local preferences applicable to a single device. Stored in local storage.
61
- * TODO: eventually `LocalPrefs` type should not use `SyncedPrefs` or `MetadataPrefs`;
62
- * this is only a stop-gap solution.
63
54
  */
64
- export type LocalPrefs = SyncedPrefs &
65
- MetadataPrefs &
66
- Partial<{
67
- 'ui.showClosedAccounts': boolean;
68
- 'expand-splits': boolean;
69
- 'budget.collapsed': string[];
70
- 'budget.summaryCollapsed': boolean;
71
- 'budget.showHiddenCategories': boolean;
72
- 'budget.startMonth': string;
73
- 'flags.updateNotificationShownForVersion': string;
74
- reportsViewLegend: boolean;
75
- reportsViewSummary: boolean;
76
- reportsViewLabel: boolean;
77
- spendingReportFilter: string;
78
- spendingReportTime: spendingReportTimeType;
79
- spendingReportCompare: spendingReportTimeType;
80
- sidebarWidth: number;
81
- 'mobile.showSpentColumn': boolean;
82
- }>;
55
+ export type LocalPrefs = Partial<{
56
+ 'ui.showClosedAccounts': boolean;
57
+ 'expand-splits': boolean;
58
+ 'budget.collapsed': string[];
59
+ 'budget.summaryCollapsed': boolean;
60
+ 'budget.showHiddenCategories': boolean;
61
+ 'budget.startMonth': string;
62
+ 'flags.updateNotificationShownForVersion': string;
63
+ reportsViewLegend: boolean;
64
+ reportsViewSummary: boolean;
65
+ reportsViewLabel: boolean;
66
+ sidebarWidth: number;
67
+ 'mobile.showSpentColumn': boolean;
68
+ }>;
83
69
 
84
70
  export type Theme = 'light' | 'dark' | 'auto' | 'midnight' | 'development';
71
+ export type DarkTheme = 'dark' | 'midnight';
85
72
  export type GlobalPrefs = Partial<{
86
73
  floatingSidebar: boolean;
87
74
  maxMonths: number;
88
75
  keyId?: string;
89
76
  theme: Theme;
77
+ preferredDarkTheme: DarkTheme;
90
78
  documentDir: string; // Electron only
91
79
  serverSelfSignedCert: string; // Electron only
92
80
  }>;
@@ -18,4 +18,5 @@ export interface ServerEvents {
18
18
  'start-load': unknown;
19
19
  'sync-event': { type; subtype; meta; tables; syncDisabled };
20
20
  'undo-event': UndoState;
21
+ 'api-fetch-redirected': unknown;
21
22
  }
@@ -17,7 +17,7 @@ import {
17
17
  RuleEntity,
18
18
  PayeeEntity,
19
19
  } from './models';
20
- import { GlobalPrefs, LocalPrefs } from './prefs';
20
+ import { GlobalPrefs, MetadataPrefs } from './prefs';
21
21
  import { Query } from './query';
22
22
  import { EmptyObject } from './util';
23
23
 
@@ -59,22 +59,20 @@ export interface ServerHandlers {
59
59
 
60
60
  'get-budget-bounds': () => Promise<{ start: string; end: string }>;
61
61
 
62
- 'rollover-budget-month': (arg: { month }) => Promise<
62
+ 'envelope-budget-month': (arg: { month }) => Promise<
63
63
  {
64
64
  value: string | number | boolean;
65
65
  name: string;
66
66
  }[]
67
67
  >;
68
68
 
69
- 'report-budget-month': (arg: { month }) => Promise<
69
+ 'tracking-budget-month': (arg: { month }) => Promise<
70
70
  {
71
71
  value: string | number | boolean;
72
72
  name: string;
73
73
  }[]
74
74
  >;
75
75
 
76
- 'budget-set-type': (arg: { type }) => Promise<unknown>;
77
-
78
76
  'category-create': (arg: {
79
77
  name;
80
78
  groupId;
@@ -241,7 +239,7 @@ export interface ServerHandlers {
241
239
 
242
240
  'save-prefs': (prefsToSet) => Promise<'ok'>;
243
241
 
244
- 'load-prefs': () => Promise<LocalPrefs | null>;
242
+ 'load-prefs': () => Promise<MetadataPrefs | null>;
245
243
 
246
244
  'sync-reset': () => Promise<{ error?: { reason: string; meta?: unknown } }>;
247
245
 
@@ -7,3 +7,5 @@ export type StripNever<T> = {
7
7
  export type EverythingButIdOptional<T> = { id: T['id'] } & Partial<
8
8
  Omit<T, 'id'>
9
9
  >;
10
+
11
+ export type WithRequired<T, K extends keyof T> = T & Required<Pick<T, K>>;
@@ -0,0 +1,4 @@
1
+ export default function runMigration(db: any, { fs, fileId }: {
2
+ fs: any;
3
+ fileId: any;
4
+ }): Promise<void>;