@actual-app/api 25.4.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.
- package/@types/app/bundle.api.d.ts +1 -5
- package/@types/loot-core/mocks/index.d.ts +5 -2
- package/@types/loot-core/mocks/util.d.ts +1 -0
- package/@types/loot-core/platform/server/asyncStorage/index.d.ts +7 -6
- package/@types/loot-core/platform/server/indexeddb/index.d.ts +15 -24
- package/@types/loot-core/server/accounts/sync.d.ts +1 -9
- package/@types/loot-core/server/api-models.d.ts +2 -10
- package/@types/loot-core/server/aql/compiler.d.ts +40 -38
- package/@types/loot-core/server/aql/exec.d.ts +15 -7
- package/@types/loot-core/server/aql/index.d.ts +8 -1
- package/@types/loot-core/server/aql/schema/executors.d.ts +2 -5
- package/@types/loot-core/server/auth/app.d.ts +142 -0
- package/@types/loot-core/server/budget/app.d.ts +1 -1
- package/@types/loot-core/server/budget/base.d.ts +2 -1
- package/@types/loot-core/server/budget/category-template-context.d.ts +49 -0
- package/@types/loot-core/server/budget/cleanup-template.d.ts +8 -1
- package/@types/loot-core/server/budget/envelope.d.ts +3 -0
- package/@types/loot-core/server/budget/goal-template.d.ts +29 -0
- package/@types/loot-core/server/budget/report.d.ts +4 -1
- package/@types/loot-core/server/budget/schedule-template.d.ts +7 -0
- package/@types/loot-core/server/budget/template-notes.d.ts +7 -1
- package/@types/loot-core/server/budget/types/templates.d.ts +20 -4
- package/@types/loot-core/server/budgetfiles/app.d.ts +139 -0
- package/@types/loot-core/server/cloud-storage.d.ts +2 -2
- package/@types/loot-core/server/db/index.d.ts +3 -2
- package/@types/loot-core/server/encryption/app.d.ts +40 -0
- package/@types/loot-core/server/{encryption-internals.d.ts → encryption/encryption-internals.d.ts} +0 -1
- package/@types/loot-core/server/errors.d.ts +4 -0
- package/@types/loot-core/server/importers/index.d.ts +1 -2
- package/@types/loot-core/server/main-app.d.ts +1 -1
- package/@types/loot-core/server/prefs.d.ts +1 -1
- package/@types/loot-core/server/reports/app.d.ts +2 -2
- package/@types/loot-core/server/spreadsheet/spreadsheet.d.ts +9 -2
- package/@types/loot-core/server/tools/app.d.ts +1 -0
- package/@types/loot-core/server/transactions/app.d.ts +4 -1
- package/@types/loot-core/server/transactions/import/ofx2json.d.ts +1 -0
- package/@types/loot-core/server/transactions/import/parse-file.d.ts +1 -0
- package/@types/loot-core/server/transactions/index.d.ts +1 -0
- package/@types/loot-core/server/transactions/merge.d.ts +2 -0
- package/@types/loot-core/server/transactions/transaction-rules.d.ts +1 -0
- package/@types/loot-core/server/transactions/transfer.d.ts +2 -2
- package/@types/loot-core/shared/errors.d.ts +4 -4
- package/@types/loot-core/shared/locale.d.ts +2 -1
- package/@types/loot-core/shared/months.d.ts +6 -0
- package/@types/loot-core/shared/schedules.d.ts +2 -1
- package/@types/loot-core/shared/transactions.d.ts +7 -67
- package/@types/loot-core/shared/util.d.ts +3 -2
- package/@types/loot-core/types/api-handlers.d.ts +170 -183
- package/@types/loot-core/types/budget.d.ts +6 -6
- package/@types/loot-core/types/handlers.d.ts +5 -21
- package/@types/loot-core/types/models/bank-sync.d.ts +10 -17
- package/@types/loot-core/types/models/category-group.d.ts +8 -13
- package/@types/loot-core/types/models/category.d.ts +8 -8
- package/@types/loot-core/types/models/dashboard.d.ts +43 -88
- package/@types/loot-core/types/models/gocardless.d.ts +56 -71
- package/@types/loot-core/types/models/note.d.ts +2 -2
- package/@types/loot-core/types/models/openid.d.ts +6 -6
- package/@types/loot-core/types/models/payee.d.ts +6 -7
- package/@types/loot-core/types/models/reports.d.ts +98 -118
- package/@types/loot-core/types/models/rule.d.ts +62 -161
- package/@types/loot-core/types/models/schedule.d.ts +36 -38
- package/@types/loot-core/types/models/simplefin.d.ts +13 -17
- package/@types/loot-core/types/models/transaction-filter.d.ts +5 -6
- package/@types/loot-core/types/models/transaction.d.ts +30 -30
- package/@types/loot-core/types/prefs.d.ts +2 -5
- package/@types/loot-core/types/server-events.d.ts +43 -68
- package/@types/loot-core/types/server-handlers.d.ts +26 -198
- package/@types/loot-core/types/util.d.ts +7 -18
- package/@types/methods.d.ts +6 -1
- package/@types/vitest.config.d.ts +7 -0
- package/dist/app/bundle.api.js +16159 -110865
- package/dist/methods.js +8 -0
- package/dist/migrations/1745425408000_update_budgetType_pref.sql +7 -0
- package/dist/package.json +8 -10
- package/dist/vitest.config.js +11 -0
- package/package.json +8 -10
- package/@types/jest.config.d.ts +0 -9
- package/@types/loot-core/client/accounts/accountsSlice.d.ts +0 -175
- package/@types/loot-core/client/app/appSlice.d.ts +0 -175
- package/@types/loot-core/client/budgets/budgetsSlice.d.ts +0 -401
- package/@types/loot-core/client/modals/modalsSlice.d.ts +0 -486
- package/@types/loot-core/client/notifications/notificationsSlice.d.ts +0 -47
- package/@types/loot-core/client/prefs/prefsSlice.d.ts +0 -186
- package/@types/loot-core/client/queries/queriesSlice.d.ts +0 -692
- package/@types/loot-core/client/redux.d.ts +0 -18546
- package/@types/loot-core/client/store/index.d.ts +0 -133
- package/@types/loot-core/client/users/usersSlice.d.ts +0 -89
- package/@types/loot-core/platform/client/undo/index.d.ts +0 -21
- package/@types/loot-core/server/aql/schema/run-query.d.ts +0 -6
- package/@types/loot-core/server/backups.test.d.ts +0 -1
- package/@types/loot-core/server/budget/categoryTemplate.d.ts +0 -49
- package/@types/loot-core/server/budget/goalsSchedule.d.ts +0 -8
- package/@types/loot-core/server/budget/goaltemplates.d.ts +0 -16
- package/@types/loot-core/server/encryption-internals.web.d.ts +0 -23
- package/@types/loot-core/server/encryption.test.d.ts +0 -1
- package/@types/loot-core/server/platform.d.ts +0 -3
- package/@types/loot-core/server/platform.web.d.ts +0 -3
- package/@types/loot-core/types/file.d.ts +0 -47
- package/dist/jest.config.js +0 -22
- /package/@types/loot-core/server/{backups.d.ts → budgetfiles/backups.d.ts} +0 -0
- /package/@types/loot-core/server/{encryption.d.ts → encryption/index.d.ts} +0 -0
- /package/@types/loot-core/{client → shared}/platform.d.ts +0 -0
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
export = __webpack_exports__;
|
|
2
|
-
|
|
3
|
-
/******/
|
|
4
|
-
/************************************************************************/
|
|
5
|
-
/******/
|
|
6
|
-
/******/ /******/ /******/ /******/ declare var __webpack_exports__: any;
|
|
2
|
+
declare var __webpack_exports__: any;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type { AccountEntity, CategoryEntity, CategoryGroupEntity,
|
|
1
|
+
import type { AccountEntity, CategoryEntity, CategoryGroupEntity, TransactionEntity } from '../types/models';
|
|
2
2
|
export declare function generateAccount(name: AccountEntity['name'], isConnected?: boolean, offbudget?: boolean): AccountEntity;
|
|
3
3
|
export declare function generateCategory(name: string, group: string, isIncome?: boolean): CategoryEntity;
|
|
4
4
|
export declare function generateCategoryGroup(name: string, isIncome?: boolean): CategoryGroupEntity;
|
|
5
|
-
export
|
|
5
|
+
export type CategoryGroupDefinition = Omit<CategoryGroupEntity, 'id' | 'categories'> & {
|
|
6
|
+
categories: Omit<CategoryEntity, 'id' | 'group'>[];
|
|
7
|
+
};
|
|
8
|
+
export declare function generateCategoryGroups(definition: Partial<CategoryGroupDefinition>[]): CategoryGroupEntity[];
|
|
6
9
|
export declare function generateTransaction(data: Partial<TransactionEntity> & Pick<TransactionEntity, 'account'>, splitAmount?: number, showError?: boolean): TransactionEntity[];
|
|
7
10
|
export declare function generateTransactions(count: number, accountId: string, groupId: string, splitAtIndexes?: number[], showError?: boolean): TransactionEntity[];
|
|
@@ -13,22 +13,23 @@ export type GetItem = typeof getItem;
|
|
|
13
13
|
export function setItem<K extends keyof GlobalPrefsJson>(
|
|
14
14
|
key: K,
|
|
15
15
|
value: GlobalPrefsJson[K],
|
|
16
|
-
): void
|
|
16
|
+
): Promise<void>;
|
|
17
17
|
export type SetItem = typeof setItem;
|
|
18
18
|
|
|
19
|
-
export function removeItem(key: keyof GlobalPrefsJson): void
|
|
19
|
+
export function removeItem(key: keyof GlobalPrefsJson): Promise<void>;
|
|
20
20
|
export type RemoveItem = typeof removeItem;
|
|
21
21
|
|
|
22
|
-
export
|
|
22
|
+
export function multiGet<K extends readonly (keyof GlobalPrefsJson)[]>(
|
|
23
23
|
keys: K,
|
|
24
|
-
): Promise<{ [P in
|
|
24
|
+
): Promise<{ [P in K[number]]: GlobalPrefsJson[P] }>;
|
|
25
|
+
|
|
25
26
|
export type MultiGet = typeof multiGet;
|
|
26
27
|
|
|
27
28
|
export function multiSet<K extends keyof GlobalPrefsJson>(
|
|
28
29
|
keyValues: Array<[K, GlobalPrefsJson[K]]>,
|
|
29
|
-
): void
|
|
30
|
+
): Promise<void>;
|
|
30
31
|
|
|
31
32
|
export type MultiSet = typeof multiSet;
|
|
32
33
|
|
|
33
|
-
export function multiRemove(keys: (keyof GlobalPrefsJson)[]): void
|
|
34
|
+
export function multiRemove(keys: (keyof GlobalPrefsJson)[]): Promise<void>;
|
|
34
35
|
export type MultiRemove = typeof multiRemove;
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
mapper?: (v: unknown) => unknown,
|
|
17
|
-
);
|
|
18
|
-
export type Get = typeof get;
|
|
19
|
-
|
|
20
|
-
export function set(store: IDBObjectStore, value: unknown);
|
|
21
|
-
export type Set = typeof set;
|
|
22
|
-
|
|
23
|
-
export function del(store: IDBObjectStore, key: IDBValidKey);
|
|
24
|
-
export type Del = typeof del;
|
|
1
|
+
type Data = {
|
|
2
|
+
filepath: string;
|
|
3
|
+
contents: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const getStore: (db: IDBDatabase, name: string) => {
|
|
6
|
+
trans: IDBTransaction;
|
|
7
|
+
store: IDBObjectStore;
|
|
8
|
+
};
|
|
9
|
+
export declare const get: (store: IDBObjectStore, key: IDBValidKey | IDBKeyRange) => Promise<Data>;
|
|
10
|
+
export declare const set: (store: IDBObjectStore, item: Data) => Promise<unknown>;
|
|
11
|
+
export declare const del: (store: IDBObjectStore, key: string) => Promise<unknown>;
|
|
12
|
+
export declare const getDatabase: () => Promise<IDBDatabase>;
|
|
13
|
+
export declare const openDatabase: () => Promise<IDBDatabase>;
|
|
14
|
+
export declare const closeDatabase: () => void;
|
|
15
|
+
export {};
|
|
@@ -20,15 +20,7 @@ export declare function addTransactions(acctId: any, transactions: any, { runTra
|
|
|
20
20
|
runTransfers?: boolean;
|
|
21
21
|
learnCategories?: boolean;
|
|
22
22
|
}): Promise<any>;
|
|
23
|
-
export declare function syncAccount(userId: string | undefined, userKey: string | undefined, id: string, acctId: string, bankId: string): Promise<{
|
|
24
|
-
added: any[];
|
|
25
|
-
updated: string[];
|
|
26
|
-
updatedPreview: Array<{
|
|
27
|
-
transaction: TransactionEntity;
|
|
28
|
-
existing?: TransactionEntity;
|
|
29
|
-
ignored?: boolean;
|
|
30
|
-
}>;
|
|
31
|
-
} | {
|
|
23
|
+
export declare function syncAccount(userId: string | undefined, userKey: string | undefined, id: string, acctId: string, bankId: string): Promise<ReconcileTransactionsResult | {
|
|
32
24
|
added: any[];
|
|
33
25
|
updated: any[];
|
|
34
26
|
}>;
|
|
@@ -13,19 +13,11 @@ export declare const accountModel: {
|
|
|
13
13
|
}): import("./db").DbAccount;
|
|
14
14
|
};
|
|
15
15
|
export type APICategoryEntity = Pick<CategoryEntity, 'id' | 'name' | 'is_income' | 'hidden'> & {
|
|
16
|
-
group_id
|
|
16
|
+
group_id: string;
|
|
17
17
|
};
|
|
18
18
|
export declare const categoryModel: {
|
|
19
19
|
toExternal(category: CategoryEntity): APICategoryEntity;
|
|
20
|
-
fromExternal(category: APICategoryEntity):
|
|
21
|
-
id: string;
|
|
22
|
-
name: string;
|
|
23
|
-
is_income?: boolean;
|
|
24
|
-
cat_group?: CategoryGroupEntity["id"];
|
|
25
|
-
sort_order?: number;
|
|
26
|
-
tombstone?: boolean;
|
|
27
|
-
hidden?: boolean;
|
|
28
|
-
};
|
|
20
|
+
fromExternal(category: APICategoryEntity): CategoryEntity;
|
|
29
21
|
validate(category: Partial<import("./db").DbCategory>, { update }?: {
|
|
30
22
|
update?: boolean;
|
|
31
23
|
}): import("./db").DbCategory;
|
|
@@ -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,
|
|
6
|
+
tableViews?: Record<string, string> | ((name: string, config: {
|
|
6
7
|
withDead: any;
|
|
7
8
|
isJoin: any;
|
|
8
9
|
tableOptions: any;
|
|
9
|
-
}) =>
|
|
10
|
+
}) => string);
|
|
10
11
|
tableFilters?: (name: string) => unknown[];
|
|
11
|
-
customizeQuery?: (
|
|
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
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
41
|
-
export
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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:
|
|
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
|
|
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,6 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { AqlQueryExecutor } from '../exec';
|
|
2
2
|
export declare function isHappyPathQuery(queryState: any): boolean;
|
|
3
|
-
export declare const schemaExecutors:
|
|
4
|
-
transactions: typeof execTransactions;
|
|
5
|
-
};
|
|
6
|
-
export {};
|
|
3
|
+
export declare const schemaExecutors: Record<string, AqlQueryExecutor>;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { OpenIdConfig } from '../../types/models';
|
|
2
|
+
export type AuthHandlers = {
|
|
3
|
+
'get-did-bootstrap': typeof didBootstrap;
|
|
4
|
+
'subscribe-needs-bootstrap': typeof needsBootstrap;
|
|
5
|
+
'subscribe-bootstrap': typeof bootstrap;
|
|
6
|
+
'subscribe-get-login-methods': typeof getLoginMethods;
|
|
7
|
+
'subscribe-get-user': typeof getUser;
|
|
8
|
+
'subscribe-change-password': typeof changePassword;
|
|
9
|
+
'subscribe-sign-in': typeof signIn;
|
|
10
|
+
'subscribe-sign-out': typeof signOut;
|
|
11
|
+
'subscribe-set-token': typeof setToken;
|
|
12
|
+
'enable-openid': typeof enableOpenId;
|
|
13
|
+
'get-openid-config': typeof getOpenIdConfig;
|
|
14
|
+
'enable-password': typeof enablePassword;
|
|
15
|
+
};
|
|
16
|
+
export declare const app: {
|
|
17
|
+
events: import("mitt").Emitter<{
|
|
18
|
+
sync: import("../../types/server-events").ServerEvents["sync-event"];
|
|
19
|
+
'load-budget': {
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
23
|
+
handlers: AuthHandlers;
|
|
24
|
+
services: (() => () => void)[];
|
|
25
|
+
unlistenServices: (() => void)[];
|
|
26
|
+
method<Name extends "get-did-bootstrap" | "subscribe-needs-bootstrap" | "subscribe-bootstrap" | "subscribe-get-login-methods" | "subscribe-get-user" | "subscribe-change-password" | "subscribe-sign-in" | "subscribe-sign-out" | "subscribe-set-token" | "enable-openid" | "get-openid-config" | "enable-password">(name: Name, func: AuthHandlers[Name]): void;
|
|
27
|
+
service(func: () => () => void): void;
|
|
28
|
+
combine(...apps: any[]): void;
|
|
29
|
+
startServices(): void;
|
|
30
|
+
stopServices(): void;
|
|
31
|
+
};
|
|
32
|
+
declare function didBootstrap(): Promise<boolean>;
|
|
33
|
+
declare function needsBootstrap({ url }?: {
|
|
34
|
+
url?: string;
|
|
35
|
+
}): Promise<{
|
|
36
|
+
error: string;
|
|
37
|
+
bootstrapped?: undefined;
|
|
38
|
+
hasServer?: undefined;
|
|
39
|
+
availableLoginMethods?: undefined;
|
|
40
|
+
multiuser?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
bootstrapped: boolean;
|
|
43
|
+
hasServer: boolean;
|
|
44
|
+
error?: undefined;
|
|
45
|
+
availableLoginMethods?: undefined;
|
|
46
|
+
multiuser?: undefined;
|
|
47
|
+
} | {
|
|
48
|
+
bootstrapped: boolean;
|
|
49
|
+
availableLoginMethods: {
|
|
50
|
+
method: string;
|
|
51
|
+
displayName: string;
|
|
52
|
+
active: boolean;
|
|
53
|
+
}[];
|
|
54
|
+
multiuser: boolean;
|
|
55
|
+
hasServer: boolean;
|
|
56
|
+
error?: undefined;
|
|
57
|
+
}>;
|
|
58
|
+
declare function bootstrap(loginConfig: {
|
|
59
|
+
password?: string;
|
|
60
|
+
openId?: OpenIdConfig;
|
|
61
|
+
}): Promise<{
|
|
62
|
+
error: string;
|
|
63
|
+
} | {
|
|
64
|
+
error?: undefined;
|
|
65
|
+
}>;
|
|
66
|
+
declare function getLoginMethods(): Promise<{
|
|
67
|
+
error: string;
|
|
68
|
+
methods?: undefined;
|
|
69
|
+
} | {
|
|
70
|
+
methods: {
|
|
71
|
+
method: string;
|
|
72
|
+
displayName: string;
|
|
73
|
+
active: boolean;
|
|
74
|
+
}[];
|
|
75
|
+
error?: undefined;
|
|
76
|
+
}>;
|
|
77
|
+
declare function getUser(): Promise<{
|
|
78
|
+
offline: boolean;
|
|
79
|
+
userName?: undefined;
|
|
80
|
+
permission?: undefined;
|
|
81
|
+
userId?: undefined;
|
|
82
|
+
displayName?: undefined;
|
|
83
|
+
loginMethod?: undefined;
|
|
84
|
+
tokenExpired?: undefined;
|
|
85
|
+
} | {
|
|
86
|
+
offline: boolean;
|
|
87
|
+
userName: any;
|
|
88
|
+
permission: any;
|
|
89
|
+
userId: any;
|
|
90
|
+
displayName: any;
|
|
91
|
+
loginMethod: any;
|
|
92
|
+
tokenExpired: boolean;
|
|
93
|
+
}>;
|
|
94
|
+
declare function changePassword({ password }: {
|
|
95
|
+
password: string;
|
|
96
|
+
}): Promise<{
|
|
97
|
+
error: string;
|
|
98
|
+
} | {
|
|
99
|
+
error?: undefined;
|
|
100
|
+
}>;
|
|
101
|
+
declare function signIn(loginInfo: {
|
|
102
|
+
password: string;
|
|
103
|
+
loginMethod?: string;
|
|
104
|
+
} | {
|
|
105
|
+
returnUrl: string;
|
|
106
|
+
loginMethod?: 'openid';
|
|
107
|
+
}): Promise<{
|
|
108
|
+
error: string;
|
|
109
|
+
redirectUrl?: undefined;
|
|
110
|
+
} | {
|
|
111
|
+
redirectUrl: string;
|
|
112
|
+
error?: undefined;
|
|
113
|
+
} | {
|
|
114
|
+
error?: undefined;
|
|
115
|
+
redirectUrl?: undefined;
|
|
116
|
+
}>;
|
|
117
|
+
declare function signOut(): Promise<string>;
|
|
118
|
+
declare function setToken({ token }: {
|
|
119
|
+
token: string;
|
|
120
|
+
}): Promise<void>;
|
|
121
|
+
declare function enableOpenId(openIdConfig: {
|
|
122
|
+
openId: OpenIdConfig;
|
|
123
|
+
}): Promise<{
|
|
124
|
+
error: string;
|
|
125
|
+
} | {
|
|
126
|
+
error?: undefined;
|
|
127
|
+
}>;
|
|
128
|
+
declare function getOpenIdConfig({ password }: {
|
|
129
|
+
password: string;
|
|
130
|
+
}): Promise<{
|
|
131
|
+
openId: OpenIdConfig;
|
|
132
|
+
} | {
|
|
133
|
+
error: string;
|
|
134
|
+
}>;
|
|
135
|
+
declare function enablePassword(passwordConfig: {
|
|
136
|
+
password: string;
|
|
137
|
+
}): Promise<{
|
|
138
|
+
error: string;
|
|
139
|
+
} | {
|
|
140
|
+
error?: undefined;
|
|
141
|
+
}>;
|
|
142
|
+
export {};
|
|
@@ -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 './
|
|
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,9 +1,10 @@
|
|
|
1
|
-
export declare function getBudgetType():
|
|
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;
|
|
5
5
|
range: string[];
|
|
6
6
|
};
|
|
7
|
+
export declare function createCategory(cat: any, sheetName: any, prevSheetName: any, start: any, end: any): void;
|
|
7
8
|
export declare function triggerBudgetChanges(oldValues: any, newValues: any): void;
|
|
8
9
|
export declare function doTransfer(categoryIds: any, transferId: any): Promise<void>;
|
|
9
10
|
export declare function createBudget(months: any): Promise<void>;
|
|
@@ -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
|
-
|
|
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 {};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare function createBlankCategory(cat: any, months: any): void;
|
|
2
2
|
export declare function createCategory(cat: any, sheetName: any, prevSheetName: any): void;
|
|
3
|
+
export declare function createCategoryGroup(group: any, sheetName: any): void;
|
|
3
4
|
export declare function createSummary(groups: any, categories: any, prevSheetName: any, sheetName: any): void;
|
|
4
5
|
export declare function createBudget(meta: any, categories: any, months: any): void;
|
|
6
|
+
export declare function handleCategoryChange(months: any, oldValue: any, newValue: any): void;
|
|
7
|
+
export declare function handleCategoryGroupChange(months: any, oldValue: any, newValue: any): void;
|
|
@@ -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 {};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export declare function createCategory(cat: any, sheetName: any, prevSheetName: any): Promise<void>;
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function createCategoryGroup(group: any, sheetName: any): void;
|
|
3
|
+
export declare function createSummary(groups: any, sheetName: any): void;
|
|
4
|
+
export declare function handleCategoryChange(months: any, oldValue: any, newValue: any): void;
|
|
5
|
+
export declare function handleCategoryGroupChange(months: any, oldValue: any, newValue: any): void;
|
|
@@ -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
|
-
|
|
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?: {
|
|
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
|
-
|
|
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?: {
|
|
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?: {
|
|
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 {
|