@actual-app/api 25.5.0 → 25.6.0-edge.23

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 (46) hide show
  1. package/@types/loot-core/server/aql/compiler.d.ts +40 -38
  2. package/@types/loot-core/server/aql/exec.d.ts +15 -7
  3. package/@types/loot-core/server/aql/index.d.ts +8 -1
  4. package/@types/loot-core/server/aql/schema/executors.d.ts +2 -7
  5. package/@types/loot-core/server/budget/app.d.ts +1 -1
  6. package/@types/loot-core/server/budget/base.d.ts +1 -1
  7. package/@types/loot-core/server/budget/category-template-context.d.ts +49 -0
  8. package/@types/loot-core/server/budget/cleanup-template.d.ts +8 -1
  9. package/@types/loot-core/server/budget/goal-template.d.ts +29 -0
  10. package/@types/loot-core/server/budget/schedule-template.d.ts +7 -0
  11. package/@types/loot-core/server/budget/template-notes.d.ts +7 -1
  12. package/@types/loot-core/server/budget/types/templates.d.ts +20 -4
  13. package/@types/loot-core/server/prefs.d.ts +1 -1
  14. package/@types/loot-core/server/tools/app.d.ts +1 -0
  15. package/@types/loot-core/shared/locale.d.ts +2 -1
  16. package/@types/loot-core/shared/months.d.ts +6 -0
  17. package/@types/loot-core/shared/schedules.d.ts +2 -1
  18. package/@types/loot-core/shared/transactions.d.ts +7 -67
  19. package/@types/loot-core/shared/util.d.ts +3 -2
  20. package/@types/loot-core/types/models/category.d.ts +1 -0
  21. package/@types/loot-core/types/models/transaction.d.ts +2 -1
  22. package/@types/loot-core/types/prefs.d.ts +0 -1
  23. package/@types/methods.d.ts +5 -0
  24. package/dist/app/bundle.api.js +8091 -9447
  25. package/dist/methods.js +8 -0
  26. package/dist/migrations/1745425408000_update_budgetType_pref.sql +7 -0
  27. package/dist/package.json +6 -6
  28. package/package.json +6 -6
  29. package/@types/loot-core/client/app/appSlice.d.ts +0 -175
  30. package/@types/loot-core/client/budgets/budgetsSlice.d.ts +0 -405
  31. package/@types/loot-core/client/modals/modalsSlice.d.ts +0 -490
  32. package/@types/loot-core/client/notifications/notificationsSlice.d.ts +0 -47
  33. package/@types/loot-core/client/prefs/prefsSlice.d.ts +0 -180
  34. package/@types/loot-core/client/queries/queriesSlice.d.ts +0 -692
  35. package/@types/loot-core/client/redux.d.ts +0 -18546
  36. package/@types/loot-core/client/store/index.d.ts +0 -133
  37. package/@types/loot-core/client/users/usersSlice.d.ts +0 -105
  38. package/@types/loot-core/platform/client/undo/index.d.ts +0 -21
  39. package/@types/loot-core/server/aql/schema/run-query.d.ts +0 -6
  40. package/@types/loot-core/server/budget/categoryTemplate.d.ts +0 -49
  41. package/@types/loot-core/server/budget/goalsSchedule.d.ts +0 -8
  42. package/@types/loot-core/server/budget/goaltemplates.d.ts +0 -16
  43. package/@types/loot-core/server/platform.d.ts +0 -3
  44. package/@types/loot-core/server/platform.web.d.ts +0 -3
  45. package/@types/loot-core/types/file.d.ts +0 -34
  46. /package/@types/loot-core/{client → shared}/platform.d.ts +0 -0
@@ -1,54 +1,56 @@
1
1
  import { QueryState } from '../../shared/query';
2
2
  export declare function quoteAlias(alias: any): any;
3
3
  export declare function isAggregateQuery(queryState: any): boolean;
