@haex-space/vault-sdk 2.2.4 → 2.2.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.
Files changed (41) hide show
  1. package/dist/cli/index.js +53 -29
  2. package/dist/cli/index.js.map +1 -1
  3. package/dist/cli/index.mjs +49 -25
  4. package/dist/cli/index.mjs.map +1 -1
  5. package/dist/{client-BbGCsMv1.d.mts → client-DeP-DCz5.d.ts} +2 -209
  6. package/dist/{client-BbGCsMv1.d.ts → client-wxMr0ONL.d.mts} +2 -209
  7. package/dist/config-D_HXjsEV.d.mts +33 -0
  8. package/dist/config-D_HXjsEV.d.ts +33 -0
  9. package/dist/index.d.mts +5 -3
  10. package/dist/index.d.ts +5 -3
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/node.d.mts +14 -21
  14. package/dist/node.d.ts +14 -21
  15. package/dist/node.js +55 -0
  16. package/dist/node.js.map +1 -1
  17. package/dist/node.mjs +55 -1
  18. package/dist/node.mjs.map +1 -1
  19. package/dist/nuxt.js +2 -1
  20. package/dist/nuxt.js.map +1 -1
  21. package/dist/nuxt.mjs +2 -1
  22. package/dist/nuxt.mjs.map +1 -1
  23. package/dist/react.d.mts +2 -1
  24. package/dist/react.d.ts +2 -1
  25. package/dist/react.js.map +1 -1
  26. package/dist/react.mjs.map +1 -1
  27. package/dist/runtime/nuxt.plugin.client.d.mts +2 -1
  28. package/dist/runtime/nuxt.plugin.client.d.ts +2 -1
  29. package/dist/runtime/nuxt.plugin.client.js.map +1 -1
  30. package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
  31. package/dist/svelte.d.mts +2 -1
  32. package/dist/svelte.d.ts +2 -1
  33. package/dist/svelte.js.map +1 -1
  34. package/dist/svelte.mjs.map +1 -1
  35. package/dist/types-DiGbHxTr.d.mts +216 -0
  36. package/dist/types-DiGbHxTr.d.ts +216 -0
  37. package/dist/vue.d.mts +2 -1
  38. package/dist/vue.d.ts +2 -1
  39. package/dist/vue.js.map +1 -1
  40. package/dist/vue.mjs.map +1 -1
  41. package/package.json +1 -1
