@haex-space/vault-sdk 2.5.2 → 2.5.6

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.
@@ -254,6 +254,16 @@ interface PendingAuthorization {
254
254
  * Decision type for external authorization prompts
255
255
  */
256
256
  type ExternalAuthDecision = 'allow' | 'deny';
257
+ /**
258
+ * Session-based authorization entry (for "allow once" authorizations)
259
+ * These are stored in-memory and cleared when haex-vault restarts.
260
+ */
261
+ interface SessionAuthorization {
262
+ /** Unique client identifier (public key fingerprint) */
263
+ clientId: string;
264
+ /** Extension ID this client can access */
265
+ extensionId: string;
266
+ }
257
267
  /**
258
268
  * Connection state for external clients connecting to haex-vault via WebSocket.
259
269
  * Used by browser extensions, CLI tools, servers, and other external clients.
@@ -270,6 +280,30 @@ declare enum ExternalConnectionState {
270
280
  /** Connected and authorized to communicate */
271
281
  PAIRED = "paired"
272
282
  }
283
+ /**
284
+ * Error codes for external client connections.
285
+ * Used to identify specific error conditions for i18n in the frontend.
286
+ */
287
+ declare enum ExternalConnectionErrorCode {
288
+ /** No error */
289
+ NONE = "none",
290
+ /** Client is not authorized (rejected or not yet approved) */
291
+ CLIENT_NOT_AUTHORIZED = "client_not_authorized",
292
+ /** Client was blocked by the user */
293
+ CLIENT_BLOCKED = "client_blocked",
294
+ /** Connection to haex-vault failed (not running or network error) */
295
+ CONNECTION_FAILED = "connection_failed",
296
+ /** Connection timed out */
297
+ CONNECTION_TIMEOUT = "connection_timeout",
298
+ /** WebSocket connection was closed unexpectedly */
299
+ CONNECTION_CLOSED = "connection_closed",
300
+ /** Failed to decrypt message (invalid key or corrupted data) */
301
+ DECRYPTION_FAILED = "decryption_failed",
302
+ /** Invalid message format received */
303
+ INVALID_MESSAGE = "invalid_message",
304
+ /** Unknown or unspecified error */
305
+ UNKNOWN = "unknown"
306
+ }
273
307
  /**
274
308
  * Full connection status including state, client ID, and any error
275
309
  */
@@ -278,8 +312,10 @@ interface ExternalConnection {
278
312
  state: ExternalConnectionState;
279
313
  /** Client identifier (derived from public key) */
280
314
  clientId: string | null;
281
- /** Error message if connection failed */
282
- error: string | null;
315
+ /** Error code for i18n (use this for translations) */
316
+ errorCode: ExternalConnectionErrorCode;
317
+ /** Error message (original message, for logging/debugging) */
318
+ errorMessage: string | null;
283
319
  }
