@camstack/sdk 0.1.44 → 0.1.45

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/system.d.ts CHANGED
@@ -22,7 +22,7 @@ import type { BackendConnectionState } from './types.js';
22
22
  export interface UserInfo {
23
23
  readonly id: string;
24
24
  readonly username: string;
25
- readonly role: string;
25
+ readonly isAdmin: boolean;
26
26
  readonly permissions?: {
27
27
  readonly allowedAddons?: ReadonlyArray<string> | '*';
28
28
  readonly allowedDevices?: Readonly<Record<string, ReadonlyArray<string> | '*'>>;
@@ -183,6 +183,17 @@ export declare class System {
183
183
  private disposeMirror;
184
184
  login(username: string, password: string): Promise<{
185
185
  token: string;
186
+ requiresTotp?: boolean;
187
+ }>;
188
+ /**
189
+ * Second leg of the 2FA login. The caller passes the challenge
190
+ * token returned by `login` (when `requiresTotp: true`) plus the
191
+ * 6-digit code from the user's authenticator app. On success the
192
+ * server mints the real session JWT, which we set as the active
193
+ * token on this client.
194
+ */
195
+ loginVerifyTotp(challengeToken: string, code: string): Promise<{
196
+ token: string;
186
197
  }>;
187
198
  logout(): Promise<void>;
188
199
  getMe(): Promise<UserInfo>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/sdk",
3
- "version": "0.1.44",
3
+ "version": "0.1.45",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",