@actual-app/api 24.12.0 → 25.1.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 (31) hide show
  1. package/@types/loot-core/client/state-types/app.d.ts +6 -1
  2. package/@types/loot-core/client/state-types/modals.d.ts +50 -0
  3. package/@types/loot-core/server/accounts/transaction-rules.d.ts +4 -3
  4. package/@types/loot-core/server/admin/app.d.ts +12 -0
  5. package/@types/loot-core/server/admin/types/handlers.d.ts +41 -0
  6. package/@types/loot-core/server/budget/categoryTemplate.d.ts +3 -2
  7. package/@types/loot-core/server/budget/goalsSchedule.d.ts +7 -5
  8. package/@types/loot-core/server/cloud-storage.d.ts +9 -0
  9. package/@types/loot-core/server/db/index.d.ts +1 -0
  10. package/@types/loot-core/server/main-app.d.ts +1 -1
  11. package/@types/loot-core/server/post.d.ts +2 -0
  12. package/@types/loot-core/server/tools/types/handlers.d.ts +3 -0
  13. package/@types/loot-core/server/util/budget-name.d.ts +6 -2
  14. package/@types/loot-core/shared/errors.d.ts +3 -0
  15. package/@types/loot-core/shared/query.d.ts +13 -12
  16. package/@types/loot-core/shared/util.d.ts +7 -1
  17. package/@types/loot-core/types/budget.d.ts +1 -0
  18. package/@types/loot-core/types/file.d.ts +7 -0
  19. package/@types/loot-core/types/handlers.d.ts +2 -0
  20. package/@types/loot-core/types/models/dashboard.d.ts +12 -1
  21. package/@types/loot-core/types/models/index.d.ts +1 -0
  22. package/@types/loot-core/types/models/openid.d.ts +7 -0
  23. package/@types/loot-core/types/models/rule.d.ts +5 -1
  24. package/@types/loot-core/types/models/user.d.ts +26 -0
  25. package/@types/loot-core/types/models/userAccess.d.ts +9 -0
  26. package/@types/loot-core/types/prefs.d.ts +4 -1
  27. package/@types/loot-core/types/server-handlers.d.ts +89 -12
  28. package/dist/app/bundle.api.js +1476 -735
  29. package/dist/methods.js +4 -1
  30. package/dist/package.json +2 -2
  31. package/package.json +2 -2
@@ -1,7 +1,12 @@
1
1
  import type { UndoState } from '../../server/undo';
2
2
  import type * as constants from '../constants';
3
3
 
4
- export type SplitState = { ids: Set<string>; mode: 'collapse' | 'expand' };
4
+ export type SplitMode = 'collapse' | 'expand';
5
+ export type SplitState = {
6
+ ids: Set<string>;
7
+ mode: SplitMode;
8
+ transitionId: string | null;
9
+ };
5
10
 
