@haex-space/vault-sdk 2.5.0 → 2.5.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.
@@ -254,6 +254,42 @@ interface PendingAuthorization {
254
254
  * Decision type for external authorization prompts
255
255
  */
256
256
  type ExternalAuthDecision = 'allow' | 'deny';
257
+ /**
258
+ * Connection state for external clients connecting to haex-vault via WebSocket.
259
+ * Used by browser extensions, CLI tools, servers, and other external clients.
260
+ */
261
+ declare enum ExternalConnectionState {
262
+ /** Not connected to haex-vault */
263
+ DISCONNECTED = "disconnected",
264
+ /** Attempting to establish connection */
265
+ CONNECTING = "connecting",
266
+ /** WebSocket connected but not yet authorized */
267
+ CONNECTED = "connected",
268
+ /** Connected and waiting for user approval in haex-vault */
269
+ PENDING_APPROVAL = "pending_approval",
270
+ /** Connected and authorized to communicate */
271
+ PAIRED = "paired"
272
+ }
273
+ /**
274
+ * Full connection status including state, client ID, and any error
275
+ */
276
+ interface ExternalConnection {
277
+ /** Current connection state */
278
+ state: ExternalConnectionState;
279
+ /** Client identifier (derived from public key) */
280
+ clientId: string | null;
281
+ /** Error message if connection failed */
282
+ error: string | null;
283
+ }
284
+ /**
285
+ * Check if external client connection state indicates an active connection
286
+ * (connected, pending approval, or paired)
287
+ */
288
+ declare function isExternalClientConnected(state: ExternalConnectionState): boolean;
289
+ /**
290
+ * Check if external client can send requests (only when paired/authorized)
291
+ */
292
+ declare function canExternalClientSendRequests(state: ExternalConnectionState): boolean;
257
293
  type EventCallback = (event: HaexHubEvent) => void;
258
294
  interface ExtensionManifest {
259
295
  name: string;
@@ -334,4 +370,4 @@ declare class HaexVaultSdkError extends Error {
334
370
  };
335
371
  }
336
372
 
337
- export { type ApplicationContext as A, type BlockedClient as B, type ContextChangedEvent as C, type DatabaseQueryResult as D, type ExtensionManifest as E, HaexVaultSdkError as F, HAEXTENSION_EVENTS as G, type HaexHubConfig as H, type HaextensionEvent as I, EXTERNAL_EVENTS as J, type ExternalEvent as K, type Migration as M, type PermissionResponse as P, 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, PermissionStatus as w, ErrorCode as x, DEFAULT_TIMEOUT as y, getTableName as z };
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 };
@@ -254,6 +254,42 @@ interface PendingAuthorization {
254
254
  * Decision type for external authorization prompts
255
255
  */
256
256
  type ExternalAuthDecision = 'allow' | 'deny';
257
+ /**
258
+ * Connection state for external clients connecting to haex-vault via WebSocket.
259
+ * Used by browser extensions, CLI tools, servers, and other external clients.
260
+ */
261
+ declare enum ExternalConnectionState {
262
+ /** Not connected to haex-vault */
263
+ DISCONNECTED = "disconnected",
264
+ /** Attempting to establish connection */
265
+ CONNECTING = "connecting",
266
+ /** WebSocket connected but not yet authorized */
267
+ CONNECTED = "connected",
268
+ /** Connected and waiting for user approval in haex-vault */
269
+ PENDING_APPROVAL = "pending_approval",
270
+ /** Connected and authorized to communicate */
271
+ PAIRED = "paired"
272
+ }
273
+ /**
274
+ * Full connection status including state, client ID, and any error
275
+ */
276
+ interface ExternalConnection {
277
+ /** Current connection state */
278
+ state: ExternalConnectionState;
279
+ /** Client identifier (derived from public key) */
280
+ clientId: string | null;
281
+ /** Error message if connection failed */
282
+ error: string | null;
283
+ }
284
+ /**
285
+ * Check if external client connection state indicates an active connection
286
+ * (connected, pending approval, or paired)
287
+ */
288
+ declare function isExternalClientConnected(state: ExternalConnectionState): boolean;
289
+ /**
290
+ * Check if external client can send requests (only when paired/authorized)
291
+ */
292
+ declare function canExternalClientSendRequests(state: ExternalConnectionState): boolean;
257
293
  type EventCallback = (event: HaexHubEvent) => void;
258
294
  interface ExtensionManifest {
259
295
  name: string;
@@ -334,4 +370,4 @@ declare class HaexVaultSdkError extends Error {
334
370
  };
335
371
  }
336
372
 
337
- export { type ApplicationContext as A, type BlockedClient as B, type ContextChangedEvent as C, type DatabaseQueryResult as D, type ExtensionManifest as E, HaexVaultSdkError as F, HAEXTENSION_EVENTS as G, type HaexHubConfig as H, type HaextensionEvent as I, EXTERNAL_EVENTS as J, type ExternalEvent as K, type Migration as M, type PermissionResponse as P, 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, PermissionStatus as w, ErrorCode as x, DEFAULT_TIMEOUT as y, getTableName as z };
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 };
package/dist/vue.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { H as HaexVaultClient, S as StorageAPI } from './client-DQ6VwHic.mjs';
1
+ import { H as HaexVaultClient, S as StorageAPI } from './client-DTqEEmX-.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-Bw5uc1vm.mjs';
4
+ import { H as HaexHubConfig } from './types-Dzp3QG4t.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-BNq2TcVs.js';
1
+ import { H as HaexVaultClient, S as StorageAPI } from './client-DfmTO8Mz.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-Bw5uc1vm.js';
4
+ import { H as HaexHubConfig } from './types-Dzp3QG4t.js';
5
5
 
6
6
  /**
7
7
  * Vue 3 composable for HaexHub SDK