@north-light/crouter-api 0.3.283 → 0.3.285
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/dist/api/client.d.ts +3 -1
- package/dist/shared/env.d.ts +5 -0
- package/dist/shared/env.js +8 -0
- package/package.json +1 -1
package/dist/api/client.d.ts
CHANGED
|
@@ -28,7 +28,9 @@ export interface CrtrClientOptions {
|
|
|
28
28
|
socketPath?: string;
|
|
29
29
|
/** `http(s)://host:port` for TCP/remote transport. */
|
|
30
30
|
baseUrl?: string;
|
|
31
|
-
/** Extra headers
|
|
31
|
+
/** Extra headers, e.g. `{ authorization: 'Bearer <token>' }` when the target
|
|
32
|
+
* crtrd's TCP listener has `CRTRD_TOKEN` set (unix-socket transport is
|
|
33
|
+
* never checked, and a TCP daemon with no token set ignores this too). */
|
|
32
34
|
headers?: Record<string, string>;
|
|
33
35
|
/** Autostart on a cold socket (default true for socketPath, false for baseUrl). */
|
|
34
36
|
autostart?: boolean;
|
package/dist/shared/env.d.ts
CHANGED
|
@@ -56,6 +56,11 @@ export declare function envNoDaemonAutostart(): boolean;
|
|
|
56
56
|
/** The `--tcp` fallback for crtrd's opt-in TCP listener (`CRTRD_TCP`), raw
|
|
57
57
|
* (`host:port` or undefined — absent means unix socket only). */
|
|
58
58
|
export declare function envCrtrdTcp(): string | undefined;
|
|
59
|
+
/** The opt-in bearer token guarding crtrd's TCP listener (`CRTRD_TOKEN`).
|
|
60
|
+
* Unset (or blank) → undefined, and the TCP listener performs NO auth check
|
|
61
|
+
* at all — exactly today's behavior. The unix socket never checks this,
|
|
62
|
+
* set or not. */
|
|
63
|
+
export declare function envCrtrdToken(): string | undefined;
|
|
59
64
|
/** Kill switch for the host-exports writer/pruner (`CRTR_NO_EXPORTS=1`). */
|
|
60
65
|
export declare function envNoExports(): boolean;
|
|
61
66
|
/** Verbose-diagnostics gate for otherwise-silent best-effort catches
|
package/dist/shared/env.js
CHANGED
|
@@ -137,6 +137,14 @@ export function envNoDaemonAutostart() {
|
|
|
137
137
|
export function envCrtrdTcp() {
|
|
138
138
|
return process.env['CRTRD_TCP'];
|
|
139
139
|
}
|
|
140
|
+
/** The opt-in bearer token guarding crtrd's TCP listener (`CRTRD_TOKEN`).
|
|
141
|
+
* Unset (or blank) → undefined, and the TCP listener performs NO auth check
|
|
142
|
+
* at all — exactly today's behavior. The unix socket never checks this,
|
|
143
|
+
* set or not. */
|
|
144
|
+
export function envCrtrdToken() {
|
|
145
|
+
const raw = process.env['CRTRD_TOKEN'];
|
|
146
|
+
return raw !== undefined && raw !== '' ? raw : undefined;
|
|
147
|
+
}
|
|
140
148
|
/** Kill switch for the host-exports writer/pruner (`CRTR_NO_EXPORTS=1`). */
|
|
141
149
|
export function envNoExports() {
|
|
142
150
|
return process.env['CRTR_NO_EXPORTS'] === '1';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@north-light/crouter-api",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.285",
|
|
4
4
|
"description": "Typed crtrd /v1 API contract — DTOs, route builders, the error contract, the CrtrClient, and the command-plugin manifest format. Zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/api/index.js",
|