bkper 4.5.0 → 4.6.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 +5 -4
- package/lib/cli.js +2 -22
- package/lib/cli.js.map +1 -1
- package/lib/commands/auth/register.d.ts +3 -0
- package/lib/commands/auth/register.d.ts.map +1 -0
- package/lib/commands/auth/register.js +33 -0
- package/lib/commands/auth/register.js.map +1 -0
- package/lib/commands/auth/token.d.ts +8 -0
- package/lib/commands/auth/token.d.ts.map +1 -0
- package/lib/commands/auth/token.js +27 -0
- package/lib/commands/auth/token.js.map +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ A **command-line interface** for [Bkper](https://bkper.com), a financial account
|
|
|
13
13
|
|
|
14
14
|
- [Node.js](https://nodejs.org/) >= 18
|
|
15
15
|
|
|
16
|
-
### Install
|
|
16
|
+
### Install (choose one)
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
# bun
|
|
@@ -29,7 +29,7 @@ yarn global add bkper
|
|
|
29
29
|
### Authenticate
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
bkper login
|
|
32
|
+
bkper auth login
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
### Try It
|
|
@@ -534,8 +534,9 @@ Apps are configured via a `bkper.yaml` file in the project root. See the complet
|
|
|
534
534
|
|
|
535
535
|
#### Authentication
|
|
536
536
|
|
|
537
|
-
- `login` - Authenticate with Bkper, storing credentials locally
|
|
538
|
-
- `logout` - Remove stored credentials
|
|
537
|
+
- `auth login` - Authenticate with Bkper, storing credentials locally
|
|
538
|
+
- `auth logout` - Remove stored credentials
|
|
539
|
+
- `auth token` - Print the current OAuth access token to stdout
|
|
539
540
|
|
|
540
541
|
#### App Lifecycle
|
|
541
542
|
|
package/lib/cli.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
import 'dotenv/config'; // Must be first to load env vars before other imports
|
|
12
3
|
import { program } from 'commander';
|
|
13
|
-
import {
|
|
4
|
+
import { registerAuthCommands } from './commands/auth/register.js';
|
|
14
5
|
import { registerAppCommands } from './commands/apps/register.js';
|
|
15
6
|
import { registerBookCommands } from './commands/books/register.js';
|
|
16
7
|
import { registerAccountCommands } from './commands/accounts/register.js';
|
|
@@ -26,18 +17,7 @@ program.version(VERSION, '-v, --version');
|
|
|
26
17
|
program.option('--format <format>', 'Output format: table, json, or csv', 'table');
|
|
27
18
|
program.option('--json', 'Output as JSON (alias for --format json)');
|
|
28
19
|
// Auth commands
|
|
29
|
-
program
|
|
30
|
-
.command('login')
|
|
31
|
-
.description('Login Bkper')
|
|
32
|
-
.action(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
-
yield login();
|
|
34
|
-
}));
|
|
35
|
-
program
|
|
36
|
-
.command('logout')
|
|
37
|
-
.description('Logout Bkper')
|
|
38
|
-
.action(() => {
|
|
39
|
-
logout();
|
|
40
|
-
});
|
|
20
|
+
registerAuthCommands(program);
|
|
41
21
|
// Resource commands
|
|
42
22
|
registerAppCommands(program);
|
|
43
23
|
registerBookCommands(program);
|
package/lib/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[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CAAC,CAAC;AACjC,0BAA0B,CAAC,OAAO,CAAC,CAAC;AAEpC,kBAAkB;AAClB,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAEhC,4EAA4E;AAC5E,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,EAAE,CAAC;IACxC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;AAClC,CAAC;AAED,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuB3D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { login, logout } from '../../auth/local-auth-service.js';
|
|
11
|
+
import { token } from './token.js';
|
|
12
|
+
export function registerAuthCommands(program) {
|
|
13
|
+
const authCommand = program.command('auth').description('Manage authentication');
|
|
14
|
+
authCommand
|
|
15
|
+
.command('login')
|
|
16
|
+
.description('Authenticate with Bkper, storing credentials locally')
|
|
17
|
+
.action(() => __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
yield login();
|
|
19
|
+
}));
|
|
20
|
+
authCommand
|
|
21
|
+
.command('logout')
|
|
22
|
+
.description('Remove stored credentials')
|
|
23
|
+
.action(() => {
|
|
24
|
+
logout();
|
|
25
|
+
});
|
|
26
|
+
authCommand
|
|
27
|
+
.command('token')
|
|
28
|
+
.description('Print the current OAuth access token to stdout')
|
|
29
|
+
.action(() => __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
yield token();
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/commands/auth/register.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACjD,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAEjF,WAAW;SACN,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,sDAAsD,CAAC;SACnE,MAAM,CAAC,GAAS,EAAE;QACf,MAAM,KAAK,EAAE,CAAC;IAClB,CAAC,CAAA,CAAC,CAAC;IAEP,WAAW;SACN,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,2BAA2B,CAAC;SACxC,MAAM,CAAC,GAAG,EAAE;QACT,MAAM,EAAE,CAAC;IACb,CAAC,CAAC,CAAC;IAEP,WAAW;SACN,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,gDAAgD,CAAC;SAC7D,MAAM,CAAC,GAAS,EAAE;QACf,MAAM,KAAK,EAAE,CAAC;IAClB,CAAC,CAAA,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prints the current OAuth access token to stdout.
|
|
3
|
+
*
|
|
4
|
+
* Designed for shell substitution: TOKEN=$(bkper auth token)
|
|
5
|
+
* Outputs only the raw token string with no extra formatting.
|
|
6
|
+
*/
|
|
7
|
+
export declare function token(): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=token.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../src/commands/auth/token.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAO3C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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 { isLoggedIn, getOAuthToken } from '../../auth/local-auth-service.js';
|
|
11
|
+
/**
|
|
12
|
+
* Prints the current OAuth access token to stdout.
|
|
13
|
+
*
|
|
14
|
+
* Designed for shell substitution: TOKEN=$(bkper auth token)
|
|
15
|
+
* Outputs only the raw token string with no extra formatting.
|
|
16
|
+
*/
|
|
17
|
+
export function token() {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
if (!isLoggedIn()) {
|
|
20
|
+
console.error('Error: Not logged in. Run: bkper auth login');
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
const accessToken = yield getOAuthToken();
|
|
24
|
+
process.stdout.write(accessToken);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../../src/commands/auth/token.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,UAAgB,KAAK;;QACvB,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;YAC7D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;QACD,MAAM,WAAW,GAAG,MAAM,aAAa,EAAE,CAAC;QAC1C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bkper",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "Command line client for Bkper",
|
|
5
5
|
"bin": {
|
|
6
6
|
"bkper": "./lib/cli.js"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"postversion": "git push --tags && yarn publish --new-version $npm_package_version && git push && echo \"Successfully released version $npm_package_version!\""
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"bkper-js": "^2.29.
|
|
48
|
+
"bkper-js": "^2.29.2",
|
|
49
49
|
"chokidar": "^5.0.0",
|
|
50
50
|
"commander": "^13.1.0",
|
|
51
51
|
"dotenv": "^8.2.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"yaml": "^2.5.1"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@bkper/bkper-api-types": "^5.
|
|
62
|
+
"@bkper/bkper-api-types": "^5.36.0",
|
|
63
63
|
"@types/chai": "^4.3.0",
|
|
64
64
|
"@types/mocha": "^10.0.0",
|
|
65
65
|
"@types/node": "^22.5.1",
|