6
11
  export type AppState = {
7
12
  loadingText: string | null;
@@ -8,6 +8,8 @@ import type {
8
8
  TransactionEntity,
9
9
  } from '../../types/models';
10
10
  import type { NewRuleEntity, RuleEntity } from '../../types/models/rule';
11
+ import { type NewUserEntity, type UserEntity } from '../../types/models/user';
12
+ import { type UserAccessEntity } from '../../types/models/userAccess';
11
13
  import type { EmptyObject, StripNever } from '../../types/util';
12
14
  import type * as constants from '../constants';
13
15
  export type ModalType = keyof FinanceModals;
@@ -78,6 +80,37 @@ type FinanceModals = {
78
80
 
79
81
  'delete-budget': { file: File };
80
82
 
83
+ 'duplicate-budget': {
84
+ /** The budget file to be duplicated */
85
+ file: File;
86
+ /**
87
+ * Indicates whether the duplication is initiated from the budget
88
+ * management page. This may affect the behavior or UI of the
89
+ * duplication process.
90
+ */
91
+ managePage?: boolean;
92
+ /**
93
+ * loadBudget indicates whether to open the 'original' budget, the
94
+ * new duplicated 'copy' budget, or no budget ('none'). If 'none'
95
+ * duplicate-budget stays on the same page.
96
+ */
97
+ loadBudget?: 'none' | 'original' | 'copy';
98
+ /**
99
+ * onComplete is called when the DuplicateFileModal is closed.
100
+ * @param event the event object will pass back the status of the
101
+ * duplicate process.
102
+ * 'success' if the budget was duplicated.
103
+ * 'failed' if the budget could not be duplicated. This will also
104
+ * pass an error on the event object.
105
+ * 'canceled' if the DuplicateFileModal was canceled.
106
+ * @returns
107
+ */
108
+ onComplete?: (event: {
109
+ status: 'success' | 'failed' | 'canceled';
110
+ error?: Error;
111
+ }) => void;
112
+ };
113
+
81
114
  import: null;
82
115
 
83
116
  'import-ynab4': null;
@@ -281,6 +314,23 @@ type FinanceModals = {
281
314
  message?: string;
282
315
  onConfirm: () => void;
283
316
  };
317
+ 'edit-user': {
318
+ user: UserEntity | NewUserEntity;
319
+ onSave: (rule: UserEntity) => void;
320
+ };
321
+ 'edit-access': {
322
+ access: UserAccessEntity | NewUserAccessEntity;
323
+ onSave: (rule: UserEntity) => void;
324
+ };
325
+ 'transfer-ownership': {
326
+ onSave: () => void;
327
+ };
328
+ 'enable-openid': {
329
+ onSave: () => void;
330
+ };
331
+ 'enable-password-auth': {
332
+ onSave: () => void;
333
+ };
284
334
  'confirm-unlink-account': {
285
335
  accountName: string;
286
336
  onUnlink: () => void;
@@ -1,4 +1,4 @@
1
- import { type TransactionEntity, type RuleActionEntity, type RuleEntity } from '../../types/models';
1
+ import { type TransactionEntity, type RuleActionEntity, type RuleEntity, AccountEntity } from '../../types/models';
2
2
  import { Action, Rule } from './rules';
3
3
  export { iterateIds } from './rules';
4
4
  export declare function resetState(): void;
@@ -19,7 +19,7 @@ export declare function insertRule(rule: Omit<RuleEntity, 'id'> & {
19
19
  }): Promise<any>;
20
20
  export declare function updateRule(rule: any): Promise<void>;
21
21
  export declare function deleteRule(id: string): Promise<boolean>;
22
- export declare function runRules(trans: any): Promise<TransactionEntity>;
22
+ export declare function runRules(trans: any, accounts?: Map<string, AccountEntity> | null): Promise<TransactionEntity>;
23
23
  export declare function conditionsToAQL(conditions: any, { recurDateBounds }?: {
24
24
  recurDateBounds?: number;
25
25
  }): {
@@ -45,6 +45,7 @@ export declare function getProbableCategory(transactions: any): any;
45
45
  export declare function updateCategoryRules(transactions: any): Promise<void>;
46
46
  export type TransactionForRules = TransactionEntity & {
47
47
  payee_name?: string;
48
+ _account?: AccountEntity;
48
49
  };
49
- export declare function prepareTransactionForRules(trans: TransactionEntity): Promise<TransactionForRules>;
50
+ export declare function prepareTransactionForRules(trans: TransactionEntity, accounts?: Map<string, AccountEntity> | null): Promise<TransactionForRules>;
50
51
  export declare function finalizeTransactionForRules(trans: TransactionEntity | TransactionForRules): Promise<TransactionEntity>;
@@ -0,0 +1,12 @@
1
+ import { AdminHandlers } from './types/handlers';
2
+ export declare const app: {
3
+ events: any;
4
+ handlers: AdminHandlers;
5
+ services: any;
6
+ unlistenServices: any;
7
+ 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;
9
+ combine(...apps: any[]): void;
10
+ startServices(): void;
11
+ stopServices(): void;
12
+ };
@@ -0,0 +1,41 @@
1
+ import { UserAvailable, UserEntity } from '../../../types/models/user';
2
+ import { NewUserAccessEntity } from '../../../types/models/userAccess';
3
+ export interface AdminHandlers {
4
+ 'users-get': () => Promise<UserEntity[] | null | {
5
+ error: string;
6
+ }>;
7
+ 'user-delete-all': (ids: string[]) => Promise<{
8
+ someDeletionsFailed: boolean;
9
+ ids?: number[];
10
+ }>;
11
+ 'user-add': (user: Omit<UserEntity, 'id'>) => Promise<{
12
+ error?: string;
13
+ } | {
14
+ id: string;
15
+ }>;
16
+ 'user-update': (user: Omit<UserEntity, 'id'>) => Promise<{
17
+ error?: string;
18
+ } | {
19
+ id: string;
20
+ }>;
21
+ 'access-add': (user: NewUserAccessEntity) => Promise<{
22
+ error?: string;
23
+ } | Record<string, never>>;
24
+ 'access-delete-all': ({ fileId, ids, }: {
25
+ fileId: string;
26
+ ids: string[];
27
+ }) => Promise<{
28
+ someDeletionsFailed: boolean;
29
+ ids?: number[];
30
+ }>;
31
+ 'access-get-available-users': (fileId: string) => Promise<UserAvailable[] | {
32
+ error: string;
33
+ }>;
34
+ 'transfer-ownership': ({ fileId, newUserId, }: {
35
+ fileId: string;
36
+ newUserId: string;
37
+ }) => Promise<{
38
+ error?: string;
39
+ } | Record<string, never>>;
40
+ 'owner-created': () => Promise<boolean>;
41
+ }
@@ -1,6 +1,7 @@
1
+ import { CategoryEntity } from '../../types/models';
1
2
  import { Template } from './types/templates';
2
3
  export declare class CategoryTemplate {
3
- static init(templates: Template[], categoryID: string, month: any): Promise<CategoryTemplate>;
4
+ static init(templates: Template[], category: CategoryEntity, month: any): Promise<CategoryTemplate>;
4
5
  getPriorities(): number[];
5
6
  getRemainderWeight(): number;
6
7
  getLimitExcess(): number;
@@ -12,7 +13,7 @@ export declare class CategoryTemplate {
12
13
  goal: any;
13
14
  longGoal: any;
14
15
  };
15
- readonly categoryID: string;
16
+ readonly category: CategoryEntity;
16
17
  private month;
17
18
  private templates;
18
19
  private remainder;
@@ -1,6 +1,8 @@
1
- export declare function goalsSchedule(scheduleFlag: any, template_lines: any, current_month: any, balance: any, remainder: any, last_month_balance: any, to_budget: any, errors: any, category: any): Promise<{
2
- to_budget: any;
3
- errors: any;
4
- remainder: any;
5
- scheduleFlag: any;
1
+ import { CategoryEntity } from '../../types/models';
2
+ import { Template } from './types/templates';
3
+ export declare function goalsSchedule(scheduleFlag: boolean, template_lines: Template[], current_month: string, balance: number, remainder: number, last_month_balance: number, to_budget: number, errors: string[], category: CategoryEntity): Promise<{
4
+ to_budget: number;
5
+ errors: string[];
6
+ remainder: number;
7
+ scheduleFlag: true;
6
8
  }>;
@@ -1,3 +1,9 @@
1
+ export interface UsersWithAccess {
2
+ userId: string;
3
+ userName: string;
4
+ displayName: string;
5
+ owner: boolean;
6
+ }
1
7
  export interface RemoteFile {
2
8
  deleted: boolean;
3
9
  fileId: string;
@@ -5,6 +11,8 @@ export interface RemoteFile {
5
11
  name: string;
6
12
  encryptKeyId: string;
7
13
  hasKey: boolean;
14
+ owner: string;
15
+ usersWithAccess: UsersWithAccess[];
8
16
  }
9
17
  export declare function checkKey(): Promise<{
10
18
  valid: boolean;
@@ -27,6 +35,7 @@ export declare function upload(): Promise<void>;
27
35
  export declare function possiblyUpload(): Promise<void>;
28
36
  export declare function removeFile(fileId: any): Promise<void>;
29
37
  export declare function listRemoteFiles(): Promise<RemoteFile[] | null>;
38
+ export declare function getRemoteFile(fileId: string): Promise<RemoteFile | null>;
30
39
  export declare function download(fileId: any): Promise<{
31
40
  id: any;
32
41
  }>;
@@ -80,6 +80,7 @@ export declare function updateCategory(category: any): Promise<void>;
80
80
  export declare function moveCategory(id: any, groupId: any, targetId?: string): Promise<void>;
81
81
  export declare function deleteCategory(category: any, transferId?: string): Promise<void>;
82
82
  export declare function getPayee(id: any): Promise<any>;
83
+ export declare function getAccount(id: any): Promise<any>;
83
84
  export declare function insertPayee(payee: any): Promise<any>;
84
85
  export declare function deletePayee(payee: any): Promise<void>;
85
86
  export declare function deleteTransferPayee(payee: any): Promise<void>;
@@ -4,7 +4,7 @@ export declare const app: {
4
4
  handlers: Handlers;
5
5
  services: any;
6
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-bootstrap" | "subscribe-get-user" | "subscribe-change-password" | "subscribe-sign-in" | "subscribe-sign-out" | "get-server-version" | "get-server-url" | "set-server-url" | "get-budgets" | "get-remote-files" | "reset-budget-cache" | "upload-budget" | "download-budget" | "sync-budget" | "load-budget" | "create-demo-budget" | "close-budget" | "delete-budget" | "create-budget" | "import-budget" | "export-budget" | "upload-file-web" | "backups-get" | "backup-load" | "backup-make" | "get-last-opened-backup" | "app-focused" | "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" | "tools/fix-split-transactions">(name: Name, func: Handlers[Name]): void;
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
8
  service(func: any): void;
9
9
  combine(...apps: any[]): void;
10
10
  startServices(): void;
@@ -1,3 +1,5 @@
1
1
  export declare function post(url: any, data: any, headers?: {}, timeout?: any): Promise<any>;
2
+ export declare function del(url: any, data: any, headers?: {}, timeout?: any): Promise<any>;
3
+ export declare function patch(url: any, data: any, headers?: {}, timeout?: any): Promise<any>;
2
4
  export declare function postBinary(url: any, data: any, headers: any): Promise<any>;
3
5
  export declare function get(url: any, opts?: any): Promise<string>;
@@ -1,7 +1,10 @@
1
+ import { TransactionEntity } from './models';
2
+
1
3
  export interface ToolsHandlers {
2
4
  'tools/fix-split-transactions': () => Promise<{
3
5
  numBlankPayees: number;
4
6
  numCleared: number;
5
7
  numDeleted: number;
8
+ mismatchedSplits: TransactionEntity[];
6
9
  }>;
7
10
  }
@@ -1,2 +1,6 @@
1
- export declare function uniqueFileName(existingFiles: any): Promise<string>;
2
- export declare function idFromFileName(name: any): Promise<string>;
1
+ export declare function uniqueBudgetName(initialName?: string): Promise<string>;
2
+ export declare function validateBudgetName(name: string): Promise<{
3
+ valid: boolean;
4
+ message?: string;
5
+ }>;
6
+ export declare function idFromBudgetName(name: string): Promise<string>;
@@ -20,3 +20,6 @@ export declare class LazyLoadFailedError extends Error {
20
20
  meta: {};
21
21
  constructor(name: string, cause: unknown);
22
22
  }
23
+ export declare function getUserAccessErrors(reason: string): string;
24
+ export declare function getSecretsError(error: string, reason: string): string;
25
+ export declare function getOpenIdErrors(reason: string): string;
@@ -3,18 +3,18 @@ type ObjectExpression = {
3
3
  [key: string]: ObjectExpression | unknown;
4
4
  };
5
5
  export type QueryState = {
6
- table: string;
7
- tableOptions: Record<string, unknown>;
8
- filterExpressions: Array<ObjectExpression>;
9
- selectExpressions: Array<ObjectExpression | string | '*'>;
10
- groupExpressions: Array<ObjectExpression | string>;
11
- orderExpressions: Array<ObjectExpression | string>;
12
- calculation: boolean;
13
- rawMode: boolean;
14
- withDead: boolean;
15
- validateRefs: boolean;
16
- limit: number | null;
17
- offset: number | null;
6
+ get table(): string;
7
+ get tableOptions(): Readonly<Record<string, unknown>>;
8
+ get filterExpressions(): ReadonlyArray<ObjectExpression>;
9
+ get selectExpressions(): ReadonlyArray<ObjectExpression | string | '*'>;
10
+ get groupExpressions(): ReadonlyArray<ObjectExpression | string>;
11
+ get orderExpressions(): ReadonlyArray<ObjectExpression | string>;
12
+ get calculation(): boolean;
13
+ get rawMode(): boolean;
14
+ get withDead(): boolean;
15
+ get validateRefs(): boolean;
16
+ get limit(): number | null;
17
+ get offset(): number | null;
18
18
  };
19
19
  export declare class Query {
20
20
  state: QueryState;
@@ -33,6 +33,7 @@ export declare class Query {
33
33
  options(opts: Record<string, unknown>): Query;
34
34
  reset(): Query;
35
35
  serialize(): QueryState;
36
+ serializeAsString(): string;
36
37
  }
37
38
  export declare function getPrimaryOrderBy(query: Query, defaultOrderBy: ObjectExpression | null): {
38
39
  order: string;
@@ -28,7 +28,6 @@ export declare function titleFirst(str: string): string;
28
28
  export declare function appendDecimals(amountText: string, hideDecimals?: boolean): string;
29
29
  declare const NUMBER_FORMATS: readonly ["comma-dot", "dot-comma", "space-comma", "apostrophe-dot", "comma-dot", "comma-dot-in"];
30
30
  type NumberFormats = (typeof NUMBER_FORMATS)[number];
31
- export declare function isNumberFormat(input?: string): input is NumberFormats;
32
31
  export declare const numberFormats: Array<{
33
32
  value: NumberFormats;
34
33
  label: string;
@@ -38,6 +37,13 @@ declare let numberFormatConfig: {
38
37
  format: NumberFormats;
39
38
  hideFraction: boolean;
40
39
  };
40
+ export declare function parseNumberFormat({ format, hideFraction, }: {
41
+ format?: string;
42
+ hideFraction?: string | boolean;
43
+ }): {
44
+ format: "comma-dot" | "dot-comma" | "space-comma" | "apostrophe-dot" | "comma-dot-in";
45
+ hideFraction: boolean;
46
+ };
41
47
  export declare function setNumberFormat(config: typeof numberFormatConfig): void;
42
48
  export declare function getNumberFormat({ format, hideFraction, }?: {
43
49
  format?: NumberFormats;
@@ -4,4 +4,5 @@ export type Budget = {
4
4
  encryptKeyId?: string;
5
5
  groupId?: string;
6
6
  name: string;
7
+ owner?: string;
7
8
  };
@@ -1,3 +1,5 @@
1
+ import { UsersWithAccess } from '../server/cloud-storage';
2
+
1
3
  import { Budget } from './budget';
2
4
 
3
5
  export type FileState =
@@ -18,6 +20,7 @@ export type SyncableLocalFile = Budget & {
18
20
  groupId: string;
19
21
  state: 'broken' | 'unknown';
20
22
  hasKey: boolean;
23
+ owner: string;
21
24
  };
22
25
 
23
26
  export type SyncedLocalFile = Budget & {
@@ -26,6 +29,8 @@ export type SyncedLocalFile = Budget & {
26
29
  encryptKeyId?: string;
27
30
  hasKey: boolean;
28
31
  state: 'synced' | 'detached';
32
+ owner: string;
33
+ usersWithAccess: UsersWithAccess[];
29
34
  };
30
35
 
31
36
  export type RemoteFile = {
@@ -35,6 +40,8 @@ export type RemoteFile = {
35
40
  encryptKeyId?: string;
36
41
  hasKey: boolean;
37
42
  state: 'remote';
43
+ owner: string;
44
+ usersWithAccess: UsersWithAccess[];
38
45
  };
39
46
 
40
47
  export type File = LocalFile | SyncableLocalFile | SyncedLocalFile | RemoteFile;
@@ -1,3 +1,4 @@
1
+ import type { AdminHandlers } from '../server/admin/types/handlers';
1
2
  import type { BudgetHandlers } from '../server/budget/types/handlers';
2
3
  import type { DashboardHandlers } from '../server/dashboard/types/handlers';
3
4
  import type { FiltersHandlers } from '../server/filters/types/handlers';
@@ -22,6 +23,7 @@ export interface Handlers
22
23
  ReportsHandlers,
23
24
  RulesHandlers,
24
25
  SchedulesHandlers,
26
+ AdminHandlers,
25
27
  ToolsHandlers {}
26
28
 
27
29
  export type HandlerFunctions = Handlers[keyof Handlers];
@@ -66,7 +66,8 @@ type SpecializedWidget =
66
66
  | CashFlowWidget
67
67
  | SpendingWidget
68
68
  | MarkdownWidget
69
- | SummaryWidget;
69
+ | SummaryWidget
70
+ | CalendarWidget;
70
71
  export type Widget = SpecializedWidget | CustomReportWidget;
71
72
  export type NewWidget = Omit<Widget, 'id' | 'tombstone'>;
72
73
 
@@ -115,3 +116,13 @@ export type PercentageSummaryContent = {
115
116
  };
116
117
 
117
118
  export type SummaryContent = BaseSummaryContent | PercentageSummaryContent;
119
+
120
+ export type CalendarWidget = AbstractWidget<
121
+ 'calendar-card',
122
+ {
123
+ name?: string;
124
+ conditions?: RuleConditionEntity[];
125
+ conditionsOp?: 'and' | 'or';
126
+ timeFrame?: TimeFrame;
127
+ } | null
128
+ >;
@@ -12,3 +12,4 @@ export type * from './rule';
12
12
  export type * from './schedule';
13
13
  export type * from './transaction';
14
14
  export type * from './transaction-filter';
15
+ export type * from './user';
@@ -0,0 +1,7 @@
1
+ export type OpenIdConfig = {
2
+ selectedProvider: string;
3
+ issuer: string;
4
+ client_id: string;
5
+ client_secret: string;
6
+ server_hostname: string;
7
+ };
@@ -27,7 +27,9 @@ export type RuleConditionOp =
27
27
  | 'doesNotContain'
28
28
  | 'hasTags'
29
29
  | 'and'
30
- | 'matches';
30
+ | 'matches'
31
+ | 'onBudget'
32
+ | 'offBudget';
31
33
 
32
34
  type FieldValueTypes = {
33
35
  account: string;
@@ -76,6 +78,8 @@ export type RuleConditionEntity =
76
78
  | 'contains'
77
79
  | 'doesNotContain'
78
80
  | 'matches'
81
+ | 'onBudget'
82
+ | 'offBudget'
79
83
  >
80
84
  | BaseConditionEntity<
81
85
  'category',
@@ -0,0 +1,26 @@
1
+ export interface NewUserEntity {
2
+ userName: string;
3
+ displayName: string;
4
+ role: string;
5
+ enabled: boolean;
6
+ }
7
+ export interface UserEntity extends NewUserEntity {
8
+ id: string;
9
+ owner: boolean;
10
+ }
11
+ export interface UserEntityDropdown {
12
+ userId: string;
13
+ userName: string;
14
+ displayName?: string;
15
+ }
16
+ export interface UserAvailable {
17
+ userId: string;
18
+ displayName?: string;
19
+ userName: string;
20
+ haveAccess?: number;
21
+ owner?: number;
22
+ }
23
+ export declare const PossibleRoles: {
24
+ ADMIN: string;
25
+ BASIC: string;
26
+ };
@@ -0,0 +1,9 @@
1
+ export interface NewUserAccessEntity {
2
+ fileId: string;
3
+ userId: string;
4
+ }
5
+ export interface UserAccessEntity extends NewUserAccessEntity {
6
+ displayName: string;
7
+ userName: string;
8
+ fileName: string;
9
+ }
@@ -2,7 +2,8 @@ export type FeatureFlag =
2
2
  | 'goalTemplatesEnabled'
3
3
  | 'actionTemplating'
4
4
  | 'upcomingLengthAdjustment'
5
- | 'contextMenus';
5
+ | 'contextMenus'
6
+ | 'openidAuth';
6
7
 
7
8
  /**
8
9
  * Cross-device preferences. These sync across devices when they are changed.
@@ -81,3 +82,5 @@ export type GlobalPrefs = Partial<{
81
82
  documentDir: string; // Electron only
82
83
  serverSelfSignedCert: string; // Electron only
83
84
  }>;
85
+
86
+ export type AuthMethods = 'password' | 'openid';