bkper 4.0.2 → 4.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.
- package/CHANGELOG.md +4 -1
- package/README.md +52 -4
- package/lib/auth/local-auth-service.d.ts +12 -0
- package/lib/auth/local-auth-service.d.ts.map +1 -1
- package/lib/auth/local-auth-service.js +12 -0
- package/lib/auth/local-auth-service.js.map +1 -1
- package/lib/cli.js +19 -949
- package/lib/cli.js.map +1 -1
- package/lib/commands/accounts/batch-create.d.ts +10 -0
- package/lib/commands/accounts/batch-create.d.ts.map +1 -0
- package/lib/commands/accounts/batch-create.js +74 -0
- package/lib/commands/accounts/batch-create.js.map +1 -0
- package/lib/commands/accounts/create.d.ts +17 -0
- package/lib/commands/accounts/create.d.ts.map +1 -1
- package/lib/commands/accounts/create.js +8 -0
- package/lib/commands/accounts/create.js.map +1 -1
- package/lib/commands/accounts/delete.d.ts +8 -0
- package/lib/commands/accounts/delete.d.ts.map +1 -1
- package/lib/commands/accounts/delete.js +8 -0
- package/lib/commands/accounts/delete.js.map +1 -1
- package/lib/commands/accounts/get.d.ts +8 -0
- package/lib/commands/accounts/get.d.ts.map +1 -1
- package/lib/commands/accounts/get.js +8 -0
- package/lib/commands/accounts/get.js.map +1 -1
- package/lib/commands/accounts/index.d.ts +2 -1
- package/lib/commands/accounts/index.d.ts.map +1 -1
- package/lib/commands/accounts/index.js +2 -1
- package/lib/commands/accounts/index.js.map +1 -1
- package/lib/commands/accounts/list.d.ts +12 -0
- package/lib/commands/accounts/list.d.ts.map +1 -1
- package/lib/commands/accounts/list.js +25 -0
- package/lib/commands/accounts/list.js.map +1 -1
- package/lib/commands/accounts/register.d.ts +3 -0
- package/lib/commands/accounts/register.d.ts.map +1 -0
- package/lib/commands/accounts/register.js +96 -0
- package/lib/commands/accounts/register.js.map +1 -0
- package/lib/commands/accounts/update.d.ts +18 -0
- package/lib/commands/accounts/update.d.ts.map +1 -1
- package/lib/commands/accounts/update.js +10 -0
- package/lib/commands/accounts/update.js.map +1 -1
- package/lib/commands/action.d.ts +21 -0
- package/lib/commands/action.d.ts.map +1 -0
- package/lib/commands/action.js +36 -0
- package/lib/commands/action.js.map +1 -0
- package/lib/commands/apps/index.d.ts +1 -1
- package/lib/commands/apps/index.d.ts.map +1 -1
- package/lib/commands/apps/index.js +1 -1
- package/lib/commands/apps/index.js.map +1 -1
- package/lib/commands/apps/install.d.ts +7 -0
- package/lib/commands/apps/install.d.ts.map +1 -1
- package/lib/commands/apps/install.js +7 -0
- package/lib/commands/apps/install.js.map +1 -1
- package/lib/commands/apps/list.d.ts +6 -0
- package/lib/commands/apps/list.d.ts.map +1 -1
- package/lib/commands/apps/list.js +20 -0
- package/lib/commands/apps/list.js.map +1 -1
- package/lib/commands/apps/register.d.ts +3 -0
- package/lib/commands/apps/register.d.ts.map +1 -0
- package/lib/commands/apps/register.js +130 -0
- package/lib/commands/apps/register.js.map +1 -0
- package/lib/commands/apps/uninstall.d.ts +8 -0
- package/lib/commands/apps/uninstall.d.ts.map +1 -1
- package/lib/commands/apps/uninstall.js +8 -0
- package/lib/commands/apps/uninstall.js.map +1 -1
- package/lib/commands/balances/list.d.ts +12 -0
- package/lib/commands/balances/list.d.ts.map +1 -1
- package/lib/commands/balances/list.js +16 -1
- package/lib/commands/balances/list.js.map +1 -1
- package/lib/commands/balances/register.d.ts +3 -0
- package/lib/commands/balances/register.d.ts.map +1 -0
- package/lib/commands/balances/register.js +35 -0
- package/lib/commands/balances/register.js.map +1 -0
- package/lib/commands/books/create.d.ts +9 -0
- package/lib/commands/books/create.d.ts.map +1 -1
- package/lib/commands/books/create.js +6 -0
- package/lib/commands/books/create.js.map +1 -1
- package/lib/commands/books/get.d.ts +6 -0
- package/lib/commands/books/get.d.ts.map +1 -1
- package/lib/commands/books/get.js +6 -0
- package/lib/commands/books/get.js.map +1 -1
- package/lib/commands/books/index.d.ts +1 -1
- package/lib/commands/books/index.d.ts.map +1 -1
- package/lib/commands/books/index.js +1 -1
- package/lib/commands/books/index.js.map +1 -1
- package/lib/commands/books/list.d.ts +13 -0
- package/lib/commands/books/list.d.ts.map +1 -1
- package/lib/commands/books/list.js +43 -0
- package/lib/commands/books/list.js.map +1 -1
- package/lib/commands/books/register.d.ts +3 -0
- package/lib/commands/books/register.d.ts.map +1 -0
- package/lib/commands/books/register.js +82 -0
- package/lib/commands/books/register.js.map +1 -0
- package/lib/commands/books/update.d.ts +11 -0
- package/lib/commands/books/update.d.ts.map +1 -1
- package/lib/commands/books/update.js +8 -0
- package/lib/commands/books/update.js.map +1 -1
- package/lib/commands/cli-helpers.d.ts +15 -0
- package/lib/commands/cli-helpers.d.ts.map +1 -0
- package/lib/commands/cli-helpers.js +29 -0
- package/lib/commands/cli-helpers.js.map +1 -0
- package/lib/commands/collections/add-book.d.ts +8 -0
- package/lib/commands/collections/add-book.d.ts.map +1 -1
- package/lib/commands/collections/add-book.js +8 -0
- package/lib/commands/collections/add-book.js.map +1 -1
- package/lib/commands/collections/create.d.ts +9 -0
- package/lib/commands/collections/create.d.ts.map +1 -1
- package/lib/commands/collections/create.js +6 -0
- package/lib/commands/collections/create.js.map +1 -1
- package/lib/commands/collections/delete.d.ts +7 -0
- package/lib/commands/collections/delete.d.ts.map +1 -1
- package/lib/commands/collections/delete.js +7 -0
- package/lib/commands/collections/delete.js.map +1 -1
- package/lib/commands/collections/get.d.ts +7 -0
- package/lib/commands/collections/get.d.ts.map +1 -1
- package/lib/commands/collections/get.js +7 -0
- package/lib/commands/collections/get.js.map +1 -1
- package/lib/commands/collections/index.d.ts +1 -1
- package/lib/commands/collections/index.d.ts.map +1 -1
- package/lib/commands/collections/index.js +1 -1
- package/lib/commands/collections/index.js.map +1 -1
- package/lib/commands/collections/list.d.ts +11 -0
- package/lib/commands/collections/list.d.ts.map +1 -1
- package/lib/commands/collections/list.js +26 -0
- package/lib/commands/collections/list.js.map +1 -1
- package/lib/commands/collections/register.d.ts +3 -0
- package/lib/commands/collections/register.d.ts.map +1 -0
- package/lib/commands/collections/register.js +86 -0
- package/lib/commands/collections/register.js.map +1 -0
- package/lib/commands/collections/remove-book.d.ts +8 -0
- package/lib/commands/collections/remove-book.d.ts.map +1 -1
- package/lib/commands/collections/remove-book.js +8 -0
- package/lib/commands/collections/remove-book.js.map +1 -1
- package/lib/commands/collections/update.d.ts +11 -0
- package/lib/commands/collections/update.d.ts.map +1 -1
- package/lib/commands/collections/update.js +8 -0
- package/lib/commands/collections/update.js.map +1 -1
- package/lib/commands/groups/batch-create.d.ts +10 -0
- package/lib/commands/groups/batch-create.d.ts.map +1 -0
- package/lib/commands/groups/batch-create.js +69 -0
- package/lib/commands/groups/batch-create.js.map +1 -0
- package/lib/commands/groups/create.d.ts +8 -0
- package/lib/commands/groups/create.d.ts.map +1 -1
- package/lib/commands/groups/create.js +7 -0
- package/lib/commands/groups/create.js.map +1 -1
- package/lib/commands/groups/delete.d.ts +7 -0
- package/lib/commands/groups/delete.d.ts.map +1 -1
- package/lib/commands/groups/delete.js +7 -0
- package/lib/commands/groups/delete.js.map +1 -1
- package/lib/commands/groups/get.d.ts +7 -0
- package/lib/commands/groups/get.d.ts.map +1 -1
- package/lib/commands/groups/get.js +7 -0
- package/lib/commands/groups/get.js.map +1 -1
- package/lib/commands/groups/index.d.ts +2 -1
- package/lib/commands/groups/index.d.ts.map +1 -1
- package/lib/commands/groups/index.js +2 -1
- package/lib/commands/groups/index.js.map +1 -1
- package/lib/commands/groups/list.d.ts +12 -0
- package/lib/commands/groups/list.d.ts.map +1 -1
- package/lib/commands/groups/list.js +25 -0
- package/lib/commands/groups/list.js.map +1 -1
- package/lib/commands/groups/register.d.ts +3 -0
- package/lib/commands/groups/register.d.ts.map +1 -0
- package/lib/commands/groups/register.js +90 -0
- package/lib/commands/groups/register.js.map +1 -0
- package/lib/commands/groups/update.d.ts +9 -0
- package/lib/commands/groups/update.d.ts.map +1 -1
- package/lib/commands/groups/update.js +8 -0
- package/lib/commands/groups/update.js.map +1 -1
- package/lib/commands/transactions/batch-create.d.ts +10 -0
- package/lib/commands/transactions/batch-create.d.ts.map +1 -0
- package/lib/commands/transactions/batch-create.js +98 -0
- package/lib/commands/transactions/batch-create.js.map +1 -0
- package/lib/commands/transactions/check.d.ts +7 -0
- package/lib/commands/transactions/check.d.ts.map +1 -1
- package/lib/commands/transactions/check.js +7 -0
- package/lib/commands/transactions/check.js.map +1 -1
- package/lib/commands/transactions/create.d.ts +10 -0
- package/lib/commands/transactions/create.d.ts.map +1 -1
- package/lib/commands/transactions/create.js +8 -2
- package/lib/commands/transactions/create.js.map +1 -1
- package/lib/commands/transactions/index.d.ts +2 -1
- package/lib/commands/transactions/index.d.ts.map +1 -1
- package/lib/commands/transactions/index.js +2 -1
- package/lib/commands/transactions/index.js.map +1 -1
- package/lib/commands/transactions/list.d.ts +20 -0
- package/lib/commands/transactions/list.d.ts.map +1 -1
- package/lib/commands/transactions/list.js +38 -0
- package/lib/commands/transactions/list.js.map +1 -1
- package/lib/commands/transactions/merge.d.ts +12 -0
- package/lib/commands/transactions/merge.d.ts.map +1 -1
- package/lib/commands/transactions/merge.js +9 -0
- package/lib/commands/transactions/merge.js.map +1 -1
- package/lib/commands/transactions/post.d.ts +7 -0
- package/lib/commands/transactions/post.d.ts.map +1 -1
- package/lib/commands/transactions/post.js +7 -0
- package/lib/commands/transactions/post.js.map +1 -1
- package/lib/commands/transactions/register.d.ts +3 -0
- package/lib/commands/transactions/register.d.ts.map +1 -0
- package/lib/commands/transactions/register.js +146 -0
- package/lib/commands/transactions/register.js.map +1 -0
- package/lib/commands/transactions/trash.d.ts +7 -0
- package/lib/commands/transactions/trash.d.ts.map +1 -1
- package/lib/commands/transactions/trash.js +7 -0
- package/lib/commands/transactions/trash.js.map +1 -1
- package/lib/commands/transactions/update.d.ts +11 -0
- package/lib/commands/transactions/update.d.ts.map +1 -1
- package/lib/commands/transactions/update.js +8 -0
- package/lib/commands/transactions/update.js.map +1 -1
- package/lib/input/csv-parser.d.ts +9 -0
- package/lib/input/csv-parser.d.ts.map +1 -0
- package/lib/input/csv-parser.js +110 -0
- package/lib/input/csv-parser.js.map +1 -0
- package/lib/input/format-detector.d.ts +12 -0
- package/lib/input/format-detector.d.ts.map +1 -0
- package/lib/input/format-detector.js +14 -0
- package/lib/input/format-detector.js.map +1 -0
- package/lib/input/index.d.ts +9 -0
- package/lib/input/index.d.ts.map +1 -0
- package/lib/input/index.js +40 -0
- package/lib/input/index.js.map +1 -0
- package/lib/input/stdin-reader.d.ts +8 -0
- package/lib/input/stdin-reader.d.ts.map +1 -0
- package/lib/input/stdin-reader.js +37 -0
- package/lib/input/stdin-reader.js.map +1 -0
- package/lib/render/csv-formatter.d.ts +15 -0
- package/lib/render/csv-formatter.d.ts.map +1 -0
- package/lib/render/csv-formatter.js +37 -0
- package/lib/render/csv-formatter.js.map +1 -0
- package/lib/render/index.d.ts +3 -1
- package/lib/render/index.d.ts.map +1 -1
- package/lib/render/index.js +2 -1
- package/lib/render/index.js.map +1 -1
- package/lib/render/output.d.ts +27 -6
- package/lib/render/output.d.ts.map +1 -1
- package/lib/render/output.js +35 -12
- package/lib/render/output.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { Group } from 'bkper-js';
|
|
2
|
+
/** Options for updating an existing group in a book. */
|
|
2
3
|
export interface UpdateGroupOptions {
|
|
3
4
|
name?: string;
|
|
4
5
|
hidden?: boolean;
|
|
5
6
|
property?: string[];
|
|
6
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Updates an existing group in the specified book.
|
|
10
|
+
*
|
|
11
|
+
* @param bookId - The ID of the book containing the group
|
|
12
|
+
* @param groupIdOrName - The ID or name of the group to update
|
|
13
|
+
* @param options - Fields to update on the group
|
|
14
|
+
* @returns The updated Group
|
|
15
|
+
*/
|
|
7
16
|
export declare function updateGroup(bookId: string, groupIdOrName: string, options: UpdateGroupOptions): Promise<Group>;
|
|
8
17
|
//# sourceMappingURL=update.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/groups/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,MAAM,WAAW,kBAAkB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAsB,WAAW,CAC7B,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,kBAAkB,GAC5B,OAAO,CAAC,KAAK,CAAC,CA+BhB"}
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/groups/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,wDAAwD;AACxD,MAAM,WAAW,kBAAkB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC7B,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,kBAAkB,GAC5B,OAAO,CAAC,KAAK,CAAC,CA+BhB"}
|
|
@@ -10,6 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { getBkperInstance } from '../../bkper-factory.js';
|
|
11
11
|
import { parsePropertyFlag } from '../../utils/properties.js';
|
|
12
12
|
import { throwIfErrors } from '../../utils/validation.js';
|
|
13
|
+
/**
|
|
14
|
+
* Updates an existing group in the specified book.
|
|
15
|
+
*
|
|
16
|
+
* @param bookId - The ID of the book containing the group
|
|
17
|
+
* @param groupIdOrName - The ID or name of the group to update
|
|
18
|
+
* @param options - Fields to update on the group
|
|
19
|
+
* @returns The updated Group
|
|
20
|
+
*/
|
|
13
21
|
export function updateGroup(bookId, groupIdOrName, options) {
|
|
14
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
15
23
|
const bkper = getBkperInstance();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/groups/update.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/groups/update.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAS1D;;;;;;;GAOG;AACH,MAAM,UAAgB,WAAW,CAC7B,MAAc,EACd,aAAqB,EACrB,OAA2B;;QAE3B,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,MAAM,IAAI,KAAK,CAAC,oBAAoB,aAAa,EAAE,CAAC,CAAC;QACzD,CAAC;QAED,MAAM,MAAM,GAAa,EAAE,CAAC;QAE5B,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;YAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC5D,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS;YAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAElE,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACnB,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACjC,IAAI,CAAC;oBACD,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;oBAC5C,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;wBACf,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;oBAC9B,CAAC;yBAAM,CAAC;wBACJ,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;oBAClC,CAAC;gBACL,CAAC;gBAAC,OAAO,GAAY,EAAE,CAAC;oBACpB,MAAM,CAAC,IAAI,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;gBACxC,CAAC;YACL,CAAC;QACL,CAAC;QAED,aAAa,CAAC,MAAM,CAAC,CAAC;QAEtB,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;IAC1B,CAAC;CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates multiple transactions from stdin items using the batch API.
|
|
3
|
+
* Outputs NDJSON (one JSON object per line) as each chunk completes.
|
|
4
|
+
*
|
|
5
|
+
* @param bookId - Target book ID
|
|
6
|
+
* @param items - Parsed stdin items (field-value maps)
|
|
7
|
+
* @param propertyOverrides - CLI --property flags that override stdin fields
|
|
8
|
+
*/
|
|
9
|
+
export declare function batchCreateTransactions(bookId: string, items: Record<string, string>[], propertyOverrides?: string[]): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=batch-create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-create.d.ts","sourceRoot":"","sources":["../../../src/commands/transactions/batch-create.ts"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CACzC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAC/B,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAC7B,OAAO,CAAC,IAAI,CAAC,CA0Ef"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { getBkperInstance } from '../../bkper-factory.js';
|
|
11
|
+
import { Transaction } from 'bkper-js';
|
|
12
|
+
import { parsePropertyFlag } from '../../utils/properties.js';
|
|
13
|
+
const CHUNK_SIZE = 100;
|
|
14
|
+
/**
|
|
15
|
+
* Creates multiple transactions from stdin items using the batch API.
|
|
16
|
+
* Outputs NDJSON (one JSON object per line) as each chunk completes.
|
|
17
|
+
*
|
|
18
|
+
* @param bookId - Target book ID
|
|
19
|
+
* @param items - Parsed stdin items (field-value maps)
|
|
20
|
+
* @param propertyOverrides - CLI --property flags that override stdin fields
|
|
21
|
+
*/
|
|
22
|
+
export function batchCreateTransactions(bookId, items, propertyOverrides) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const bkper = getBkperInstance();
|
|
25
|
+
const book = yield bkper.getBook(bookId);
|
|
26
|
+
for (let i = 0; i < items.length; i += CHUNK_SIZE) {
|
|
27
|
+
const chunk = items.slice(i, i + CHUNK_SIZE);
|
|
28
|
+
const transactions = [];
|
|
29
|
+
for (const item of chunk) {
|
|
30
|
+
const tx = new Transaction(book);
|
|
31
|
+
if (item.date)
|
|
32
|
+
tx.setDate(item.date);
|
|
33
|
+
if (item.amount)
|
|
34
|
+
tx.setAmount(item.amount);
|
|
35
|
+
if (item.description)
|
|
36
|
+
tx.setDescription(item.description);
|
|
37
|
+
if (item.from) {
|
|
38
|
+
const creditAccount = yield book.getAccount(item.from);
|
|
39
|
+
if (creditAccount)
|
|
40
|
+
tx.setCreditAccount(creditAccount);
|
|
41
|
+
}
|
|
42
|
+
if (item.to) {
|
|
43
|
+
const debitAccount = yield book.getAccount(item.to);
|
|
44
|
+
if (debitAccount)
|
|
45
|
+
tx.setDebitAccount(debitAccount);
|
|
46
|
+
}
|
|
47
|
+
if (item.url) {
|
|
48
|
+
for (const u of item.url.split(',').map((s) => s.trim())) {
|
|
49
|
+
if (u)
|
|
50
|
+
tx.addUrl(u);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (item.remoteId || item['remote-id'] || item['Remote Id']) {
|
|
54
|
+
const rid = item.remoteId || item['remote-id'] || item['Remote Id'];
|
|
55
|
+
for (const r of rid.split(',').map((s) => s.trim())) {
|
|
56
|
+
if (r)
|
|
57
|
+
tx.addRemoteId(r);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Set properties from stdin fields (excluding known fields)
|
|
61
|
+
const knownFields = new Set([
|
|
62
|
+
'date',
|
|
63
|
+
'amount',
|
|
64
|
+
'description',
|
|
65
|
+
'from',
|
|
66
|
+
'to',
|
|
67
|
+
'url',
|
|
68
|
+
'remoteId',
|
|
69
|
+
'remote-id',
|
|
70
|
+
'Remote Id',
|
|
71
|
+
]);
|
|
72
|
+
for (const [key, value] of Object.entries(item)) {
|
|
73
|
+
if (!knownFields.has(key) && value !== '') {
|
|
74
|
+
tx.setProperty(key, value);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// CLI --property flags override stdin
|
|
78
|
+
if (propertyOverrides) {
|
|
79
|
+
for (const raw of propertyOverrides) {
|
|
80
|
+
const [key, value] = parsePropertyFlag(raw);
|
|
81
|
+
if (value === '') {
|
|
82
|
+
tx.deleteProperty(key);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
tx.setProperty(key, value);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
transactions.push(tx);
|
|
90
|
+
}
|
|
91
|
+
const results = yield book.batchCreateTransactions(transactions);
|
|
92
|
+
for (const result of results) {
|
|
93
|
+
console.log(JSON.stringify(result.json()));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=batch-create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-create.js","sourceRoot":"","sources":["../../../src/commands/transactions/batch-create.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,UAAU,GAAG,GAAG,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,UAAgB,uBAAuB,CACzC,MAAc,EACd,KAA+B,EAC/B,iBAA4B;;QAE5B,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC;YAChD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC;YAC7C,MAAM,YAAY,GAAkB,EAAE,CAAC;YAEvC,KAAK,MAAM,IAAI,IAAI,KAA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AAC,CAAC;YAC1B,CAAC;YAED,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC;YACjE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;gBAC3B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YAC/C,CAAC;QACL,CAAC;IACL,CAAC;CAAA"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { Transaction } from 'bkper-js';
|
|
2
|
+
/**
|
|
3
|
+
* Marks a transaction as checked (reconciled).
|
|
4
|
+
*
|
|
5
|
+
* @param bookId - The book ID containing the transaction
|
|
6
|
+
* @param transactionId - The ID of the transaction to check
|
|
7
|
+
* @returns The checked transaction
|
|
8
|
+
*/
|
|
2
9
|
export declare function checkTransaction(bookId: string, transactionId: string): Promise<Transaction>;
|
|
3
10
|
//# sourceMappingURL=check.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/commands/transactions/check.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,wBAAsB,gBAAgB,CAClC,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,WAAW,CAAC,CAQtB"}
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/commands/transactions/check.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAClC,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,GACtB,OAAO,CAAC,WAAW,CAAC,CAQtB"}
|
|
@@ -8,6 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { getBkperInstance } from '../../bkper-factory.js';
|
|
11
|
+
/**
|
|
12
|
+
* Marks a transaction as checked (reconciled).
|
|
13
|
+
*
|
|
14
|
+
* @param bookId - The book ID containing the transaction
|
|
15
|
+
* @param transactionId - The ID of the transaction to check
|
|
16
|
+
* @returns The checked transaction
|
|
17
|
+
*/
|
|
11
18
|
export function checkTransaction(bookId, transactionId) {
|
|
12
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13
20
|
const bkper = getBkperInstance();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../../src/commands/transactions/check.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,MAAM,UAAgB,gBAAgB,CAClC,MAAc,EACd,aAAqB;;QAErB,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QAC7D,IAAI,CAAC,WAAW,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,0BAA0B,aAAa,EAAE,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,WAAW,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;CAAA"}
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../../src/commands/transactions/check.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D;;;;;;GAMG;AACH,MAAM,UAAgB,gBAAgB,CAClC,MAAc,EACd,aAAqB;;QAErB,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QAC7D,IAAI,CAAC,WAAW,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,0BAA0B,aAAa,EAAE,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,WAAW,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;CAAA"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Transaction } from 'bkper-js';
|
|
2
|
+
/**
|
|
3
|
+
* Options for creating a new transaction in a book.
|
|
4
|
+
*/
|
|
2
5
|
export interface CreateTransactionOptions {
|
|
3
6
|
date: string;
|
|
4
7
|
amount: string | number;
|
|
@@ -9,5 +12,12 @@ export interface CreateTransactionOptions {
|
|
|
9
12
|
remoteId?: string[];
|
|
10
13
|
property?: string[];
|
|
11
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new transaction in the specified book.
|
|
17
|
+
*
|
|
18
|
+
* @param bookId - The target book ID
|
|
19
|
+
* @param options - Transaction fields (date, amount, accounts, properties, etc.)
|
|
20
|
+
* @returns The created transaction
|
|
21
|
+
*/
|
|
12
22
|
export declare function createTransaction(bookId: string, options: CreateTransactionOptions): Promise<Transaction>;
|
|
13
23
|
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/transactions/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC,MAAM,WAAW,wBAAwB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAsB,iBAAiB,CACnC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/transactions/create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACnC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,WAAW,CAAC,CA0DtB"}
|
|
@@ -11,6 +11,13 @@ import { getBkperInstance } from '../../bkper-factory.js';
|
|
|
11
11
|
import { Transaction } from 'bkper-js';
|
|
12
12
|
import { parsePropertyFlag } from '../../utils/properties.js';
|
|
13
13
|
import { throwIfErrors } from '../../utils/validation.js';
|
|
14
|
+
/**
|
|
15
|
+
* Creates a new transaction in the specified book.
|
|
16
|
+
*
|
|
17
|
+
* @param bookId - The target book ID
|
|
18
|
+
* @param options - Transaction fields (date, amount, accounts, properties, etc.)
|
|
19
|
+
* @returns The created transaction
|
|
20
|
+
*/
|
|
14
21
|
export function createTransaction(bookId, options) {
|
|
15
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
23
|
const bkper = getBkperInstance();
|
|
@@ -64,8 +71,7 @@ export function createTransaction(bookId, options) {
|
|
|
64
71
|
}
|
|
65
72
|
}
|
|
66
73
|
throwIfErrors(errors);
|
|
67
|
-
|
|
68
|
-
return results[0];
|
|
74
|
+
return tx.create();
|
|
69
75
|
});
|
|
70
76
|
}
|
|
71
77
|
//# sourceMappingURL=create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/transactions/create.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/transactions/create.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAgB1D;;;;;;GAMG;AACH,MAAM,UAAgB,iBAAiB,CACnC,MAAc,EACd,OAAiC;;QAEjC,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEzC,MAAM,MAAM,GAAa,EAAE,CAAC;QAE5B,MAAM,EAAE,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEjF,IAAI,OAAO,CAAC,WAAW;YAAE,EAA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AAiB,CAAC,GAAG,CAAC,CAAC;oBAC5C,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;wBACf,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;oBAC3B,CAAC;yBAAM,CAAC;wBACJ,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;oBAC/B,CAAC;gBACL,CAAC;gBAAC,OAAO,GAAY,EAAE,CAAC;oBACpB,MAAM,CAAC,IAAI,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;gBACxC,CAAC;YACL,CAAC;QACL,CAAC;QAED,aAAa,CAAC,MAAM,CAAC,CAAC;QAEtB,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { listTransactions, ListTransactionsOptions, ListTransactionsResult } from './list.js';
|
|
1
|
+
export { listTransactions, listTransactionsFormatted, ListTransactionsOptions, ListTransactionsResult, } from './list.js';
|
|
2
2
|
export { createTransaction, CreateTransactionOptions } from './create.js';
|
|
3
3
|
export { updateTransaction, UpdateTransactionOptions } from './update.js';
|
|
4
4
|
export { postTransaction } from './post.js';
|
|
5
5
|
export { checkTransaction } from './check.js';
|
|
6
6
|
export { trashTransaction } from './trash.js';
|
|
7
7
|
export { mergeTransactions, MergeResult } from './merge.js';
|
|
8
|
+
export { batchCreateTransactions } from './batch-create.js';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/transactions/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/transactions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,GACzB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { listTransactions } from './list.js';
|
|
1
|
+
export { listTransactions, listTransactionsFormatted, } from './list.js';
|
|
2
2
|
export { createTransaction } from './create.js';
|
|
3
3
|
export { updateTransaction } from './update.js';
|
|
4
4
|
export { postTransaction } from './post.js';
|
|
5
5
|
export { checkTransaction } from './check.js';
|
|
6
6
|
export { trashTransaction } from './trash.js';
|
|
7
7
|
export { mergeTransactions } from './merge.js';
|
|
8
|
+
export { batchCreateTransactions } from './batch-create.js';
|
|
8
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/transactions/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/transactions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,yBAAyB,GAG5B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAA4B,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAA4B,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAe,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,14 +1,34 @@
|
|
|
1
1
|
import { Book, Transaction, Account } from 'bkper-js';
|
|
2
|
+
import type { OutputFormat, ListResult } from '../../render/output.js';
|
|
3
|
+
/**
|
|
4
|
+
* Options for querying transactions from a book.
|
|
5
|
+
*/
|
|
2
6
|
export interface ListTransactionsOptions {
|
|
3
7
|
query: string;
|
|
4
8
|
limit?: number;
|
|
5
9
|
cursor?: string;
|
|
10
|
+
properties?: boolean;
|
|
6
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Result of a transaction listing query, including the book context and pagination cursor.
|
|
14
|
+
*/
|
|
7
15
|
export interface ListTransactionsResult {
|
|
8
16
|
book: Book;
|
|
9
17
|
items: Transaction[];
|
|
10
18
|
account?: Account;
|
|
11
19
|
cursor?: string;
|
|
12
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Queries transactions from a book using the provided search options.
|
|
23
|
+
*
|
|
24
|
+
* @param bookId - The book ID to query
|
|
25
|
+
* @param options - Query parameters including search string, limit, and cursor
|
|
26
|
+
* @returns The matching transactions with book context and pagination cursor
|
|
27
|
+
*/
|
|
13
28
|
export declare function listTransactions(bookId: string, options: ListTransactionsOptions): Promise<ListTransactionsResult>;
|
|
29
|
+
/**
|
|
30
|
+
* Lists transactions and returns a ListResult ready for rendering.
|
|
31
|
+
* Absorbs TransactionsDataTableBuilder config, JSON wrapping, and cursor footer.
|
|
32
|
+
*/
|
|
33
|
+
export declare function listTransactionsFormatted(bookId: string, options: ListTransactionsOptions, format: OutputFormat): Promise<ListResult>;
|
|
14
34
|
//# sourceMappingURL=list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/transactions/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAmB,MAAM,UAAU,CAAC;AAEvE,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/transactions/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAmB,MAAM,UAAU,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAClC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,sBAAsB,CAAC,CAYjC;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,CAC3C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,uBAAuB,EAChC,MAAM,EAAE,YAAY,GACrB,OAAO,CAAC,UAAU,CAAC,CA2BrB"}
|
|
@@ -8,6 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { getBkperInstance } from '../../bkper-factory.js';
|
|
11
|
+
/**
|
|
12
|
+
* Queries transactions from a book using the provided search options.
|
|
13
|
+
*
|
|
14
|
+
* @param bookId - The book ID to query
|
|
15
|
+
* @param options - Query parameters including search string, limit, and cursor
|
|
16
|
+
* @returns The matching transactions with book context and pagination cursor
|
|
17
|
+
*/
|
|
11
18
|
export function listTransactions(bookId, options) {
|
|
12
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13
20
|
const bkper = getBkperInstance();
|
|
@@ -23,4 +30,35 @@ export function listTransactions(bookId, options) {
|
|
|
23
30
|
};
|
|
24
31
|
});
|
|
25
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Lists transactions and returns a ListResult ready for rendering.
|
|
35
|
+
* Absorbs TransactionsDataTableBuilder config, JSON wrapping, and cursor footer.
|
|
36
|
+
*/
|
|
37
|
+
export function listTransactionsFormatted(bookId, options, format) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const result = yield listTransactions(bookId, options);
|
|
40
|
+
if (format === 'json') {
|
|
41
|
+
return {
|
|
42
|
+
kind: 'json',
|
|
43
|
+
data: {
|
|
44
|
+
items: result.items.map(tx => tx.json()),
|
|
45
|
+
cursor: result.cursor,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const builder = result.book.createTransactionsDataTable(result.items, result.account).ids(true);
|
|
50
|
+
if (format === 'csv') {
|
|
51
|
+
builder.properties(true).hiddenProperties(true).urls(true).recordedAt(true);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
builder.formatDates(true).formatValues(true).recordedAt(false);
|
|
55
|
+
if (options.properties) {
|
|
56
|
+
builder.properties(true);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const matrix = yield builder.build();
|
|
60
|
+
const footer = result.cursor ? `\nNext cursor: ${result.cursor}` : undefined;
|
|
61
|
+
return { kind: 'matrix', matrix, footer };
|
|
62
|
+
});
|
|
63
|
+
}
|
|
26
64
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/transactions/list.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/transactions/list.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAwB1D;;;;;;GAMG;AACH,MAAM,UAAgB,gBAAgB,CAClC,MAAc,EACd,OAAgC;;QAEhC,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACzF,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAChC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1C,OAAO;YACH,IAAI;YACJ,KAAK,EAAE,KAAK,IAAI,EAAE;YAClB,OAAO;YACP,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE;SAC7B,CAAC;IACN,CAAC;CAAA;AAED;;;GAGG;AACH,MAAM,UAAgB,yBAAyB,CAC3C,MAAc,EACd,OAAgC,EAChC,MAAoB;;QAEpB,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAEvD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACpB,OAAO;gBACH,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE;oBACF,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;oBACxC,MAAM,EAAE,MAAM,CAAC,MAAM;iBACxB;aACJ,CAAC;QACN,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAEhG,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;YACnB,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAChF,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC/D,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBACrB,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAC7B,CAAC;QACL,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,kBAAkB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAC7E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC9C,CAAC;CAAA"}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { Transaction } from 'bkper-js';
|
|
2
|
+
/**
|
|
3
|
+
* Result of merging two transactions.
|
|
4
|
+
*/
|
|
2
5
|
export interface MergeResult {
|
|
3
6
|
mergedTransaction: Transaction;
|
|
4
7
|
revertedTransactionId: string;
|
|
5
8
|
auditRecord: string | null;
|
|
6
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Merges two transactions by updating one and trashing the other.
|
|
12
|
+
* Fails if the transaction amounts differ.
|
|
13
|
+
*
|
|
14
|
+
* @param bookId - The book ID containing both transactions
|
|
15
|
+
* @param transactionId1 - The ID of the first transaction
|
|
16
|
+
* @param transactionId2 - The ID of the second transaction
|
|
17
|
+
* @returns The merge result with the updated transaction and reverted ID
|
|
18
|
+
*/
|
|
7
19
|
export declare function mergeTransactions(bookId: string, transactionId1: string, transactionId2: string): Promise<MergeResult>;
|
|
8
20
|
//# sourceMappingURL=merge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../src/commands/transactions/merge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC,MAAM,WAAW,WAAW;IACxB,iBAAiB,EAAE,WAAW,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,wBAAsB,iBAAiB,CACnC,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,GACvB,OAAO,CAAC,WAAW,CAAC,CAuCtB"}
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../src/commands/transactions/merge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,iBAAiB,EAAE,WAAW,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACnC,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,MAAM,GACvB,OAAO,CAAC,WAAW,CAAC,CAuCtB"}
|
|
@@ -10,6 +10,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { getBkperInstance } from '../../bkper-factory.js';
|
|
11
11
|
import { TransactionMergeOperation } from '../../domain/transaction/merge-operation.js';
|
|
12
12
|
import { throwIfErrors } from '../../utils/validation.js';
|
|
13
|
+
/**
|
|
14
|
+
* Merges two transactions by updating one and trashing the other.
|
|
15
|
+
* Fails if the transaction amounts differ.
|
|
16
|
+
*
|
|
17
|
+
* @param bookId - The book ID containing both transactions
|
|
18
|
+
* @param transactionId1 - The ID of the first transaction
|
|
19
|
+
* @param transactionId2 - The ID of the second transaction
|
|
20
|
+
* @returns The merge result with the updated transaction and reverted ID
|
|
21
|
+
*/
|
|
13
22
|
export function mergeTransactions(bookId, transactionId1, transactionId2) {
|
|
14
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
15
24
|
const bkper = getBkperInstance();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../../src/commands/transactions/merge.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../../src/commands/transactions/merge.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAW1D;;;;;;;;GAQG;AACH,MAAM,UAAgB,iBAAiB,CACnC,MAAc,EACd,cAAsB,EACtB,cAAsB;;QAEtB,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEzC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
|
4
|
+
*
|
|
5
|
+
* @param bookId - The book ID containing the transaction
|
|
6
|
+
* @param transactionId - The ID of the transaction to post
|
|
7
|
+
* @returns The posted transaction
|
|
8
|
+
*/
|
|
2
9
|
export declare function postTransaction(bookId: string, transactionId: string): Promise<Transaction>;
|
|
3
10
|
//# sourceMappingURL=post.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../src/commands/transactions/post.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAQjG"}
|
|
1
|
+
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../src/commands/transactions/post.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAQjG"}
|
|
@@ -8,6 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { getBkperInstance } from '../../bkper-factory.js';
|
|
11
|
+
/**
|
|
12
|
+
* Posts a draft transaction, making it permanent in the book.
|
|
13
|
+
*
|
|
14
|
+
* @param bookId - The book ID containing the transaction
|
|
15
|
+
* @param transactionId - The ID of the transaction to post
|
|
16
|
+
* @returns The posted transaction
|
|
17
|
+
*/
|
|
11
18
|
export function postTransaction(bookId, transactionId) {
|
|
12
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13
20
|
const bkper = getBkperInstance();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.js","sourceRoot":"","sources":["../../../src/commands/transactions/post.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D,MAAM,UAAgB,eAAe,CAAC,MAAc,EAAE,aAAqB;;QACvE,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QAC7D,IAAI,CAAC,WAAW,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,0BAA0B,aAAa,EAAE,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC;CAAA"}
|
|
1
|
+
{"version":3,"file":"post.js","sourceRoot":"","sources":["../../../src/commands/transactions/post.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D;;;;;;GAMG;AACH,MAAM,UAAgB,eAAe,CAAC,MAAc,EAAE,aAAqB;;QACvE,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QAC7D,IAAI,CAAC,WAAW,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,0BAA0B,aAAa,EAAE,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,WAAW,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC;CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/commands/transactions/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBzC,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiLlE"}
|