@@ -0,0 +1,216 @@
1
+ /**
2
+ * Central event name definitions for HaexHub extensions
3
+ *
4
+ * Event Naming Schema: haextension:{subject}:{predicate}
5
+ *
6
+ * IMPORTANT: Tauri event names can only contain:
7
+ * - Alphanumeric characters (a-z, A-Z, 0-9)
8
+ * - Hyphens (-)
9
+ * - Slashes (/)
10
+ * - Colons (:)
11
+ * - Underscores (_)
12
+ *
13
+ * NO dots (.) allowed!
14
+ */
15
+ declare const HAEXTENSION_EVENTS: {
16
+ /** Context (theme, locale, platform) has changed */
17
+ readonly CONTEXT_CHANGED: "haextension:context:changed";
18
+ /** Search request from HaexHub */
19
+ readonly SEARCH_REQUEST: "haextension:search:request";
20
+ };
21
+ type HaextensionEvent = typeof HAEXTENSION_EVENTS[keyof typeof HAEXTENSION_EVENTS];
22
+
23
+ declare const DEFAULT_TIMEOUT = 30000;
24
+ declare const TABLE_SEPARATOR = "__";
25
+ interface HaexHubRequest {
26
+ method: string;
27
+ params: Record<string, unknown>;
28
+ timestamp: number;
29
+ }
30
+ interface HaexHubResponse<T = unknown> {
31
+ id: string;
32
+ result?: T;
33
+ error?: HaexHubError;
34
+ }
35
+ interface ExtensionInfo {
36
+ publicKey: string;
37
+ name: string;
38
+ version: string;
39
+ displayName?: string;
40
+ namespace?: string;
41
+ }
42
+ interface ApplicationContext {
43
+ theme: "light" | "dark" | "system";
44
+ locale: string;
45
+ platform: "linux" | "macos" | "ios" | "freebsd" | "dragonfly" | "netbsd" | "openbsd" | "solaris" | "android" | "windows" | undefined;
46
+ }
47
+ interface SearchQuery {
48
+ query: string;
49
+ filters?: Record<string, unknown>;
50
+ limit?: number;
51
+ }
52
+ interface SearchResult {
53
+ id: string;
54
+ title: string;
55
+ description?: string;
56
+ type: string;
57
+ data?: Record<string, unknown>;
58
+ score?: number;
59
+ }
60
+ declare enum PermissionStatus {
61
+ GRANTED = "granted",
62
+ DENIED = "denied",
63
+ ASK = "ask"
64
+ }
65
+ interface PermissionResponse {
66
+ status: PermissionStatus;
67
+ permanent: boolean;
68
+ }
69
+ interface DatabasePermission {
70
+ extensionId: string;
71
+ resource: string;
72
+ operation: "read" | "write";
73
+ path: string;
74
+ }
75
+ interface DatabasePermissionRequest {
76
+ resource: string;
77
+ operation: "read" | "write";
78
+ reason?: string;
79
+ }
80
+ interface DatabaseQueryParams {
81
+ query: string;
82
+ params?: unknown[];
83
+ }
84
+ interface DatabaseQueryResult {
85
+ rows: unknown[];
86
+ columns?: string[];
87
+ rowsAffected: number;
88
+ lastInsertId?: number;
89
+ }
90
+ interface DatabaseExecuteParams {
91
+ statements: string[];
92
+ }
93
+ interface MigrationResult {
94
+ appliedCount: number;
95
+ alreadyAppliedCount: number;
96
+ appliedMigrations: string[];
97
+ }
98
+ interface Migration {
99
+ name: string;
100
+ sql: string;
101
+ }
102
+ interface DatabaseTableInfo {
103
+ name: string;
104
+ columns: DatabaseColumnInfo[];
105
+ }
106
+ interface DatabaseColumnInfo {
107
+ name: string;
108
+ type: string;
109
+ notNull: boolean;
110
+ defaultValue?: unknown;
111
+ primaryKey: boolean;
112
+ }
113
+ interface HaexHubEvent {
114
+ type: string;
115
+ data: unknown;
116
+ timestamp: number;
117
+ }
118
+ interface ContextChangedEvent extends HaexHubEvent {
119
+ type: typeof HAEXTENSION_EVENTS.CONTEXT_CHANGED;
120
+ data: {
121
+ context: ApplicationContext;
122
+ };
123
+ }
124
+ interface SearchRequestEvent extends HaexHubEvent {
125
+ type: typeof HAEXTENSION_EVENTS.SEARCH_REQUEST;
126
+ data: {
127
+ query: SearchQuery;
128
+ requestId: string;
129
+ };
130
+ }
131
+ type EventCallback = (event: HaexHubEvent) => void;
132
+ interface ExtensionManifest {
133
+ name: string;
134
+ version: string;
135
+ author?: string | null;
136
+ entry?: string | null;
137
+ icon?: string | null;
138
+ publicKey: string;
139
+ signature: string;
140
+ permissions: {
141
+ database?: any[];
142
+ filesystem?: any[];
143
+ http?: any[];
144
+ shell?: any[];
145
+ };
146
+ homepage?: string | null;
147
+ description?: string | null;
148
+ singleInstance?: boolean | null;
149
+ displayMode?: "auto" | "window" | "iframe" | null;
150
+ /**
151
+ * Path to the migrations directory relative to the extension root.
152
+ * Contains Drizzle-style migrations with meta/_journal.json and *.sql files.
153
+ * These migrations will be applied when the extension is installed.
154
+ * Example: "database/migrations"
155
+ */
156
+ migrationsDir?: string | null;
157
+ }
158
+ interface HaexHubConfig {
159
+ debug?: boolean;
160
+ timeout?: number;
161
+ /** Extension manifest data (auto-injected by framework integrations) */
162
+ manifest?: ExtensionManifest;
163
+ }
164
+ interface WebRequestOptions {
165
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
166
+ headers?: Record<string, string>;
167
+ body?: string | ArrayBuffer | Blob;
168
+ timeout?: number;
169
+ }
170
+ interface WebResponse {
171
+ status: number;
172
+ statusText: string;
173
+ headers: Record<string, string>;
174
+ body: ArrayBuffer;
175
+ url: string;
176
+ }
177
+ declare enum ErrorCode {
178
+ TIMEOUT = "TIMEOUT",
179
+ NOT_IN_IFRAME = "NOT_IN_IFRAME",
180
+ UNAUTHORIZED_ORIGIN = "UNAUTHORIZED_ORIGIN",
181
+ PERMISSION_DENIED = "PERMISSION_DENIED",
182
+ INVALID_PUBLIC_KEY = "INVALID_PUBLIC_KEY",
183
+ INVALID_EXTENSION_NAME = "INVALID_EXTENSION_NAME",
184
+ INVALID_TABLE_NAME = "INVALID_TABLE_NAME",
185
+ INVALID_PARAMS = "INVALID_PARAMS",
186
+ EXTENSION_NOT_INITIALIZED = "EXTENSION_NOT_INITIALIZED",
187
+ EXTENSION_INFO_UNAVAILABLE = "EXTENSION_INFO_UNAVAILABLE",
188
+ METHOD_NOT_FOUND = "METHOD_NOT_FOUND",
189
+ INTERNAL_ERROR = "INTERNAL_ERROR",
190
+ DATABASE_ERROR = "DATABASE_ERROR",
191
+ WEB_ERROR = "WEB_ERROR"
192
+ }
193
+ interface HaexHubError {
194
+ code: ErrorCode;
195
+ message: string;
196
+ details?: Record<string, unknown>;
197
+ }
198
+ declare class HaexHubError extends Error {
199
+ code: ErrorCode;
200
+ messageKey: string;
201
+ details?: Record<string, unknown> | undefined;
202
+ constructor(code: ErrorCode, messageKey: string, details?: Record<string, unknown> | undefined);
203
+ /**
204
+ * Get localized error message
205
+ * @param locale - Locale code (e.g., 'en', 'de')
206
+ * @param translations - Translation object
207
+ */
208
+ getLocalizedMessage(locale?: string, translations?: Record<string, Record<string, string>>): string;
209
+ toJSON(): {
210
+ code: ErrorCode;
211
+ message: string;
212
+ details: Record<string, unknown> | undefined;
213
+ };
214
+ }
215
+
216
+ export { type ApplicationContext as A, type ContextChangedEvent as C, type DatabaseQueryResult as D, type ExtensionManifest as E, type HaexHubConfig as H, 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 EventCallback as e, type HaexHubRequest as f, type HaexHubResponse as g, type HaexHubEvent as h, type DatabasePermission as i, type DatabaseQueryParams as j, type DatabaseExecuteParams as k, type DatabaseTableInfo as l, type DatabaseColumnInfo as m, type SearchQuery as n, type SearchRequestEvent as o, PermissionStatus as p, ErrorCode as q, DEFAULT_TIMEOUT as r, HaexHubError as s, HAEXTENSION_EVENTS as t, type HaextensionEvent as u };
@@ -0,0 +1,216 @@
1
+ /**
2
+ * Central event name definitions for HaexHub extensions
3
+ *
4
+ * Event Naming Schema: haextension:{subject}:{predicate}
5
+ *
6
+ * IMPORTANT: Tauri event names can only contain:
7
+ * - Alphanumeric characters (a-z, A-Z, 0-9)
8
+ * - Hyphens (-)
9
+ * - Slashes (/)
10
+ * - Colons (:)
11
+ * - Underscores (_)
12
+ *
13
+ * NO dots (.) allowed!
14
+ */
15
+ declare const HAEXTENSION_EVENTS: {
16
+ /** Context (theme, locale, platform) has changed */
17
+ readonly CONTEXT_CHANGED: "haextension:context:changed";
18
+ /** Search request from HaexHub */
19
+ readonly SEARCH_REQUEST: "haextension:search:request";
20
+ };
21
+ type HaextensionEvent = typeof HAEXTENSION_EVENTS[keyof typeof HAEXTENSION_EVENTS];
22
+
23
+ declare const DEFAULT_TIMEOUT = 30000;
24
+ declare const TABLE_SEPARATOR = "__";
25
+ interface HaexHubRequest {
26
+ method: string;
27
+ params: Record<string, unknown>;
28
+ timestamp: number;
29
+ }
30
+ interface HaexHubResponse<T = unknown> {
31
+ id: string;
32
+ result?: T;
33
+ error?: HaexHubError;
34
+ }
35
+ interface ExtensionInfo {
36
+ publicKey: string;
37
+ name: string;
38
+ version: string;
39
+ displayName?: string;
40
+ namespace?: string;
41
+ }
42
+ interface ApplicationContext {
43
+ theme: "light" | "dark" | "system";
44
+ locale: string;
45
+ platform: "linux" | "macos" | "ios" | "freebsd" | "dragonfly" | "netbsd" | "openbsd" | "solaris" | "android" | "windows" | undefined;
46
+ }
47
+ interface SearchQuery {
48
+ query: string;
49
+ filters?: Record<string, unknown>;
50
+ limit?: number;
51
+ }
52
+ interface SearchResult {
53
+ id: string;
54
+ title: string;
55
+ description?: string;
56
+ type: string;
57
+ data?: Record<string, unknown>;
58
+ score?: number;
59
+ }
60
+ declare enum PermissionStatus {
61
+ GRANTED = "granted",
62
+ DENIED = "denied",
63
+ ASK = "ask"
64
+ }
65
+ interface PermissionResponse {
66
+ status: PermissionStatus;
67
+ permanent: boolean;
68
+ }
69
+ interface DatabasePermission {
70
+ extensionId: string;
71
+ resource: string;
72
+ operation: "read" | "write";
73
+ path: string;
74
+ }
75
+ interface DatabasePermissionRequest {
76
+ resource: string;
77
+ operation: "read" | "write";
78
+ reason?: string;
79
+ }
80
+ interface DatabaseQueryParams {
81
+ query: string;
82
+ params?: unknown[];
83
+ }
84
+ interface DatabaseQueryResult {
85
+ rows: unknown[];
86
+ columns?: string[];
87
+ rowsAffected: number;
88
+ lastInsertId?: number;
89
+ }
90
+ interface DatabaseExecuteParams {
91
+ statements: string[];
92
+ }
93
+ interface MigrationResult {
94
+ appliedCount: number;
95
+ alreadyAppliedCount: number;
96
+ appliedMigrations: string[];
97
+ }
98
+ interface Migration {
99
+ name: string;
100
+ sql: string;
101
+ }
102
+ interface DatabaseTableInfo {
103
+ name: string;
104
+ columns: DatabaseColumnInfo[];
105
+ }
106
+ interface DatabaseColumnInfo {
107
+ name: string;
108
+ type: string;
109
+ notNull: boolean;
110
+ defaultValue?: unknown;
111
+ primaryKey: boolean;
112
+ }
113
+ interface HaexHubEvent {
114
+ type: string;
115
+ data: unknown;
116
+ timestamp: number;
117
+ }
118
+ interface ContextChangedEvent extends HaexHubEvent {
119
+ type: typeof HAEXTENSION_EVENTS.CONTEXT_CHANGED;
120
+ data: {
121
+ context: ApplicationContext;
122
+ };
123
+ }
124
+ interface SearchRequestEvent extends HaexHubEvent {
125
+ type: typeof HAEXTENSION_EVENTS.SEARCH_REQUEST;
126
+ data: {
127
+ query: SearchQuery;
128
+ requestId: string;
129
+ };
130
+ }
131
+ type EventCallback = (event: HaexHubEvent) => void;
132
+ interface ExtensionManifest {
133
+ name: string;
134
+ version: string;
135
+ author?: string | null;
136
+ entry?: string | null;
137
+ icon?: string | null;
138
+ publicKey: string;
139
+ signature: string;
140
+ permissions: {
141
+ database?: any[];
142
+ filesystem?: any[];
143
+ http?: any[];
144
+ shell?: any[];
145
+ };
146
+ homepage?: string | null;
147
+ description?: string | null;
148
+ singleInstance?: boolean | null;
149
+ displayMode?: "auto" | "window" | "iframe" | null;
150
+ /**
151
+ * Path to the migrations directory relative to the extension root.
152
+ * Contains Drizzle-style migrations with meta/_journal.json and *.sql files.
153
+ * These migrations will be applied when the extension is installed.
154
+ * Example: "database/migrations"
155
+ */
156
+ migrationsDir?: string | null;
157
+ }
158
+ interface HaexHubConfig {
159
+ debug?: boolean;
160
+ timeout?: number;
161
+ /** Extension manifest data (auto-injected by framework integrations) */
162
+ manifest?: ExtensionManifest;
163
+ }
164
+ interface WebRequestOptions {
165
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
166
+ headers?: Record<string, string>;
167
+ body?: string | ArrayBuffer | Blob;
168
+ timeout?: number;
169
+ }
170
+ interface WebResponse {
171
+ status: number;
172
+ statusText: string;
173
+ headers: Record<string, string>;
174
+ body: ArrayBuffer;
175
+ url: string;
176
+ }
177
+ declare enum ErrorCode {
178
+ TIMEOUT = "TIMEOUT",
179
+ NOT_IN_IFRAME = "NOT_IN_IFRAME",
180
+ UNAUTHORIZED_ORIGIN = "UNAUTHORIZED_ORIGIN",
181
+ PERMISSION_DENIED = "PERMISSION_DENIED",
182
+ INVALID_PUBLIC_KEY = "INVALID_PUBLIC_KEY",
183
+ INVALID_EXTENSION_NAME = "INVALID_EXTENSION_NAME",
184
+ INVALID_TABLE_NAME = "INVALID_TABLE_NAME",
185
+ INVALID_PARAMS = "INVALID_PARAMS",
186
+ EXTENSION_NOT_INITIALIZED = "EXTENSION_NOT_INITIALIZED",
187
+ EXTENSION_INFO_UNAVAILABLE = "EXTENSION_INFO_UNAVAILABLE",
188
+ METHOD_NOT_FOUND = "METHOD_NOT_FOUND",
189
+ INTERNAL_ERROR = "INTERNAL_ERROR",
190
+ DATABASE_ERROR = "DATABASE_ERROR",
191
+ WEB_ERROR = "WEB_ERROR"
192
+ }
193
+ interface HaexHubError {
194
+ code: ErrorCode;
195
+ message: string;
196
+ details?: Record<string, unknown>;
197
+ }
198
+ declare class HaexHubError extends Error {
199
+ code: ErrorCode;
200
+ messageKey: string;
201
+ details?: Record<string, unknown> | undefined;
202
+ constructor(code: ErrorCode, messageKey: string, details?: Record<string, unknown> | undefined);
203
+ /**
204
+ * Get localized error message
205
+ * @param locale - Locale code (e.g., 'en', 'de')
206
+ * @param translations - Translation object
207
+ */
208
+ getLocalizedMessage(locale?: string, translations?: Record<string, Record<string, string>>): string;
209
+ toJSON(): {
210
+ code: ErrorCode;
211
+ message: string;
212
+ details: Record<string, unknown> | undefined;
213
+ };
214
+ }
215
+
216
+ export { type ApplicationContext as A, type ContextChangedEvent as C, type DatabaseQueryResult as D, type ExtensionManifest as E, type HaexHubConfig as H, 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 EventCallback as e, type HaexHubRequest as f, type HaexHubResponse as g, type HaexHubEvent as h, type DatabasePermission as i, type DatabaseQueryParams as j, type DatabaseExecuteParams as k, type DatabaseTableInfo as l, type DatabaseColumnInfo as m, type SearchQuery as n, type SearchRequestEvent as o, PermissionStatus as p, ErrorCode as q, DEFAULT_TIMEOUT as r, HaexHubError as s, HAEXTENSION_EVENTS as t, type HaextensionEvent as u };
package/dist/vue.d.mts CHANGED
@@ -1,6 +1,7 @@
1
- import { H as HaexHubConfig, a as HaexVaultClient, S as StorageAPI } from './client-BbGCsMv1.mjs';
1
+ import { H as HaexVaultClient, S as StorageAPI } from './client-wxMr0ONL.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-DiGbHxTr.mjs';
4
5
 
5
6
  /**
6
7
  * Vue 3 composable for HaexHub SDK
package/dist/vue.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { H as HaexHubConfig, a as HaexVaultClient, S as StorageAPI } from './client-BbGCsMv1.js';
1
+ import { H as HaexVaultClient, S as StorageAPI } from './client-DeP-DCz5.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-DiGbHxTr.js';
4
5
 
5
6
  /**
6
7
  * Vue 3 composable for HaexHub SDK