@haex-space/vault-sdk 2.2.5 → 2.2.7
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/{client-UgMJJ4NT.d.mts → client-BIiJwbdW.d.mts} +2 -216
- package/dist/{client-UgMJJ4NT.d.ts → client-D4hDL-PR.d.ts} +2 -216
- package/dist/config-D_HXjsEV.d.mts +33 -0
- package/dist/config-D_HXjsEV.d.ts +33 -0
- package/dist/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +14 -29
- package/dist/node.d.ts +14 -29
- package/dist/node.js +55 -0
- package/dist/node.js.map +1 -1
- package/dist/node.mjs +55 -1
- package/dist/node.mjs.map +1 -1
- package/dist/react.d.mts +2 -1
- package/dist/react.d.ts +2 -1
- package/dist/react.js +5 -3
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +5 -3
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.d.mts +2 -1
- package/dist/runtime/nuxt.plugin.client.d.ts +2 -1
- package/dist/runtime/nuxt.plugin.client.js +5 -3
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +5 -3
- package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
- package/dist/svelte.d.mts +2 -1
- package/dist/svelte.d.ts +2 -1
- package/dist/svelte.js +5 -3
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +5 -3
- package/dist/svelte.mjs.map +1 -1
- package/dist/types-FE9ewl3r.d.mts +238 -0
- package/dist/types-FE9ewl3r.d.ts +238 -0
- package/dist/vue.d.mts +2 -1
- package/dist/vue.d.ts +2 -1
- package/dist/vue.js +5 -3
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +5 -3
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,238 @@
|
|
|
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
|
+
/**
|
|
26
|
+
* Build a fully qualified table name for extensions.
|
|
27
|
+
* Use this in Drizzle schemas to create table names at build time.
|
|
28
|
+
*
|
|
29
|
+
* @param publicKey - The extension's public key (from manifest.json)
|
|
30
|
+
* @param extensionName - The extension name (from manifest.json or package.json)
|
|
31
|
+
* @param tableName - The table name (e.g., "users", "items")
|
|
32
|
+
* @returns Fully qualified table name: `{publicKey}__{extensionName}__{tableName}`
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* import { getTableName } from "@haex-space/vault-sdk";
|
|
37
|
+
* import manifest from "../haextension/manifest.json";
|
|
38
|
+
* import pkg from "../package.json";
|
|
39
|
+
*
|
|
40
|
+
* const tableName = (name: string) =>
|
|
41
|
+
* getTableName(manifest.publicKey, manifest.name || pkg.name, name);
|
|
42
|
+
*
|
|
43
|
+
* export const users = sqliteTable(tableName("users"), { ... });
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare function getTableName(publicKey: string, extensionName: string, tableName: string): string;
|
|
47
|
+
interface HaexHubRequest {
|
|
48
|
+
method: string;
|
|
49
|
+
params: Record<string, unknown>;
|
|
50
|
+
timestamp: number;
|
|
51
|
+
}
|
|
52
|
+
interface HaexHubResponse<T = unknown> {
|
|
53
|
+
id: string;
|
|
54
|
+
result?: T;
|
|
55
|
+
error?: HaexHubError;
|
|
56
|
+
}
|
|
57
|
+
interface ExtensionInfo {
|
|
58
|
+
publicKey: string;
|
|
59
|
+
name: string;
|
|
60
|
+
version: string;
|
|
61
|
+
displayName?: string;
|
|
62
|
+
namespace?: string;
|
|
63
|
+
}
|
|
64
|
+
interface ApplicationContext {
|
|
65
|
+
theme: "light" | "dark" | "system";
|
|
66
|
+
locale: string;
|
|
67
|
+
platform: "linux" | "macos" | "ios" | "freebsd" | "dragonfly" | "netbsd" | "openbsd" | "solaris" | "android" | "windows" | undefined;
|
|
68
|
+
}
|
|
69
|
+
interface SearchQuery {
|
|
70
|
+
query: string;
|
|
71
|
+
filters?: Record<string, unknown>;
|
|
72
|
+
limit?: number;
|
|
73
|
+
}
|
|
74
|
+
interface SearchResult {
|
|
75
|
+
id: string;
|
|
76
|
+
title: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
type: string;
|
|
79
|
+
data?: Record<string, unknown>;
|
|
80
|
+
score?: number;
|
|
81
|
+
}
|
|
82
|
+
declare enum PermissionStatus {
|
|
83
|
+
GRANTED = "granted",
|
|
84
|
+
DENIED = "denied",
|
|
85
|
+
ASK = "ask"
|
|
86
|
+
}
|
|
87
|
+
interface PermissionResponse {
|
|
88
|
+
status: PermissionStatus;
|
|
89
|
+
permanent: boolean;
|
|
90
|
+
}
|
|
91
|
+
interface DatabasePermission {
|
|
92
|
+
extensionId: string;
|
|
93
|
+
resource: string;
|
|
94
|
+
operation: "read" | "write";
|
|
95
|
+
path: string;
|
|
96
|
+
}
|
|
97
|
+
interface DatabasePermissionRequest {
|
|
98
|
+
resource: string;
|
|
99
|
+
operation: "read" | "write";
|
|
100
|
+
reason?: string;
|
|
101
|
+
}
|
|
102
|
+
interface DatabaseQueryParams {
|
|
103
|
+
query: string;
|
|
104
|
+
params?: unknown[];
|
|
105
|
+
}
|
|
106
|
+
interface DatabaseQueryResult {
|
|
107
|
+
rows: unknown[];
|
|
108
|
+
columns?: string[];
|
|
109
|
+
rowsAffected: number;
|
|
110
|
+
lastInsertId?: number;
|
|
111
|
+
}
|
|
112
|
+
interface DatabaseExecuteParams {
|
|
113
|
+
statements: string[];
|
|
114
|
+
}
|
|
115
|
+
interface MigrationResult {
|
|
116
|
+
appliedCount: number;
|
|
117
|
+
alreadyAppliedCount: number;
|
|
118
|
+
appliedMigrations: string[];
|
|
119
|
+
}
|
|
120
|
+
interface Migration {
|
|
121
|
+
name: string;
|
|
122
|
+
sql: string;
|
|
123
|
+
}
|
|
124
|
+
interface DatabaseTableInfo {
|
|
125
|
+
name: string;
|
|
126
|
+
columns: DatabaseColumnInfo[];
|
|
127
|
+
}
|
|
128
|
+
interface DatabaseColumnInfo {
|
|
129
|
+
name: string;
|
|
130
|
+
type: string;
|
|
131
|
+
notNull: boolean;
|
|
132
|
+
defaultValue?: unknown;
|
|
133
|
+
primaryKey: boolean;
|
|
134
|
+
}
|
|
135
|
+
interface HaexHubEvent {
|
|
136
|
+
type: string;
|
|
137
|
+
data: unknown;
|
|
138
|
+
timestamp: number;
|
|
139
|
+
}
|
|
140
|
+
interface ContextChangedEvent extends HaexHubEvent {
|
|
141
|
+
type: typeof HAEXTENSION_EVENTS.CONTEXT_CHANGED;
|
|
142
|
+
data: {
|
|
143
|
+
context: ApplicationContext;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
interface SearchRequestEvent extends HaexHubEvent {
|
|
147
|
+
type: typeof HAEXTENSION_EVENTS.SEARCH_REQUEST;
|
|
148
|
+
data: {
|
|
149
|
+
query: SearchQuery;
|
|
150
|
+
requestId: string;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
type EventCallback = (event: HaexHubEvent) => void;
|
|
154
|
+
interface ExtensionManifest {
|
|
155
|
+
name: string;
|
|
156
|
+
version: string;
|
|
157
|
+
author?: string | null;
|
|
158
|
+
entry?: string | null;
|
|
159
|
+
icon?: string | null;
|
|
160
|
+
publicKey: string;
|
|
161
|
+
signature: string;
|
|
162
|
+
permissions: {
|
|
163
|
+
database?: any[];
|
|
164
|
+
filesystem?: any[];
|
|
165
|
+
http?: any[];
|
|
166
|
+
shell?: any[];
|
|
167
|
+
};
|
|
168
|
+
homepage?: string | null;
|
|
169
|
+
description?: string | null;
|
|
170
|
+
singleInstance?: boolean | null;
|
|
171
|
+
displayMode?: "auto" | "window" | "iframe" | null;
|
|
172
|
+
/**
|
|
173
|
+
* Path to the migrations directory relative to the extension root.
|
|
174
|
+
* Contains Drizzle-style migrations with meta/_journal.json and *.sql files.
|
|
175
|
+
* These migrations will be applied when the extension is installed.
|
|
176
|
+
* Example: "database/migrations"
|
|
177
|
+
*/
|
|
178
|
+
migrationsDir?: string | null;
|
|
179
|
+
}
|
|
180
|
+
interface HaexHubConfig {
|
|
181
|
+
debug?: boolean;
|
|
182
|
+
timeout?: number;
|
|
183
|
+
/** Extension manifest data (auto-injected by framework integrations) */
|
|
184
|
+
manifest?: ExtensionManifest;
|
|
185
|
+
}
|
|
186
|
+
interface WebRequestOptions {
|
|
187
|
+
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
|
|
188
|
+
headers?: Record<string, string>;
|
|
189
|
+
body?: string | ArrayBuffer | Blob;
|
|
190
|
+
timeout?: number;
|
|
191
|
+
}
|
|
192
|
+
interface WebResponse {
|
|
193
|
+
status: number;
|
|
194
|
+
statusText: string;
|
|
195
|
+
headers: Record<string, string>;
|
|
196
|
+
body: ArrayBuffer;
|
|
197
|
+
url: string;
|
|
198
|
+
}
|
|
199
|
+
declare enum ErrorCode {
|
|
200
|
+
TIMEOUT = "TIMEOUT",
|
|
201
|
+
NOT_IN_IFRAME = "NOT_IN_IFRAME",
|
|
202
|
+
UNAUTHORIZED_ORIGIN = "UNAUTHORIZED_ORIGIN",
|
|
203
|
+
PERMISSION_DENIED = "PERMISSION_DENIED",
|
|
204
|
+
INVALID_PUBLIC_KEY = "INVALID_PUBLIC_KEY",
|
|
205
|
+
INVALID_EXTENSION_NAME = "INVALID_EXTENSION_NAME",
|
|
206
|
+
INVALID_TABLE_NAME = "INVALID_TABLE_NAME",
|
|
207
|
+
INVALID_PARAMS = "INVALID_PARAMS",
|
|
208
|
+
EXTENSION_NOT_INITIALIZED = "EXTENSION_NOT_INITIALIZED",
|
|
209
|
+
EXTENSION_INFO_UNAVAILABLE = "EXTENSION_INFO_UNAVAILABLE",
|
|
210
|
+
METHOD_NOT_FOUND = "METHOD_NOT_FOUND",
|
|
211
|
+
INTERNAL_ERROR = "INTERNAL_ERROR",
|
|
212
|
+
DATABASE_ERROR = "DATABASE_ERROR",
|
|
213
|
+
WEB_ERROR = "WEB_ERROR"
|
|
214
|
+
}
|
|
215
|
+
interface HaexHubError {
|
|
216
|
+
code: ErrorCode;
|
|
217
|
+
message: string;
|
|
218
|
+
details?: Record<string, unknown>;
|
|
219
|
+
}
|
|
220
|
+
declare class HaexHubError extends Error {
|
|
221
|
+
code: ErrorCode;
|
|
222
|
+
messageKey: string;
|
|
223
|
+
details?: Record<string, unknown> | undefined;
|
|
224
|
+
constructor(code: ErrorCode, messageKey: string, details?: Record<string, unknown> | undefined);
|
|
225
|
+
/**
|
|
226
|
+
* Get localized error message
|
|
227
|
+
* @param locale - Locale code (e.g., 'en', 'de')
|
|
228
|
+
* @param translations - Translation object
|
|
229
|
+
*/
|
|
230
|
+
getLocalizedMessage(locale?: string, translations?: Record<string, Record<string, string>>): string;
|
|
231
|
+
toJSON(): {
|
|
232
|
+
code: ErrorCode;
|
|
233
|
+
message: string;
|
|
234
|
+
details: Record<string, unknown> | undefined;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
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, getTableName as s, HaexHubError as t, HAEXTENSION_EVENTS as u, type HaextensionEvent as v };
|
|
@@ -0,0 +1,238 @@
|
|
|
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
|
+
/**
|
|
26
|
+
* Build a fully qualified table name for extensions.
|
|
27
|
+
* Use this in Drizzle schemas to create table names at build time.
|
|
28
|
+
*
|
|
29
|
+
* @param publicKey - The extension's public key (from manifest.json)
|
|
30
|
+
* @param extensionName - The extension name (from manifest.json or package.json)
|
|
31
|
+
* @param tableName - The table name (e.g., "users", "items")
|
|
32
|
+
* @returns Fully qualified table name: `{publicKey}__{extensionName}__{tableName}`
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* import { getTableName } from "@haex-space/vault-sdk";
|
|
37
|
+
* import manifest from "../haextension/manifest.json";
|
|
38
|
+
* import pkg from "../package.json";
|
|
39
|
+
*
|
|
40
|
+
* const tableName = (name: string) =>
|
|
41
|
+
* getTableName(manifest.publicKey, manifest.name || pkg.name, name);
|
|
42
|
+
*
|
|
43
|
+
* export const users = sqliteTable(tableName("users"), { ... });
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare function getTableName(publicKey: string, extensionName: string, tableName: string): string;
|
|
47
|
+
interface HaexHubRequest {
|
|
48
|
+
method: string;
|
|
49
|
+
params: Record<string, unknown>;
|
|
50
|
+
timestamp: number;
|
|
51
|
+
}
|
|
52
|
+
interface HaexHubResponse<T = unknown> {
|
|
53
|
+
id: string;
|
|
54
|
+
result?: T;
|
|
55
|
+
error?: HaexHubError;
|
|
56
|
+
}
|
|
57
|
+
interface ExtensionInfo {
|
|
58
|
+
publicKey: string;
|
|
59
|
+
name: string;
|
|
60
|
+
version: string;
|
|
61
|
+
displayName?: string;
|
|
62
|
+
namespace?: string;
|
|
63
|
+
}
|
|
64
|
+
interface ApplicationContext {
|
|
65
|
+
theme: "light" | "dark" | "system";
|
|
66
|
+
locale: string;
|
|
67
|
+
platform: "linux" | "macos" | "ios" | "freebsd" | "dragonfly" | "netbsd" | "openbsd" | "solaris" | "android" | "windows" | undefined;
|
|
68
|
+
}
|
|
69
|
+
interface SearchQuery {
|
|
70
|
+
query: string;
|
|
71
|
+
filters?: Record<string, unknown>;
|
|
72
|
+
limit?: number;
|
|
73
|
+
}
|
|
74
|
+
interface SearchResult {
|
|
75
|
+
id: string;
|
|
76
|
+
title: string;
|
|
77
|
+
description?: string;
|
|
78
|
+
type: string;
|
|
79
|
+
data?: Record<string, unknown>;
|
|
80
|
+
score?: number;
|
|
81
|
+
}
|
|
82
|
+
declare enum PermissionStatus {
|
|
83
|
+
GRANTED = "granted",
|
|
84
|
+
DENIED = "denied",
|
|
85
|
+
ASK = "ask"
|
|
86
|
+
}
|
|
87
|
+
interface PermissionResponse {
|
|
88
|
+
status: PermissionStatus;
|
|
89
|
+
permanent: boolean;
|
|
90
|
+
}
|
|
91
|
+
interface DatabasePermission {
|
|
92
|
+
extensionId: string;
|
|
93
|
+
resource: string;
|
|
94
|
+
operation: "read" | "write";
|
|
95
|
+
path: string;
|
|
96
|
+
}
|
|
97
|
+
interface DatabasePermissionRequest {
|
|
98
|
+
resource: string;
|
|
99
|
+
operation: "read" | "write";
|
|
100
|
+
reason?: string;
|
|
101
|
+
}
|
|
102
|
+
interface DatabaseQueryParams {
|
|
103
|
+
query: string;
|
|
104
|
+
params?: unknown[];
|
|
105
|
+
}
|
|
106
|
+
interface DatabaseQueryResult {
|
|
107
|
+
rows: unknown[];
|
|
108
|
+
columns?: string[];
|
|
109
|
+
rowsAffected: number;
|
|
110
|
+
lastInsertId?: number;
|
|
111
|
+
}
|
|
112
|
+
interface DatabaseExecuteParams {
|
|
113
|
+
statements: string[];
|
|
114
|
+
}
|
|
115
|
+
interface MigrationResult {
|
|
116
|
+
appliedCount: number;
|
|
117
|
+
alreadyAppliedCount: number;
|
|
118
|
+
appliedMigrations: string[];
|
|
119
|
+
}
|
|
120
|
+
interface Migration {
|
|
121
|
+
name: string;
|
|
122
|
+
sql: string;
|
|
123
|
+
}
|
|
124
|
+
interface DatabaseTableInfo {
|
|
125
|
+
name: string;
|
|
126
|
+
columns: DatabaseColumnInfo[];
|
|
127
|
+
}
|
|
128
|
+
interface DatabaseColumnInfo {
|
|
129
|
+
name: string;
|
|
130
|
+
type: string;
|
|
131
|
+
notNull: boolean;
|
|
132
|
+
defaultValue?: unknown;
|
|
133
|
+
primaryKey: boolean;
|
|
134
|
+
}
|
|
135
|
+
interface HaexHubEvent {
|
|
136
|
+
type: string;
|
|
137
|
+
data: unknown;
|
|
138
|
+
timestamp: number;
|
|
139
|
+
}
|
|
140
|
+
interface ContextChangedEvent extends HaexHubEvent {
|
|
141
|
+
type: typeof HAEXTENSION_EVENTS.CONTEXT_CHANGED;
|
|
142
|
+
data: {
|
|
143
|
+
context: ApplicationContext;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
interface SearchRequestEvent extends HaexHubEvent {
|
|
147
|
+
type: typeof HAEXTENSION_EVENTS.SEARCH_REQUEST;
|
|
148
|
+
data: {
|
|
149
|
+
query: SearchQuery;
|
|
150
|
+
requestId: string;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
type EventCallback = (event: HaexHubEvent) => void;
|
|
154
|
+
interface ExtensionManifest {
|
|
155
|
+
name: string;
|
|
156
|
+
version: string;
|
|
157
|
+
author?: string | null;
|
|
158
|
+
entry?: string | null;
|
|
159
|
+
icon?: string | null;
|
|
160
|
+
publicKey: string;
|
|
161
|
+
signature: string;
|
|
162
|
+
permissions: {
|
|
163
|
+
database?: any[];
|
|
164
|
+
filesystem?: any[];
|
|
165
|
+
http?: any[];
|
|
166
|
+
shell?: any[];
|
|
167
|
+
};
|
|
168
|
+
homepage?: string | null;
|
|
169
|
+
description?: string | null;
|
|
170
|
+
singleInstance?: boolean | null;
|
|
171
|
+
displayMode?: "auto" | "window" | "iframe" | null;
|
|
172
|
+
/**
|
|
173
|
+
* Path to the migrations directory relative to the extension root.
|
|
174
|
+
* Contains Drizzle-style migrations with meta/_journal.json and *.sql files.
|
|
175
|
+
* These migrations will be applied when the extension is installed.
|
|
176
|
+
* Example: "database/migrations"
|
|
177
|
+
*/
|
|
178
|
+
migrationsDir?: string | null;
|
|
179
|
+
}
|
|
180
|
+
interface HaexHubConfig {
|
|
181
|
+
debug?: boolean;
|
|
182
|
+
timeout?: number;
|
|
183
|
+
/** Extension manifest data (auto-injected by framework integrations) */
|
|
184
|
+
manifest?: ExtensionManifest;
|
|
185
|
+
}
|
|
186
|
+
interface WebRequestOptions {
|
|
187
|
+
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
|
|
188
|
+
headers?: Record<string, string>;
|
|
189
|
+
body?: string | ArrayBuffer | Blob;
|
|
190
|
+
timeout?: number;
|
|
191
|
+
}
|
|
192
|
+
interface WebResponse {
|
|
193
|
+
status: number;
|
|
194
|
+
statusText: string;
|
|
195
|
+
headers: Record<string, string>;
|
|
196
|
+
body: ArrayBuffer;
|
|
197
|
+
url: string;
|
|
198
|
+
}
|
|
199
|
+
declare enum ErrorCode {
|
|
200
|
+
TIMEOUT = "TIMEOUT",
|
|
201
|
+
NOT_IN_IFRAME = "NOT_IN_IFRAME",
|
|
202
|
+
UNAUTHORIZED_ORIGIN = "UNAUTHORIZED_ORIGIN",
|
|
203
|
+
PERMISSION_DENIED = "PERMISSION_DENIED",
|
|
204
|
+
INVALID_PUBLIC_KEY = "INVALID_PUBLIC_KEY",
|
|
205
|
+
INVALID_EXTENSION_NAME = "INVALID_EXTENSION_NAME",
|
|
206
|
+
INVALID_TABLE_NAME = "INVALID_TABLE_NAME",
|
|
207
|
+
INVALID_PARAMS = "INVALID_PARAMS",
|
|
208
|
+
EXTENSION_NOT_INITIALIZED = "EXTENSION_NOT_INITIALIZED",
|
|
209
|
+
EXTENSION_INFO_UNAVAILABLE = "EXTENSION_INFO_UNAVAILABLE",
|
|
210
|
+
METHOD_NOT_FOUND = "METHOD_NOT_FOUND",
|
|
211
|
+
INTERNAL_ERROR = "INTERNAL_ERROR",
|
|
212
|
+
DATABASE_ERROR = "DATABASE_ERROR",
|
|
213
|
+
WEB_ERROR = "WEB_ERROR"
|
|
214
|
+
}
|
|
215
|
+
interface HaexHubError {
|
|
216
|
+
code: ErrorCode;
|
|
217
|
+
message: string;
|
|
218
|
+
details?: Record<string, unknown>;
|
|
219
|
+
}
|
|
220
|
+
declare class HaexHubError extends Error {
|
|
221
|
+
code: ErrorCode;
|
|
222
|
+
messageKey: string;
|
|
223
|
+
details?: Record<string, unknown> | undefined;
|
|
224
|
+
constructor(code: ErrorCode, messageKey: string, details?: Record<string, unknown> | undefined);
|
|
225
|
+
/**
|
|
226
|
+
* Get localized error message
|
|
227
|
+
* @param locale - Locale code (e.g., 'en', 'de')
|
|
228
|
+
* @param translations - Translation object
|
|
229
|
+
*/
|
|
230
|
+
getLocalizedMessage(locale?: string, translations?: Record<string, Record<string, string>>): string;
|
|
231
|
+
toJSON(): {
|
|
232
|
+
code: ErrorCode;
|
|
233
|
+
message: string;
|
|
234
|
+
details: Record<string, unknown> | undefined;
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
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, getTableName as s, HaexHubError as t, HAEXTENSION_EVENTS as u, type HaextensionEvent as v };
|
package/dist/vue.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { H as
|
|
1
|
+
import { H as HaexVaultClient, S as StorageAPI } from './client-BIiJwbdW.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-FE9ewl3r.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
|
|
1
|
+
import { H as HaexVaultClient, S as StorageAPI } from './client-D4hDL-PR.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-FE9ewl3r.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Vue 3 composable for HaexHub SDK
|
package/dist/vue.js
CHANGED
|
@@ -366,6 +366,9 @@ var HAEXTENSION_METHODS = {
|
|
|
366
366
|
// src/types.ts
|
|
367
367
|
var DEFAULT_TIMEOUT = 3e4;
|
|
368
368
|
var TABLE_SEPARATOR = "__";
|
|
369
|
+
function getTableName(publicKey, extensionName, tableName) {
|
|
370
|
+
return `${publicKey}${TABLE_SEPARATOR}${extensionName}${TABLE_SEPARATOR}${tableName}`;
|
|
371
|
+
}
|
|
369
372
|
var HaexHubError = class extends Error {
|
|
370
373
|
constructor(code, messageKey, details) {
|
|
371
374
|
super(messageKey);
|
|
@@ -907,14 +910,13 @@ var HaexVaultClient = class {
|
|
|
907
910
|
}
|
|
908
911
|
this.validateTableName(tableName);
|
|
909
912
|
const { publicKey, name } = this._extensionInfo;
|
|
910
|
-
|
|
911
|
-
return `"${publicKey}${TABLE_SEPARATOR}${extensionName}${TABLE_SEPARATOR}${tableName}"`;
|
|
913
|
+
return `"${getTableName(publicKey, name, tableName)}"`;
|
|
912
914
|
}
|
|
913
915
|
getDependencyTableName(publicKey, extensionName, tableName) {
|
|
914
916
|
this.validatePublicKey(publicKey);
|
|
915
917
|
this.validateExtensionName(extensionName);
|
|
916
918
|
this.validateTableName(tableName);
|
|
917
|
-
return `"${publicKey
|
|
919
|
+
return `"${getTableName(publicKey, extensionName, tableName)}"`;
|
|
918
920
|
}
|
|
919
921
|
parseTableName(fullTableName) {
|
|
920
922
|
let cleanTableName = fullTableName;
|