@solongate/proxy 0.81.37 → 0.81.39
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/client.d.ts +8 -0
- package/dist/api-client/device-login.d.ts +16 -0
- package/dist/api-client/index.d.ts +1 -0
- package/dist/commands/index.js +3 -0
- package/dist/index.js +487 -275
- package/dist/tui/index.js +285 -67
- package/dist/tui/panels/Accounts.d.ts +7 -0
- package/package.json +1 -1
|
@@ -14,6 +14,14 @@ export declare function listAccounts(): SavedAccount[];
|
|
|
14
14
|
/** Upsert an account (dedupe by apiKey). Called from `login`. */
|
|
15
15
|
export declare function saveAccount(acc: SavedAccount): void;
|
|
16
16
|
export declare function setViewCredentials(creds: Credentials | null): void;
|
|
17
|
+
/** True when the given key is the ACTIVE one the guard hooks use. */
|
|
18
|
+
export declare function isActiveAccount(apiKey: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Make an account the ACTIVE one the guard hooks read (writes the active-key
|
|
21
|
+
* file). Used when a dataroom login should also become this device's enforcing
|
|
22
|
+
* account. Best-effort; returns false on failure.
|
|
23
|
+
*/
|
|
24
|
+
export declare function setActiveAccount(creds: Credentials): boolean;
|
|
17
25
|
/**
|
|
18
26
|
* Thrown for any non-2xx response. `code`/`message` come from the API's
|
|
19
27
|
* `{ error: { code, message } }` envelope when present; `status` is the HTTP
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface DeviceStart {
|
|
2
|
+
deviceCode: string;
|
|
3
|
+
verifyUrl: string;
|
|
4
|
+
intervalMs: number;
|
|
5
|
+
expiresAt: number;
|
|
6
|
+
}
|
|
7
|
+
export interface DevicePoll {
|
|
8
|
+
status: 'pending' | 'approved' | 'expired' | 'not_found';
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
project?: string;
|
|
11
|
+
user?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Best-effort browser open. No-op on failure (headless / missing opener). */
|
|
14
|
+
export declare function openBrowser(url: string): void;
|
|
15
|
+
export declare function startDeviceLogin(apiUrl?: string): Promise<DeviceStart>;
|
|
16
|
+
export declare function pollDeviceLogin(apiUrl: string, deviceCode: string): Promise<DevicePoll>;
|
package/dist/commands/index.js
CHANGED
|
@@ -139,6 +139,9 @@ async function request(method, path, opts = {}) {
|
|
|
139
139
|
return json;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
// src/api-client/device-login.ts
|
|
143
|
+
import { spawn } from "child_process";
|
|
144
|
+
|
|
142
145
|
// src/api-client/policies.ts
|
|
143
146
|
var policies_exports = {};
|
|
144
147
|
__export(policies_exports, {
|