bkper 4.10.6 → 4.11.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/README.md +16 -21
- package/lib/commands/groups/index.d.ts +0 -1
- package/lib/commands/groups/index.d.ts.map +1 -1
- package/lib/commands/groups/index.js +0 -1
- package/lib/commands/groups/index.js.map +1 -1
- package/lib/commands/groups/register.d.ts.map +1 -1
- package/lib/commands/groups/register.js +12 -23
- package/lib/commands/groups/register.js.map +1 -1
- package/lib/docs/cli-reference.md +16 -21
- package/lib/docs-compliance/rules.d.ts.map +1 -1
- package/lib/docs-compliance/rules.js +37 -0
- package/lib/docs-compliance/rules.js.map +1 -1
- package/package.json +1 -1
- package/lib/commands/groups/batch-create.d.ts +0 -12
- package/lib/commands/groups/batch-create.d.ts.map +0 -1
- package/lib/commands/groups/batch-create.js +0 -49
- package/lib/commands/groups/batch-create.js.map +0 -1
package/README.md
CHANGED
|
@@ -238,6 +238,16 @@ bkper group update "Cash" -b abc123 --hidden true
|
|
|
238
238
|
bkper group delete "Cash" -b abc123
|
|
239
239
|
```
|
|
240
240
|
|
|
241
|
+
### Book setup guidance (important)
|
|
242
|
+
|
|
243
|
+
When setting up a full Book or starter chart of accounts, prefer a hierarchical group structure by default.
|
|
244
|
+
|
|
245
|
+
Create top-level groups first, then child groups with `--parent`, then accounts with `--groups`.
|
|
246
|
+
|
|
247
|
+
Verify the resulting group hierarchy and account memberships before reporting success.
|
|
248
|
+
|
|
249
|
+
Avoid using the same name for a Group and an Account in the same Book.
|
|
250
|
+
|
|
241
251
|
<details>
|
|
242
252
|
<summary>Command reference</summary>
|
|
243
253
|
|
|
@@ -448,7 +458,7 @@ CSV is significantly more token-efficient than JSON for tabular data, and for wi
|
|
|
448
458
|
|
|
449
459
|
### Batch Operations & Piping
|
|
450
460
|
|
|
451
|
-
Write commands (`account create`, `
|
|
461
|
+
Write commands (`account create`, `transaction create`) accept JSON data piped via stdin for batch operations. The `transaction update` command also accepts stdin for batch updates. The input format follows the [Bkper API Types](https://raw.githubusercontent.com/bkper/bkper-api-types/refs/heads/master/index.d.ts) exactly -- a single JSON object or an array of objects.
|
|
452
462
|
|
|
453
463
|
```bash
|
|
454
464
|
# Create transactions
|
|
@@ -465,15 +475,13 @@ echo '[{
|
|
|
465
475
|
echo '[{"name":"Cash","type":"ASSET"},{"name":"Revenue","type":"INCOMING"}]' | \
|
|
466
476
|
bkper account create -b abc123
|
|
467
477
|
|
|
468
|
-
# Create groups
|
|
469
|
-
echo '[{"name":"Fixed Costs","hidden":true}]' | \
|
|
470
|
-
bkper group create -b abc123
|
|
471
|
-
|
|
472
478
|
# Pipe from a script
|
|
473
479
|
python export_bank.py | bkper transaction create -b abc123
|
|
474
480
|
```
|
|
475
481
|
|
|
476
|
-
The input follows the exact `bkper.Transaction
|
|
482
|
+
The input follows the exact `bkper.Transaction` or `bkper.Account` type from the [Bkper API Types](https://raw.githubusercontent.com/bkper/bkper-api-types/refs/heads/master/index.d.ts). Custom properties go inside the `properties` object.
|
|
483
|
+
|
|
484
|
+
Groups are created explicitly with `bkper group create --name` and optional `--parent` so hierarchy stays deterministic during setup.
|
|
477
485
|
|
|
478
486
|
The `--property` CLI flag can override or delete properties from the stdin payload:
|
|
479
487
|
|
|
@@ -491,21 +499,17 @@ bkper account create -b abc123 < accounts.json
|
|
|
491
499
|
|
|
492
500
|
**Piping between commands:**
|
|
493
501
|
|
|
494
|
-
|
|
502
|
+
For resources that support stdin creation, JSON output can be piped directly into create or update commands:
|
|
495
503
|
|
|
496
504
|
```bash
|
|
497
505
|
# Copy all accounts from one book to another
|
|
498
506
|
bkper account list -b $BOOK_A --format json | bkper account create -b $BOOK_B
|
|
499
507
|
|
|
500
|
-
# Copy all groups from one book to another
|
|
501
|
-
bkper group list -b $BOOK_A --format json | bkper group create -b $BOOK_B
|
|
502
|
-
|
|
503
508
|
# Copy transactions matching a query
|
|
504
509
|
bkper transaction list -b $BOOK_A -q "after:2025-01-01" --format json | \
|
|
505
510
|
bkper transaction create -b $BOOK_B
|
|
506
511
|
|
|
507
|
-
# Clone
|
|
508
|
-
bkper group list -b $SOURCE --format json | bkper group create -b $DEST
|
|
512
|
+
# Clone accounts, then transactions
|
|
509
513
|
bkper account list -b $SOURCE --format json | bkper account create -b $DEST
|
|
510
514
|
bkper transaction list -b $SOURCE -q "after:2025-01-01" --format json | \
|
|
511
515
|
bkper transaction create -b $DEST
|
|
@@ -555,15 +559,6 @@ Only the fields below are meaningful when creating or updating resources via std
|
|
|
555
559
|
| `groups` | `[{"name":"..."}, ...]` | Groups to assign by name or id |
|
|
556
560
|
| `properties` | `{"key": "value", ...}` | Custom key/value properties |
|
|
557
561
|
|
|
558
|
-
**Group** (`bkper.Group`)
|
|
559
|
-
|
|
560
|
-
| Field | Type | Notes |
|
|
561
|
-
| ------------ | ---------------------------------- | -------------------------------- |
|
|
562
|
-
| `name` | `string` | Group name (required) |
|
|
563
|
-
| `hidden` | `boolean` | Hide from transactions main menu |
|
|
564
|
-
| `parent` | `{"name":"..."}` or `{"id":"..."}` | Parent group for nesting |
|
|
565
|
-
| `properties` | `{"key": "value", ...}` | Custom key/value properties |
|
|
566
|
-
|
|
567
562
|
</details>
|
|
568
563
|
|
|
569
564
|
---
|
|
@@ -3,5 +3,4 @@ export { getGroup } from './get.js';
|
|
|
3
3
|
export { createGroup, CreateGroupOptions } from './create.js';
|
|
4
4
|
export { updateGroup, UpdateGroupOptions } from './update.js';
|
|
5
5
|
export { deleteGroup } from './delete.js';
|
|
6
|
-
export { batchCreateGroups } from './batch-create.js';
|
|
7
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/groups/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/groups/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/groups/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/groups/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/commands/groups/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/commands/groups/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmF5D"}
|
|
@@ -11,8 +11,7 @@ import { withAction } from '../action.js';
|
|
|
11
11
|
import { collectProperty } from '../cli-helpers.js';
|
|
12
12
|
import { renderListResult, renderItem } from '../../render/index.js';
|
|
13
13
|
import { validateRequiredOptions, throwIfErrors } from '../../utils/validation.js';
|
|
14
|
-
import {
|
|
15
|
-
import { listGroupsFormatted, getGroup, createGroup, updateGroup, deleteGroup, batchCreateGroups, } from './index.js';
|
|
14
|
+
import { listGroupsFormatted, getGroup, createGroup, updateGroup, deleteGroup } from './index.js';
|
|
16
15
|
export function registerGroupCommands(program) {
|
|
17
16
|
const groupCommand = program.command('group').description('Manage Groups');
|
|
18
17
|
groupCommand
|
|
@@ -42,27 +41,17 @@ export function registerGroupCommands(program) {
|
|
|
42
41
|
.option('--hidden', 'Hide the group')
|
|
43
42
|
.option('-p, --property <key=value>', 'Set a property (repeatable)', collectProperty)
|
|
44
43
|
.action(options => withAction('creating group', (format) => __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{ name: 'name', flag: '--name' },
|
|
57
|
-
]));
|
|
58
|
-
const group = yield createGroup(options.book, {
|
|
59
|
-
name: options.name,
|
|
60
|
-
parent: options.parent,
|
|
61
|
-
hidden: options.hidden,
|
|
62
|
-
property: options.property,
|
|
63
|
-
});
|
|
64
|
-
renderItem(group.json(), format);
|
|
65
|
-
}
|
|
44
|
+
throwIfErrors(validateRequiredOptions(options, [
|
|
45
|
+
{ name: 'book', flag: '--book' },
|
|
46
|
+
{ name: 'name', flag: '--name' },
|
|
47
|
+
]));
|
|
48
|
+
const group = yield createGroup(options.book, {
|
|
49
|
+
name: options.name,
|
|
50
|
+
parent: options.parent,
|
|
51
|
+
hidden: options.hidden,
|
|
52
|
+
property: options.property,
|
|
53
|
+
});
|
|
54
|
+
renderItem(group.json(), format);
|
|
66
55
|
}))());
|
|
67
56
|
groupCommand
|
|
68
57
|
.command('update <idOrName>')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/commands/groups/register.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/commands/groups/register.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAElG,M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abc123
|
|
239
239
|
```
|
|
240
240
|
|
|
241
|
+
### Book setup guidance (important)
|
|
242
|
+
|
|
243
|
+
When setting up a full Book or starter chart of accounts, prefer a hierarchical group structure by default.
|
|
244
|
+
|
|
245
|
+
Create top-level groups first, then child groups with `--parent`, then accounts with `--groups`.
|
|
246
|
+
|
|
247
|
+
Verify the resulting group hierarchy and account memberships before reporting success.
|
|
248
|
+
|
|
249
|
+
Avoid using the same name for a Group and an Account in the same Book.
|
|
250
|
+
|
|
241
251
|
<details>
|
|
242
252
|
<summary>Command reference</summary>
|
|
243
253
|
|
|
@@ -448,7 +458,7 @@ CSV is significantly more token-efficient than JSON for tabular data, and for wi
|
|
|
448
458
|
|
|
449
459
|
### Batch Operations & Piping
|
|
450
460
|
|
|
451
|
-
Write commands (`account create`, `
|
|
461
|
+
Write commands (`account create`, `transaction create`) accept JSON data piped via stdin for batch operations. The `transaction update` command also accepts stdin for batch updates. The input format follows the [Bkper API Types](https://raw.githubusercontent.com/bkper/bkper-api-types/refs/heads/master/index.d.ts) exactly -- a single JSON object or an array of objects.
|
|
452
462
|
|
|
453
463
|
```bash
|
|
454
464
|
# Create transactions
|
|
@@ -465,15 +475,13 @@ echo '[{
|
|
|
465
475
|
echo '[{"name":"Cash","type":"ASSET"},{"name":"Revenue","type":"INCOMING"}]' | \
|
|
466
476
|
bkper account create -b abc123
|
|
467
477
|
|
|
468
|
-
# Create groups
|
|
469
|
-
echo '[{"name":"Fixed Costs","hidden":true}]' | \
|
|
470
|
-
bkper group create -b abc123
|
|
471
|
-
|
|
472
478
|
# Pipe from a script
|
|
473
479
|
python export_bank.py | bkper transaction create -b abc123
|
|
474
480
|
```
|
|
475
481
|
|
|
476
|
-
The input follows the exact `bkper.Transaction
|
|
482
|
+
The input follows the exact `bkper.Transaction` or `bkper.Account` type from the [Bkper API Types](https://raw.githubusercontent.com/bkper/bkper-api-types/refs/heads/master/index.d.ts). Custom properties go inside the `properties` object.
|
|
483
|
+
|
|
484
|
+
Groups are created explicitly with `bkper group create --name` and optional `--parent` so hierarchy stays deterministic during setup.
|
|
477
485
|
|
|
478
486
|
The `--property` CLI flag can override or delete properties from the stdin payload:
|
|
479
487
|
|
|
@@ -491,21 +499,17 @@ bkper account create -b abc123 < accounts.json
|
|
|
491
499
|
|
|
492
500
|
**Piping between commands:**
|
|
493
501
|
|
|
494
|
-
|
|
502
|
+
For resources that support stdin creation, JSON output can be piped directly into create or update commands:
|
|
495
503
|
|
|
496
504
|
```bash
|
|
497
505
|
# Copy all accounts from one book to another
|
|
498
506
|
bkper account list -b $BOOK_A --format json | bkper account create -b $BOOK_B
|
|
499
507
|
|
|
500
|
-
# Copy all groups from one book to another
|
|
501
|
-
bkper group list -b $BOOK_A --format json | bkper group create -b $BOOK_B
|
|
502
|
-
|
|
503
508
|
# Copy transactions matching a query
|
|
504
509
|
bkper transaction list -b $BOOK_A -q "after:2025-01-01" --format json | \
|
|
505
510
|
bkper transaction create -b $BOOK_B
|
|
506
511
|
|
|
507
|
-
# Clone
|
|
508
|
-
bkper group list -b $SOURCE --format json | bkper group create -b $DEST
|
|
512
|
+
# Clone accounts, then transactions
|
|
509
513
|
bkper account list -b $SOURCE --format json | bkper account create -b $DEST
|
|
510
514
|
bkper transaction list -b $SOURCE -q "after:2025-01-01" --format json | \
|
|
511
515
|
bkper transaction create -b $DEST
|
|
@@ -555,15 +559,6 @@ Only the fields below are meaningful when creating or updating resources via std
|
|
|
555
559
|
| `groups` | `[{"name":"..."}, ...]` | Groups to assign by name or id |
|
|
556
560
|
| `properties` | `{"key": "value", ...}` | Custom key/value properties |
|
|
557
561
|
|
|
558
|
-
**Group** (`bkper.Group`)
|
|
559
|
-
|
|
560
|
-
| Field | Type | Notes |
|
|
561
|
-
| ------------ | ---------------------------------- | -------------------------------- |
|
|
562
|
-
| `name` | `string` | Group name (required) |
|
|
563
|
-
| `hidden` | `boolean` | Hide from transactions main menu |
|
|
564
|
-
| `parent` | `{"name":"..."}` or `{"id":"..."}` | Parent group for nesting |
|
|
565
|
-
| `properties` | `{"key": "value", ...}` | Custom key/value properties |
|
|
566
|
-
|
|
567
562
|
</details>
|
|
568
563
|
|
|
569
564
|
---
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/docs-compliance/rules.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,eAAe,EAAE,CAAC;CAC7B;AA4BD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/docs-compliance/rules.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,eAAe,EAAE,CAAC;CAC7B;AA4BD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAsI1E"}
|
|
@@ -39,6 +39,24 @@ export function evaluateReadmeCompliance(content) {
|
|
|
39
39
|
line: getLineNumber(content, periodMatch.index),
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
+
if (!content.includes('### Book setup guidance (important)')) {
|
|
43
|
+
errors.push({
|
|
44
|
+
code: 'missing-book-setup-guidance-title',
|
|
45
|
+
message: 'Missing `Book setup guidance (important)` section.',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (!content.includes('Create top-level groups first, then child groups with `--parent`, then accounts with `--groups`.')) {
|
|
49
|
+
errors.push({
|
|
50
|
+
code: 'missing-book-setup-order-guidance',
|
|
51
|
+
message: 'Missing guidance to create top-level groups first, then child groups, then accounts.',
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (!content.includes('Verify the resulting group hierarchy and account memberships before reporting success.')) {
|
|
55
|
+
errors.push({
|
|
56
|
+
code: 'missing-book-setup-verification-guidance',
|
|
57
|
+
message: 'Missing guidance to verify hierarchy and account memberships before success.',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
42
60
|
if (!content.includes('LLM-first output guidance (important):')) {
|
|
43
61
|
errors.push({
|
|
44
62
|
code: 'missing-llm-guidance-title',
|
|
@@ -69,6 +87,25 @@ export function evaluateReadmeCompliance(content) {
|
|
|
69
87
|
message: 'Missing explicit semantics for `after:` and `before:`.',
|
|
70
88
|
});
|
|
71
89
|
}
|
|
90
|
+
if (content.includes('Write commands (`account create`, `group create`, `transaction create`) accept JSON data piped via stdin')) {
|
|
91
|
+
errors.push({
|
|
92
|
+
code: 'group-create-stdin-documented',
|
|
93
|
+
message: 'README should not document stdin batch creation for `group create`.',
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
const groupPipePattern = /bkper\s+group\s+list\b.*\|\s*bkper\s+group\s+create\b/;
|
|
97
|
+
if (groupPipePattern.test(content)) {
|
|
98
|
+
errors.push({
|
|
99
|
+
code: 'group-create-pipe-documented',
|
|
100
|
+
message: 'README should not document piping group JSON into `group create`.',
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
if (content.includes('**Group** (`bkper.Group`)')) {
|
|
104
|
+
errors.push({
|
|
105
|
+
code: 'group-stdin-fields-documented',
|
|
106
|
+
message: 'README should not document stdin writable fields for `bkper.Group`.',
|
|
107
|
+
});
|
|
108
|
+
}
|
|
72
109
|
return { errors };
|
|
73
110
|
}
|
|
74
111
|
//# sourceMappingURL=rules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/docs-compliance/rules.ts"],"names":[],"mappings":"AAUA,SAAS,aAAa,CAAC,OAA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,EACH,CAAC;QACC,MAAM,CAAC,IAAI,CAAC;YACR,IAAI,EAAE,+BAA+B;YACrC,OAAO,EAAE,qEAAqE;SACjF,CAAC,CAAC;IACP,CAAC;IAED,MAAM,gBAAgB,GAAG,uDAAuD,CAAC;IACjF,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC;YACR,IAAI,EAAE,8BAA8B;YACpC,OAAO,EAAE,mEAAmE;SAC/E,CAAC,CAAC;IACP,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAAE,CAAC;QAChD,MAAM,CAAC,IAAI,CAAC;YACR,IAAI,EAAE,+BAA+B;YACrC,OAAO,EAAE,qEAAqE;SACjF,CAAC,CAAC;IACP,CAAC;IAED,OAAO,EAAC,MAAM,EAAC,CAAC;AACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates multiple groups from stdin items using the batch API.
|
|
3
|
-
* Outputs a flat JSON array of all created groups.
|
|
4
|
-
*
|
|
5
|
-
* Stdin items must follow the bkper.Group format exactly.
|
|
6
|
-
*
|
|
7
|
-
* @param bookId - Target book ID
|
|
8
|
-
* @param items - Parsed stdin items as bkper.Group payloads
|
|
9
|
-
* @param propertyOverrides - CLI --property flags that override stdin properties
|
|
10
|
-
*/
|
|
11
|
-
export declare function batchCreateGroups(bookId: string, items: Record<string, unknown>[], propertyOverrides?: string[]): Promise<void>;
|
|
12
|
-
//# sourceMappingURL=batch-create.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"batch-create.d.ts","sourceRoot":"","sources":["../../../src/commands/groups/batch-create.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACnC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAChC,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAC7B,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
|
|
@@ -1,49 +0,0 @@
|
|
|
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 { Group } from 'bkper-js';
|
|
12
|
-
import { parsePropertyFlag } from '../../utils/properties.js';
|
|
13
|
-
/**
|
|
14
|
-
* Creates multiple groups from stdin items using the batch API.
|
|
15
|
-
* Outputs a flat JSON array of all created groups.
|
|
16
|
-
*
|
|
17
|
-
* Stdin items must follow the bkper.Group format exactly.
|
|
18
|
-
*
|
|
19
|
-
* @param bookId - Target book ID
|
|
20
|
-
* @param items - Parsed stdin items as bkper.Group payloads
|
|
21
|
-
* @param propertyOverrides - CLI --property flags that override stdin properties
|
|
22
|
-
*/
|
|
23
|
-
export function batchCreateGroups(bookId, items, propertyOverrides) {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
const bkper = getBkperInstance();
|
|
26
|
-
const book = yield bkper.getBook(bookId);
|
|
27
|
-
const groups = [];
|
|
28
|
-
for (const item of items) {
|
|
29
|
-
const group = new Group(book, item);
|
|
30
|
-
// CLI --property flags override stdin properties
|
|
31
|
-
if (propertyOverrides) {
|
|
32
|
-
for (const raw of propertyOverrides) {
|
|
33
|
-
const [key, value] = parsePropertyFlag(raw);
|
|
34
|
-
if (value === '') {
|
|
35
|
-
group.deleteProperty(key);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
group.setProperty(key, value);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
groups.push(group);
|
|
43
|
-
}
|
|
44
|
-
const results = yield book.batchCreateGroups(groups);
|
|
45
|
-
const allResults = results.map(result => result.json());
|
|
46
|
-
console.log(JSON.stringify(allResults, null, 2));
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=batch-create.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"batch-create.js","sourceRoot":"","sources":["../../../src/commands/groups/batch-create.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D;;;;;;;;;GASG;AACH,MAAM,UAAgB,iBAAiB,CACnC,MAAc,EACd,KAAgC,EAChC,iBAA4B;;QAE5B,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEzC,MAAM,MAAM,GAAY,EAAE,CAAC;QAE3B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,EAAE,IAAmB,CAAC,CAAC;YAEnD,iDAAiD;YACjD,IAAI,iBAAiB,EAAE,CAAC;gBACpB,KAAK,MAAM,GAAG,IAAI,iBAAiB,EAAE,CAAC;oBAClC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;oBAC5C,IAAI,KAAK,KAAK,EAAE,E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