@actual-app/api 25.1.0 → 25.2.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 (61) hide show
  1. package/@types/loot-core/client/constants.d.ts +0 -11
  2. package/@types/loot-core/client/state-types/index.d.ts +0 -14
  3. package/@types/loot-core/client/state-types/modals.d.ts +7 -2
  4. package/@types/loot-core/mocks/index.d.ts +9 -20
  5. package/@types/loot-core/platform/client/fetch/index.d.ts +10 -1
  6. package/@types/loot-core/platform/client/undo/index.d.ts +8 -4
  7. package/@types/loot-core/platform/server/connection/index.d.ts +1 -1
  8. package/@types/loot-core/server/accounts/sync.d.ts +1 -1
  9. package/@types/loot-core/server/accounts/transaction-rules.d.ts +0 -3
  10. package/@types/loot-core/server/accounts/transactions.d.ts +0 -3
  11. package/@types/loot-core/server/accounts/transfer.d.ts +0 -11
  12. package/@types/loot-core/server/admin/app.d.ts +9 -4
  13. package/@types/loot-core/server/admin/types/handlers.d.ts +4 -2
  14. package/@types/loot-core/server/app.d.ts +14 -4
  15. package/@types/loot-core/server/aql/compiler.d.ts +4 -6
  16. package/@types/loot-core/server/aql/schema/index.d.ts +3 -0
  17. package/@types/loot-core/server/budget/actions.d.ts +6 -0
  18. package/@types/loot-core/server/budget/app.d.ts +10 -5
  19. package/@types/loot-core/server/budget/types/handlers.d.ts +4 -0
  20. package/@types/loot-core/server/dashboard/app.d.ts +9 -4
  21. package/@types/loot-core/server/filters/app.d.ts +9 -4
  22. package/@types/loot-core/server/importers/ynab4-types.d.ts +0 -2
  23. package/@types/loot-core/server/importers/ynab5-types.d.ts +0 -2
  24. package/@types/loot-core/server/main-app.d.ts +10 -5
  25. package/@types/loot-core/server/main.d.ts +2 -2
  26. package/@types/loot-core/server/notes/app.d.ts +9 -4
  27. package/@types/loot-core/server/preferences/app.d.ts +9 -4
  28. package/@types/loot-core/server/reports/app.d.ts +11 -4
  29. package/@types/loot-core/server/rules/app.d.ts +9 -4
  30. package/@types/loot-core/server/rules/types/handlers.d.ts +4 -4
  31. package/@types/loot-core/server/schedules/app.d.ts +10 -7
  32. package/@types/loot-core/server/schedules/types/handlers.d.ts +5 -5
  33. package/@types/loot-core/server/tools/app.d.ts +9 -4
  34. package/@types/loot-core/server/tools/types/handlers.d.ts +2 -1
  35. package/@types/loot-core/shared/schedules.d.ts +5 -31
  36. package/@types/loot-core/shared/transactions.d.ts +101 -17
  37. package/@types/loot-core/shared/util.d.ts +23 -9
  38. package/@types/loot-core/types/api-handlers.d.ts +3 -0
  39. package/@types/loot-core/types/models/dashboard.d.ts +1 -1
  40. package/@types/loot-core/types/models/payee.d.ts +1 -0
  41. package/@types/loot-core/types/models/reports.d.ts +4 -0
  42. package/@types/loot-core/types/models/rule.d.ts +6 -4
  43. package/@types/loot-core/types/models/schedule.d.ts +5 -18
  44. package/@types/loot-core/types/models/simplefin.d.ts +2 -0
  45. package/@types/loot-core/types/models/transaction.d.ts +6 -0
  46. package/@types/loot-core/types/prefs.d.ts +3 -2
  47. package/@types/loot-core/types/server-events.d.ts +80 -17
  48. package/@types/loot-core/types/server-handlers.d.ts +19 -7
  49. package/@types/loot-core/types/util.d.ts +5 -0
  50. package/@types/methods.d.ts +4 -4
  51. package/dist/app/bundle.api.js +334 -187
  52. package/dist/methods.js +4 -1
  53. package/dist/migrations/1736640000000__custom_report_sorting.sql +7 -0
  54. package/dist/migrations/1737158400000_add_learn_categories_to_payees.sql +5 -0
  55. package/dist/migrations/1738491452000__sorting_rename.sql +13 -0
  56. package/dist/package.json +1 -1
  57. package/package.json +1 -1
  58. package/@types/loot-core/client/actions/types.d.ts +0 -6
  59. package/@types/loot-core/client/state-types/account.d.ts +0 -27
  60. package/@types/loot-core/client/state-types/app.d.ts +0 -42
  61. package/@types/loot-core/client/state-types/queries.d.ts +0 -76
