@basis-theory-labs/cli 4.2.0 → 4.3.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 +174 -8
- package/dist/commands/proxies/logs/read.d.ts +14 -0
- package/dist/commands/proxies/logs/read.js +56 -0
- package/dist/commands/proxies/logs/tail.d.ts +13 -0
- package/dist/commands/proxies/logs/tail.js +50 -0
- package/dist/commands/proxies/logs.js +1 -1
- package/dist/commands/reactors/logs/read.d.ts +14 -0
- package/dist/commands/reactors/logs/read.js +56 -0
- package/dist/commands/reactors/logs/tail.d.ts +13 -0
- package/dist/commands/reactors/logs/tail.js +50 -0
- package/dist/commands/reactors/logs.js +1 -1
- package/dist/logs/events.d.ts +56 -0
- package/dist/logs/events.js +571 -0
- package/dist/logs/format.d.ts +10 -0
- package/dist/logs/format.js +162 -0
- package/dist/logs/index.js +17 -0
- package/dist/logs/runtime.d.ts +18 -0
- package/dist/logs/runtime.js +362 -0
- package/dist/logs/time.d.ts +16 -0
- package/dist/logs/time.js +74 -0
- package/oclif.manifest.json +235 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ $ npm install -g @basis-theory-labs/cli
|
|
|
19
19
|
$ bt COMMAND
|
|
20
20
|
running command...
|
|
21
21
|
$ bt (--version)
|
|
22
|
-
@basis-theory-labs/cli/4.
|
|
22
|
+
@basis-theory-labs/cli/4.3.0 linux-x64 node-v22.23.3
|
|
23
23
|
$ bt --help [COMMAND]
|
|
24
24
|
USAGE
|
|
25
25
|
$ bt COMMAND
|
|
@@ -36,11 +36,15 @@ USAGE
|
|
|
36
36
|
* [`bt proxies create`](#bt-proxies-create)
|
|
37
37
|
* [`bt proxies delete ID`](#bt-proxies-delete-id)
|
|
38
38
|
* [`bt proxies logs [ID]`](#bt-proxies-logs-id)
|
|
39
|
+
* [`bt proxies logs read ID`](#bt-proxies-logs-read-id)
|
|
40
|
+
* [`bt proxies logs tail ID`](#bt-proxies-logs-tail-id)
|
|
39
41
|
* [`bt proxies update ID`](#bt-proxies-update-id)
|
|
40
42
|
* [`bt reactors`](#bt-reactors)
|
|
41
43
|
* [`bt reactors create`](#bt-reactors-create)
|
|
42
44
|
* [`bt reactors delete ID`](#bt-reactors-delete-id)
|
|
43
45
|
* [`bt reactors logs [ID]`](#bt-reactors-logs-id)
|
|
46
|
+
* [`bt reactors logs read ID`](#bt-reactors-logs-read-id)
|
|
47
|
+
* [`bt reactors logs tail ID`](#bt-reactors-logs-tail-id)
|
|
44
48
|
* [`bt reactors update ID`](#bt-reactors-update-id)
|
|
45
49
|
|
|
46
50
|
## `bt applications`
|
|
@@ -62,7 +66,7 @@ EXAMPLES
|
|
|
62
66
|
$ bt applications
|
|
63
67
|
```
|
|
64
68
|
|
|
65
|
-
_See code: [dist/commands/applications/index.ts](https://github.com/Basis-Theory-Labs/basistheory-cli/blob/v4.
|
|
69
|
+
_See code: [dist/commands/applications/index.ts](https://github.com/Basis-Theory-Labs/basistheory-cli/blob/v4.3.0/dist/commands/applications/index.ts)_
|
|
66
70
|
|
|
67
71
|
## `bt applications create`
|
|
68
72
|
|
|
@@ -151,7 +155,7 @@ EXAMPLES
|
|
|
151
155
|
$ bt proxies
|
|
152
156
|
```
|
|
153
157
|
|
|
154
|
-
_See code: [dist/commands/proxies/index.ts](https://github.com/Basis-Theory-Labs/basistheory-cli/blob/v4.
|
|
158
|
+
_See code: [dist/commands/proxies/index.ts](https://github.com/Basis-Theory-Labs/basistheory-cli/blob/v4.3.0/dist/commands/proxies/index.ts)_
|
|
155
159
|
|
|
156
160
|
## `bt proxies create`
|
|
157
161
|
|
|
@@ -256,7 +260,7 @@ EXAMPLES
|
|
|
256
260
|
|
|
257
261
|
## `bt proxies logs [ID]`
|
|
258
262
|
|
|
259
|
-
|
|
263
|
+
Legacy tunnel-based Proxy Transform logs. Opens a local tunnel and updates logging configuration. For v2/runtime debugging, use `bt proxies logs tail <id>` or `bt proxies logs read <id>`. Requires `proxy:update` Management Application permissions
|
|
260
264
|
|
|
261
265
|
```
|
|
262
266
|
USAGE
|
|
@@ -270,7 +274,9 @@ FLAGS
|
|
|
270
274
|
-x, --management-key=<value> (required) management key used for connecting with the reactor / proxy
|
|
271
275
|
|
|
272
276
|
DESCRIPTION
|
|
273
|
-
|
|
277
|
+
Legacy tunnel-based Proxy Transform logs. Opens a local tunnel and updates logging configuration. For v2/runtime
|
|
278
|
+
debugging, use `bt proxies logs tail <id>` or `bt proxies logs read <id>`. Requires `proxy:update` Management
|
|
279
|
+
Application permissions
|
|
274
280
|
|
|
275
281
|
EXAMPLES
|
|
276
282
|
$ bt proxies logs
|
|
@@ -280,6 +286,86 @@ EXAMPLES
|
|
|
280
286
|
$ bt proxies logs 03858bf5-32d3-4a2e-b74b-daeea0883bca -p 3000
|
|
281
287
|
```
|
|
282
288
|
|
|
289
|
+
## `bt proxies logs read ID`
|
|
290
|
+
|
|
291
|
+
Read a fixed window of Proxy runtime logs through Events and exit. Requires `event:read` and runtime logging already enabled.
|
|
292
|
+
|
|
293
|
+
```
|
|
294
|
+
USAGE
|
|
295
|
+
$ bt proxies logs read ID -x <value> [--since <value>] [--until <value>] [--format pretty|json|json-pretty]
|
|
296
|
+
|
|
297
|
+
ARGUMENTS
|
|
298
|
+
ID Proxy id
|
|
299
|
+
|
|
300
|
+
FLAGS
|
|
301
|
+
-x, --management-key=<value> (required) management key used for connecting with the reactor / proxy
|
|
302
|
+
--format=<option> [default: pretty] pretty: readable logs; json: compact objects; json-pretty: indented
|
|
303
|
+
objects. Entries are separated by blank lines; colors are enabled in terminals
|
|
304
|
+
<options: pretty|json|json-pretty>
|
|
305
|
+
--since=<value> window start: positive duration (30s, 5m, 2h, 1d, 1w) or ISO timestamp with timezone;
|
|
306
|
+
defaults to five minutes before the end
|
|
307
|
+
--until=<value> window end (exclusive): positive duration or ISO timestamp with timezone; defaults to
|
|
308
|
+
command start
|
|
309
|
+
|
|
310
|
+
DESCRIPTION
|
|
311
|
+
Read a fixed window of Proxy runtime logs through Events and exit. Requires `event:read` and runtime logging already
|
|
312
|
+
enabled.
|
|
313
|
+
|
|
314
|
+
Defaults to the five minutes preceding --until, or command start when --until is omitted. Explicit relative values use
|
|
315
|
+
command-start time. Both request and response transforms are included and distinguished. Windows include their start
|
|
316
|
+
and exclude their end, filtering event batch timestamps rather than individual record occurrence times. Each matching
|
|
317
|
+
batch is expanded in record sequence; flattened output has no global chronological ordering. History is tenant-limited
|
|
318
|
+
(24 hours by default, at most 30 days); the API clamps unavailable history. Indexing is asynchronous and pagination is
|
|
319
|
+
not a snapshot, so empty or exhausted results do not prove complete coverage. Large windows may hit bounded work
|
|
320
|
+
limits and fail with partial output. Application logs come from the injected `logger`, not arbitrary stdout or
|
|
321
|
+
`console.log`; collection requires resource opt-in and the platform runtime-log gate. Does not enable logging or open
|
|
322
|
+
a tunnel.
|
|
323
|
+
|
|
324
|
+
EXAMPLES
|
|
325
|
+
$ bt proxies logs read 03858bf5-32d3-4a2e-b74b-daeea0883bca --since 1h --until 30m
|
|
326
|
+
|
|
327
|
+
$ bt proxies logs read 03858bf5-32d3-4a2e-b74b-daeea0883bca --since 2026-10-01T10:00:00Z --until 2026-10-01T10:15:00Z --format json
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
## `bt proxies logs tail ID`
|
|
331
|
+
|
|
332
|
+
Tail Proxy runtime logs through Events. Requires `event:read` and runtime logging already enabled.
|
|
333
|
+
|
|
334
|
+
```
|
|
335
|
+
USAGE
|
|
336
|
+
$ bt proxies logs tail ID -x <value> [--since <value>] [--format pretty|json|json-pretty]
|
|
337
|
+
|
|
338
|
+
ARGUMENTS
|
|
339
|
+
ID Proxy id
|
|
340
|
+
|
|
341
|
+
FLAGS
|
|
342
|
+
-x, --management-key=<value> (required) management key used for connecting with the reactor / proxy
|
|
343
|
+
--format=<option> [default: pretty] pretty: readable logs; json: compact objects; json-pretty: indented
|
|
344
|
+
objects. Entries are separated by blank lines; colors are enabled in terminals
|
|
345
|
+
<options: pretty|json|json-pretty>
|
|
346
|
+
--since=<value> include initial history from a positive duration (30s, 5m, 2h, 1d, 1w) or ISO timestamp
|
|
347
|
+
with timezone; omitted means watch from command start
|
|
348
|
+
|
|
349
|
+
DESCRIPTION
|
|
350
|
+
Tail Proxy runtime logs through Events. Requires `event:read` and runtime logging already enabled.
|
|
351
|
+
|
|
352
|
+
Starts watching from command time. Supply --since to retrieve initial history before following new logs. Polls every
|
|
353
|
+
five seconds with a rolling five-minute overlap that never reaches before the requested start. Both request and
|
|
354
|
+
response transforms are included and distinguished. Time windows filter event batches, not individual record
|
|
355
|
+
occurrence times; a newly arriving batch can contain records that occurred before command start. History is
|
|
356
|
+
tenant-limited (24 hours by default, at most 30 days); the API clamps unavailable history. Large initial windows may
|
|
357
|
+
hit bounded work limits and fail with partial output. Visibility is delayed and best-effort; output has no durable
|
|
358
|
+
resume or global chronological ordering. Application logs come from the injected `logger`, not arbitrary stdout or
|
|
359
|
+
`console.log`; collection requires resource opt-in and the platform runtime-log gate. Silence does not distinguish an
|
|
360
|
+
idle resource, a wrong ID, disabled collection, or delayed indexing. Runs until interrupted, output closes, or an
|
|
361
|
+
error occurs.
|
|
362
|
+
|
|
363
|
+
EXAMPLES
|
|
364
|
+
$ bt proxies logs tail 03858bf5-32d3-4a2e-b74b-daeea0883bca
|
|
365
|
+
|
|
366
|
+
$ bt proxies logs tail 03858bf5-32d3-4a2e-b74b-daeea0883bca --since 30m --format json
|
|
367
|
+
```
|
|
368
|
+
|
|
283
369
|
## `bt proxies update ID`
|
|
284
370
|
|
|
285
371
|
Updates an existing Pre-Configured Proxy. Requires `proxy:update` Management Application permission
|
|
@@ -382,7 +468,7 @@ EXAMPLES
|
|
|
382
468
|
$ bt reactors
|
|
383
469
|
```
|
|
384
470
|
|
|
385
|
-
_See code: [dist/commands/reactors/index.ts](https://github.com/Basis-Theory-Labs/basistheory-cli/blob/v4.
|
|
471
|
+
_See code: [dist/commands/reactors/index.ts](https://github.com/Basis-Theory-Labs/basistheory-cli/blob/v4.3.0/dist/commands/reactors/index.ts)_
|
|
386
472
|
|
|
387
473
|
## `bt reactors create`
|
|
388
474
|
|
|
@@ -456,7 +542,7 @@ EXAMPLES
|
|
|
456
542
|
|
|
457
543
|
## `bt reactors logs [ID]`
|
|
458
544
|
|
|
459
|
-
|
|
545
|
+
Legacy tunnel-based Reactor logs. Opens a local tunnel and updates logging configuration. For v2/runtime debugging, use `bt reactors logs tail <id>` or `bt reactors logs read <id>`. Requires `reactor:update` Management Application permissions
|
|
460
546
|
|
|
461
547
|
```
|
|
462
548
|
USAGE
|
|
@@ -470,7 +556,9 @@ FLAGS
|
|
|
470
556
|
-x, --management-key=<value> (required) management key used for connecting with the reactor / proxy
|
|
471
557
|
|
|
472
558
|
DESCRIPTION
|
|
473
|
-
|
|
559
|
+
Legacy tunnel-based Reactor logs. Opens a local tunnel and updates logging configuration. For v2/runtime debugging,
|
|
560
|
+
use `bt reactors logs tail <id>` or `bt reactors logs read <id>`. Requires `reactor:update` Management Application
|
|
561
|
+
permissions
|
|
474
562
|
|
|
475
563
|
EXAMPLES
|
|
476
564
|
$ bt reactors logs
|
|
@@ -480,6 +568,84 @@ EXAMPLES
|
|
|
480
568
|
$ bt reactors logs 03858bf5-32d3-4a2e-b74b-daeea0883bca -p 3000
|
|
481
569
|
```
|
|
482
570
|
|
|
571
|
+
## `bt reactors logs read ID`
|
|
572
|
+
|
|
573
|
+
Read a fixed window of Reactor runtime logs through Events and exit. Requires `event:read` and runtime logging already enabled.
|
|
574
|
+
|
|
575
|
+
```
|
|
576
|
+
USAGE
|
|
577
|
+
$ bt reactors logs read ID -x <value> [--since <value>] [--until <value>] [--format pretty|json|json-pretty]
|
|
578
|
+
|
|
579
|
+
ARGUMENTS
|
|
580
|
+
ID Reactor id
|
|
581
|
+
|
|
582
|
+
FLAGS
|
|
583
|
+
-x, --management-key=<value> (required) management key used for connecting with the reactor / proxy
|
|
584
|
+
--format=<option> [default: pretty] pretty: readable logs; json: compact objects; json-pretty: indented
|
|
585
|
+
objects. Entries are separated by blank lines; colors are enabled in terminals
|
|
586
|
+
<options: pretty|json|json-pretty>
|
|
587
|
+
--since=<value> window start: positive duration (30s, 5m, 2h, 1d, 1w) or ISO timestamp with timezone;
|
|
588
|
+
defaults to five minutes before the end
|
|
589
|
+
--until=<value> window end (exclusive): positive duration or ISO timestamp with timezone; defaults to
|
|
590
|
+
command start
|
|
591
|
+
|
|
592
|
+
DESCRIPTION
|
|
593
|
+
Read a fixed window of Reactor runtime logs through Events and exit. Requires `event:read` and runtime logging already
|
|
594
|
+
enabled.
|
|
595
|
+
|
|
596
|
+
Defaults to the five minutes preceding --until, or command start when --until is omitted. Explicit relative values use
|
|
597
|
+
command-start time. Windows include their start and exclude their end, filtering event batch timestamps rather than
|
|
598
|
+
individual record occurrence times. Each matching batch is expanded in record sequence; flattened output has no global
|
|
599
|
+
chronological ordering. History is tenant-limited (24 hours by default, at most 30 days); the API clamps unavailable
|
|
600
|
+
history. Indexing is asynchronous and pagination is not a snapshot, so empty or exhausted results do not prove
|
|
601
|
+
complete coverage. Large windows may hit bounded work limits and fail with partial output. Application logs come from
|
|
602
|
+
the injected `logger`, not arbitrary stdout or `console.log`; collection requires resource opt-in and the platform
|
|
603
|
+
runtime-log gate. Does not enable logging or open a tunnel.
|
|
604
|
+
|
|
605
|
+
EXAMPLES
|
|
606
|
+
$ bt reactors logs read 03858bf5-32d3-4a2e-b74b-daeea0883bca --since 1h --until 30m
|
|
607
|
+
|
|
608
|
+
$ bt reactors logs read 03858bf5-32d3-4a2e-b74b-daeea0883bca --since 2026-10-01T10:00:00Z --until 2026-10-01T10:15:00Z --format json
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
## `bt reactors logs tail ID`
|
|
612
|
+
|
|
613
|
+
Tail Reactor runtime logs through Events. Requires `event:read` and runtime logging already enabled.
|
|
614
|
+
|
|
615
|
+
```
|
|
616
|
+
USAGE
|
|
617
|
+
$ bt reactors logs tail ID -x <value> [--since <value>] [--format pretty|json|json-pretty]
|
|
618
|
+
|
|
619
|
+
ARGUMENTS
|
|
620
|
+
ID Reactor id
|
|
621
|
+
|
|
622
|
+
FLAGS
|
|
623
|
+
-x, --management-key=<value> (required) management key used for connecting with the reactor / proxy
|
|
624
|
+
--format=<option> [default: pretty] pretty: readable logs; json: compact objects; json-pretty: indented
|
|
625
|
+
objects. Entries are separated by blank lines; colors are enabled in terminals
|
|
626
|
+
<options: pretty|json|json-pretty>
|
|
627
|
+
--since=<value> include initial history from a positive duration (30s, 5m, 2h, 1d, 1w) or ISO timestamp
|
|
628
|
+
with timezone; omitted means watch from command start
|
|
629
|
+
|
|
630
|
+
DESCRIPTION
|
|
631
|
+
Tail Reactor runtime logs through Events. Requires `event:read` and runtime logging already enabled.
|
|
632
|
+
|
|
633
|
+
Starts watching from command time. Supply --since to retrieve initial history before following new logs. Polls every
|
|
634
|
+
five seconds with a rolling five-minute overlap that never reaches before the requested start. Time windows filter
|
|
635
|
+
event batches, not individual record occurrence times; a newly arriving batch can contain records that occurred before
|
|
636
|
+
command start. History is tenant-limited (24 hours by default, at most 30 days); the API clamps unavailable history.
|
|
637
|
+
Large initial windows may hit bounded work limits and fail with partial output. Visibility is delayed and best-effort;
|
|
638
|
+
output has no durable resume or global chronological ordering. Application logs come from the injected `logger`, not
|
|
639
|
+
arbitrary stdout or `console.log`; collection requires resource opt-in and the platform runtime-log gate. Silence does
|
|
640
|
+
not distinguish an idle resource, a wrong ID, disabled collection, or delayed indexing. Runs until interrupted, output
|
|
641
|
+
closes, or an error occurs.
|
|
642
|
+
|
|
643
|
+
EXAMPLES
|
|
644
|
+
$ bt reactors logs tail 03858bf5-32d3-4a2e-b74b-daeea0883bca
|
|
645
|
+
|
|
646
|
+
$ bt reactors logs tail 03858bf5-32d3-4a2e-b74b-daeea0883bca --since 30m --format json
|
|
647
|
+
```
|
|
648
|
+
|
|
483
649
|
## `bt reactors update ID`
|
|
484
650
|
|
|
485
651
|
Updates an existing Reactor. Requires `reactor:update` Management Application permission
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base';
|
|
2
|
+
export default class Read extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
since: import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
until: import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
format: import("@oclif/core/lib/interfaces/parser").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_1 = require("../../../base");
|
|
5
|
+
const runtime_1 = require("../../../logs/runtime");
|
|
6
|
+
const time_1 = require("../../../logs/time");
|
|
7
|
+
class Read extends base_1.BaseCommand {
|
|
8
|
+
async run() {
|
|
9
|
+
const now = Date.now();
|
|
10
|
+
const { flags: { 'management-key': apiKey, 'api-base-url': apiBaseUrl, format, since, until, }, args: { id }, } = await this.parse(Read);
|
|
11
|
+
if (!id.trim()) {
|
|
12
|
+
this.error('Proxy id must not be blank');
|
|
13
|
+
}
|
|
14
|
+
await (0, runtime_1.readEventLogs)({
|
|
15
|
+
apiKey,
|
|
16
|
+
apiBaseUrl,
|
|
17
|
+
resourceType: 'proxy',
|
|
18
|
+
resourceId: id,
|
|
19
|
+
format: format,
|
|
20
|
+
window: (0, time_1.resolveLogWindow)({
|
|
21
|
+
since,
|
|
22
|
+
until,
|
|
23
|
+
}, now),
|
|
24
|
+
});
|
|
25
|
+
// Cleanup has completed. Oclif's final flush would stall on a pending write.
|
|
26
|
+
if (process.stdout.writableLength > 0 && process.exitCode !== undefined) {
|
|
27
|
+
this.exit(process.exitCode);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.default = Read;
|
|
32
|
+
Read.description = 'Read a fixed window of Proxy runtime logs through Events and exit. Requires `event:read` and runtime logging already enabled.\n\n' +
|
|
33
|
+
'Defaults to the five minutes preceding --until, or command start when --until is omitted. Explicit relative values use command-start time. Both request and response transforms are included and distinguished. Windows include their start and exclude their end, filtering event batch timestamps rather than individual record occurrence times. Each matching batch is expanded in record sequence; flattened output has no global chronological ordering. History is tenant-limited (24 hours by default, at most 30 days); the API clamps unavailable history. Indexing is asynchronous and pagination is not a snapshot, so empty or exhausted results do not prove complete coverage. Large windows may hit bounded work limits and fail with partial output. Application logs come from the injected `logger`, not arbitrary stdout or `console.log`; collection requires resource opt-in and the platform runtime-log gate. Does not enable logging or open a tunnel.';
|
|
34
|
+
Read.examples = [
|
|
35
|
+
'<%= config.bin %> proxies logs read 03858bf5-32d3-4a2e-b74b-daeea0883bca --since 1h --until 30m',
|
|
36
|
+
'<%= config.bin %> proxies logs read 03858bf5-32d3-4a2e-b74b-daeea0883bca --since 2026-10-01T10:00:00Z --until 2026-10-01T10:15:00Z --format json',
|
|
37
|
+
];
|
|
38
|
+
Read.args = {
|
|
39
|
+
id: core_1.Args.string({
|
|
40
|
+
description: 'Proxy id',
|
|
41
|
+
required: true,
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
44
|
+
Read.flags = {
|
|
45
|
+
since: core_1.Flags.string({
|
|
46
|
+
description: 'window start: positive duration (30s, 5m, 2h, 1d, 1w) or ISO timestamp with timezone; defaults to five minutes before the end',
|
|
47
|
+
}),
|
|
48
|
+
until: core_1.Flags.string({
|
|
49
|
+
description: 'window end (exclusive): positive duration or ISO timestamp with timezone; defaults to command start',
|
|
50
|
+
}),
|
|
51
|
+
format: core_1.Flags.string({
|
|
52
|
+
description: 'pretty: readable logs; json: compact objects; json-pretty: indented objects. Entries are separated by blank lines; colors are enabled in terminals',
|
|
53
|
+
options: ['pretty', 'json', 'json-pretty'],
|
|
54
|
+
default: 'pretty',
|
|
55
|
+
}),
|
|
56
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base';
|
|
2
|
+
export default class Tail extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
since: import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
format: import("@oclif/core/lib/interfaces/parser").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_1 = require("../../../base");
|
|
5
|
+
const runtime_1 = require("../../../logs/runtime");
|
|
6
|
+
const time_1 = require("../../../logs/time");
|
|
7
|
+
class Tail extends base_1.BaseCommand {
|
|
8
|
+
async run() {
|
|
9
|
+
const now = Date.now();
|
|
10
|
+
const { flags: { 'management-key': apiKey, 'api-base-url': apiBaseUrl, format, since, }, args: { id }, } = await this.parse(Tail);
|
|
11
|
+
if (!id.trim()) {
|
|
12
|
+
this.error('Proxy id must not be blank');
|
|
13
|
+
}
|
|
14
|
+
await (0, runtime_1.followEventLogs)({
|
|
15
|
+
apiKey,
|
|
16
|
+
apiBaseUrl,
|
|
17
|
+
resourceType: 'proxy',
|
|
18
|
+
resourceId: id,
|
|
19
|
+
format: format,
|
|
20
|
+
window: (0, time_1.resolveTailWindow)({ since }, now),
|
|
21
|
+
});
|
|
22
|
+
// Cleanup has completed. Oclif's final flush would stall on a pending write.
|
|
23
|
+
if (process.stdout.writableLength > 0 && process.exitCode !== undefined) {
|
|
24
|
+
this.exit(process.exitCode);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.default = Tail;
|
|
29
|
+
Tail.description = 'Tail Proxy runtime logs through Events. Requires `event:read` and runtime logging already enabled.\n\n' +
|
|
30
|
+
'Starts watching from command time. Supply --since to retrieve initial history before following new logs. Polls every five seconds with a rolling five-minute overlap that never reaches before the requested start. Both request and response transforms are included and distinguished. Time windows filter event batches, not individual record occurrence times; a newly arriving batch can contain records that occurred before command start. History is tenant-limited (24 hours by default, at most 30 days); the API clamps unavailable history. Large initial windows may hit bounded work limits and fail with partial output. Visibility is delayed and best-effort; output has no durable resume or global chronological ordering. Application logs come from the injected `logger`, not arbitrary stdout or `console.log`; collection requires resource opt-in and the platform runtime-log gate. Silence does not distinguish an idle resource, a wrong ID, disabled collection, or delayed indexing. Runs until interrupted, output closes, or an error occurs.';
|
|
31
|
+
Tail.examples = [
|
|
32
|
+
'<%= config.bin %> proxies logs tail 03858bf5-32d3-4a2e-b74b-daeea0883bca',
|
|
33
|
+
'<%= config.bin %> proxies logs tail 03858bf5-32d3-4a2e-b74b-daeea0883bca --since 30m --format json',
|
|
34
|
+
];
|
|
35
|
+
Tail.args = {
|
|
36
|
+
id: core_1.Args.string({
|
|
37
|
+
description: 'Proxy id',
|
|
38
|
+
required: true,
|
|
39
|
+
}),
|
|
40
|
+
};
|
|
41
|
+
Tail.flags = {
|
|
42
|
+
since: core_1.Flags.string({
|
|
43
|
+
description: 'include initial history from a positive duration (30s, 5m, 2h, 1d, 1w) or ISO timestamp with timezone; omitted means watch from command start',
|
|
44
|
+
}),
|
|
45
|
+
format: core_1.Flags.string({
|
|
46
|
+
description: 'pretty: readable logs; json: compact objects; json-pretty: indented objects. Entries are separated by blank lines; colors are enabled in terminals',
|
|
47
|
+
options: ['pretty', 'json', 'json-pretty'],
|
|
48
|
+
default: 'pretty',
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
@@ -19,7 +19,7 @@ class Logs extends base_1.BaseCommand {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
exports.default = Logs;
|
|
22
|
-
Logs.description = '
|
|
22
|
+
Logs.description = 'Legacy tunnel-based Proxy Transform logs. Opens a local tunnel and updates logging configuration. For v2/runtime debugging, use `bt proxies logs tail <id>` or `bt proxies logs read <id>`. Requires `proxy:update` Management Application permissions';
|
|
23
23
|
Logs.examples = [
|
|
24
24
|
'<%= config.bin %> <%= command.id %>',
|
|
25
25
|
'<%= config.bin %> <%= command.id %> 03858bf5-32d3-4a2e-b74b-daeea0883bca',
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base';
|
|
2
|
+
export default class Read extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
since: import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
until: import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
format: import("@oclif/core/lib/interfaces/parser").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_1 = require("../../../base");
|
|
5
|
+
const runtime_1 = require("../../../logs/runtime");
|
|
6
|
+
const time_1 = require("../../../logs/time");
|
|
7
|
+
class Read extends base_1.BaseCommand {
|
|
8
|
+
async run() {
|
|
9
|
+
const now = Date.now();
|
|
10
|
+
const { flags: { 'management-key': apiKey, 'api-base-url': apiBaseUrl, format, since, until, }, args: { id }, } = await this.parse(Read);
|
|
11
|
+
if (!id.trim()) {
|
|
12
|
+
this.error('Reactor id must not be blank');
|
|
13
|
+
}
|
|
14
|
+
await (0, runtime_1.readEventLogs)({
|
|
15
|
+
apiKey,
|
|
16
|
+
apiBaseUrl,
|
|
17
|
+
resourceType: 'reactor',
|
|
18
|
+
resourceId: id,
|
|
19
|
+
format: format,
|
|
20
|
+
window: (0, time_1.resolveLogWindow)({
|
|
21
|
+
since,
|
|
22
|
+
until,
|
|
23
|
+
}, now),
|
|
24
|
+
});
|
|
25
|
+
// Cleanup has completed. Oclif's final flush would stall on a pending write.
|
|
26
|
+
if (process.stdout.writableLength > 0 && process.exitCode !== undefined) {
|
|
27
|
+
this.exit(process.exitCode);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.default = Read;
|
|
32
|
+
Read.description = 'Read a fixed window of Reactor runtime logs through Events and exit. Requires `event:read` and runtime logging already enabled.\n\n' +
|
|
33
|
+
'Defaults to the five minutes preceding --until, or command start when --until is omitted. Explicit relative values use command-start time. Windows include their start and exclude their end, filtering event batch timestamps rather than individual record occurrence times. Each matching batch is expanded in record sequence; flattened output has no global chronological ordering. History is tenant-limited (24 hours by default, at most 30 days); the API clamps unavailable history. Indexing is asynchronous and pagination is not a snapshot, so empty or exhausted results do not prove complete coverage. Large windows may hit bounded work limits and fail with partial output. Application logs come from the injected `logger`, not arbitrary stdout or `console.log`; collection requires resource opt-in and the platform runtime-log gate. Does not enable logging or open a tunnel.';
|
|
34
|
+
Read.examples = [
|
|
35
|
+
'<%= config.bin %> reactors logs read 03858bf5-32d3-4a2e-b74b-daeea0883bca --since 1h --until 30m',
|
|
36
|
+
'<%= config.bin %> reactors logs read 03858bf5-32d3-4a2e-b74b-daeea0883bca --since 2026-10-01T10:00:00Z --until 2026-10-01T10:15:00Z --format json',
|
|
37
|
+
];
|
|
38
|
+
Read.args = {
|
|
39
|
+
id: core_1.Args.string({
|
|
40
|
+
description: 'Reactor id',
|
|
41
|
+
required: true,
|
|
42
|
+
}),
|
|
43
|
+
};
|
|
44
|
+
Read.flags = {
|
|
45
|
+
since: core_1.Flags.string({
|
|
46
|
+
description: 'window start: positive duration (30s, 5m, 2h, 1d, 1w) or ISO timestamp with timezone; defaults to five minutes before the end',
|
|
47
|
+
}),
|
|
48
|
+
until: core_1.Flags.string({
|
|
49
|
+
description: 'window end (exclusive): positive duration or ISO timestamp with timezone; defaults to command start',
|
|
50
|
+
}),
|
|
51
|
+
format: core_1.Flags.string({
|
|
52
|
+
description: 'pretty: readable logs; json: compact objects; json-pretty: indented objects. Entries are separated by blank lines; colors are enabled in terminals',
|
|
53
|
+
options: ['pretty', 'json', 'json-pretty'],
|
|
54
|
+
default: 'pretty',
|
|
55
|
+
}),
|
|
56
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base';
|
|
2
|
+
export default class Tail extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
since: import("@oclif/core/lib/interfaces/parser").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
format: import("@oclif/core/lib/interfaces/parser").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_1 = require("../../../base");
|
|
5
|
+
const runtime_1 = require("../../../logs/runtime");
|
|
6
|
+
const time_1 = require("../../../logs/time");
|
|
7
|
+
class Tail extends base_1.BaseCommand {
|
|
8
|
+
async run() {
|
|
9
|
+
const now = Date.now();
|
|
10
|
+
const { flags: { 'management-key': apiKey, 'api-base-url': apiBaseUrl, format, since, }, args: { id }, } = await this.parse(Tail);
|
|
11
|
+
if (!id.trim()) {
|
|
12
|
+
this.error('Reactor id must not be blank');
|
|
13
|
+
}
|
|
14
|
+
await (0, runtime_1.followEventLogs)({
|
|
15
|
+
apiKey,
|
|
16
|
+
apiBaseUrl,
|
|
17
|
+
resourceType: 'reactor',
|
|
18
|
+
resourceId: id,
|
|
19
|
+
format: format,
|
|
20
|
+
window: (0, time_1.resolveTailWindow)({ since }, now),
|
|
21
|
+
});
|
|
22
|
+
// Cleanup has completed. Oclif's final flush would stall on a pending write.
|
|
23
|
+
if (process.stdout.writableLength > 0 && process.exitCode !== undefined) {
|
|
24
|
+
this.exit(process.exitCode);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.default = Tail;
|
|
29
|
+
Tail.description = 'Tail Reactor runtime logs through Events. Requires `event:read` and runtime logging already enabled.\n\n' +
|
|
30
|
+
'Starts watching from command time. Supply --since to retrieve initial history before following new logs. Polls every five seconds with a rolling five-minute overlap that never reaches before the requested start. Time windows filter event batches, not individual record occurrence times; a newly arriving batch can contain records that occurred before command start. History is tenant-limited (24 hours by default, at most 30 days); the API clamps unavailable history. Large initial windows may hit bounded work limits and fail with partial output. Visibility is delayed and best-effort; output has no durable resume or global chronological ordering. Application logs come from the injected `logger`, not arbitrary stdout or `console.log`; collection requires resource opt-in and the platform runtime-log gate. Silence does not distinguish an idle resource, a wrong ID, disabled collection, or delayed indexing. Runs until interrupted, output closes, or an error occurs.';
|
|
31
|
+
Tail.examples = [
|
|
32
|
+
'<%= config.bin %> reactors logs tail 03858bf5-32d3-4a2e-b74b-daeea0883bca',
|
|
33
|
+
'<%= config.bin %> reactors logs tail 03858bf5-32d3-4a2e-b74b-daeea0883bca --since 30m --format json',
|
|
34
|
+
];
|
|
35
|
+
Tail.args = {
|
|
36
|
+
id: core_1.Args.string({
|
|
37
|
+
description: 'Reactor id',
|
|
38
|
+
required: true,
|
|
39
|
+
}),
|
|
40
|
+
};
|
|
41
|
+
Tail.flags = {
|
|
42
|
+
since: core_1.Flags.string({
|
|
43
|
+
description: 'include initial history from a positive duration (30s, 5m, 2h, 1d, 1w) or ISO timestamp with timezone; omitted means watch from command start',
|
|
44
|
+
}),
|
|
45
|
+
format: core_1.Flags.string({
|
|
46
|
+
description: 'pretty: readable logs; json: compact objects; json-pretty: indented objects. Entries are separated by blank lines; colors are enabled in terminals',
|
|
47
|
+
options: ['pretty', 'json', 'json-pretty'],
|
|
48
|
+
default: 'pretty',
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
@@ -19,7 +19,7 @@ class Logs extends base_1.BaseCommand {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
exports.default = Logs;
|
|
22
|
-
Logs.description = '
|
|
22
|
+
Logs.description = 'Legacy tunnel-based Reactor logs. Opens a local tunnel and updates logging configuration. For v2/runtime debugging, use `bt reactors logs tail <id>` or `bt reactors logs read <id>`. Requires `reactor:update` Management Application permissions';
|
|
23
23
|
Logs.examples = [
|
|
24
24
|
'<%= config.bin %> <%= command.id %>',
|
|
25
25
|
'<%= config.bin %> <%= command.id %> 03858bf5-32d3-4a2e-b74b-daeea0883bca',
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
type ResourceType = 'reactor' | 'proxy';
|
|
2
|
+
interface EventLogRecord {
|
|
3
|
+
event_id: string;
|
|
4
|
+
event_type: string;
|
|
5
|
+
event_timestamp: string;
|
|
6
|
+
tenant_id: string;
|
|
7
|
+
trace_id?: string;
|
|
8
|
+
resource_type: ResourceType;
|
|
9
|
+
resource_id: string;
|
|
10
|
+
invocation_id: string;
|
|
11
|
+
transform_type?: 'request_transform' | 'response_transform';
|
|
12
|
+
occurred_at: string;
|
|
13
|
+
sequence: number;
|
|
14
|
+
source: 'application' | 'platform';
|
|
15
|
+
record_type: 'log' | 'lifecycle';
|
|
16
|
+
level?: string;
|
|
17
|
+
message?: string | null;
|
|
18
|
+
attributes?: Record<string, unknown>;
|
|
19
|
+
error?: {
|
|
20
|
+
type: string;
|
|
21
|
+
message: string;
|
|
22
|
+
stack_trace?: string;
|
|
23
|
+
};
|
|
24
|
+
event?: string;
|
|
25
|
+
outcome?: string;
|
|
26
|
+
duration_ms?: number;
|
|
27
|
+
}
|
|
28
|
+
interface EventLogPage {
|
|
29
|
+
batches: EventLogRecord[][];
|
|
30
|
+
next: string | null;
|
|
31
|
+
}
|
|
32
|
+
declare class EventsReadError extends Error {
|
|
33
|
+
readonly retryable: boolean;
|
|
34
|
+
readonly retryAfterMs?: number;
|
|
35
|
+
constructor(message: string, options?: {
|
|
36
|
+
retryable?: boolean;
|
|
37
|
+
retryAfterMs?: number;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/** Resolve and validate the API origin before any credential is sent. */
|
|
41
|
+
declare const resolveEventsOrigin: (apiBaseUrl?: string) => string;
|
|
42
|
+
interface ReadEventPageOptions {
|
|
43
|
+
origin: string;
|
|
44
|
+
apiKey: string;
|
|
45
|
+
resourceType: ResourceType;
|
|
46
|
+
resourceId: string;
|
|
47
|
+
start: number;
|
|
48
|
+
end: number;
|
|
49
|
+
cursor?: string;
|
|
50
|
+
signal: AbortSignal;
|
|
51
|
+
onBytes: (bytes: number) => void;
|
|
52
|
+
}
|
|
53
|
+
/** Read and validate one Events page. Continuations contain only the opaque cursor. */
|
|
54
|
+
declare const readEventPage: (options: ReadEventPageOptions) => Promise<EventLogPage>;
|
|
55
|
+
export type { EventLogPage, EventLogRecord, ReadEventPageOptions, ResourceType, };
|
|
56
|
+
export { EventsReadError, readEventPage, resolveEventsOrigin };
|