@actual-app/api 25.3.0 → 25.4.0-alpha.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 (121) hide show
  1. package/@types/app/bundle.api.d.ts +1 -5
  2. package/@types/loot-core/client/accounts/accountsSlice.d.ts +175 -0
  3. package/@types/loot-core/client/app/appSlice.d.ts +175 -0
  4. package/@types/loot-core/client/budgets/budgetsSlice.d.ts +405 -0
  5. package/@types/loot-core/client/modals/modalsSlice.d.ts +490 -0
  6. package/@types/loot-core/client/notifications/notificationsSlice.d.ts +47 -0
  7. package/@types/loot-core/client/platform.d.ts +1 -0
  8. package/@types/loot-core/client/prefs/prefsSlice.d.ts +178 -0
  9. package/@types/loot-core/client/queries/queriesSlice.d.ts +692 -0
  10. package/@types/loot-core/client/redux.d.ts +18546 -0
  11. package/@types/loot-core/client/store/index.d.ts +133 -0
  12. package/@types/loot-core/client/users/usersSlice.d.ts +105 -0
  13. package/@types/loot-core/mocks/index.d.ts +5 -2
  14. package/@types/loot-core/platform/client/fetch/index.d.ts +1 -10
  15. package/@types/loot-core/platform/client/undo/index.d.ts +19 -31
  16. package/@types/loot-core/platform/exceptions/index.d.ts +2 -5
  17. package/@types/loot-core/platform/server/asyncStorage/index.d.ts +5 -5
  18. package/@types/loot-core/platform/server/connection/index.d.ts +0 -3
  19. package/@types/loot-core/platform/server/fetch/index.d.ts +1 -4
  20. package/@types/loot-core/platform/server/indexeddb/index.d.ts +15 -24
  21. package/@types/loot-core/platform/server/log/index.d.ts +4 -6
  22. package/@types/loot-core/server/accounts/app.d.ts +19 -5
  23. package/@types/loot-core/server/accounts/link.d.ts +6 -1
  24. package/@types/loot-core/server/admin/app.d.ts +54 -1
  25. package/@types/loot-core/server/api-models.d.ts +24 -32
  26. package/@types/loot-core/server/aql/exec.d.ts +1 -1
  27. package/@types/loot-core/server/aql/schema/executors.d.ts +2 -0
  28. package/@types/loot-core/server/aql/schema/index.d.ts +9 -0
  29. package/@types/loot-core/server/auth/app.d.ts +142 -0
  30. package/@types/loot-core/server/budget/actions.d.ts +6 -5
  31. package/@types/loot-core/server/budget/app.d.ts +103 -2
  32. package/@types/loot-core/server/budget/base.d.ts +1 -1
  33. package/@types/loot-core/server/budget/cleanup-template.d.ts +1 -1
  34. package/@types/loot-core/server/budget/goaltemplates.d.ts +1 -1
  35. package/@types/loot-core/server/budget/statements.d.ts +2 -2
  36. package/@types/loot-core/server/budget/template-notes.d.ts +1 -1
  37. package/@types/loot-core/server/budget/types/templates.d.ts +2 -1
  38. package/@types/loot-core/server/budgetfiles/app.d.ts +139 -0
  39. package/@types/loot-core/server/cloud-storage.d.ts +3 -3
  40. package/@types/loot-core/server/dashboard/app.d.ts +35 -1
  41. package/@types/loot-core/server/db/index.d.ts +38 -31
  42. package/@types/loot-core/server/db/sort.d.ts +1 -1
  43. package/@types/loot-core/server/encryption/app.d.ts +40 -0
  44. package/@types/loot-core/server/{encryption-internals.d.ts → encryption/encryption-internals.d.ts} +5 -5
  45. package/@types/loot-core/server/{encryption.d.ts → encryption/index.d.ts} +3 -3
  46. package/@types/loot-core/server/errors.d.ts +4 -0
  47. package/@types/loot-core/server/filters/app.d.ts +10 -1
  48. package/@types/loot-core/server/importers/index.d.ts +1 -2
  49. package/@types/loot-core/server/main-app.d.ts +1 -1
  50. package/@types/loot-core/server/models.d.ts +24 -23
  51. package/@types/loot-core/server/notes/app.d.ts +6 -1
  52. package/@types/loot-core/server/payees/app.d.ts +48 -0
  53. package/@types/loot-core/server/preferences/app.d.ts +1 -10
  54. package/@types/loot-core/server/reports/app.d.ts +9 -1
  55. package/@types/loot-core/server/rules/app.d.ts +50 -1
  56. package/@types/loot-core/server/schedules/app.d.ts +25 -2
  57. package/@types/loot-core/server/schedules/find-schedules.d.ts +1 -1
  58. package/@types/loot-core/server/server-config.d.ts +1 -0
  59. package/@types/loot-core/server/sheet.d.ts +1 -1
  60. package/@types/loot-core/server/spreadsheet/app.d.ts +38 -0
  61. package/@types/loot-core/server/spreadsheet/graph-data-structure.d.ts +4 -4
  62. package/@types/loot-core/server/spreadsheet/spreadsheet.d.ts +12 -4
  63. package/@types/loot-core/server/sync/app.d.ts +38 -0
  64. package/@types/loot-core/server/sync/make-test-message.d.ts +1 -1
  65. package/@types/loot-core/server/tools/app.d.ts +13 -1
  66. package/@types/loot-core/server/transactions/app.d.ts +1 -1
  67. package/@types/loot-core/server/transactions/import/parse-file.d.ts +1 -0
  68. package/@types/loot-core/server/transactions/transaction-rules.d.ts +5 -4
  69. package/@types/loot-core/server/undo.d.ts +1 -1
  70. package/@types/loot-core/shared/async.d.ts +4 -3
  71. package/@types/loot-core/shared/errors.d.ts +4 -4
  72. package/@types/loot-core/shared/locale.d.ts +1 -0
  73. package/@types/loot-core/shared/months.d.ts +2 -2
  74. package/@types/loot-core/shared/schedules.d.ts +5 -3
  75. package/@types/loot-core/shared/util.d.ts +4 -1
  76. package/@types/loot-core/types/handlers.d.ts +22 -10
  77. package/@types/loot-core/types/models/account.d.ts +2 -1
  78. package/@types/loot-core/types/models/bank-sync.d.ts +1 -1
  79. package/@types/loot-core/types/models/category-group.d.ts +2 -6
  80. package/@types/loot-core/types/models/category.d.ts +1 -1
  81. package/@types/loot-core/types/models/index.d.ts +5 -1
  82. package/@types/loot-core/types/models/openid.d.ts +2 -1
  83. package/@types/loot-core/types/models/payee.d.ts +2 -2
  84. package/@types/loot-core/types/models/pluggyai.d.ts +18 -0
  85. package/@types/loot-core/types/models/user-access.d.ts +10 -0
  86. package/@types/loot-core/types/models/user.d.ts +17 -18
  87. package/@types/loot-core/types/prefs.d.ts +9 -1
  88. package/@types/loot-core/types/server-events.d.ts +1 -1
  89. package/@types/loot-core/types/server-handlers.d.ts +2 -276
  90. package/@types/loot-core/types/util.d.ts +7 -0
  91. package/dist/app/bundle.api.js +17509 -67076
  92. package/dist/index.js +17 -7
  93. package/dist/jest.config.js +0 -2
  94. package/dist/methods.js +17 -7
  95. package/dist/migrations/1740506588539_add_last_reconciled_at.sql +5 -0
  96. package/dist/package.json +8 -8
  97. package/dist/validateNodeVersion.js +17 -7
  98. package/package.json +8 -8
  99. package/@types/loot-core/client/constants.d.ts +0 -21
  100. package/@types/loot-core/client/state-types/budgets.d.ts +0 -36
  101. package/@types/loot-core/client/state-types/index.d.ts +0 -27
  102. package/@types/loot-core/client/state-types/modals.d.ts +0 -392
  103. package/@types/loot-core/client/state-types/notifications.d.ts +0 -57
  104. package/@types/loot-core/client/state-types/prefs.d.ts +0 -40
  105. package/@types/loot-core/client/state-types/user.d.ts +0 -13
  106. package/@types/loot-core/server/admin/types/handlers.d.ts +0 -43
  107. package/@types/loot-core/server/budget/types/handlers.d.ts +0 -91
  108. package/@types/loot-core/server/dashboard/types/handlers.d.ts +0 -24
  109. package/@types/loot-core/server/encryption-internals.web.d.ts +0 -23
  110. package/@types/loot-core/server/encryption.test.d.ts +0 -1
  111. package/@types/loot-core/server/filters/types/handlers.d.ts +0 -7
  112. package/@types/loot-core/server/notes/types/handlers.d.ts +0 -3
  113. package/@types/loot-core/server/reports/types/handlers.d.ts +0 -6
  114. package/@types/loot-core/server/rules/types/handlers.d.ts +0 -40
  115. package/@types/loot-core/server/schedules/types/handlers.d.ts +0 -31
  116. package/@types/loot-core/server/tools/types/handlers.d.ts +0 -11
  117. package/@types/loot-core/types/models/userAccess.d.ts +0 -9
  118. package/@types/methods.test.d.ts +0 -1
  119. package/dist/methods.test.js +0 -541
  120. /package/@types/loot-core/server/{backups.test.d.ts → api.test.d.ts} +0 -0
  121. /package/@types/loot-core/server/{backups.d.ts → budgetfiles/backups.d.ts} +0 -0