4
+ type Schema = unknown;
4
5
  export type SchemaConfig = {
5
- tableViews?: Record<string, unknown> | ((name: string, config: {
6
+ tableViews?: Record<string, string> | ((name: string, config: {
6
7
  withDead: any;
7
8
  isJoin: any;
8
9
  tableOptions: any;
9
- }) => unknown);
10
+ }) => string);
10
11
  tableFilters?: (name: string) => unknown[];
11
- customizeQuery?: (queryString: QueryState) => QueryState;
12
+ customizeQuery?: (queryState: QueryState) => QueryState;
12
13
  views?: Record<string, {
13
14
  fields?: Record<string, string>;
14
15
  [key: `v_${string}`]: string | ((internalFields: any, publicFields: any) => string);
15
16
  }>;
16
17
  };
17
- export declare function compileQuery(queryState: any, schema: any, schemaConfig?: SchemaConfig): {
18
- sqlPieces: {
19
- select: string;
20
- from: unknown;
21
- joins: string;
22
- where: string;
23
- groupBy: string;
24
- orderBy: string;
25
- limit: number;
26
- offset: number;
27
- };
28
- state: {
29
- schema: any;
30
- implicitTableName: any;
31
- implicitTableId: unknown;
32
- paths: Map<any, any>;
33
- dependencies: any[];
34
- compileStack: any[];
35
- outputTypes: Map<any, any>;
36
- validateRefs: any;
37
- namedParameters: any[];
38
- };
18
+ export type OutputTypes = Map<string, string | number | null>;
19
+ type NamedParameter = {
20
+ type: string;
21
+ paramName: string;
22
+ paramType?: string;
23
+ value: string;
39
24
  };
40
- export declare function defaultConstructQuery(queryState: any, state: any, sqlPieces: any): string;
41
- export declare function generateSQLWithState(queryState: any, schema?: unknown, schemaConfig?: unknown): {
25
+ type CompileStack = unknown[];
26
+ export type CompilerState = {
27
+ schema: Schema;
28
+ implicitTableName: string;
29
+ implicitTableId: string;
30
+ paths: Map<string, unknown>;
31
+ dependencies: string[];
32
+ compileStack: CompileStack;
33
+ outputTypes: OutputTypes;
34
+ validateRefs: boolean;
35
+ namedParameters: NamedParameter[];
36
+ };
37
+ export type SqlPieces = {
38
+ select: string;
39
+ from: string;
40
+ joins: string;
41
+ where: string;
42
+ groupBy: string;
43
+ orderBy: string;
44
+ limit: number | null;
45
+ offset: number | null;
46
+ };
47
+ export declare function compileQuery(queryState: QueryState, schema: Schema, schemaConfig?: SchemaConfig): {
48
+ sqlPieces: SqlPieces;
49
+ state: CompilerState;
50
+ };
51
+ export declare function defaultConstructQuery(queryState: QueryState, compilerState: CompilerState, sqlPieces: SqlPieces): string;
52
+ export declare function generateSQLWithState(queryState: QueryState, schema?: Schema, schemaConfig?: SchemaConfig): {
42
53
  sql: string;
43
- state: {
44
- schema: any;
45
- implicitTableName: any;
46
- implicitTableId: unknown;
47
- paths: Map<any, any>;
48
- dependencies: any[];
49
- compileStack: any[];
50
- outputTypes: Map<any, any>;
51
- validateRefs: any;
52
- namedParameters: any[];
53
- };
54
+ state: CompilerState;
54
55
  };
56
+ export {};
@@ -1,9 +1,17 @@
1
- export declare function execQuery(queryState: any, state: any, sqlPieces: any, params: any, outputTypes: any): Promise<unknown[]>;
2
- export declare function runCompiledQuery(query: any, pieces: any, state: any, { params, executors }?: {
3
- params?: {};
4
- executors?: {};
5
- }): Promise<any>;
6
- export declare function runQuery(schema: any, schemaConfig: any, query: any, options: any): Promise<{
1
+ import { QueryState } from '../../shared/query';
2
+ import { CompilerState, OutputTypes, SchemaConfig, SqlPieces } from './compiler';
3
+ export declare function execQuery(queryState: QueryState, compilerState: CompilerState, sqlPieces: SqlPieces, params: (string | number)[], outputTypes: OutputTypes): Promise<Record<string, unknown>[]>;
4
+ export type AqlQueryExecutor = (compilerState: CompilerState, queryState: QueryState, sqlPieces: SqlPieces, params: (string | number)[], outputTypes: OutputTypes) => Promise<Record<string, unknown>[]>;
5
+ type AqlQueryParamName = string;
6
+ type AqlQueryParamValue = unknown;
7
+ export type AqlQueryParams = Record<AqlQueryParamName, AqlQueryParamValue>;
8
+ export type RunCompiledAqlQueryOptions = {
9
+ params?: AqlQueryParams;
10
+ executors?: Record<string, AqlQueryExecutor>;
11
+ };
12
+ export declare function runCompiledAqlQuery(queryState: QueryState, sqlPieces: SqlPieces, compilerState: CompilerState, { params, executors }?: RunCompiledAqlQueryOptions): Promise<unknown>;
13
+ export declare function compileAndRunAqlQuery(schema: any, schemaConfig: SchemaConfig, queryState: QueryState, options: RunCompiledAqlQueryOptions): Promise<{
7
14
  data: any;
8
- dependencies: any[];
15
+ dependencies: string[];
9
16
  }>;
17
+ export {};
@@ -1,5 +1,12 @@
1
+ import { Query, type QueryState } from '../../shared/query';
2
+ import { CompilerState, SqlPieces } from './compiler';
3
+ import { AqlQueryParams } from './exec';
1
4
  export { convertForInsert, convertForUpdate, convertFromSelect, convertInputType, } from './schema-helpers';
2
5
  export { compileQuery } from './compiler';
3
6
  export { makeViews } from './views';
4
7
  export { schema, schemaConfig } from './schema';
5
- export { runQuery, runCompiledQuery } from './schema/run-query';
8
+ export declare function aqlCompiledQuery(queryState: QueryState, sqlPieces: SqlPieces, compilerState: CompilerState, params?: AqlQueryParams): Promise<unknown>;
9
+ export declare function aqlQuery(query: Query | QueryState, params?: AqlQueryParams): Promise<{
10
+ data: any;
11
+ dependencies: string[];
12
+ }>;
@@ -1,8 +1,3 @@
1
- declare function execTransactions(state: any, query: any, sql: any, params: any, outputTypes: any): Promise<any>;
1
+ import { AqlQueryExecutor } from '../exec';
2
2
  export declare function isHappyPathQuery(queryState: any): boolean;
3
- declare function execCategoryGroups(state: any, query: any, sql: any, params: any, outputTypes: any): Promise<unknown[]>;
4
- export declare const schemaExecutors: {
5
- transactions: typeof execTransactions;
6
- category_groups: typeof execCategoryGroups;
7
- };
8
- export {};
3
+ export declare const schemaExecutors: Record<string, AqlQueryExecutor>;
@@ -1,7 +1,7 @@
1
1
  import { CategoryEntity, CategoryGroupEntity } from '../../types/models';
2
2
  import * as actions from './actions';
3
3
  import * as cleanupActions from './cleanup-template';
4
- import * as goalActions from './goaltemplates';
4
+ import * as goalActions from './goal-template';
5
5
  export interface BudgetHandlers {
6
6
  'budget/budget-amount': typeof actions.setBudget;
7
7
  'budget/copy-previous-month': typeof actions.copyPreviousMonth;
@@ -1,4 +1,4 @@
1
- export declare function getBudgetType(): "report" | "rollover";
1
+ export declare function getBudgetType(): "tracking" | "envelope";
2
2
  export declare function getBudgetRange(start: string, end: string): {
3
3
  start: string;
4
4
  end: string;
@@ -0,0 +1,49 @@
1
+ import { CategoryEntity } from '../../types/models';
2
+ import { AverageTemplate, CopyTemplate, PercentageTemplate, SimpleTemplate, SpendTemplate, Template, WeekTemplate } from './types/templates';
3
+ export declare class CategoryTemplateContext {
4
+ static init(templates: Template[], category: CategoryEntity, month: string, budgeted: number): Promise<CategoryTemplateContext>;
5
+ isGoalOnly(): boolean;
6
+ getPriorities(): number[];
7
+ getRemainderWeight(): number;
8
+ getLimitExcess(): number;
9
+ runAll(available: number): Promise<number>;
10
+ runTemplatesForPriority(priority: number, budgetAvail: number, availStart: number): Promise<number>;
11
+ runRemainder(budgetAvail: number, perWeight: number): number;
12
+ getValues(): {
13
+ budgeted: number;
14
+ goal: number;
15
+ longGoal: boolean;
16
+ };
17
+ readonly category: CategoryEntity;
18
+ private month;
19
+ private templates;
20
+ private remainder;
21
+ private goals;
22
+ private priorities;
23
+ private remainderWeight;
24
+ private toBudgetAmount;
25
+ private fullAmount;
26
+ private isLongGoal;
27
+ private goalAmount;
28
+ private fromLastMonth;
29
+ private limitMet;
30
+ private limitExcess;
31
+ private limitAmount;
32
+ private limitCheck;
33
+ private limitHold;
34
+ readonly previouslyBudgeted: number;
35
+ protected constructor(templates: Template[], category: CategoryEntity, month: string, fromLastMonth: number, budgeted: number);
36
+ private runGoal;
37
+ static checkByAndScheduleAndSpend(templates: Template[], month: string): Promise<void>;
38
+ static checkPercentage(templates: Template[]): Promise<void>;
39
+ private checkLimit;
40
+ private checkSpend;
41
+ private checkGoal;
42
+ static runSimple(template: SimpleTemplate, limit: number): number;
43
+ static runCopy(template: CopyTemplate, templateContext: CategoryTemplateContext): Promise<number>;
44
+ static runWeek(template: WeekTemplate, templateContext: CategoryTemplateContext): number;
45
+ static runSpend(template: SpendTemplate, templateContext: CategoryTemplateContext): Promise<number>;
46
+ static runPercentage(template: PercentageTemplate, availableFunds: number, templateContext: CategoryTemplateContext): Promise<number>;
47
+ static runAverage(template: AverageTemplate, templateContext: CategoryTemplateContext): Promise<number>;
48
+ static runBy(templateContext: CategoryTemplateContext): number;
49
+ }
@@ -1,4 +1,11 @@
1
- import { Notification } from '../../client/notifications/notificationsSlice';
1
+ type Notification = {
2
+ type?: 'message' | 'error' | 'warning' | undefined;
3
+ pre?: string | undefined;
4
+ title?: string | undefined;
5
+ message: string;
6
+ sticky?: boolean | undefined;
7
+ };
2
8
  export declare function cleanupTemplate({ month }: {
3
9
  month: string;
4
10
  }): Promise<Notification>;
11
+ export {};
@@ -0,0 +1,29 @@
1
+ import { CategoryEntity } from '../../types/models';
2
+ type Notification = {
3
+ type?: 'message' | 'error' | 'warning' | undefined;
4
+ pre?: string | undefined;
5
+ title?: string | undefined;
6
+ message: string;
7
+ sticky?: boolean | undefined;
8
+ };
9
+ export declare function applyTemplate({ month, }: {
10
+ month: string;
11
+ }): Promise<Notification>;
12
+ export declare function overwriteTemplate({ month, }: {
13
+ month: string;
14
+ }): Promise<Notification>;
15
+ export declare function applyMultipleCategoryTemplates({ month, categoryIds, }: {
16
+ month: string;
17
+ categoryIds: Array<CategoryEntity['id']>;
18
+ }): Promise<Notification>;
19
+ export declare function applySingleCategoryTemplate({ month, category, }: {
20
+ month: string;
21
+ category: CategoryEntity['id'];
22
+ }): Promise<Notification>;
23
+ export declare function runCheckTemplates(): Promise<{
24
+ type?: "message" | "error" | "warning" | undefined;
25
+ pre?: string | undefined;
26
+ message: string;
27
+ sticky?: boolean | undefined;
28
+ }>;
29
+ export {};
@@ -0,0 +1,7 @@
1
+ import { CategoryEntity } from '../../types/models';
2
+ import { Template } from './types/templates';
3
+ export declare function runSchedule(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
+ }>;
@@ -1,5 +1,11 @@
1
- import { Notification } from '../../client/notifications/notificationsSlice';
1
+ type Notification = {
2
+ type?: 'message' | 'error' | 'warning' | undefined;
3
+ pre?: string | undefined;
4
+ message: string;
5
+ sticky?: boolean | undefined;
6
+ };
2
7
  export declare const TEMPLATE_PREFIX = "#template";
3
8
  export declare const GOAL_PREFIX = "#goal";
4
9
  export declare function storeTemplates(): Promise<void>;
5
10
  export declare function checkTemplates(): Promise<Notification>;
11
+ export {};
@@ -16,7 +16,12 @@ interface WeekTemplate extends BaseTemplate {
16
16
  amount: number;
17
17
  weeks: number | null;
18
18
  starting: string;
19
- limit?: { amount: number; hold: boolean };
19
+ limit?: {
20
+ amount: number;
21
+ hold: boolean;
22
+ period?: 'daily' | 'weekly' | 'monthly';
23
+ start?: string;
24
+ };
20
25
  }
21
26
 
22
27
  interface ByTemplate extends BaseTemplate {
@@ -33,13 +38,19 @@ interface SpendTemplate extends BaseTemplate {
33
38
  amount: number;
34
39
  month: string;
35
40
  from: string;
36
- repeat?: { annual: boolean; repeat?: number };
41
+ annual?: boolean;
42
+ repeat?: number;
37
43
  }
38
44
 
39
45
  interface SimpleTemplate extends BaseTemplate {
40
46
  type: 'simple';
41
47
  monthly?: number;
42
- limit?: { amount: number; hold: boolean };
48
+ limit?: {
49
+ amount: number;
50
+ hold: boolean;
51
+ period?: 'daily' | 'weekly' | 'monthly';
52
+ start?: string;
53
+ };
43
54
  }
44
55
 
45
56
  interface ScheduleTemplate extends BaseTemplate {
@@ -52,7 +63,12 @@ interface ScheduleTemplate extends BaseTemplate {
52
63
  interface RemainderTemplate extends BaseTemplate {
53
64
  type: 'remainder';
54
65
  weight: number;
55
- limit?: { amount: number; hold: boolean };
66
+ limit?: {
67
+ amount: number;
68
+ hold: boolean;
69
+ period?: 'daily' | 'weekly' | 'monthly';
70
+ start?: string;
71
+ };
56
72
  }
57
73
 
58
74
  interface AverageTemplate extends BaseTemplate {
@@ -1,5 +1,5 @@
1
1
  import type { MetadataPrefs } from '../types/prefs';
2
- export declare const BUDGET_TYPES: readonly ["report", "rollover"];
2
+ export declare const BUDGET_TYPES: readonly ["tracking", "envelope"];
3
3
  export type BudgetType = (typeof BUDGET_TYPES)[number];
4
4
  export declare const UPCOMING_SCHEDULED_TRANSACTION_LENGTHS: readonly ["1", "7", "14", "30"];
5
5
  export type UpcomingScheduledTransactionLength = (typeof UPCOMING_SCHEDULED_TRANSACTION_LENGTHS)[number];
@@ -24,6 +24,7 @@ declare function fixSplitTransactions(): Promise<{
24
24
  numDeleted: number;
25
25
  numTransfersFixed: number;
26
26
  numNonParentErrorsFixed: number;
27
+ numParentTransactionsWithCategoryFixed: number;
27
28
  mismatchedSplits: TransactionEntity[];
28
29
  }>;
29
30
  export {};
@@ -1 +1,2 @@
1
- export declare function getLocale(language: string): Locale;
1
+ import * as locales from 'date-fns/locale';
2
+ export declare function getLocale(language: string): locales.Locale;
@@ -1,3 +1,4 @@
1
+ import { Locale } from 'date-fns';
1
2
  import { type SyncedPrefs } from '../types/prefs';
2
3
  type DateLike = string | Date;
3
4
  export declare function _parse(value: DateLike): Date;
@@ -29,6 +30,7 @@ export declare function subDays(day: DateLike, n: number): string;
29
30
  export declare function isBefore(month1: DateLike, month2: DateLike): boolean;
30
31
  export declare function isAfter(month1: DateLike, month2: DateLike): boolean;
31
32
  export declare function isCurrentMonth(month: DateLike): boolean;
33
+ export declare function isCurrentDay(day: DateLike): boolean;
32
34
  export declare function bounds(month: DateLike): {
33
35
  start: number;
34
36
  end: number;
@@ -55,6 +57,10 @@ export declare function getYearEnd(month: string): string;
55
57
  export declare function sheetForMonth(month: string): string;
56
58
  export declare function nameForMonth(month: DateLike, locale?: Locale): string;
57
59
  export declare function format(month: DateLike, format: string, locale?: Locale): string;
60
+ export declare function formatDistance(date1: DateLike, date2: DateLike, locale?: Locale, options?: {
61
+ addSuffix?: boolean;
62
+ includeSeconds?: boolean;
63
+ }): string;
58
64
  export declare const getDateFormatRegex: import("memoize-one").MemoizedFn<(format: string) => RegExp>;
59
65
  export declare const getDayMonthFormat: import("memoize-one").MemoizedFn<(format: string) => string>;
60
66
  export declare const getDayMonthRegex: import("memoize-one").MemoizedFn<(format: string) => RegExp>;
@@ -1,6 +1,7 @@
1
1
  import type { IRuleOptions } from '@rschedule/core';
2
+ import { Locale } from 'date-fns';
2
3
  import { Condition } from '../server/rules';
3
- export declare function getStatus(nextDate: string, completed: boolean, hasTrans: boolean, upcomingLength: string): "completed" | "paid" | "due" | "upcoming" | "missed" | "scheduled";
4
+ export declare function getStatus(nextDate: string, completed: boolean, hasTrans: boolean, upcomingLength?: string): "completed" | "paid" | "due" | "upcoming" | "missed" | "scheduled";
4
5
  export declare function getStatusLabel(status: string): string;
5
6
  export declare function getHasTransactionsQuery(schedules: any): import("./query").Query;
6
7
  export declare function getRecurringDescription(config: any, dateFormat: any, locale: Locale): string;
@@ -16,7 +16,7 @@ export declare function recalculateSplit(trans: TransactionEntity): {
16
16
  parent_id?: TransactionEntity["id"];
17
17
  account: import("../types/models").AccountEntity["id"];
18
18
  category?: import("../types/models").CategoryEntity["id"];
19
- amount: number;
19
+ amount: import("./util").IntegerAmount;
20
20
  payee?: import("../types/models").PayeeEntity["id"];
21
21
  notes?: string;
22
22
  date: string;
@@ -36,75 +36,15 @@ export declare function recalculateSplit(trans: TransactionEntity): {
36
36
  raw_synced_data?: string | undefined;
37
37
  };
38
38
  export declare function ungroupTransactions(transactions: TransactionEntity[]): TransactionEntity[];
39
- export declare function groupTransaction(split: TransactionEntity[]): {
40
- subtransactions: TransactionEntity[];
41
- id: string;
42
- is_parent?: boolean;
43
- is_child?: boolean;
44
- parent_id?: TransactionEntity["id"];
45
- account: import("../types/models").AccountEntity["id"];
46
- category?: import("../types/models").CategoryEntity["id"];
47
- amount: number;
48
- payee?: import("../types/models").PayeeEntity["id"];
49
- notes?: string;
50
- date: string;
51
- imported_id?: string;
52
- imported_payee?: string;
53
- starting_balance_flag?: boolean;
54
- transfer_id?: TransactionEntity["id"];
55
- sort_order?: number;
56
- cleared?: boolean;
57
- reconciled?: boolean;
58
- tombstone?: boolean;
59
- forceUpcoming?: boolean;
60
- schedule?: import("../types/models").ScheduleEntity["id"];
61
- _unmatched?: boolean;
62
- _deleted?: boolean;
63
- error?: {
64
- type: "SplitTransactionError";
65
- version: 1;
66
- difference: number;
67
- } | null;
68
- raw_synced_data?: string | undefined;
69
- };
39
+ export declare function groupTransaction(split: TransactionEntity[]): TransactionEntity;
70
40
  export declare function ungroupTransaction(split: TransactionEntity | null): TransactionEntity[];
71
- export declare function applyTransactionDiff(groupedTrans: Parameters<typeof ungroupTransaction>[0], diff: Parameters<typeof applyChanges>[0]): {
72
- subtransactions: TransactionEntity[];
73
- id: string;
74
- is_parent?: boolean;
75
- is_child?: boolean;
76
- parent_id?: TransactionEntity["id"];
77
- account: import("../types/models").AccountEntity["id"];
78
- category?: import("../types/models").CategoryEntity["id"];
79
- amount: number;
80
- payee?: import("../types/models").PayeeEntity["id"];
81
- notes?: string;
82
- date: string;
83
- imported_id?: string;
84
- imported_payee?: string;
85
- starting_balance_flag?: boolean;
86
- transfer_id?: TransactionEntity["id"];
87
- sort_order?: number;
88
- cleared?: boolean;
89
- reconciled?: boolean;
90
- tombstone?: boolean;
91
- forceUpcoming?: boolean;
92
- schedule?: import("../types/models").ScheduleEntity["id"];
93
- _unmatched?: boolean;
94
- _deleted?: boolean;
95
- error?: {
96
- type: "SplitTransactionError";
97
- version: 1;
98
- difference: number;
99
- } | null;
100
- raw_synced_data?: string | undefined;
101
- };
102
- export declare function addSplitTransaction(transactions: TransactionEntity[], id: string): {
41
+ export declare function applyTransactionDiff(groupedTrans: Parameters<typeof ungroupTransaction>[0], diff: Parameters<typeof applyChanges>[0]): TransactionEntity;
42
+ export declare function addSplitTransaction(transactions: readonly TransactionEntity[], id: string): {
103
43
  data: TransactionEntity[];
104
44
  newTransaction: TransactionEntity | null;
105
45
  diff: ReturnType<typeof diffItems<TransactionEntity>>;
106
46
  };
107
- export declare function updateTransaction(transactions: TransactionEntity[], transaction: TransactionEntity): {
47
+ export declare function updateTransaction(transactions: readonly TransactionEntity[], transaction: TransactionEntity): {
108
48
  data: TransactionEntity[];
109
49
  newTransaction: TransactionEntity | null;
110
50
  diff: ReturnType<typeof diffItems<TransactionEntity>>;
@@ -114,7 +54,7 @@ export declare function deleteTransaction(transactions: TransactionEntity[], id:
114
54
  newTransaction: TransactionEntity | null;
115
55
  diff: ReturnType<typeof diffItems<TransactionEntity>>;
116
56
  };
117
- export declare function splitTransaction(transactions: TransactionEntity[], id: string, createSubtransactions?: (parentTransaction: TransactionEntity) => TransactionEntity[]): {
57
+ export declare function splitTransaction(transactions: readonly TransactionEntity[], id: string, createSubtransactions?: (parentTransaction: TransactionEntity) => TransactionEntity[]): {
118
58
  data: TransactionEntity[];
119
59
  newTransaction: TransactionEntity | null;
120
60
  diff: ReturnType<typeof diffItems<TransactionEntity>>;
@@ -123,7 +63,7 @@ export declare function realizeTempTransactions(transactions: TransactionEntity[
123
63
  export declare function makeAsNonChildTransactions(childTransactionsToUpdate: TransactionEntity[], transactions: TransactionEntity[]): {
124
64
  updated: TransactionEntity[];
125
65
  deleted: {
126
- amount: number;
66
+ amount: import("./util").IntegerAmount;
127
67
  id: string;
128
68
  is_parent?: boolean;
129
69
  is_child?: boolean;
@@ -1,3 +1,4 @@
1
+ import { type Locale } from 'date-fns';
1
2
  export declare function last<T>(arr: Array<T>): T;
2
3
  export declare function getChangedValues<T extends {
3
4
  id?: string;
@@ -20,11 +21,11 @@ export declare function diffItems<T extends {
20
21
  }>(items: T[], newItems: T[]): Diff<T>;
21
22
  export declare function groupById<T extends {
22
23
  id: string;
23
- }>(data: T[]): Record<string, T>;
24
+ }>(data: T[] | null | undefined): Record<string, T>;
24
25
  export declare function setIn(map: Map<string, unknown>, keys: string[], item: unknown): void;
25
26
  export declare function getIn(map: any, keys: any): any;
26
27
  export declare function fastSetMerge<T>(set1: Set<T>, set2: Set<T>): Set<T>;
27
- export declare function titleFirst(str: string): string;
28
+ export declare function titleFirst(str: string | null | undefined): string;
28
29
  export declare function appendDecimals(amountText: string, hideDecimals?: boolean): string;
29
30
  declare const NUMBER_FORMATS: readonly ["comma-dot", "dot-comma", "space-comma", "apostrophe-dot", "comma-dot", "comma-dot-in"];
30
31
  type NumberFormats = (typeof NUMBER_FORMATS)[number];
@@ -4,6 +4,7 @@ export interface CategoryEntity {
4
4
  name: string;
5
5
  is_income?: boolean;
6
6
  group: CategoryGroupEntity['id'];
7
+ goal_def?: string;
7
8
  sort_order?: number;
8
9
  tombstone?: boolean;
9
10
  hidden?: boolean;
@@ -1,3 +1,4 @@
1
+ import { IntegerAmount } from '../../shared/util';
1
2
  import { AccountEntity } from './account';
2
3
  import { CategoryEntity } from './category';
3
4
  import { PayeeEntity } from './payee';
@@ -9,7 +10,7 @@ export interface TransactionEntity {
9
10
  parent_id?: TransactionEntity['id'];
10
11
  account: AccountEntity['id'];
11
12
  category?: CategoryEntity['id'];
12
- amount: number;
13
+ amount: IntegerAmount;
13
14
  payee?: PayeeEntity['id'];
14
15
  notes?: string;
15
16
  date: string;
@@ -3,7 +3,6 @@ export type FeatureFlag =
3
3
  | 'goalTemplatesUIEnabled'
4
4
  | 'actionTemplating'
5
5
  | 'contextMenus'
6
- | 'openidAuth'
7
6
  | 'pluggyAiBankSync';
8
7
 
9
8
  /**
@@ -10,7 +10,12 @@ export declare function runBankSync(args?: {
10
10
  accountId: string;
11
11
  }): Promise<void>;
12
12
  export declare function batchBudgetUpdates(func: any): Promise<void>;
13
+ /**
14
+ * @deprecated Please use `aqlQuery` instead.
15
+ * This function will be removed in a future release.
16
+ */
13
17
  export declare function runQuery(query: any): Promise<unknown>;
18
+ export declare function aqlQuery(query: any): Promise<unknown>;
14
19
  export declare function getBudgetMonths(): Promise<string[]>;
15
20
  export declare function getBudgetMonth(month: any): Promise<{
16
21
  month: string;