284
320
  /**
285
321
  * Check if external client connection state indicates an active connection
@@ -370,4 +406,4 @@ declare class HaexVaultSdkError extends Error {
370
406
  };
371
407
  }
372
408
 
373
- export { type ApplicationContext as A, type BlockedClient as B, type ContextChangedEvent as C, type DatabaseQueryResult as D, type ExtensionManifest as E, getTableName as F, ExternalConnectionState as G, type HaexHubConfig as H, isExternalClientConnected as I, canExternalClientSendRequests as J, HaexVaultSdkError as K, HAEXTENSION_EVENTS as L, type Migration as M, type HaextensionEvent as N, EXTERNAL_EVENTS as O, type PermissionResponse as P, type ExternalEvent as Q, type SearchResult as S, TABLE_SEPARATOR as T, type WebRequestOptions as W, type ExtensionInfo as a, type MigrationResult as b, type WebResponse as c, type DatabasePermissionRequest as d, type ExternalRequestHandler as e, type ExternalResponse as f, type EventCallback as g, type HaexHubRequest as h, type HaexHubResponse as i, type HaexHubEvent as j, type DatabasePermission as k, type DatabaseQueryParams as l, type DatabaseExecuteParams as m, type DatabaseTableInfo as n, type DatabaseColumnInfo as o, type SearchQuery as p, type SearchRequestEvent as q, type ExternalRequestEvent as r, type ExternalRequest as s, type AuthorizedClient as t, type PendingAuthorization as u, type ExternalAuthDecision as v, type ExternalConnection as w, PermissionStatus as x, ErrorCode as y, DEFAULT_TIMEOUT as z };
409
+ export { type ApplicationContext as A, type BlockedClient as B, type ContextChangedEvent as C, type DatabaseQueryResult as D, type ExtensionManifest as E, DEFAULT_TIMEOUT as F, getTableName as G, type HaexHubConfig as H, ExternalConnectionState as I, ExternalConnectionErrorCode as J, isExternalClientConnected as K, canExternalClientSendRequests as L, type Migration as M, HaexVaultSdkError as N, HAEXTENSION_EVENTS as O, type PermissionResponse as P, type HaextensionEvent as Q, EXTERNAL_EVENTS as R, type SearchResult as S, TABLE_SEPARATOR as T, type ExternalEvent as U, type WebRequestOptions as W, type ExtensionInfo as a, type MigrationResult as b, type WebResponse as c, type DatabasePermissionRequest as d, type ExternalRequestHandler as e, type ExternalResponse as f, type EventCallback as g, type HaexHubRequest as h, type HaexHubResponse as i, type HaexHubEvent as j, type DatabasePermission as k, type DatabaseQueryParams as l, type DatabaseExecuteParams as m, type DatabaseTableInfo as n, type DatabaseColumnInfo as o, type SearchQuery as p, type SearchRequestEvent as q, type ExternalRequestEvent as r, type ExternalRequest as s, type AuthorizedClient as t, type PendingAuthorization as u, type ExternalAuthDecision as v, type SessionAuthorization as w, type ExternalConnection as x, PermissionStatus as y, ErrorCode as z };
@@ -254,6 +254,16 @@ interface PendingAuthorization {
254
254
  * Decision type for external authorization prompts
255
255
  */
256
256
  type ExternalAuthDecision = 'allow' | 'deny';
257
+ /**
258
+ * Session-based authorization entry (for "allow once" authorizations)
259
+ * These are stored in-memory and cleared when haex-vault restarts.
260
+ */
261
+ interface SessionAuthorization {
262
+ /** Unique client identifier (public key fingerprint) */
263
+ clientId: string;
264
+ /** Extension ID this client can access */
265
+ extensionId: string;
266
+ }
257
267
  /**
258
268
  * Connection state for external clients connecting to haex-vault via WebSocket.
259
269
  * Used by browser extensions, CLI tools, servers, and other external clients.
@@ -270,6 +280,30 @@ declare enum ExternalConnectionState {
270
280
  /** Connected and authorized to communicate */
271
281
  PAIRED = "paired"
272
282
  }
283
+ /**
284
+ * Error codes for external client connections.
285
+ * Used to identify specific error conditions for i18n in the frontend.
286
+ */
287
+ declare enum ExternalConnectionErrorCode {
288
+ /** No error */
289
+ NONE = "none",
290
+ /** Client is not authorized (rejected or not yet approved) */
291
+ CLIENT_NOT_AUTHORIZED = "client_not_authorized",
292
+ /** Client was blocked by the user */
293
+ CLIENT_BLOCKED = "client_blocked",
294
+ /** Connection to haex-vault failed (not running or network error) */
295
+ CONNECTION_FAILED = "connection_failed",
296
+ /** Connection timed out */
297
+ CONNECTION_TIMEOUT = "connection_timeout",
298
+ /** WebSocket connection was closed unexpectedly */
299
+ CONNECTION_CLOSED = "connection_closed",
300
+ /** Failed to decrypt message (invalid key or corrupted data) */
301
+ DECRYPTION_FAILED = "decryption_failed",
302
+ /** Invalid message format received */
303
+ INVALID_MESSAGE = "invalid_message",
304
+ /** Unknown or unspecified error */
305
+ UNKNOWN = "unknown"
306
+ }
273
307
  /**
274
308
  * Full connection status including state, client ID, and any error
275
309
  */
@@ -278,8 +312,10 @@ interface ExternalConnection {
278
312
  state: ExternalConnectionState;
279
313
  /** Client identifier (derived from public key) */
280
314
  clientId: string | null;
281
- /** Error message if connection failed */
282
- error: string | null;
315
+ /** Error code for i18n (use this for translations) */
316
+ errorCode: ExternalConnectionErrorCode;
317
+ /** Error message (original message, for logging/debugging) */
318
+ errorMessage: string | null;
283
319
  }
