@zaflun/lumio-cli 0.3.0 → 0.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +13 -0
  2. package/dist/index.js +850 -88
  3. package/package.json +16 -13
package/dist/index.d.ts CHANGED
@@ -9,6 +9,17 @@ declare class CredentialStore {
9
9
  getApiUrl(): string;
10
10
  isAuthenticated(): boolean;
11
11
  saveToken(token: string, apiUrl?: string): void;
12
+ /**
13
+ * Persist a full session from the browser PKCE flow — the short-lived JWT plus
14
+ * the long-lived refresh token and the JWT's expiry — so a later refresh can
15
+ * mint a fresh JWT without re-opening the browser.
16
+ */
17
+ saveSession(session: {
18
+ token: string;
19
+ refreshToken?: string;
20
+ expiresAt?: string;
21
+ apiUrl?: string;
22
+ }): void;
12
23
  clear(): void;
13
24
  private readCredentials;
14
25
  }
@@ -20,6 +31,8 @@ declare class LumioApiClient {
20
31
  url(endpoint: string): string;
21
32
  authHeaders(): Record<string, string>;
22
33
  uploadHeaders(): Record<string, string>;
34
+ /** Throw an {@link ApiError} (with status) when the response is not ok. */
35
+ private ensureOk;
23
36
  get<T>(endpoint: string): Promise<T>;
24
37
  post<T>(endpoint: string, body?: unknown): Promise<T>;
25
38
  put<T>(endpoint: string, body?: unknown): Promise<T>;