@@ -1,12 +1,3 @@
1
- export declare const SET_NEW_TRANSACTIONS = "SET_NEW_TRANSACTIONS";
2
- export declare const UPDATE_NEW_TRANSACTIONS = "UPDATE_NEW_TRANSACTIONS";
3
- export declare const SET_LAST_TRANSACTION = "SET_LAST_TRANSACTION";
4
- export declare const MARK_ACCOUNT_READ = "MARK_ACCOUNT_READ";
5
- export declare const LOAD_ACCOUNTS = "LOAD_ACCOUNTS";
6
- export declare const UPDATE_ACCOUNT = "UPDATE_ACCOUNT";
7
- export declare const LOAD_CATEGORIES = "LOAD_CATEGORIES";
8
- export declare const LOAD_COMMON_PAYEES = "LOAD_COMMON_PAYEES";
9
- export declare const LOAD_PAYEES = "LOAD_PAYEES";
10
1
  export declare const SET_PREFS = "SET_PREFS";
11
2
  export declare const MERGE_LOCAL_PREFS = "MERGE_LOCAL_PREFS";
12
3
  export declare const MERGE_GLOBAL_PREFS = "MERGE_GLOBAL_PREFS";
@@ -25,8 +16,6 @@ export declare const ADD_NOTIFICATION = "ADD_NOTIFICATION";
25
16
  export declare const REMOVE_NOTIFICATION = "REMOVE_NOTIFICATION";
26
17
  export declare const SET_NOTIFICATION_INSET = "SET_NOTIFICATION_INSET";
27
18
  export declare const GET_USER_DATA = "GET_USER_DATA";
28
- export declare const SET_LAST_UNDO_STATE = "SET_LAST_UNDO_STATE";
29
- export declare const SET_LAST_SPLIT_STATE = "SET_LAST_SPLIT_STATE";
30
19
  export declare const SET_ACCOUNTS_SYNCING = "SET_ACCOUNTS_SYNCING";
31
20
  export declare const ACCOUNT_SYNC_STATUS = "ACCOUNT_SYNC_STATUS";
32
21
  export declare const SIGN_OUT = "SIGN_OUT";
@@ -1,12 +1,9 @@
1
1
  import type * as constants from '../constants';
2
2
 
3
- import type { AccountActions, AccountState } from './account';
4
- import type { AppActions, AppState } from './app';
5
3
  import type { BudgetsActions, BudgetsState } from './budgets';
6
4
  import type { ModalsActions, ModalsState } from './modals';
7
5
  import type { NotificationsActions, NotificationsState } from './notifications';
8
6
  import type { PrefsActions, PrefsState } from './prefs';
9
- import type { QueriesActions, QueriesState } from './queries';
10
7
  import type { UserActions, UserState } from './user';
11
8
 