284
320
  /**
285
321
  * Check if external client connection state indicates an active connection
@@ -370,4 +406,4 @@ declare class HaexVaultSdkError extends Error {
370
406
  };
371
407
  }
372
408
 
373
- export { type ApplicationContext as A, type BlockedClient as B, type ContextChangedEvent as C, type DatabaseQueryResult as D, type ExtensionManifest as E, getTableName as F, ExternalConnectionState as G, type HaexHubConfig as H, isExternalClientConnected as I, canExternalClientSendRequests as J, HaexVaultSdkError as K, HAEXTENSION_EVENTS as L, type Migration as M, type HaextensionEvent as N, EXTERNAL_EVENTS as O, type PermissionResponse as P, type ExternalEvent as Q, type SearchResult as S, TABLE_SEPARATOR as T, type WebRequestOptions as W, type ExtensionInfo as a, type MigrationResult as b, type WebResponse as c, type DatabasePermissionRequest as d, type ExternalRequestHandler as e, type ExternalResponse as f, type EventCallback as g, type HaexHubRequest as h, type HaexHubResponse as i, type HaexHubEvent as j, type DatabasePermission as k, type DatabaseQueryParams as l, type DatabaseExecuteParams as m, type DatabaseTableInfo as n, type DatabaseColumnInfo as o, type SearchQuery as p, type SearchRequestEvent as q, type ExternalRequestEvent as r, type ExternalRequest as s, type AuthorizedClient as t, type PendingAuthorization as u, type ExternalAuthDecision as v, type ExternalConnection as w, PermissionStatus as x, ErrorCode as y, DEFAULT_TIMEOUT as z };
409
+ export { type ApplicationContext as A, type BlockedClient as B, type ContextChangedEvent as C, type DatabaseQueryResult as D, type ExtensionManifest as E, DEFAULT_TIMEOUT as F, getTableName as G, type HaexHubConfig as H, ExternalConnectionState as I, ExternalConnectionErrorCode as J, isExternalClientConnected as K, canExternalClientSendRequests as L, type Migration as M, HaexVaultSdkError as N, HAEXTENSION_EVENTS as O, type PermissionResponse as P, type HaextensionEvent as Q, EXTERNAL_EVENTS as R, type SearchResult as S, TABLE_SEPARATOR as T, type ExternalEvent as U, type WebRequestOptions as W, type ExtensionInfo as a, type MigrationResult as b, type WebResponse as c, type DatabasePermissionRequest as d, type ExternalRequestHandler as e, type ExternalResponse as f, type EventCallback as g, type HaexHubRequest as h, type HaexHubResponse as i, type HaexHubEvent as j, type DatabasePermission as k, type DatabaseQueryParams as l, type DatabaseExecuteParams as m, type DatabaseTableInfo as n, type DatabaseColumnInfo as o, type SearchQuery as p, type SearchRequestEvent as q, type ExternalRequestEvent as r, type ExternalRequest as s, type AuthorizedClient as t, type PendingAuthorization as u, type ExternalAuthDecision as v, type SessionAuthorization as w, type ExternalConnection as x, PermissionStatus as y, ErrorCode as z };
package/dist/vue.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { H as HaexVaultClient, S as StorageAPI } from './client-DTqEEmX-.mjs';
1
+ import { H as HaexVaultClient, S as StorageAPI } from './client-Bcysw57u.mjs';
2
2
  import * as drizzle_orm_sqlite_proxy from 'drizzle-orm/sqlite-proxy';
3
3
  import { Ref } from 'vue';
4
- import { H as HaexHubConfig } from './types-Dzp3QG4t.mjs';
4
+ import { H as HaexHubConfig } from './types-CAHAohTY.mjs';
5
5
 
6
6
  /**
7
7
  * Vue 3 composable for HaexHub SDK
package/dist/vue.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { H as HaexVaultClient, S as StorageAPI } from './client-DfmTO8Mz.js';
1
+ import { H as HaexVaultClient, S as StorageAPI } from './client-K4BOBLQE.js';
2
2
  import * as drizzle_orm_sqlite_proxy from 'drizzle-orm/sqlite-proxy';
3
3
  import { Ref } from 'vue';
4
- import { H as HaexHubConfig } from './types-Dzp3QG4t.js';
4
+ import { H as HaexHubConfig } from './types-CAHAohTY.js';
5
5
 
6
6
  /**
7
7
  * Vue 3 composable for HaexHub SDK