@taskmagic/apps-actualbudget 0.0.3
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/README.md +7 -0
- package/package.json +40 -0
- package/src/index.d.ts +12 -0
- package/src/index.js +54 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/get-accounts.d.ts +6 -0
- package/src/lib/actions/get-accounts.js +24 -0
- package/src/lib/actions/get-accounts.js.map +1 -0
- package/src/lib/actions/get-budget.d.ts +9 -0
- package/src/lib/actions/get-budget.js +41 -0
- package/src/lib/actions/get-budget.js.map +1 -0
- package/src/lib/actions/get-categories.d.ts +6 -0
- package/src/lib/actions/get-categories.js +24 -0
- package/src/lib/actions/get-categories.js.map +1 -0
- package/src/lib/actions/import-transaction.d.ts +17 -0
- package/src/lib/actions/import-transaction.js +88 -0
- package/src/lib/actions/import-transaction.js.map +1 -0
- package/src/lib/actions/import-transactions.d.ts +9 -0
- package/src/lib/actions/import-transactions.js +36 -0
- package/src/lib/actions/import-transactions.js.map +1 -0
- package/src/lib/common/common.d.ts +4 -0
- package/src/lib/common/common.js +82 -0
- package/src/lib/common/common.js.map +1 -0
- package/src/lib/common/models.d.ts +14 -0
- package/src/lib/common/models.js +3 -0
- package/src/lib/common/models.js.map +1 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@taskmagic/apps-actualbudget",
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@actual-app/api": "25.3.1",
|
|
6
|
+
"@sinclair/typebox": "0.34.11",
|
|
7
|
+
"deepmerge-ts": "7.1.0",
|
|
8
|
+
"nanoid": "3.3.8",
|
|
9
|
+
"semver": "7.6.0",
|
|
10
|
+
"@taskmagic/pieces-framework": "0.7.46",
|
|
11
|
+
"@taskmagic/shared": "0.10.171",
|
|
12
|
+
"tslib": "1.14.1"
|
|
13
|
+
},
|
|
14
|
+
"overrides": {
|
|
15
|
+
"cross-spawn": "7.0.6",
|
|
16
|
+
"elliptic": "^6.6.1",
|
|
17
|
+
"fast-xml-parser": "^4.4.1",
|
|
18
|
+
"protobufjs": "^7.5.5",
|
|
19
|
+
"tmp": "^0.2.4",
|
|
20
|
+
"koa": "^2.16.4",
|
|
21
|
+
"picomatch": "^4.0.4",
|
|
22
|
+
"langsmith": "^0.6.0",
|
|
23
|
+
"serialize-javascript": "^6.0.2",
|
|
24
|
+
"elevenlabs": {
|
|
25
|
+
"form-data": "^4.0.4"
|
|
26
|
+
},
|
|
27
|
+
"@tryfabric/martian": {
|
|
28
|
+
"@notionhq/client": "$@notionhq/client"
|
|
29
|
+
},
|
|
30
|
+
"vite": {
|
|
31
|
+
"rollup": "npm:@rollup/wasm-node@^4.61.1"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"resolutions": {
|
|
35
|
+
"rollup": "npm:@rollup/wasm-node@^4.61.1"
|
|
36
|
+
},
|
|
37
|
+
"types": "./src/index.d.ts",
|
|
38
|
+
"main": "./src/index.js",
|
|
39
|
+
"type": "commonjs"
|
|
40
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const actualBudgetAuth: import("@taskmagic/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
server_url: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
password: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
sync_id: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
encryption_password: import("@taskmagic/pieces-framework").SecretTextProperty<false>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const actualbudget: import("@taskmagic/pieces-framework").Piece<import("@taskmagic/pieces-framework").CustomAuthProperty<{
|
|
8
|
+
server_url: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
|
|
9
|
+
password: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
10
|
+
sync_id: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
11
|
+
encryption_password: import("@taskmagic/pieces-framework").SecretTextProperty<false>;
|
|
12
|
+
}>>;
|
package/src/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.actualbudget = exports.actualBudgetAuth = void 0;
|
|
4
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
5
|
+
const get_budget_1 = require("./lib/actions/get-budget");
|
|
6
|
+
const import_transaction_1 = require("./lib/actions/import-transaction");
|
|
7
|
+
const get_categories_1 = require("./lib/actions/get-categories");
|
|
8
|
+
const import_transactions_1 = require("./lib/actions/import-transactions");
|
|
9
|
+
const get_accounts_1 = require("./lib/actions/get-accounts");
|
|
10
|
+
const shared_1 = require("@taskmagic/shared");
|
|
11
|
+
exports.actualBudgetAuth = pieces_framework_1.PieceAuth.CustomAuth({
|
|
12
|
+
description: 'Enter authentication details',
|
|
13
|
+
props: {
|
|
14
|
+
server_url: pieces_framework_1.Property.ShortText({
|
|
15
|
+
displayName: 'Server URL',
|
|
16
|
+
description: 'This is the URL of your running server',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
password: pieces_framework_1.PieceAuth.SecretText({
|
|
20
|
+
displayName: 'Password',
|
|
21
|
+
description: 'This is the password you use to log into the server',
|
|
22
|
+
required: true,
|
|
23
|
+
}),
|
|
24
|
+
sync_id: pieces_framework_1.PieceAuth.SecretText({
|
|
25
|
+
displayName: 'Sync ID',
|
|
26
|
+
description: 'This is the ID from Settings → Show advanced settings → Sync ID',
|
|
27
|
+
required: true,
|
|
28
|
+
}),
|
|
29
|
+
encryption_password: pieces_framework_1.PieceAuth.SecretText({
|
|
30
|
+
displayName: 'End-to-end encryption password',
|
|
31
|
+
description: 'if you have end-to-end encryption enabled',
|
|
32
|
+
required: false,
|
|
33
|
+
}),
|
|
34
|
+
},
|
|
35
|
+
required: true,
|
|
36
|
+
});
|
|
37
|
+
exports.actualbudget = (0, pieces_framework_1.createPiece)({
|
|
38
|
+
displayName: 'Actual Budget',
|
|
39
|
+
description: 'Personal finance app',
|
|
40
|
+
auth: exports.actualBudgetAuth,
|
|
41
|
+
minimumSupportedRelease: '0.30.0',
|
|
42
|
+
logoUrl: 'https://cdn.activepieces.com/pieces/actualbudget.png',
|
|
43
|
+
categories: [shared_1.PieceCategory.ACCOUNTING],
|
|
44
|
+
authors: ['hugh-codes'],
|
|
45
|
+
actions: [
|
|
46
|
+
get_budget_1.getBudget,
|
|
47
|
+
import_transaction_1.importTransaction,
|
|
48
|
+
import_transactions_1.importTransactions,
|
|
49
|
+
get_categories_1.getCategories,
|
|
50
|
+
get_accounts_1.getAccounts,
|
|
51
|
+
],
|
|
52
|
+
triggers: [],
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/actualbudget/src/index.ts"],"names":[],"mappings":";;;AAAA,kEAIqC;AACrC,yDAAqD;AACrD,yEAAqE;AACrE,iEAA6D;AAC7D,2EAAuE;AACvE,6DAAyD;AACzD,8CAAkD;AAErC,QAAA,gBAAgB,GAAG,4BAAS,CAAC,UAAU,CAAC;IACnD,WAAW,EAAE,8BAA8B;IAC3C,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC7B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,qDAAqD;YAClE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC5B,WAAW,EAAE,SAAS;YACtB,WAAW,EACT,iEAAiE;YACnE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,mBAAmB,EAAE,4BAAS,CAAC,UAAU,CAAC;YACxC,WAAW,EAAE,gCAAgC;YAC7C,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACD,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEU,QAAA,YAAY,GAAG,IAAA,8BAAW,EAAC;IACtC,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,sBAAsB;IACnC,IAAI,EAAE,wBAAgB;IACtB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,sDAAsD;IAC/D,UAAU,EAAE,CAAC,sBAAa,CAAC,UAAU,CAAC;IACtC,OAAO,EAAE,CAAC,YAAY,CAAC;IAEvB,OAAO,EAAE;QACP,sBAAS;QACT,sCAAiB;QACjB,wCAAkB;QAClB,8BAAa;QACb,0BAAW;KACZ;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const getAccounts: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
server_url: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
password: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
sync_id: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
encryption_password: import("@taskmagic/pieces-framework").SecretTextProperty<false>;
|
|
6
|
+
}>, {}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAccounts = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const __1 = require("../..");
|
|
6
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
7
|
+
const api = tslib_1.__importStar(require("@actual-app/api"));
|
|
8
|
+
const common_1 = require("../common/common");
|
|
9
|
+
exports.getAccounts = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.actualBudgetAuth,
|
|
11
|
+
name: 'get_accounts',
|
|
12
|
+
displayName: 'Get Accounts',
|
|
13
|
+
description: 'Get your accounts',
|
|
14
|
+
props: {},
|
|
15
|
+
run(context) {
|
|
16
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
yield (0, common_1.initializeAndDownloadBudget)(api, context.auth);
|
|
18
|
+
const accounts = yield api.getAccounts();
|
|
19
|
+
yield api.shutdown();
|
|
20
|
+
return accounts;
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=get-accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-accounts.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/actualbudget/src/lib/actions/get-accounts.ts"],"names":[],"mappings":";;;;AAAA,6BAAyC;AACzC,kEAA2D;AAC3D,6DAAuC;AACvC,6CAA+D;AAGlD,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,oBAAgB;IACtB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,mBAAmB;IAChC,KAAK,EAAE,EAAE;IACH,GAAG,CAAC,OAAO;;YACf,MAAM,IAAA,oCAA2B,EAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;YACpD,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,WAAW,EAAE,CAAC;YACzC,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;YACrB,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const getBudget: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
server_url: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
password: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
sync_id: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
encryption_password: import("@taskmagic/pieces-framework").SecretTextProperty<false>;
|
|
6
|
+
}>, {
|
|
7
|
+
month: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, true>;
|
|
8
|
+
year: import("@taskmagic/pieces-framework").StaticDropdownProperty<string, true>;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBudget = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const __1 = require("../..");
|
|
6
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
7
|
+
const api = tslib_1.__importStar(require("@actual-app/api"));
|
|
8
|
+
const common_1 = require("../common/common");
|
|
9
|
+
exports.getBudget = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.actualBudgetAuth,
|
|
11
|
+
name: 'get_budget',
|
|
12
|
+
displayName: 'Get Budget',
|
|
13
|
+
description: 'Get your monthly budget',
|
|
14
|
+
props: {
|
|
15
|
+
month: pieces_framework_1.Property.StaticDropdown({
|
|
16
|
+
displayName: 'Month',
|
|
17
|
+
description: 'The month of the budget you want to get',
|
|
18
|
+
required: true,
|
|
19
|
+
options: {
|
|
20
|
+
options: (0, common_1.getMonths)()
|
|
21
|
+
}
|
|
22
|
+
}),
|
|
23
|
+
year: pieces_framework_1.Property.StaticDropdown({
|
|
24
|
+
displayName: 'Year',
|
|
25
|
+
description: 'The year of the budget you want to get',
|
|
26
|
+
required: true,
|
|
27
|
+
options: {
|
|
28
|
+
options: (0, common_1.getYears)()
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
},
|
|
32
|
+
run(context) {
|
|
33
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
yield (0, common_1.initializeAndDownloadBudget)(api, context.auth);
|
|
35
|
+
const budget = yield api.getBudgetMonth(`${context.propsValue.year}-${context.propsValue.month}`);
|
|
36
|
+
yield api.shutdown();
|
|
37
|
+
return budget;
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=get-budget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-budget.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/actualbudget/src/lib/actions/get-budget.ts"],"names":[],"mappings":";;;;AAAA,6BAAyC;AACzC,kEAAqE;AACrE,6DAAuC;AACvC,6CAAoF;AAGvE,QAAA,SAAS,GAAG,IAAA,+BAAY,EAAC;IACpC,IAAI,EAAE,oBAAgB;IACtB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,yBAAyB;IACtC,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC7B,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,IAAA,kBAAS,GAAE;aACnB;SACJ,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC5B,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,IAAA,iBAAQ,GAAE;aACpB;SACF,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,IAAA,oCAA2B,EAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;YACpD,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC;YAClG,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;YACrB,OAAO,MAAM,CAAC;QAChB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const getCategories: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
server_url: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
password: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
sync_id: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
encryption_password: import("@taskmagic/pieces-framework").SecretTextProperty<false>;
|
|
6
|
+
}>, {}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCategories = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const __1 = require("../..");
|
|
6
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
7
|
+
const api = tslib_1.__importStar(require("@actual-app/api"));
|
|
8
|
+
const common_1 = require("../common/common");
|
|
9
|
+
exports.getCategories = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.actualBudgetAuth,
|
|
11
|
+
name: 'get_categories',
|
|
12
|
+
displayName: 'Get Categories',
|
|
13
|
+
description: 'Get your categories',
|
|
14
|
+
props: {},
|
|
15
|
+
run(context) {
|
|
16
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
yield (0, common_1.initializeAndDownloadBudget)(api, context.auth);
|
|
18
|
+
const categories = yield api.getCategories();
|
|
19
|
+
yield api.shutdown();
|
|
20
|
+
return categories;
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=get-categories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-categories.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/actualbudget/src/lib/actions/get-categories.ts"],"names":[],"mappings":";;;;AAAA,6BAAyC;AACzC,kEAA2D;AAC3D,6DAAuC;AACvC,6CAA+D;AAGlD,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,oBAAgB;IACtB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,qBAAqB;IAClC,KAAK,EAAE,EAAE;IACH,GAAG,CAAC,OAAO;;YACf,MAAM,IAAA,oCAA2B,EAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;YACpD,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,aAAa,EAAE,CAAC;YAC7C,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;YACrB,OAAO,UAAU,CAAC;QACpB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const importTransaction: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
server_url: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
password: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
sync_id: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
encryption_password: import("@taskmagic/pieces-framework").SecretTextProperty<false>;
|
|
6
|
+
}>, {
|
|
7
|
+
account_id: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
|
|
8
|
+
date: import("@taskmagic/pieces-framework").DateTimeProperty<true>;
|
|
9
|
+
payee_name: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
|
|
10
|
+
amount: import("@taskmagic/pieces-framework").NumberProperty<false>;
|
|
11
|
+
category: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
|
|
12
|
+
notes: import("@taskmagic/pieces-framework").LongTextProperty<false>;
|
|
13
|
+
imported_id: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
|
|
14
|
+
transfer_id: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
|
|
15
|
+
cleared: import("@taskmagic/pieces-framework").CheckboxProperty<false>;
|
|
16
|
+
imported_payee: import("@taskmagic/pieces-framework").ShortTextProperty<false>;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.importTransaction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const __1 = require("../..");
|
|
6
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
7
|
+
const api = tslib_1.__importStar(require("@actual-app/api"));
|
|
8
|
+
const common_1 = require("../common/common");
|
|
9
|
+
exports.importTransaction = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.actualBudgetAuth,
|
|
11
|
+
name: 'import_transaction',
|
|
12
|
+
displayName: 'Import Transaction',
|
|
13
|
+
description: 'Add a transaction',
|
|
14
|
+
props: {
|
|
15
|
+
account_id: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Account ID',
|
|
17
|
+
description: 'ID of the account you want to import a transaction to',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
date: pieces_framework_1.Property.DateTime({
|
|
21
|
+
displayName: 'Date',
|
|
22
|
+
description: 'Date the transaction took place',
|
|
23
|
+
required: true,
|
|
24
|
+
}),
|
|
25
|
+
payee_name: pieces_framework_1.Property.ShortText({
|
|
26
|
+
displayName: 'Payee Name',
|
|
27
|
+
description: 'Name of the payee',
|
|
28
|
+
required: false,
|
|
29
|
+
}),
|
|
30
|
+
amount: pieces_framework_1.Property.Number({
|
|
31
|
+
displayName: 'Amount',
|
|
32
|
+
description: 'The dollar value of the transaction',
|
|
33
|
+
required: false,
|
|
34
|
+
}),
|
|
35
|
+
category: pieces_framework_1.Property.ShortText({
|
|
36
|
+
displayName: 'Category ID',
|
|
37
|
+
description: 'ID of the transaction category',
|
|
38
|
+
required: false,
|
|
39
|
+
}),
|
|
40
|
+
notes: pieces_framework_1.Property.LongText({
|
|
41
|
+
displayName: 'Notes',
|
|
42
|
+
description: 'Additional notes about the transaction',
|
|
43
|
+
required: false,
|
|
44
|
+
}),
|
|
45
|
+
imported_id: pieces_framework_1.Property.ShortText({
|
|
46
|
+
displayName: 'Imported ID',
|
|
47
|
+
description: 'Unique ID given by the bank for importing',
|
|
48
|
+
required: false,
|
|
49
|
+
}),
|
|
50
|
+
transfer_id: pieces_framework_1.Property.ShortText({
|
|
51
|
+
displayName: 'Transfer ID',
|
|
52
|
+
description: 'ID of the transaction in the other account for the transfer',
|
|
53
|
+
required: false,
|
|
54
|
+
}),
|
|
55
|
+
cleared: pieces_framework_1.Property.Checkbox({
|
|
56
|
+
displayName: 'Cleared',
|
|
57
|
+
description: 'Flag indicating if the transaction has cleared or not',
|
|
58
|
+
required: false,
|
|
59
|
+
}),
|
|
60
|
+
imported_payee: pieces_framework_1.Property.ShortText({
|
|
61
|
+
displayName: 'Imported Payee',
|
|
62
|
+
description: 'Raw description when importing, representing the original value',
|
|
63
|
+
required: false,
|
|
64
|
+
}),
|
|
65
|
+
},
|
|
66
|
+
run(_a) {
|
|
67
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue: { account_id, payee_name, date, amount, category, notes, imported_id, transfer_id, cleared, imported_payee } }) {
|
|
68
|
+
const formattedDate = new Date(date).toISOString().split('T')[0];
|
|
69
|
+
const transaction = {
|
|
70
|
+
payee_name,
|
|
71
|
+
date: formattedDate,
|
|
72
|
+
amount: amount !== undefined ? api.utils.amountToInteger(amount) : undefined,
|
|
73
|
+
category,
|
|
74
|
+
account: account_id,
|
|
75
|
+
notes,
|
|
76
|
+
imported_id,
|
|
77
|
+
transfer_id,
|
|
78
|
+
cleared,
|
|
79
|
+
imported_payee,
|
|
80
|
+
};
|
|
81
|
+
yield (0, common_1.initializeAndDownloadBudget)(api, auth);
|
|
82
|
+
const res = yield api.importTransactions(account_id, [transaction]);
|
|
83
|
+
yield api.shutdown();
|
|
84
|
+
return res;
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=import-transaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-transaction.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/actualbudget/src/lib/actions/import-transaction.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const importTransactions: import("@taskmagic/pieces-framework").IAction<import("@taskmagic/pieces-framework").CustomAuthProperty<{
|
|
2
|
+
server_url: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
|
|
3
|
+
password: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
sync_id: import("@taskmagic/pieces-framework").SecretTextProperty<true>;
|
|
5
|
+
encryption_password: import("@taskmagic/pieces-framework").SecretTextProperty<false>;
|
|
6
|
+
}>, {
|
|
7
|
+
account_id: import("@taskmagic/pieces-framework").ShortTextProperty<true>;
|
|
8
|
+
transactions: import("@taskmagic/pieces-framework").JsonProperty<true>;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.importTransactions = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const __1 = require("../..");
|
|
6
|
+
const pieces_framework_1 = require("@taskmagic/pieces-framework");
|
|
7
|
+
const api = tslib_1.__importStar(require("@actual-app/api"));
|
|
8
|
+
const common_1 = require("../common/common");
|
|
9
|
+
exports.importTransactions = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.actualBudgetAuth,
|
|
11
|
+
name: 'import_transactions',
|
|
12
|
+
displayName: 'Import Transactions',
|
|
13
|
+
description: 'Import Transactions',
|
|
14
|
+
props: {
|
|
15
|
+
account_id: pieces_framework_1.Property.ShortText({
|
|
16
|
+
displayName: 'Account ID',
|
|
17
|
+
description: 'ID of the account you want to import a transaction to',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
transactions: pieces_framework_1.Property.Json({
|
|
21
|
+
displayName: 'Transactions',
|
|
22
|
+
description: 'A json array of the transaction object',
|
|
23
|
+
required: true,
|
|
24
|
+
defaultValue: [{ "payee_name": "Kroger", "date": "2026-12-25", "amount": 1200 }]
|
|
25
|
+
})
|
|
26
|
+
},
|
|
27
|
+
run(_a) {
|
|
28
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue: { account_id, transactions } }) {
|
|
29
|
+
yield (0, common_1.initializeAndDownloadBudget)(api, auth);
|
|
30
|
+
const res = yield api.importTransactions(account_id, transactions);
|
|
31
|
+
yield api.shutdown();
|
|
32
|
+
return res;
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=import-transactions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-transactions.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/actualbudget/src/lib/actions/import-transactions.ts"],"names":[],"mappings":";;;;AAAA,6BAAyC;AACzC,kEAAqE;AACrE,6DAAuC;AACvC,6CAA+D;AAElD,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,oBAAgB;IACtB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,qBAAqB;IAClC,KAAK,EAAE;QACL,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,uDAAuD;YACpE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,IAAI,CAAC;YACxB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,CAAC,EAAC,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAClF,CAAC;KACH;IAEK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,EAAE;YAC1D,MAAM,IAAA,oCAA2B,EAAC,GAAG,EAAE,IAAI,CAAC,CAAA;YAC5C,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,kBAAkB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;YACnE,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;YACrB,OAAO,GAAG,CAAC;QACb,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DropdownOption } from '@taskmagic/pieces-framework';
|
|
2
|
+
export declare function initializeAndDownloadBudget(api: any, auth: any): Promise<void>;
|
|
3
|
+
export declare function getYears(): DropdownOption<string>[];
|
|
4
|
+
export declare function getMonths(): DropdownOption<string>[];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initializeAndDownloadBudget = initializeAndDownloadBudget;
|
|
4
|
+
exports.getYears = getYears;
|
|
5
|
+
exports.getMonths = getMonths;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const os_1 = tslib_1.__importDefault(require("os"));
|
|
8
|
+
function initializeAndDownloadBudget(api, auth) {
|
|
9
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
var _a;
|
|
11
|
+
yield api.init({
|
|
12
|
+
// Budget data will be cached locally here, in subdirectories for each file.
|
|
13
|
+
dataDir: os_1.default.tmpdir(),
|
|
14
|
+
serverURL: auth.server_url,
|
|
15
|
+
password: auth.password,
|
|
16
|
+
});
|
|
17
|
+
yield api.downloadBudget(auth.sync_id, { password: (_a = auth.encryption_password) !== null && _a !== void 0 ? _a : undefined });
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
function getYears() {
|
|
21
|
+
const dropDownOptions = [];
|
|
22
|
+
const currentDate = new Date();
|
|
23
|
+
const currentYear = currentDate.getFullYear();
|
|
24
|
+
const startYear = currentYear - 10;
|
|
25
|
+
for (let year = startYear; year <= currentYear + 5; year++) {
|
|
26
|
+
dropDownOptions.push({ label: year.toString(), value: year.toString() });
|
|
27
|
+
}
|
|
28
|
+
return dropDownOptions;
|
|
29
|
+
}
|
|
30
|
+
function getMonths() {
|
|
31
|
+
return [
|
|
32
|
+
{
|
|
33
|
+
label: 'January',
|
|
34
|
+
value: '01'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: 'February',
|
|
38
|
+
value: '02'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: 'March',
|
|
42
|
+
value: '03'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: 'April',
|
|
46
|
+
value: '04'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: 'May',
|
|
50
|
+
value: '05'
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: 'June',
|
|
54
|
+
value: '06'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: 'July',
|
|
58
|
+
value: '07'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: 'August',
|
|
62
|
+
value: '08'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: 'September',
|
|
66
|
+
value: '09'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: 'October',
|
|
70
|
+
value: '10'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: 'November',
|
|
74
|
+
value: '11'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: 'December',
|
|
78
|
+
value: '12'
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/actualbudget/src/lib/common/common.ts"],"names":[],"mappings":";;AAGA,kEASC;AAED,4BAYC;AAED,8BAmDC;;AA9ED,oDAAoB;AAEpB,SAAsB,2BAA2B,CAAC,GAAQ,EAAE,IAAS;;;QACjE,MAAM,GAAG,CAAC,IAAI,CAAC;YACb,4EAA4E;YAC5E,OAAO,EAAE,YAAE,CAAC,MAAM,EAAE;YACpB,SAAS,EAAE,IAAI,CAAC,UAAU;YAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC;QAEH,MAAM,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAA,IAAI,CAAC,mBAAmB,mCAAI,SAAS,EAAE,CAAC,CAAC;IAChG,CAAC;CAAA;AAED,SAAgB,QAAQ;IACtB,MAAM,eAAe,GAA6B,EAAE,CAAC;IAErD,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;IAC/B,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;IAC9C,MAAM,SAAS,GAAG,WAAW,GAAC,EAAE,CAAC;IAEjC,KAAK,IAAI,IAAI,GAAG,SAAS,EAAE,IAAI,IAAI,WAAW,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC;QAC3D,eAAe,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,SAAgB,SAAS;IACvB,OAAO;QACL;YACE,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,IAAI;SACZ;QACD;YACE,KAAK,EAAE,UAAU;YACjB,KAAK,EAAE,IAAI;SACZ;QACD;YACE,KAAK,EAAE,OAAO;YACd,KAAK,EAAE,IAAI;SACZ;QACD;YACE,KAAK,EAAE,OAAO;YACd,KAAK,EAAE,IAAI;SACZ;QACD;YACE,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,IAAI;SACZ;QACD;YACE,KAAK,EAAE,MAAM;YACb,KAAK,EAAE,IAAI;SACZ;QACD;YACE,KAAK,EAAE,MAAM;YACb,KAAK,EAAE,IAAI;SACZ;QACD;YACE,KAAK,EAAE,QAAQ;YACf,KAAK,EAAE,IAAI;SACZ;QACD;YACE,KAAK,EAAE,WAAW;YAClB,KAAK,EAAE,IAAI;SACZ;QACD;YACE,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,IAAI;SACZ;QACD;YACE,KAAK,EAAE,UAAU;YACjB,KAAK,EAAE,IAAI;SACZ;QACD;YACE,KAAK,EAAE,UAAU;YACjB,KAAK,EAAE,IAAI;SACZ;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Transaction {
|
|
2
|
+
id?: string;
|
|
3
|
+
account?: string;
|
|
4
|
+
date: string;
|
|
5
|
+
amount?: number;
|
|
6
|
+
payee?: string;
|
|
7
|
+
payee_name?: string;
|
|
8
|
+
imported_payee?: string;
|
|
9
|
+
category?: string;
|
|
10
|
+
notes?: string;
|
|
11
|
+
imported_id?: string;
|
|
12
|
+
transfer_id?: string;
|
|
13
|
+
cleared?: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/actualbudget/src/lib/common/models.ts"],"names":[],"mappings":""}
|