@actual-app/api 25.3.1 → 25.4.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 (101) hide show
  1. package/@types/loot-core/client/accounts/accountsSlice.d.ts +175 -0
  2. package/@types/loot-core/client/app/appSlice.d.ts +175 -0
  3. package/@types/loot-core/client/budgets/budgetsSlice.d.ts +401 -0
  4. package/@types/loot-core/client/modals/modalsSlice.d.ts +486 -0
  5. package/@types/loot-core/client/notifications/notificationsSlice.d.ts +47 -0
  6. package/@types/loot-core/client/platform.d.ts +1 -0
  7. package/@types/loot-core/client/prefs/prefsSlice.d.ts +186 -0
  8. package/@types/loot-core/client/queries/queriesSlice.d.ts +692 -0
  9. package/@types/loot-core/client/redux.d.ts +18546 -0
  10. package/@types/loot-core/client/store/index.d.ts +133 -0
  11. package/@types/loot-core/client/users/usersSlice.d.ts +89 -0
  12. package/@types/loot-core/platform/client/fetch/index.d.ts +1 -10
  13. package/@types/loot-core/platform/client/undo/index.d.ts +19 -31
  14. package/@types/loot-core/platform/exceptions/index.d.ts +2 -5
  15. package/@types/loot-core/platform/server/connection/index.d.ts +0 -3
  16. package/@types/loot-core/platform/server/fetch/index.d.ts +1 -4
  17. package/@types/loot-core/platform/server/log/index.d.ts +4 -6
  18. package/@types/loot-core/server/accounts/app.d.ts +19 -5
  19. package/@types/loot-core/server/accounts/link.d.ts +6 -1
  20. package/@types/loot-core/server/admin/app.d.ts +54 -1
  21. package/@types/loot-core/server/api-models.d.ts +22 -22
  22. package/@types/loot-core/server/aql/exec.d.ts +1 -1
  23. package/@types/loot-core/server/aql/schema/index.d.ts +9 -0
  24. package/@types/loot-core/server/budget/actions.d.ts +6 -5
  25. package/@types/loot-core/server/budget/app.d.ts +103 -2
  26. package/@types/loot-core/server/budget/cleanup-template.d.ts +1 -1
  27. package/@types/loot-core/server/budget/goaltemplates.d.ts +1 -1
  28. package/@types/loot-core/server/budget/statements.d.ts +2 -2
  29. package/@types/loot-core/server/budget/template-notes.d.ts +1 -1
  30. package/@types/loot-core/server/budget/types/templates.d.ts +2 -1
  31. package/@types/loot-core/server/cloud-storage.d.ts +1 -1
  32. package/@types/loot-core/server/dashboard/app.d.ts +35 -1
  33. package/@types/loot-core/server/db/index.d.ts +38 -31
  34. package/@types/loot-core/server/db/sort.d.ts +1 -1
  35. package/@types/loot-core/server/encryption-internals.d.ts +5 -5
  36. package/@types/loot-core/server/encryption-internals.web.d.ts +2 -2
  37. package/@types/loot-core/server/encryption.d.ts +3 -3
  38. package/@types/loot-core/server/filters/app.d.ts +10 -1
  39. package/@types/loot-core/server/main-app.d.ts +1 -1
  40. package/@types/loot-core/server/models.d.ts +24 -23
  41. package/@types/loot-core/server/notes/app.d.ts +6 -1
  42. package/@types/loot-core/server/payees/app.d.ts +48 -0
  43. package/@types/loot-core/server/preferences/app.d.ts +1 -10
  44. package/@types/loot-core/server/reports/app.d.ts +9 -1
  45. package/@types/loot-core/server/rules/app.d.ts +50 -1
  46. package/@types/loot-core/server/schedules/app.d.ts +25 -2
  47. package/@types/loot-core/server/schedules/find-schedules.d.ts +1 -1
  48. package/@types/loot-core/server/server-config.d.ts +1 -0
  49. package/@types/loot-core/server/sheet.d.ts +1 -1
  50. package/@types/loot-core/server/spreadsheet/app.d.ts +38 -0
  51. package/@types/loot-core/server/spreadsheet/graph-data-structure.d.ts +4 -4
  52. package/@types/loot-core/server/spreadsheet/spreadsheet.d.ts +3 -2
  53. package/@types/loot-core/server/sync/app.d.ts +38 -0
  54. package/@types/loot-core/server/sync/make-test-message.d.ts +1 -1
  55. package/@types/loot-core/server/tools/app.d.ts +13 -1
  56. package/@types/loot-core/server/transactions/transaction-rules.d.ts +5 -4
  57. package/@types/loot-core/server/undo.d.ts +1 -1
  58. package/@types/loot-core/shared/async.d.ts +4 -3
  59. package/@types/loot-core/shared/locale.d.ts +1 -0
  60. package/@types/loot-core/shared/months.d.ts +2 -2
  61. package/@types/loot-core/shared/schedules.d.ts +5 -3
  62. package/@types/loot-core/shared/util.d.ts +4 -1
  63. package/@types/loot-core/types/handlers.d.ts +16 -10
  64. package/@types/loot-core/types/models/account.d.ts +2 -1
  65. package/@types/loot-core/types/models/bank-sync.d.ts +1 -1
  66. package/@types/loot-core/types/models/index.d.ts +5 -1
  67. package/@types/loot-core/types/models/openid.d.ts +2 -1
  68. package/@types/loot-core/types/models/payee.d.ts +2 -2
  69. package/@types/loot-core/types/models/pluggyai.d.ts +18 -0
  70. package/@types/loot-core/types/models/user-access.d.ts +10 -0
  71. package/@types/loot-core/types/models/user.d.ts +17 -18
  72. package/@types/loot-core/types/prefs.d.ts +13 -1
  73. package/@types/loot-core/types/server-handlers.d.ts +0 -99
  74. package/@types/loot-core/types/util.d.ts +7 -0
  75. package/dist/app/bundle.api.js +93474 -49655
  76. package/dist/index.js +17 -7
  77. package/dist/jest.config.js +0 -2
  78. package/dist/methods.js +17 -7
  79. package/dist/migrations/1740506588539_add_last_reconciled_at.sql +5 -0
  80. package/dist/package.json +8 -8
  81. package/dist/validateNodeVersion.js +17 -7
  82. package/package.json +8 -8
  83. package/@types/loot-core/client/constants.d.ts +0 -21
  84. package/@types/loot-core/client/state-types/budgets.d.ts +0 -36
  85. package/@types/loot-core/client/state-types/index.d.ts +0 -27
  86. package/@types/loot-core/client/state-types/modals.d.ts +0 -392
  87. package/@types/loot-core/client/state-types/notifications.d.ts +0 -57
  88. package/@types/loot-core/client/state-types/prefs.d.ts +0 -40
  89. package/@types/loot-core/client/state-types/user.d.ts +0 -13
  90. package/@types/loot-core/server/admin/types/handlers.d.ts +0 -43
  91. package/@types/loot-core/server/budget/types/handlers.d.ts +0 -91
  92. package/@types/loot-core/server/dashboard/types/handlers.d.ts +0 -24
  93. package/@types/loot-core/server/filters/types/handlers.d.ts +0 -7
  94. package/@types/loot-core/server/notes/types/handlers.d.ts +0 -3
  95. package/@types/loot-core/server/reports/types/handlers.d.ts +0 -6
  96. package/@types/loot-core/server/rules/types/handlers.d.ts +0 -40
  97. package/@types/loot-core/server/schedules/types/handlers.d.ts +0 -31
  98. package/@types/loot-core/server/tools/types/handlers.d.ts +0 -11
  99. package/@types/loot-core/types/models/userAccess.d.ts +0 -9
  100. package/dist/methods.test.js +0 -541
  101. /package/@types/{methods.test.d.ts → loot-core/server/api.test.d.ts} +0 -0