@@ -3,7 +3,7 @@ export declare function get(): Spreadsheet;
3
3
  export declare function loadSpreadsheet(db: any, onSheetChange?: any): Promise<Spreadsheet>;
4
4
  export declare function unloadSpreadsheet(): void;
5
5
  export declare function reloadSpreadsheet(db: any): Promise<Spreadsheet>;
6
- export declare function loadUserBudgets(db: any): Promise<void>;
6
+ export declare function loadUserBudgets(db: typeof import('./db')): Promise<void>;
7
7
  export declare function getCell(sheet: string, name: string): import("./spreadsheet/spreadsheet").Node;
8
8
  export declare function getCellValue(sheet: string, name: string): string | number | boolean;
9
9
  export declare function startTransaction(): void;
@@ -0,0 +1,38 @@
1
+ import { QueryState } from '../../shared/query';
2
+ export type SpreadsheetHandlers = {
3
+ 'get-cell': typeof getCell;
4
+ 'get-cell-names': typeof getCellNames;
5
+ 'create-query': typeof createQuery;
6
+ };
7
+ export declare const app: {
8
+ events: import("mitt").Emitter<{
9
+ sync: import("../../types/server-events").ServerEvents["sync-event"];
10
+ 'load-budget': {
11
+ id: string;
12
+ };
13
+ }>;
14
+ handlers: SpreadsheetHandlers;
15
+ services: (() => () => void)[];
16
+ unlistenServices: (() => void)[];
17
+ method<Name extends "get-cell" | "get-cell-names" | "create-query">(name: Name, func: SpreadsheetHandlers[Name]): void;
18
+ service(func: () => () => void): void;
19
+ combine(...apps: any[]): void;
20
+ startServices(): void;
21
+ stopServices(): void;
22
+ };
23
+ declare function getCell({ sheetName, name, }: {
24
+ sheetName: string;
25
+ name: string;
26
+ }): Promise<{
27
+ name: string;
28
+ value: string | number | boolean;
29
+ }>;
30
+ declare function getCellNames({ sheetName }: {
31
+ sheetName: string;
32
+ }): Promise<any[]>;
33
+ declare function createQuery({ sheetName, name, query, }: {
34
+ sheetName: string;
35
+ name: string;
36
+ query: QueryState;
37
+ }): Promise<string>;
38
+ export {};
@@ -1,10 +1,10 @@
1
1
  export declare function Graph(): {
2
- addNode: (node: any) => any;
3
- removeNode: (node: any) => any;
2
+ addNode: (node: any) => /*elided*/ any;
3
+ removeNode: (node: any) => /*elided*/ any;
4
4
  adjacent: (node: any) => any;
5
5
  adjacentIncoming: (node: any) => any;
6
- addEdge: (node1: any, node2: any) => any;
7
- removeEdge: (node1: any, node2: any) => any;
6
+ addEdge: (node1: any, node2: any) => /*elided*/ any;
7
+ removeEdge: (node1: any, node2: any) => /*elided*/ any;
8
8
  removeIncomingEdges: (node: any) => void;
9
9
  topologicalSort: (sourceNodes: any) => any[];
10
10
  generateDOT: () => string;
@@ -1,9 +1,11 @@
1
+ import { QueryState } from '../../shared/query';
2
+ import { BudgetType } from '../prefs';
1
3
  export type Node = {
2
4
  name: string;
3
5
  expr: string | number | boolean;
4
6
  value: string | number | boolean;
5
7
  sheet: unknown;
6
- query?: string;
8
+ query?: QueryState;
7
9
  sql?: {
8
10
  sqlPieces: unknown;
9
11
  state: {
@@ -15,7 +17,10 @@ export type Node = {
15
17
  _dependencies?: string[];
16
18
  };
17
19
  export declare class Spreadsheet {
18
- _meta: any;
20
+ _meta: {
21
+ createdMonths: Set<string>;
22
+ budgetType: BudgetType;
23
+ };
19
24
  cacheBarrier: any;
20
25
  computeQueue: any;
21
26
  dirtyCells: any;
@@ -27,7 +32,10 @@ export declare class Spreadsheet {
27
32
  setCacheStatus: any;
28
33
  transactionDepth: any;
29
34
  constructor(saveCache?: unknown, setCacheStatus?: unknown);
30
- meta(): any;
35
+ meta(): {
36
+ createdMonths: Set<string>;
37
+ budgetType: BudgetType;
38
+ };
31
39
  setMeta(meta: any): void;
32
40
  _getNode(name: string): Node;
33
41
  getNode(name: any): Node;
@@ -61,7 +69,7 @@ export declare class Spreadsheet {
61
69
  set(name: string, value: string | number | boolean): void;
62
70
  recompute(name: string): void;
63
71
  recomputeAll(): void;
64
- createQuery(sheetName: string, cellName: string, query: string): void;
72
+ createQuery(sheetName: string, cellName: string, query: QueryState): void;
65
73
  createStatic(sheetName: string, cellName: string, initialValue: number | boolean): void;
66
74
  createDynamic(sheetName: string, cellName: string, { dependencies, run, initialValue, refresh, }: {
67
75
  dependencies?: string[];
@@ -0,0 +1,38 @@
1
+ export type SyncHandlers = {
2
+ sync: typeof sync;
3
+ 'sync-reset': typeof resetSync;
4
+ 'sync-repair': typeof repairSync;
5
+ };
6
+ export declare const app: {
7
+ events: import("mitt").Emitter<{
8
+ sync: import("../../types/server-events").ServerEvents["sync-event"];
9
+ 'load-budget': {
10
+ id: string;
11
+ };
12
+ }>;
13
+ handlers: SyncHandlers;
14
+ services: (() => () => void)[];
15
+ unlistenServices: (() => void)[];
16
+ method<Name extends "sync" | "sync-reset" | "sync-repair">(name: Name, func: SyncHandlers[Name]): void;
17
+ service(func: () => () => void): void;
18
+ combine(...apps: any[]): void;
19
+ startServices(): void;
20
+ stopServices(): void;
21
+ };
22
+ declare function sync(): Promise<{
23
+ messages: import(".").Message[];
24
+ } | {
25
+ error: {
26
+ message: string;
27
+ reason: string;
28
+ meta: unknown;
29
+ };
30
+ }>;
31
+ declare function resetSync(): Promise<{
32
+ error?: {
33
+ reason: string;
34
+ meta?: unknown;
35
+ };
36
+ }>;
37
+ declare function repairSync(): Promise<void>;
38
+ export {};
@@ -1,5 +1,5 @@
1
1
  export declare function makeTestMessage(keyId: any): Promise<{
2
- value: Buffer;
2
+ value: Buffer<ArrayBufferLike>;
3
3
  meta: {
4
4
  keyId: any;
5
5
  algorithm: "aes-256-gcm";
@@ -1,4 +1,7 @@
1
- import { ToolsHandlers } from './types/handlers';
1
+ import { TransactionEntity } from '../../types/models';
2
+ export type ToolsHandlers = {
3
+ 'tools/fix-split-transactions': typeof fixSplitTransactions;
4
+ };
2
5
  export declare const app: {
3
6
  events: import("mitt").Emitter<{
4
7
  sync: import("../../types/server-events").ServerEvents["sync-event"];
@@ -15,3 +18,12 @@ export declare const app: {
15
18
  startServices(): void;
16
19
  stopServices(): void;
17
20
  };
21
+ declare function fixSplitTransactions(): Promise<{
22
+ numBlankPayees: number;
23
+ numCleared: number;
24
+ numDeleted: number;
25
+ numTransfersFixed: number;
26
+ numNonParentErrorsFixed: number;
27
+ mismatchedSplits: TransactionEntity[];
28
+ }>;
29
+ export {};
@@ -49,7 +49,7 @@ export declare const app: {
49
49
  handlers: TransactionHandlers;
50
50
  services: (() => () => void)[];
51
51
  unlistenServices: (() => void)[];
52
- method<Name extends "get-earliest-transaction" | "transactions-batch-update" | "transaction-add" | "transaction-update" | "transaction-delete" | "transactions-parse-file" | "transactions-export" | "transactions-export-query">(name: Name, func: TransactionHandlers[Name]): void;
52
+ method<Name extends "transactions-batch-update" | "transaction-add" | "transaction-update" | "transaction-delete" | "transactions-parse-file" | "transactions-export" | "transactions-export-query" | "get-earliest-transaction">(name: Name, func: TransactionHandlers[Name]): void;
53
53
  service(func: () => () => void): void;
54
54
  combine(...apps: any[]): void;
55
55
  startServices(): void;
@@ -11,6 +11,7 @@ export type ParseFileOptions = {
11
11
  delimiter?: string;
12
12
  fallbackMissingPayeeToMemo?: boolean;
13
13
  skipLines?: number;
14
+ importNotes?: boolean;
14
15
  };
15
16
  export declare function parseFile(filepath: string, options?: ParseFileOptions): Promise<ParseFileResult>;
16
17
  export {};
@@ -1,4 +1,5 @@
1
- import { type TransactionEntity, type RuleActionEntity, type RuleEntity, AccountEntity } from '../../types/models';
1
+ import { type TransactionEntity, type RuleActionEntity, type RuleEntity } from '../../types/models';
2
+ import * as db from '../db';
2
3
  import { Action, Rule } from '../rules';
3
4
  export { iterateIds } from '../rules';
4
5
  export declare function resetState(): void;
@@ -19,7 +20,7 @@ export declare function insertRule(rule: Omit<RuleEntity, 'id'> & {
19
20
  }): Promise<any>;
20
21
  export declare function updateRule(rule: any): Promise<void>;
21
22
  export declare function deleteRule(id: string): Promise<boolean>;
22
- export declare function runRules(trans: any, accounts?: Map<string, AccountEntity> | null): Promise<TransactionEntity>;
23
+ export declare function runRules(trans: any, accounts?: Map<string, db.DbAccount> | null): Promise<TransactionEntity>;
23
24
  export declare function conditionsToAQL(conditions: any, { recurDateBounds, applySpecialCases }?: {
24
25
  recurDateBounds?: number;
25
26
  applySpecialCases?: boolean;
@@ -43,7 +44,7 @@ export declare function getProbableCategory(transactions: any): any;
43
44
  export declare function updateCategoryRules(transactions: any): Promise<void>;
44
45
  export type TransactionForRules = TransactionEntity & {
45
46
  payee_name?: string;
46
- _account?: AccountEntity;
47
+ _account?: db.DbAccount;
47
48
  };
48
- export declare function prepareTransactionForRules(trans: TransactionEntity, accounts?: Map<string, AccountEntity> | null): Promise<TransactionForRules>;
49
+ export declare function prepareTransactionForRules(trans: TransactionEntity, accounts?: Map<string, db.DbAccount> | null): Promise<TransactionForRules>;
49
50
  export declare function finalizeTransactionForRules(trans: TransactionEntity | TransactionForRules): Promise<TransactionEntity>;
@@ -9,6 +9,6 @@ export type UndoState = {
9
9
  export declare function appendMessages(messages: any, oldData: any): void;
10
10
  export declare function clearUndo(): void;
11
11
  export declare function withUndo<T>(func: () => Promise<T>, meta?: unknown): Promise<T>;
12
- export declare function undoable<T extends HandlerFunctions>(func: T): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>;
12
+ export declare function undoable<T extends HandlerFunctions>(func: T, metaFunc?: (...metaArgs: Parameters<T>) => unknown): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>;
13
13
  export declare function undo(): Promise<void>;
14
14
  export declare function redo(): Promise<void>;
@@ -1,3 +1,4 @@
1
- import { type HandlerFunctions } from '../types/handlers';
2
- export declare function sequential<T extends HandlerFunctions>(fn: T): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>;
3
- export declare function once<T extends HandlerFunctions>(fn: T): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>> | null;
1
+ type AnyFunction = (...args: any[]) => any;
2
+ export declare function sequential<T extends AnyFunction>(fn: T): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>;
3
+ export declare function once<T extends AnyFunction>(fn: T): (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>> | null;
4
+ export {};
@@ -2,10 +2,10 @@ export declare function getUploadError({ reason, meta, }: {
2
2
  reason: string;
3
3
  meta?: unknown;
4
4
  }): string;
5
- export declare function getDownloadError({ reason, meta, fileName }: {
6
- reason: any;
7
- meta: any;
8
- fileName: any;
5
+ export declare function getDownloadError({ reason, meta, fileName, }: {
6
+ reason: string;
7
+ meta?: unknown;
8
+ fileName?: string;
9
9
  }): string;
10
10
  export declare function getCreateKeyError(error: any): string;
11
11
  export declare function getTestKeyError({ reason }: {
@@ -0,0 +1 @@
1
+ export declare function getLocale(language: string): Locale;
@@ -53,8 +53,8 @@ export declare function getWeekEnd(date: DateLike, firstDayOfWeekIdx?: SyncedPre
53
53
  export declare function getYearStart(month: string): string;
54
54
  export declare function getYearEnd(month: string): string;
55
55
  export declare function sheetForMonth(month: string): string;
56
- export declare function nameForMonth(month: DateLike): string;
57
- export declare function format(month: DateLike, format: string): string;
56
+ export declare function nameForMonth(month: DateLike, locale?: Locale): string;
57
+ export declare function format(month: DateLike, format: string, locale?: Locale): string;
58
58
  export declare const getDateFormatRegex: import("memoize-one").MemoizedFn<(format: string) => RegExp>;
59
59
  export declare const getDayMonthFormat: import("memoize-one").MemoizedFn<(format: string) => string>;
60
60
  export declare const getDayMonthRegex: import("memoize-one").MemoizedFn<(format: string) => RegExp>;
@@ -1,7 +1,9 @@
1
1
  import type { IRuleOptions } from '@rschedule/core';
2
+ import { Condition } from '../server/rules';
2
3
  export declare function getStatus(nextDate: string, completed: boolean, hasTrans: boolean, upcomingLength: string): "completed" | "paid" | "due" | "upcoming" | "missed" | "scheduled";
4
+ export declare function getStatusLabel(status: string): string;
3
5
  export declare function getHasTransactionsQuery(schedules: any): import("./query").Query;
4
- export declare function getRecurringDescription(config: any, dateFormat: any): string;
6
+ export declare function getRecurringDescription(config: any, dateFormat: any, locale: Locale): string;
5
7
  export declare function recurConfigToRSchedule(config: any): IRuleOptions[];
6
8
  export declare function extractScheduleConds(conditions: any): {
7
9
  payee: any;
@@ -16,5 +18,5 @@ export declare function getScheduledAmount(amount: number | {
16
18
  num2: number;
17
19
  }, inverse?: boolean): number;
18
20
  export declare function describeSchedule(schedule: any, payee: any): string;
19
- export declare function getUpcomingDays(upcomingLength?: string): number;
20
- export declare function scheduleIsRecurring(dateCond: any): boolean;
21
+ export declare function getUpcomingDays(upcomingLength?: string, today?: string): number;
22
+ export declare function scheduleIsRecurring(dateCond: Condition | null): boolean;
@@ -8,7 +8,7 @@ export type Diff<T extends {
8
8
  }> = {
9
9
  added: T[];
10
10
  updated: Partial<T>[];
11
- deleted: Partial<T>[];
11
+ deleted: Pick<T, 'id'>[];
12
12
  };
13
13
  export declare function applyChanges<T extends {
14
14
  id: string;
@@ -80,4 +80,7 @@ export declare function amountToInteger(amount: Amount): IntegerAmount;
80
80
  export declare function integerToAmount(integerAmount: IntegerAmount): Amount;
81
81
  export declare function looselyParseAmount(amount: string): number;
82
82
  export declare function sortByKey<T>(arr: T[], key: keyof T): T[];
83
+ export declare function tsToRelativeTime(ts: string | null, locale: Locale, options?: {
84
+ capitalize: boolean;
85
+ }): string;
83
86
  export {};
@@ -1,14 +1,20 @@
1
1
  import type { AccountHandlers } from '../server/accounts/app';
2
- import type { AdminHandlers } from '../server/admin/types/handlers';
3
- import type { BudgetHandlers } from '../server/budget/types/handlers';
4
- import type { DashboardHandlers } from '../server/dashboard/types/handlers';
5
- import type { FiltersHandlers } from '../server/filters/types/handlers';
6
- import type { NotesHandlers } from '../server/notes/types/handlers';
2
+ import type { AdminHandlers } from '../server/admin/app';
3
+ import type { AuthHandlers } from '../server/auth/app';
4
+ import type { BudgetHandlers } from '../server/budget/app';
5
+ import type { BudgetFileHandlers } from '../server/budgetfiles/app';
6
+ import type { DashboardHandlers } from '../server/dashboard/app';
7
+ import type { EncryptionHandlers } from '../server/encryption/app';
8
+ import type { FiltersHandlers } from '../server/filters/app';
9
+ import type { NotesHandlers } from '../server/notes/app';
10
+ import type { PayeesHandlers } from '../server/payees/app';
7
11
  import type { PreferencesHandlers } from '../server/preferences/app';
8
- import type { ReportsHandlers } from '../server/reports/types/handlers';
9
- import type { RulesHandlers } from '../server/rules/types/handlers';
10
- import type { SchedulesHandlers } from '../server/schedules/types/handlers';
11
- import type { ToolsHandlers } from '../server/tools/types/handlers';
12
+ import type { ReportsHandlers } from '../server/reports/app';
13
+ import type { RulesHandlers } from '../server/rules/app';
14
+ import type { SchedulesHandlers } from '../server/schedules/app';
15
+ import type { SpreadsheetHandlers } from '../server/spreadsheet/app';
16
+ import type { SyncHandlers } from '../server/sync/app';
17
+ import type { ToolsHandlers } from '../server/tools/app';
12
18
  import type { TransactionHandlers } from '../server/transactions/app';
13
19
 
14
20
  import type { ApiHandlers } from './api-handlers';
@@ -28,6 +34,12 @@ export interface Handlers
28
34
  TransactionHandlers,
29
35
  AdminHandlers,
30
36
  ToolsHandlers,
31
- AccountHandlers {}
37
+ AccountHandlers,
38
+ PayeesHandlers,
39
+ SpreadsheetHandlers,
40
+ SyncHandlers,
41
+ BudgetFileHandlers,
42
+ EncryptionHandlers,
43
+ AuthHandlers {}
32
44
 
33
45
  export type HandlerFunctions = Handlers[keyof Handlers];
@@ -4,6 +4,7 @@ export type AccountEntity = {
4
4
  offbudget: 0 | 1;
5
5
  closed: 0 | 1;
6
6
  sort_order: number;
7
+ last_reconciled: string | null;
7
8
  tombstone: 0 | 1;
8
9
  } & (_SyncFields<true> | _SyncFields<false>);
9
10
 
@@ -21,4 +22,4 @@ type _SyncFields<T> = {
21
22
  last_sync: T extends true ? string : null;
22
23
  };
23
24
 
24
- export type AccountSyncSource = 'simpleFin' | 'goCardless';
25
+ export type AccountSyncSource = 'simpleFin' | 'goCardless' | 'pluggyai';
@@ -20,4 +20,4 @@ export type BankSyncResponse = {
20
20
  error_code: string;
21
21
  };
22
22
 
23
- export type BankSyncProviders = 'goCardless' | 'simpleFin';
23
+ export type BankSyncProviders = 'goCardless' | 'simpleFin' | 'pluggyai';
@@ -1,15 +1,11 @@
1
1
  import { CategoryEntity } from './category';
2
2
 
3
- export interface NewCategoryGroupEntity {
3
+ export interface CategoryGroupEntity {
4
+ id: string;
4
5
  name: string;
5
6
  is_income?: boolean;
6
7
  sort_order?: number;
7
8
  tombstone?: boolean;
8
9
  hidden?: boolean;
9
- categories?: Omit<CategoryEntity, 'id'>[];
10
- }
11
-
12
- export interface CategoryGroupEntity extends NewCategoryGroupEntity {
13
- id: string;
14
10
  categories?: CategoryEntity[];
15
11
  }
@@ -4,7 +4,7 @@ export interface CategoryEntity {
4
4
  id: string;
5
5
  name: string;
6
6
  is_income?: boolean;
7
- cat_group?: CategoryGroupEntity['id'];
7
+ group: CategoryGroupEntity['id'];
8
8
  sort_order?: number;
9
9
  tombstone?: boolean;
10
10
  hidden?: boolean;
@@ -1,15 +1,19 @@
1
1
  export type * from './account';
2
+ export type * from './bank';
2
3
  export type * from './bank-sync';
3
4
  export type * from './category';
4
5
  export type * from './category-group';
5
6
  export type * from './dashboard';
6
7
  export type * from './gocardless';
7
- export type * from './simplefin';
8
8
  export type * from './note';
9
+ export type * from './openid';
9
10
  export type * from './payee';
11
+ export type * from './pluggyai';
10
12
  export type * from './reports';
11
13
  export type * from './rule';
12
14
  export type * from './schedule';
15
+ export type * from './simplefin';
13
16
  export type * from './transaction';
14
17
  export type * from './transaction-filter';
15
18
  export type * from './user';
19
+ export type * from './user-access';
@@ -1,7 +1,8 @@
1
1
  export type OpenIdConfig = {
2
2
  selectedProvider: string;
3
- issuer: string;
3
+ issuer?: string;
4
4
  client_id: string;
5
5
  client_secret: string;
6
6
  server_hostname: string;
7
+ discoveryURL: string;
7
8
  };
@@ -4,7 +4,7 @@ export interface PayeeEntity {
4
4
  id: string;
5
5
  name: string;
6
6
  transfer_acct?: AccountEntity['id'];
7
- favorite?: 1 | 0;
8
- learn_categories?: 1 | 0;
7
+ favorite?: boolean;
8
+ learn_categories?: boolean;
9
9
  tombstone?: boolean;
10
10
  }
@@ -0,0 +1,18 @@
1
+ export type PluggyAiOrganization = {
2
+ name: string;
3
+ domain: string;
4
+ };
5
+
6
+ export type PluggyAiAccount = {
7
+ id: string;
8
+ name: string;
9
+ org: PluggyAiOrganization;
10
+ };
11
+
12
+ export type SyncServerPluggyAiAccount = {
13
+ account_id: string;
14
+ institution?: string;
15
+ orgDomain?: string;
16
+ orgId?: string;
17
+ name: string;
18
+ };
@@ -0,0 +1,10 @@
1
+ export interface NewUserAccessEntity {
2
+ fileId: string;
3
+ userId: string;
4
+ }
5
+
6
+ export interface UserAccessEntity extends NewUserAccessEntity {
7
+ displayName: string;
8
+ userName: string;
9
+ fileName: string;
10
+ }
@@ -1,26 +1,25 @@
1
1
  export interface NewUserEntity {
2
- userName: string;
3
- displayName: string;
4
- role: string;
5
- enabled: boolean;
2
+ userName: string;
3
+ displayName: string;
4
+ role: string;
5
+ enabled: boolean;
6
6
  }
7
+
7
8
  export interface UserEntity extends NewUserEntity {
8
- id: string;
9
- owner: boolean;
9
+ id: string;
10
+ owner: boolean;
10
11
  }
12
+
11
13
  export interface UserEntityDropdown {
12
- userId: string;
13
- userName: string;
14
- displayName?: string;
14
+ userId: string;
15
+ userName: string;
16
+ displayName?: string;
15
17
  }
18
+
16
19
  export interface UserAvailable {
17
- userId: string;
18
- displayName?: string;
19
- userName: string;
20
- haveAccess?: number;
21
- owner?: number;
20
+ userId: string;
21
+ displayName?: string;
22
+ userName: string;
23
+ haveAccess?: number;
24
+ owner?: number;
22
25
  }
23
- export declare const PossibleRoles: {
24
- ADMIN: string;
25
- BASIC: string;
26
- };
@@ -3,7 +3,8 @@ export type FeatureFlag =
3
3
  | 'goalTemplatesUIEnabled'
4
4
  | 'actionTemplating'
5
5
  | 'contextMenus'
6
- | 'openidAuth';
6
+ | 'openidAuth'
7
+ | 'pluggyAiBankSync';
7
8
 
8
9
  /**
9
10
  * Cross-device preferences. These sync across devices when they are changed.
@@ -31,6 +32,7 @@ export type SyncedPrefs = Partial<
31
32
  | `csv-has-header-${string}`
32
33
  | `custom-sync-mappings-${string}`
33
34
  | `sync-import-pending-${string}`
35
+ | `sync-reimport-deleted-${string}`
34
36
  | `sync-import-notes-${string}`
35
37
  | `ofx-fallback-missing-payee-${string}`
36
38
  | `flip-amount-${string}-${'csv' | 'qif'}`
@@ -88,6 +90,11 @@ export type GlobalPrefs = Partial<{
88
90
  preferredDarkTheme: DarkTheme;
89
91
  documentDir: string; // Electron only
90
92
  serverSelfSignedCert: string; // Electron only
93
+ syncServerConfig?: {
94
+ // Electron only
95
+ autoStart?: boolean;
96
+ port?: number;
97
+ };
91
98
  }>;
92
99
 
93
100
  // GlobalPrefsJson represents what's saved in the global-store.json file
@@ -108,6 +115,7 @@ export type GlobalPrefsJson = Partial<{
108
115
  theme?: GlobalPrefs['theme'];
109
116
  'preferred-dark-theme'?: GlobalPrefs['preferredDarkTheme'];
110
117
  'server-self-signed-cert'?: GlobalPrefs['serverSelfSignedCert'];
118
+ syncServerConfig?: GlobalPrefs['syncServerConfig'];
111
119
  }>;
112
120
 
113
121
  export type AuthMethods = 'password' | 'openid';
@@ -1,4 +1,4 @@
1
- import { type Backup } from '../server/backups';
1
+ import { type Backup } from '../server/budgetfiles/backups';
2
2
  import { type UndoState } from '../server/undo';
3
3
 
4
4
  type SyncSubtype =