bkper 4.5.0 → 4.6.2
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 +215 -7
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[bkper.yaml reference]:
|
|
1
|
+
[bkper.yaml reference]: #bkperyaml-reference
|
|
2
2
|
[Developer Docs]: https://bkper.com/docs
|
|
3
3
|
[App Template]: https://github.com/bkper/bkper-app-template
|
|
4
4
|
[Skills Repository]: https://github.com/bkper/skills
|
|
@@ -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,20 @@ yarn global add bkper
|
|
|
29
29
|
### Authenticate
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
bkper login
|
|
32
|
+
bkper auth login
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Access Token
|
|
36
|
+
|
|
37
|
+
Use the access token for direct API calls from any tool:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Print the current access token
|
|
41
|
+
TOKEN=$(bkper auth token)
|
|
42
|
+
|
|
43
|
+
# Use it with curl, httpie, or any HTTP client
|
|
44
|
+
curl -s -H "Authorization: Bearer $TOKEN" \
|
|
45
|
+
https://api.bkper.app/v5/books | jq '.items[].name'
|
|
33
46
|
```
|
|
34
47
|
|
|
35
48
|
### Try It
|
|
@@ -523,7 +536,201 @@ bkper app secrets delete API_KEY
|
|
|
523
536
|
|
|
524
537
|
### Configuration
|
|
525
538
|
|
|
526
|
-
Apps are configured via a `bkper.yaml` file in the project root. See the complete
|
|
539
|
+
Apps are configured via a `bkper.yaml` file in the project root. See the complete **[bkper.yaml reference]** below.
|
|
540
|
+
|
|
541
|
+
<details>
|
|
542
|
+
<summary>bkper.yaml reference</summary>
|
|
543
|
+
|
|
544
|
+
```yaml
|
|
545
|
+
# =============================================================================
|
|
546
|
+
# bkper.yaml Reference
|
|
547
|
+
# =============================================================================
|
|
548
|
+
# This file documents all available configuration options for Bkper Apps.
|
|
549
|
+
# Copy the fields you need to your app's bkper.yaml file.
|
|
550
|
+
#
|
|
551
|
+
# For a minimal working template, see:
|
|
552
|
+
# https://github.com/bkper/bkper-app-template
|
|
553
|
+
# =============================================================================
|
|
554
|
+
|
|
555
|
+
# -----------------------------------------------------------------------------
|
|
556
|
+
# APP IDENTITY
|
|
557
|
+
# -----------------------------------------------------------------------------
|
|
558
|
+
# The app id is permanent and cannot be changed after creation.
|
|
559
|
+
# Use lowercase letters, numbers, and hyphens only.
|
|
560
|
+
id: my-app
|
|
561
|
+
|
|
562
|
+
# Display name shown in the Bkper UI
|
|
563
|
+
name: My App
|
|
564
|
+
|
|
565
|
+
# Brief description of what the app does
|
|
566
|
+
description: A Bkper app that does something useful
|
|
567
|
+
|
|
568
|
+
# -----------------------------------------------------------------------------
|
|
569
|
+
# BRANDING
|
|
570
|
+
# -----------------------------------------------------------------------------
|
|
571
|
+
# App logo for light mode (SVG recommended, PNG/JPG supported)
|
|
572
|
+
logoUrl: https://example.com/logo.svg
|
|
573
|
+
|
|
574
|
+
# App logo for dark mode (required for proper theming)
|
|
575
|
+
logoUrlDark: https://example.com/logo-dark.svg
|
|
576
|
+
|
|
577
|
+
# App website or documentation URL
|
|
578
|
+
website: https://example.com
|
|
579
|
+
|
|
580
|
+
# -----------------------------------------------------------------------------
|
|
581
|
+
# OWNERSHIP
|
|
582
|
+
# -----------------------------------------------------------------------------
|
|
583
|
+
# Developer/company name
|
|
584
|
+
ownerName: Your Name
|
|
585
|
+
|
|
586
|
+
# Owner's logo/avatar URL
|
|
587
|
+
ownerLogoUrl: https://example.com/owner-logo.png
|
|
588
|
+
|
|
589
|
+
# Owner's website
|
|
590
|
+
ownerWebsite: https://yoursite.com
|
|
591
|
+
|
|
592
|
+
# Source code repository URL
|
|
593
|
+
repoUrl: https://github.com/you/my-app
|
|
594
|
+
|
|
595
|
+
# Whether the repository is private
|
|
596
|
+
repoPrivate: true
|
|
597
|
+
|
|
598
|
+
# Mark as deprecated (hides from app listings, existing installs continue working)
|
|
599
|
+
deprecated: false
|
|
600
|
+
|
|
601
|
+
# -----------------------------------------------------------------------------
|
|
602
|
+
# ACCESS CONTROL
|
|
603
|
+
# -----------------------------------------------------------------------------
|
|
604
|
+
# Who can update the app configuration and deploy new versions.
|
|
605
|
+
# Comma-separated list of Bkper usernames (not emails).
|
|
606
|
+
# Supports domain wildcards for registered custom domains: *@yourdomain.com
|
|
607
|
+
developers: victor, aldo, *@bkper.com
|
|
608
|
+
|
|
609
|
+
# Who can install and use the app.
|
|
610
|
+
# Same format as developers. Leave empty for public apps.
|
|
611
|
+
users: maria, *@acme.com
|
|
612
|
+
|
|
613
|
+
# -----------------------------------------------------------------------------
|
|
614
|
+
# MENU INTEGRATION (optional)
|
|
615
|
+
# -----------------------------------------------------------------------------
|
|
616
|
+
# When configured, adds a menu item to Bkper's "More" menu.
|
|
617
|
+
# Clicking opens a popup with the specified URL.
|
|
618
|
+
|
|
619
|
+
# Production menu URL (supports variable substitution)
|
|
620
|
+
menuUrl: https://${id}.bkper.app?bookId=${book.id}
|
|
621
|
+
|
|
622
|
+
# Development menu URL (used when developer runs the app)
|
|
623
|
+
menuUrlDev: http://localhost:8787?bookId=${book.id}
|
|
624
|
+
|
|
625
|
+
# Custom menu text (defaults to app name if not specified)
|
|
626
|
+
menuText: Open My App
|
|
627
|
+
|
|
628
|
+
# Popup dimensions in pixels
|
|
629
|
+
menuPopupWidth: 500
|
|
630
|
+
menuPopupHeight: 300
|
|
631
|
+
|
|
632
|
+
# -----------------------------------------------------------------------------
|
|
633
|
+
# Menu URL Variables
|
|
634
|
+
# -----------------------------------------------------------------------------
|
|
635
|
+
# The following variables can be used in menuUrl and menuUrlDev:
|
|
636
|
+
#
|
|
637
|
+
# ${book.id} - Current book ID
|
|
638
|
+
# ${book.properties.xxx} - Book property value (replace xxx with property key)
|
|
639
|
+
# ${account.id} - Selected account ID (in account context)
|
|
640
|
+
# ${account.properties.xxx} - Account property value
|
|
641
|
+
# ${group.id} - Selected group ID (in group context)
|
|
642
|
+
# ${group.properties.xxx} - Group property value
|
|
643
|
+
# ${transactions.ids} - Comma-separated selected transaction IDs
|
|
644
|
+
# ${transactions.query} - Current search query
|
|
645
|
+
# -----------------------------------------------------------------------------
|
|
646
|
+
|
|
647
|
+
# -----------------------------------------------------------------------------
|
|
648
|
+
# EVENT HANDLING (optional)
|
|
649
|
+
# -----------------------------------------------------------------------------
|
|
650
|
+
# When configured, Bkper calls your webhook URL when subscribed events occur.
|
|
651
|
+
|
|
652
|
+
# Production webhook URL
|
|
653
|
+
webhookUrl: https://${id}.bkper.app/events
|
|
654
|
+
|
|
655
|
+
# Development webhook URL (auto-updated by bkper app dev)
|
|
656
|
+
webhookUrlDev: https://<random>.trycloudflare.com/events
|
|
657
|
+
|
|
658
|
+
# API version for event payloads
|
|
659
|
+
apiVersion: v5
|
|
660
|
+
|
|
661
|
+
# Events to subscribe to (remove events you don't need)
|
|
662
|
+
events:
|
|
663
|
+
- TRANSACTION_POSTED
|
|
664
|
+
- TRANSACTION_CHECKED
|
|
665
|
+
- TRANSACTION_UNCHECKED
|
|
666
|
+
- TRANSACTION_UPDATED
|
|
667
|
+
- TRANSACTION_DELETED
|
|
668
|
+
- TRANSACTION_RESTORED
|
|
669
|
+
- ACCOUNT_CREATED
|
|
670
|
+
- ACCOUNT_UPDATED
|
|
671
|
+
- ACCOUNT_DELETED
|
|
672
|
+
- GROUP_CREATED
|
|
673
|
+
- GROUP_UPDATED
|
|
674
|
+
- GROUP_DELETED
|
|
675
|
+
- FILE_CREATED
|
|
676
|
+
- BOOK_UPDATED
|
|
677
|
+
|
|
678
|
+
# -----------------------------------------------------------------------------
|
|
679
|
+
# FILE PATTERNS (optional)
|
|
680
|
+
# -----------------------------------------------------------------------------
|
|
681
|
+
# For file processing apps. When a file matching these patterns is uploaded,
|
|
682
|
+
# a FILE_CREATED event is triggered with the file content.
|
|
683
|
+
filePatterns:
|
|
684
|
+
- '*.ofx'
|
|
685
|
+
- '*.csv'
|
|
686
|
+
|
|
687
|
+
# -----------------------------------------------------------------------------
|
|
688
|
+
# PROPERTIES SCHEMA (optional)
|
|
689
|
+
# -----------------------------------------------------------------------------
|
|
690
|
+
# Defines autocomplete suggestions for custom properties in the Bkper UI.
|
|
691
|
+
# Helps users discover and use the correct property keys/values for your app.
|
|
692
|
+
propertiesSchema:
|
|
693
|
+
book:
|
|
694
|
+
keys:
|
|
695
|
+
- my_app_enabled
|
|
696
|
+
- my_app_config
|
|
697
|
+
values:
|
|
698
|
+
- 'true'
|
|
699
|
+
- 'false'
|
|
700
|
+
group:
|
|
701
|
+
keys:
|
|
702
|
+
- my_app_category
|
|
703
|
+
values:
|
|
704
|
+
- category_a
|
|
705
|
+
- category_b
|
|
706
|
+
account:
|
|
707
|
+
keys:
|
|
708
|
+
- my_app_sync_id
|
|
709
|
+
transaction:
|
|
710
|
+
keys:
|
|
711
|
+
- my_app_reference
|
|
712
|
+
|
|
713
|
+
# -----------------------------------------------------------------------------
|
|
714
|
+
# DEPLOYMENT CONFIGURATION (optional)
|
|
715
|
+
# -----------------------------------------------------------------------------
|
|
716
|
+
# For apps deployed to Bkper's Workers for Platforms infrastructure.
|
|
717
|
+
deployment:
|
|
718
|
+
# Web handler (serves UI and API)
|
|
719
|
+
web:
|
|
720
|
+
bundle: packages/web/server/dist
|
|
721
|
+
# assets: packages/web/client/dist # Static assets (when supported)
|
|
722
|
+
|
|
723
|
+
# Events handler (processes webhooks)
|
|
724
|
+
events:
|
|
725
|
+
bundle: packages/events/dist
|
|
726
|
+
|
|
727
|
+
# Platform services available to your app (one per type, auto-provisioned)
|
|
728
|
+
# See: https://developers.cloudflare.com/kv/
|
|
729
|
+
services:
|
|
730
|
+
- KV # Key-value storage
|
|
731
|
+
```
|
|
732
|
+
|
|
733
|
+
</details>
|
|
527
734
|
|
|
528
735
|
**Environment variables:**
|
|
529
736
|
|
|
@@ -534,14 +741,15 @@ Apps are configured via a `bkper.yaml` file in the project root. See the complet
|
|
|
534
741
|
|
|
535
742
|
#### Authentication
|
|
536
743
|
|
|
537
|
-
- `login` - Authenticate with Bkper, storing credentials locally
|
|
538
|
-
- `logout` - Remove stored credentials
|
|
744
|
+
- `auth login` - Authenticate with Bkper, storing credentials locally
|
|
745
|
+
- `auth logout` - Remove stored credentials
|
|
746
|
+
- `auth token` - Print the current OAuth access token to stdout
|
|
539
747
|
|
|
540
748
|
#### App Lifecycle
|
|
541
749
|
|
|
542
750
|
- `app init <name>` - Scaffold a new app from the template
|
|
543
751
|
- `app list` - List all apps you have access to
|
|
544
|
-
- `app sync` - Sync [bkper.yaml reference] configuration (URLs, description) to Bkper API
|
|
752
|
+
- `app sync` - Sync [bkper.yaml][bkper.yaml reference] configuration (URLs, description) to Bkper API
|
|
545
753
|
- `app build` - Build app artifacts
|
|
546
754
|
- `app deploy` - Deploy built artifacts to Cloudflare Workers for Platforms
|
|
547
755
|
- `-p, --preview` - Deploy to preview environment
|
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":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,eAAe,CAAC,CAAC,sDAAsD;AAE9E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE1D,UAAU;AACV,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;AAE1C,+BAA+B;AAC/B,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,oCAAoC,EAAE,OAAO,CAAC,CAAC;AACnF,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,0CAA0C,CAAC,CAAC;AAErE,gBAAgB;AAChB,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAE9B,oBAAoB;AACpB,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAC7B,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC9B,uBAAuB,CAAC,OAAO,CAAC,CAAC;AACjC,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC/B,2BAA2B,CAAC,OAAO,CAAC,CAAC;AACrC,uBAAuB,CAAC,OAAO,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.2",
|
|
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",
|