12
9
  export type CloseBudgetAction = {
@@ -14,28 +11,17 @@ export type CloseBudgetAction = {
14
11
  };
15
12
 
16
13
  export type Action =
17
- | AccountActions
18
- | AppActions
19
14
  | BudgetsActions
20
15
  | ModalsActions
21
16
  | NotificationsActions
22
17
  | PrefsActions
23
- | QueriesActions
24
18
  | UserActions
25
19
  | CloseBudgetAction;
26
20
 
27
21
  export type State = {
28
- account: AccountState;
29
- app: AppState;
30
22
  budgets: BudgetsState;
31
23
  modals: ModalsState;
32
24
  notifications: NotificationsState;
33
25
  prefs: PrefsState;
34
- queries: QueriesState;
35
26
  user: UserState;
36
27
  };
37
-
38
- declare module 'react-redux' {
39
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type, @typescript-eslint/consistent-type-definitions
40
- export interface DefaultRootState extends State {}
41
- }
@@ -148,7 +148,7 @@ type FinanceModals = {
148
148
  'category-autocomplete': {
149
149
  categoryGroups?: CategoryGroupEntity[];
150
150
  onSelect: (categoryId: string, categoryName: string) => void;
151
- month?: string;
151
+ month?: string | undefined;
152
152
  showHiddenCategories?: boolean;
153
153
  onClose?: () => void;
154
154
  };
@@ -164,6 +164,8 @@ type FinanceModals = {
164
164
  onClose?: () => void;
165
165
  };
166
166
 
167
+ 'payee-category-learning': null;
168
+
167
169
  'budget-summary': {
168
170
  month: string;
169
171
  };
@@ -181,6 +183,8 @@ type FinanceModals = {
181
183
 
182
184
  'schedules-discover': null;
183
185
 
186
+ 'schedules-upcoming-length': null;
187
+
184
188
  'schedule-posts-offline-notification': null;
185
189
  'account-menu': {
186
190
  accountId: string;
@@ -288,6 +292,7 @@ type FinanceModals = {
288
292
  transactionId: string;
289
293
  onPost: (transactionId: string) => void;
290
294
  onSkip: (transactionId: string) => void;
295
+ onComplete: (transactionId: string) => void;
291
296
  };
292
297
  'budget-page-menu': {
293
298
  onAddCategoryGroup: () => void;
@@ -311,7 +316,7 @@ type FinanceModals = {
311
316
  confirmReason: string;
312
317
  };
313
318
  'confirm-transaction-delete': {
314
- message?: string;
319
+ message?: string | undefined;
315
320
  onConfirm: () => void;
316
321
  };
317
322
  'edit-user': {
@@ -1,21 +1,10 @@
1
- import type { AccountEntity } from '../types/models';
2
- export declare function generateAccount(name: any, isConnected: any, offbudget: any): AccountEntity & {
3
- bankId: number;
4
- bankName: string;
1
+ import type { AccountEntity, CategoryEntity, CategoryGroupEntity, NewCategoryGroupEntity, TransactionEntity } from '../types/models';
2
+ export declare function generateAccount(name: AccountEntity['name'], isConnected?: boolean, offbudget?: boolean): AccountEntity & {
3
+ bankId: number | null;
4
+ bankName: string | null;
5
5
  };
6
- export declare function generateCategory(name: any, group: any, isIncome?: boolean): {
7
- id: string;
8
- name: any;
9
- cat_group: any;
10
- is_income: number;
11
- sort_order: number;
12
- };
13
- export declare function generateCategoryGroup(name: any, isIncome?: boolean): {
14
- id: string;
15
- name: any;
16
- is_income: number;
17
- sort_order: number;
18
- };
19
- export declare function generateCategoryGroups(definition: any): any;
20
- export declare function generateTransaction(data: any, splitAmount?: any, showError?: boolean): any[];
21
- export declare function generateTransactions(count: any, accountId: any, groupId: any, splitAtIndexes?: any[], showError?: boolean): any[];
6
+ export declare function generateCategory(name: string, group: string, isIncome?: boolean): CategoryEntity;
7
+ export declare function generateCategoryGroup(name: string, isIncome?: boolean): CategoryGroupEntity;
8
+ export declare function generateCategoryGroups(definition: Partial<NewCategoryGroupEntity>[]): CategoryGroupEntity[];
9
+ export declare function generateTransaction(data: Partial<TransactionEntity> & Pick<TransactionEntity, 'account'>, splitAmount?: number, showError?: boolean): TransactionEntity[];
10
+ export declare function generateTransactions(count: number, accountId: string, groupId: string, splitAtIndexes?: number[], showError?: boolean): TransactionEntity[];
@@ -1,4 +1,5 @@
1
1
  import type { Handlers } from '../../../types/handlers';
2
+ import type { CategoryGroupEntity } from '../../../types/models';
2
3
  import type { ServerEvents } from '../../../types/server-events';
3
4
 
4
5
  export function init(socketName: string): Promise<unknown>;
@@ -38,7 +39,15 @@ export function unlisten(name: string): void;
38
39
  export type Unlisten = typeof unlisten;
39
40
 
40
41
  /** Mock functions */
41
- export function initServer(handlers: unknown): void;
42
+ export function initServer(handlers: {
43
+ query: (query: { table: string; selectExpressions: unknown }) => Promise<{
44
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
+ data: any;
46
+ dependencies: string[];
47
+ }>;
48
+ getCell?: () => { value: number };
49
+ 'get-categories'?: () => { grouped: CategoryGroupEntity[] };
50
+ }): void;
42
51
  export type InitServer = typeof initServer;
43
52
 
44
53
  export function serverPush(name: string, args: unknown): void;
@@ -1,13 +1,17 @@
1
- import { type ModalType } from '../../client/state-types/modals';
1
+ import { OptionlessModal } from '../../../client/state-types/modals';
2
+ import { UndoState as ServerUndoState } from '../../../server/undo';
2
3
 
3
4
  export type UndoState = {
4
- id?: string;
5
- url: unknown;
6
- openModal: ModalType;
5
+ url: string | null;
6
+ // Right now, only the payees page uses this. It's only being set to
7
+ // `manage-rules` which is an optionless modal. Do we want to also
8
+ // support modals with options?
9
+ openModal: OptionlessModal | null;
7
10
  selectedItems: {
8
11
  name: string;
9
12
  items: Set<string>;
10
13
  } | null;
14
+ undoEvent: ServerUndoState | null;
11
15
  };
12
16
 
13
17
  export function setUndoState<K extends keyof Omit<UndoState, 'id'>>(
@@ -9,7 +9,7 @@ export type Init = typeof init;
9
9
 
10
10
  export function send<K extends keyof ServerEvents>(
11
11
  type: K,
12
- args?: ServerEvents[k],
12
+ args?: ServerEvents[K],
13
13
  ): void;
14
14
  export type Send = typeof send;
15
15
 
@@ -1,6 +1,6 @@
1
1
  import { AccountEntity } from '../../types/models';
2
2
  export declare function getGoCardlessAccounts(userId: any, userKey: any, id: any): Promise<any>;
3
- export declare function reconcileTransactions(acctId: any, transactions: any, isBankSyncAccount?: boolean, strictIdChecking?: boolean, isPreview?: boolean): Promise<{
3
+ export declare function reconcileTransactions(acctId: any, transactions: any, isBankSyncAccount?: boolean, strictIdChecking?: boolean, isPreview?: boolean, defaultCleared?: boolean): Promise<{
4
4
  added: any[];
5
5
  updated: any[];
6
6
  updatedPreview: any[];
@@ -31,9 +31,6 @@ export declare function applyActions(transactions: TransactionEntity[], actions:
31
31
  updated: TransactionEntity[] | ({
32
32
  id: any;
33
33
  transfer_id: any;
34
- } | {
35
- id: any;
36
- payee: any;
37
34
  } | {
38
35
  id: any;
39
36
  category: any;
@@ -9,9 +9,6 @@ export declare function batchUpdateTransactions({ added, deleted, updated, learn
9
9
  updated: TransactionEntity[] | ({
10
10
  id: any;
11
11
  transfer_id: any;
12
- } | {
13
- id: any;
14
- payee: any;
15
12
  } | {
16
13
  id: any;
17
14
  category: any;
@@ -1,11 +1,7 @@
1
1
  export declare function addTransfer(transaction: any, transferredAccount: any): Promise<{
2
- id: any;
3
- payee: any;
4
- } | {
5
2
  category?: any;
6
3
  id: any;
7
4
  transfer_id: any;
8
- payee?: undefined;
9
5
  }>;
10
6
  export declare function removeTransfer(transaction: any): Promise<{
11
7
  id: any;
@@ -16,21 +12,14 @@ export declare function updateTransfer(transaction: any, transferredAccount: any
16
12
  category: any;
17
13
  }>;
18
14
  export declare function onInsert(transaction: any): Promise<{
19
- id: any;
20
- payee: any;
21
- } | {
22
15
  category?: any;
23
16
  id: any;
24
17
  transfer_id: any;
25
- payee?: undefined;
26
18
  }>;
27
19
  export declare function onDelete(transaction: any): Promise<void>;
28
20
  export declare function onUpdate(transaction: any): Promise<{
29
21
  id: any;
30
22
  transfer_id: any;
31
- } | {
32
- id: any;
33
- payee: any;
34
23
  } | {
35
24
  id: any;
36
25
  category: any;
@@ -1,11 +1,16 @@
1
1
  import { AdminHandlers } from './types/handlers';
2
2
  export declare const app: {
3
- events: any;
3
+ events: import("mitt").Emitter<{
4
+ sync: import("../../types/server-events").ServerEvents["sync-event"];
5
+ 'load-budget': {
6
+ id: string;
7
+ };
8
+ }>;
4
9
  handlers: AdminHandlers;
5
- services: any;
6
- unlistenServices: any;
10
+ services: (() => () => void)[];
11
+ unlistenServices: (() => void)[];
7
12
  method<Name extends "users-get" | "user-delete-all" | "user-add" | "user-update" | "access-add" | "access-delete-all" | "access-get-available-users" | "transfer-ownership" | "owner-created">(name: Name, func: AdminHandlers[Name]): void;
8
- service(func: any): void;
13
+ service(func: () => () => void): void;
9
14
  combine(...apps: any[]): void;
10
15
  startServices(): void;
11
16
  stopServices(): void;
@@ -7,14 +7,16 @@ export interface AdminHandlers {
7
7
  'user-delete-all': (ids: string[]) => Promise<{
8
8
  someDeletionsFailed: boolean;
9
9
  ids?: number[];
10
+ } | {
11
+ error: string;
10
12
  }>;
11
13
  'user-add': (user: Omit<UserEntity, 'id'>) => Promise<{
12
- error?: string;
14
+ error: string;
13
15
  } | {
14
16
  id: string;
15
17
  }>;
16
18
  'user-update': (user: Omit<UserEntity, 'id'>) => Promise<{
17
- error?: string;
19
+ error: string;
18
20
  } | {
19
21
  id: string;
20
22
  }>;
@@ -1,11 +1,21 @@
1
+ import { type Emitter } from 'mitt';
2
+ import { ServerEvents } from '../types/server-events';
3
+ type Events = {
4
+ sync: ServerEvents['sync-event'];
5
+ 'load-budget': {
6
+ id: string;
7
+ };
8
+ };
9
+ type UnlistenService = () => void;
10
+ type Service = () => UnlistenService;
1
11
  declare class App<Handlers> {
2
- events: any;
12
+ events: Emitter<Events>;
3
13
  handlers: Handlers;
4
- services: any;
5
- unlistenServices: any;
14
+ services: Service[];
15
+ unlistenServices: UnlistenService[];
6
16
  constructor();
7
17
  method<Name extends string & keyof Handlers>(name: Name, func: Handlers[Name]): void;
8
- service(func: any): void;
18
+ service(func: Service): void;
9
19
  combine(...apps: any[]): void;
10
20
  startServices(): void;
11
21
  stopServices(): void;
@@ -1,3 +1,4 @@
1
+ import { QueryState } from '../../shared/query';
1
2
  export declare function quoteAlias(alias: any): any;
2
3
  export declare function isAggregateQuery(queryState: any): boolean;
3
4
  export type SchemaConfig = {
@@ -7,10 +8,7 @@ export type SchemaConfig = {
7
8
  tableOptions: any;
8
9
  }) => unknown);
9
10
  tableFilters?: (name: string) => unknown[];
10
- customizeQuery?: <T extends {
11
- table: string;
12
- orderExpressions: unknown[];
13
- }>(queryString: T) => T;
11
+ customizeQuery?: (queryString: QueryState) => QueryState;
14
12
  views?: Record<string, {
15
13
  fields?: Record<string, string>;
16
14
  [key: `v_${string}`]: string | ((internalFields: any, publicFields: any) => string);
@@ -24,8 +22,8 @@ export declare function compileQuery(queryState: any, schema: any, schemaConfig?
24
22
  where: string;
25
23
  groupBy: string;
26
24
  orderBy: string;
27
- limit: any;
28
- offset: any;
25
+ limit: number;
26
+ offset: number;
29
27
  };
30
28
  state: {
31
29
  schema: any;
@@ -273,6 +273,9 @@ export declare const schema: {
273
273
  group_by: {
274
274
  type: string;
275
275
  };
276
+ sort_by: {
277
+ type: string;
278
+ };
276
279
  balance_type: {
277
280
  type: string;
278
281
  };
@@ -30,6 +30,12 @@ export declare function setZero({ month }: {
30
30
  export declare function set3MonthAvg({ month, }: {
31
31
  month: string;
32
32
  }): Promise<void>;
33
+ export declare function set12MonthAvg({ month, }: {
34
+ month: string;
35
+ }): Promise<void>;
36
+ export declare function set6MonthAvg({ month, }: {
37
+ month: string;
38
+ }): Promise<void>;
33
39
  export declare function setNMonthAvg({ month, N, category, }: {
34
40
  month: string;
35
41
  N: number;
@@ -1,11 +1,16 @@
1
1
  import { BudgetHandlers } from './types/handlers';
2
2
  export declare const app: {
3
- events: any;
3
+ events: import("mitt").Emitter<{
4
+ sync: import("../../types/server-events").ServerEvents["sync-event"];
5
+ 'load-budget': {
6
+ id: string;
7
+ };
8
+ }>;
4
9
  handlers: BudgetHandlers;
5
- services: any;
6
- unlistenServices: any;
7
- method<Name extends "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" | "budget/apply-multiple-templates">(name: Name, func: BudgetHandlers[Name]): void;
8
- service(func: any): void;
10
+ services: (() => () => void)[];
11
+ unlistenServices: (() => void)[];
12
+ method<Name extends "budget/budget-amount" | "budget/copy-previous-month" | "budget/set-zero" | "budget/set-3month-avg" | "budget/set-6month-avg" | "budget/set-12month-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" | "budget/apply-multiple-templates">(name: Name, func: BudgetHandlers[Name]): void;
13
+ service(func: () => () => void): void;
9
14
  combine(...apps: any[]): void;
10
15
  startServices(): void;
11
16
  stopServices(): void;
@@ -13,6 +13,10 @@ export interface BudgetHandlers {
13
13
 
14
14
  'budget/set-3month-avg': (arg: { month: string }) => Promise<void>;
15
15
 
16
+ 'budget/set-6month-avg': (arg: { month: string }) => Promise<void>;
17
+
18
+ 'budget/set-12month-avg': (arg: { month: string }) => Promise<void>;
19
+
16
20
  'budget/check-templates': () => Promise<Notification>;
17
21
 
18
22
  'budget/apply-goal-template': (arg: {
@@ -1,11 +1,16 @@
1
1
  import { DashboardHandlers } from './types/handlers';
2
2
  export declare const app: {
3
- events: any;
3
+ events: import("mitt").Emitter<{
4
+ sync: import("../../types/server-events").ServerEvents["sync-event"];
5
+ 'load-budget': {
6
+ id: string;
7
+ };
8
+ }>;
4
9
  handlers: DashboardHandlers;
5
- services: any;
6
- unlistenServices: any;
10
+ services: (() => () => void)[];
11
+ unlistenServices: (() => void)[];
7
12
  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;
13
+ service(func: () => () => void): void;
9
14
  combine(...apps: any[]): void;
10
15
  startServices(): void;
11
16
  stopServices(): void;
@@ -1,11 +1,16 @@
1
1
  import { FiltersHandlers } from './types/handlers';
2
2
  export declare const app: {
3
- events: any;
3
+ events: import("mitt").Emitter<{
4
+ sync: import("../../types/server-events").ServerEvents["sync-event"];
5
+ 'load-budget': {
6
+ id: string;
7
+ };
8
+ }>;
4
9
  handlers: FiltersHandlers;
5
- services: any;
6
- unlistenServices: any;
10
+ services: (() => () => void)[];
11
+ unlistenServices: (() => void)[];
7
12
  method<Name extends "filter-create" | "filter-update" | "filter-delete">(name: Name, func: FiltersHandlers[Name]): void;
8
- service(func: any): void;
13
+ service(func: () => () => void): void;
9
14
  combine(...apps: any[]): void;
10
15
  startServices(): void;
11
16
  stopServices(): void;
@@ -1,5 +1,3 @@
1
- /* eslint-disable import/no-unused-modules */
2
-
3
1
  export namespace YNAB4 {
4
2
  export interface YFull {
5
3
  masterCategories: MasterCategory[];
@@ -1,5 +1,3 @@
1
- /* eslint-disable import/no-unused-modules */
2
-
3
1
  export namespace YNAB5 {
4
2
  export interface Budget {
5
3
  name?: string;
@@ -1,11 +1,16 @@
1
1
  import { Handlers } from '../types/handlers';
2
2
  export declare const app: {
3
- events: any;
3
+ events: import("mitt").Emitter<{
4
+ sync: import("../types/server-events").ServerEvents["sync-event"];
5
+ 'load-budget': {
6
+ id: string;
7
+ };
8
+ }>;
4
9
  handlers: Handlers;
5
- services: any;
6
- unlistenServices: any;
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-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" | "simplefin-batch-sync" | "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-get-login-methods" | "subscribe-bootstrap" | "subscribe-get-user" | "subscribe-change-password" | "subscribe-sign-in" | "subscribe-sign-out" | "subscribe-set-token" | "get-server-version" | "get-server-url" | "set-server-url" | "validate-budget-name" | "unique-budget-name" | "get-budgets" | "get-remote-files" | "get-user-file-info" | "reset-budget-cache" | "upload-budget" | "download-budget" | "sync-budget" | "load-budget" | "create-demo-budget" | "close-budget" | "delete-budget" | "duplicate-budget" | "create-budget" | "import-budget" | "export-budget" | "upload-file-web" | "backups-get" | "backup-load" | "backup-make" | "get-last-opened-backup" | "app-focused" | "enable-openid" | "enable-password" | "get-openid-config" | "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" | "budget/apply-multiple-templates" | "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" | "users-get" | "user-delete-all" | "user-add" | "user-update" | "access-add" | "access-delete-all" | "access-get-available-users" | "transfer-ownership" | "owner-created" | "tools/fix-split-transactions">(name: Name, func: Handlers[Name]): void;
8
- service(func: any): void;
10
+ services: (() => () => void)[];
11
+ unlistenServices: (() => void)[];
12
+ 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" | "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-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" | "simplefin-batch-sync" | "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-get-login-methods" | "subscribe-bootstrap" | "subscribe-get-user" | "subscribe-change-password" | "subscribe-sign-in" | "subscribe-sign-out" | "subscribe-set-token" | "get-server-version" | "get-server-url" | "set-server-url" | "sync" | "validate-budget-name" | "unique-budget-name" | "get-budgets" | "get-remote-files" | "get-user-file-info" | "reset-budget-cache" | "upload-budget" | "download-budget" | "sync-budget" | "load-budget" | "create-demo-budget" | "close-budget" | "delete-budget" | "duplicate-budget" | "create-budget" | "import-budget" | "export-budget" | "upload-file-web" | "backups-get" | "backup-load" | "backup-make" | "get-last-opened-backup" | "app-focused" | "enable-openid" | "enable-password" | "get-openid-config" | "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/set-6month-avg" | "budget/set-12month-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" | "budget/apply-multiple-templates" | "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" | "users-get" | "user-delete-all" | "user-add" | "user-update" | "access-add" | "access-delete-all" | "access-get-available-users" | "transfer-ownership" | "owner-created" | "tools/fix-split-transactions">(name: Name, func: Handlers[Name]): void;
13
+ service(func: () => () => void): void;
9
14
  combine(...apps: any[]): void;
10
15
  startServices(): void;
11
16
  stopServices(): void;
@@ -14,7 +14,7 @@ export declare function init(config: InitConfig): Promise<{
14
14
  getDataDir: typeof fs.getDataDir;
15
15
  sendMessage: (msg: any, args: any) => void;
16
16
  send: <K extends keyof Handlers, T extends Handlers[K]>(name: K, args?: Parameters<T>[0]) => Promise<Awaited<ReturnType<T>>>;
17
- on: (name: any, func: any) => any;
17
+ on: (name: any, func: any) => void;
18
18
  q: typeof q;
19
19
  db: typeof db;
20
20
  }>;
@@ -22,7 +22,7 @@ export declare const lib: {
22
22
  getDataDir: typeof fs.getDataDir;
23
23
  sendMessage: (msg: any, args: any) => void;
24
24
  send: <K extends keyof Handlers, T extends Handlers[K]>(name: K, args?: Parameters<T>[0]) => Promise<Awaited<ReturnType<T>>>;
25
- on: (name: any, func: any) => any;
25
+ on: (name: any, func: any) => void;
26
26
  q: typeof q;
27
27
  db: typeof db;
28
28
  };
@@ -1,11 +1,16 @@
1
1
  import { NotesHandlers } from './types/handlers';
2
2
  export declare const app: {
3
- events: any;
3
+ events: import("mitt").Emitter<{
4
+ sync: import("../../types/server-events").ServerEvents["sync-event"];
5
+ 'load-budget': {
6
+ id: string;
7
+ };
8
+ }>;
4
9
  handlers: NotesHandlers;
5
- services: any;
6
- unlistenServices: any;
10
+ services: (() => () => void)[];
11
+ unlistenServices: (() => void)[];
7
12
  method<Name extends "notes-save">(name: Name, func: NotesHandlers[Name]): void;
8
- service(func: any): void;
13
+ service(func: () => () => void): void;
9
14
  combine(...apps: any[]): void;
10
15
  startServices(): void;
11
16
  stopServices(): void;
@@ -1,11 +1,16 @@
1
1
  import { PreferencesHandlers } from './types/handlers';
2
2
  export declare const app: {
3
- events: any;
3
+ events: import("mitt").Emitter<{
4
+ sync: import("../../types/server-events").ServerEvents["sync-event"];
5
+ 'load-budget': {
6
+ id: string;
7
+ };
8
+ }>;
4
9
  handlers: PreferencesHandlers;
5
- services: any;
6
- unlistenServices: any;
10
+ services: (() => () => void)[];
11
+ unlistenServices: (() => void)[];
7
12
  method<Name extends "preferences/save" | "preferences/get">(name: Name, func: PreferencesHandlers[Name]): void;
8
- service(func: any): void;
13
+ service(func: () => () => void): void;
9
14
  combine(...apps: any[]): void;
10
15
  startServices(): void;
11
16
  stopServices(): void;
@@ -13,6 +13,7 @@ export declare const reportModel: {
13
13
  dateRange: string;
14
14
  mode: string;
15
15
  groupBy: string;
16
+ sortBy: import("../../types/models").sortByOpType;
16
17
  interval: string;
17
18
  balanceType: string;
18
19
  showEmpty: boolean;
@@ -33,6 +34,7 @@ export declare const reportModel: {
33
34
  date_range: string;
34
35
  mode: string;
35
36
  group_by: string;
37
+ sort_by: import("../../types/models").sortByOpType;
36
38
  interval: string;
37
39
  balance_type: string;
38
40
  show_empty: number;
@@ -46,12 +48,17 @@ export declare const reportModel: {
46
48
  };
47
49
  };
48
50
  export declare const app: {
49
- events: any;
51
+ events: import("mitt").Emitter<{
52
+ sync: import("../../types/server-events").ServerEvents["sync-event"];
53
+ 'load-budget': {
54
+ id: string;
55
+ };
56
+ }>;
50
57
  handlers: ReportsHandlers;
51
- services: any;
52
- unlistenServices: any;
58
+ services: (() => () => void)[];
59
+ unlistenServices: (() => void)[];
53
60
  method<Name extends "report/create" | "report/update" | "report/delete">(name: Name, func: ReportsHandlers[Name]): void;
54
- service(func: any): void;
61
+ service(func: () => () => void): void;
55
62
  combine(...apps: any[]): void;
56
63
  startServices(): void;
57
64
  stopServices(): void;