@@ -1,5 +1,4 @@
1
1
  import { type CustomReportData, type CustomReportEntity } from '../../types/models';
2
- import { ReportsHandlers } from './types/handlers';
3
2
  export declare const reportModel: {
4
3
  validate(report: Omit<CustomReportEntity, "tombstone">, { update }?: {
5
4
  update?: boolean;
@@ -47,6 +46,14 @@ export declare const reportModel: {
47
46
  conditions_op: "and" | "or";
48
47
  };
49
48
  };
49
+ declare function createReport(report: CustomReportEntity): Promise<string>;
50
+ declare function updateReport(item: CustomReportEntity): Promise<void>;
51
+ declare function deleteReport(id: CustomReportEntity['id']): Promise<void>;
52
+ export type ReportsHandlers = {
53
+ 'report/create': typeof createReport;
54
+ 'report/update': typeof updateReport;
55
+ 'report/delete': typeof deleteReport;
56
+ };
50
57
  export declare const app: {
51
58
  events: import("mitt").Emitter<{
52
59
  sync: import("../../types/server-events").ServerEvents["sync-event"];
@@ -63,3 +70,4 @@ export declare const app: {
63
70
  startServices(): void;
64
71
  stopServices(): void;
65
72
  };
73
+ export {};
@@ -1,4 +1,21 @@
1
- import { RulesHandlers } from './types/handlers';
1
+ import { RuleActionEntity, TransactionEntity, type RuleEntity } from '../../types/models';
2
+ import { Action } from '.';
3
+ type ValidationError = {
4
+ conditionErrors: string[];
5
+ actionErrors: string[];
6
+ };
7
+ export type RulesHandlers = {
8
+ 'rule-validate': typeof ruleValidate;
9
+ 'rule-add': typeof addRule;
10
+ 'rule-update': typeof updateRule;
11
+ 'rule-delete': typeof deleteRule;
12
+ 'rule-delete-all': typeof deleteAllRules;
13
+ 'rule-apply-actions': typeof applyRuleActions;
14
+ 'rule-add-payee-rename': typeof addRulePayeeRename;
15
+ 'rules-get': typeof getRules;
16
+ 'rule-get': typeof getRule;
17
+ 'rules-run': typeof runRules;
18
+ };
2
19
  export declare const app: {
3
20
  events: import("mitt").Emitter<{
4
21
  sync: import("../../types/server-events").ServerEvents["sync-event"];
@@ -15,3 +32,35 @@ export declare const app: {
15
32
  startServices(): void;
16
33
  stopServices(): void;
17
34
  };
35
+ declare function ruleValidate(rule: Partial<RuleEntity>): Promise<{
36
+ error: ValidationError | null;
37
+ }>;
38
+ declare function addRule(rule: Omit<RuleEntity, 'id'>): Promise<{
39
+ error: ValidationError;
40
+ } | RuleEntity>;
41
+ declare function updateRule<PartialRule extends Partial<Omit<RuleEntity, 'id'>> & Pick<RuleEntity, 'id'>>(rule: PartialRule): Promise<{
42
+ error: ValidationError;
43
+ } | PartialRule>;
44
+ declare function deleteRule(id: RuleEntity['id']): Promise<boolean>;
45
+ declare function deleteAllRules(ids: Array<RuleEntity['id']>): Promise<{
46
+ someDeletionsFailed: boolean;
47
+ }>;
48
+ declare function applyRuleActions({ transactions, actions, }: {
49
+ transactions: TransactionEntity[];
50
+ actions: Array<Action | RuleActionEntity>;
51
+ }): Promise<null | {
52
+ added: TransactionEntity[];
53
+ updated: unknown[];
54
+ }>;
55
+ declare function addRulePayeeRename({ fromNames, to, }: {
56
+ fromNames: string[];
57
+ to: string;
58
+ }): Promise<string>;
59
+ declare function getRule({ id, }: {
60
+ id: RuleEntity['id'];
61
+ }): Promise<RuleEntity | null>;
62
+ declare function getRules(): Promise<RuleEntity[]>;
63
+ declare function runRules({ transaction, }: {
64
+ transaction: TransactionEntity;
65
+ }): Promise<TransactionEntity>;
66
+ export {};
@@ -1,5 +1,5 @@
1
+ import { ScheduleEntity } from '../../types/models';
1
2
  import { Rule } from '../rules';
2
- import { SchedulesHandlers } from './types/handlers';
3
3
  export declare function updateConditions(conditions: any, newConditions: any): any;
4
4
  export declare function getRuleForSchedule(id: string | null): Promise<Rule>;
5
5
  export declare function setNextDate({ id, start, conditions, reset, }: {
@@ -11,7 +11,7 @@ export declare function setNextDate({ id, start, conditions, reset, }: {
11
11
  export declare function createSchedule({ schedule, conditions, }?: {
12
12
  schedule?: any;
13
13
  conditions?: any[];
14
- }): Promise<any>;
14
+ }): Promise<ScheduleEntity['id']>;
15
15
  export declare function updateSchedule({ schedule, conditions, resetNextDate, }: {
16
16
  schedule: any;
17
17
  conditions?: any;
@@ -20,6 +20,28 @@ export declare function updateSchedule({ schedule, conditions, resetNextDate, }:
20
20
  export declare function deleteSchedule({ id }: {
21
21
  id: any;
22
22
  }): Promise<void>;
23
+ declare function skipNextDate({ id }: {
24
+ id: any;
25
+ }): Promise<void>;
26
+ declare function discoverSchedules(): Promise<any>;
27
+ declare function getUpcomingDates({ config, count }: {
28
+ config: any;
29
+ count: any;
30
+ }): Promise<string[]>;
31
+ declare function postTransactionForSchedule({ id }: {
32
+ id: string;
33
+ }): Promise<void>;
34
+ declare function advanceSchedulesService(syncSuccess: any): Promise<void>;
35
+ export type SchedulesHandlers = {
36
+ 'schedule/create': typeof createSchedule;
37
+ 'schedule/update': typeof updateSchedule;
38
+ 'schedule/delete': typeof deleteSchedule;
39
+ 'schedule/skip-next-date': typeof skipNextDate;
40
+ 'schedule/post-transaction': typeof postTransactionForSchedule;
41
+ 'schedule/force-run-service': typeof advanceSchedulesService;
42
+ 'schedule/discover': typeof discoverSchedules;
43
+ 'schedule/get-upcoming-dates': typeof getUpcomingDates;
44
+ };
23
45
  export declare const app: {
24
46
  events: import("mitt").Emitter<{
25
47
  sync: import("../../types/server-events").ServerEvents["sync-event"];
@@ -36,3 +58,4 @@ export declare const app: {
36
58
  startServices(): void;
37
59
  stopServices(): void;
38
60
  };
61
+ export {};
@@ -1 +1 @@
1
- export declare function findSchedules(): Promise<import("../../types/models").DiscoverScheduleEntity[]>;
1
+ export declare function findSchedules(): Promise<any>;
@@ -4,6 +4,7 @@ type ServerConfig = {
4
4
  SIGNUP_SERVER: string;
5
5
  GOCARDLESS_SERVER: string;
6
6
  SIMPLEFIN_SERVER: string;
7
+ PLUGGYAI_SERVER: string;
7
8
  };
8
9
  export declare function isValidBaseURL(base: string): boolean;
9
10
  export declare function setServer(url: string): void;
@@ -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,10 @@
1
+ import { QueryState } from '../../shared/query';
1
2
  export type Node = {
2
3
  name: string;
3
4
  expr: string | number | boolean;
4
5
  value: string | number | boolean;
5
6
  sheet: unknown;
6
- query?: string;
7
+ query?: QueryState;
7
8
  sql?: {
8
9
  sqlPieces: unknown;
9
10
  state: {
@@ -61,7 +62,7 @@ export declare class Spreadsheet {
61
62
  set(name: string, value: string | number | boolean): void;
62
63
  recompute(name: string): void;
63
64
  recomputeAll(): void;
64
- createQuery(sheetName: string, cellName: string, query: string): void;
65
+ createQuery(sheetName: string, cellName: string, query: QueryState): void;
65
66
  createStatic(sheetName: string, cellName: string, initialValue: number | boolean): void;
66
67
  createDynamic(sheetName: string, cellName: string, { dependencies, run, initialValue, refresh, }: {
67
68
  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 {};
@@ -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 {};
@@ -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,17 @@
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 { BudgetHandlers } from '../server/budget/app';
4
+ import type { DashboardHandlers } from '../server/dashboard/app';
5
+ import type { FiltersHandlers } from '../server/filters/app';
6
+ import type { NotesHandlers } from '../server/notes/app';
7
+ import type { PayeesHandlers } from '../server/payees/app';
7
8
  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';
9
+ import type { ReportsHandlers } from '../server/reports/app';
10
+ import type { RulesHandlers } from '../server/rules/app';
11
+ import type { SchedulesHandlers } from '../server/schedules/app';
12
+ import type { SpreadsheetHandlers } from '../server/spreadsheet/app';
13
+ import type { SyncHandlers } from '../server/sync/app';
14
+ import type { ToolsHandlers } from '../server/tools/app';
12
15
  import type { TransactionHandlers } from '../server/transactions/app';
13
16
 
14
17
  import type { ApiHandlers } from './api-handlers';
@@ -28,6 +31,9 @@ export interface Handlers
28
31
  TransactionHandlers,
29
32
  AdminHandlers,
30
33
  ToolsHandlers,
31
- AccountHandlers {}
34
+ AccountHandlers,
35
+ PayeesHandlers,
36
+ SpreadsheetHandlers,
37
+ SyncHandlers {}
32
38
 
33
39
  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,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,15 @@ 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
+ ngrokConfig?: {
98
+ domain?: string;
99
+ authToken?: string;
100
+ };
101
+ };
91
102
  }>;
92
103
 
93
104
  // GlobalPrefsJson represents what's saved in the global-store.json file
@@ -108,6 +119,7 @@ export type GlobalPrefsJson = Partial<{
108
119
  theme?: GlobalPrefs['theme'];
109
120
  'preferred-dark-theme'?: GlobalPrefs['preferredDarkTheme'];
110
121
  'server-self-signed-cert'?: GlobalPrefs['serverSelfSignedCert'];
122
+ syncServerConfig?: GlobalPrefs['syncServerConfig'];
111
123
  }>;
112
124
 
113
125
  export type AuthMethods = 'password' | 'openid';