@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
|
@@ -1,220 +1,6 @@
|
|
|
1
|
+
import { D as DatabaseQueryResult, M as Migration, b as MigrationResult, W as WebRequestOptions, c as WebResponse, H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext, d as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, e as EventCallback } from './types-FE9ewl3r.mjs';
|
|
1
2
|
import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
|
|
2
3
|
|
|
3
|
-
/**
|
|
4
|
-
* Central event name definitions for HaexHub extensions
|
|
5
|
-
*
|
|
6
|
-
* Event Naming Schema: haextension:{subject}:{predicate}
|
|
7
|
-
*
|
|
8
|
-
* IMPORTANT: Tauri event names can only contain:
|
|
9
|
-
* - Alphanumeric characters (a-z, A-Z, 0-9)
|
|
10
|
-
* - Hyphens (-)
|
|
11
|
-
* - Slashes (/)
|
|
12
|
-
* - Colons (:)
|
|
13
|
-
* - Underscores (_)
|
|
14
|
-
*
|
|
15
|
-
* NO dots (.) allowed!
|
|
16
|
-
*/
|
|
17
|
-
declare const HAEXTENSION_EVENTS: {
|
|
18
|
-
/** Context (theme, locale, platform) has changed */
|
|
19
|
-
readonly CONTEXT_CHANGED: "haextension:context:changed";
|
|
20
|
-
/** Search request from HaexHub */
|
|
21
|
-
readonly SEARCH_REQUEST: "haextension:search:request";
|
|
22
|
-
};
|
|
23
|
-
type HaextensionEvent = typeof HAEXTENSION_EVENTS[keyof typeof HAEXTENSION_EVENTS];
|
|
24
|
-
|
|
25
|
-
declare const DEFAULT_TIMEOUT = 30000;
|
|
26
|
-
declare const TABLE_SEPARATOR = "__";
|
|
27
|
-
interface HaexHubRequest {
|
|
28
|
-
method: string;
|
|
29
|
-
params: Record<string, unknown>;
|
|
30
|
-
timestamp: number;
|
|
31
|
-
}
|
|
32
|
-
interface HaexHubResponse<T = unknown> {
|
|
33
|
-
id: string;
|
|
34
|
-
result?: T;
|
|
35
|
-
error?: HaexHubError;
|
|
36
|
-
}
|
|
37
|
-
interface ExtensionInfo {
|
|
38
|
-
publicKey: string;
|
|
39
|
-
name: string;
|
|
40
|
-
version: string;
|
|
41
|
-
displayName?: string;
|
|
42
|
-
namespace?: string;
|
|
43
|
-
}
|
|
44
|
-
interface ApplicationContext {
|
|
45
|
-
theme: "light" | "dark" | "system";
|
|
46
|
-
locale: string;
|
|
47
|
-
platform: "linux" | "macos" | "ios" | "freebsd" | "dragonfly" | "netbsd" | "openbsd" | "solaris" | "android" | "windows" | undefined;
|
|
48
|
-
}
|
|
49
|
-
interface SearchQuery {
|
|
50
|
-
query: string;
|
|
51
|
-
filters?: Record<string, unknown>;
|
|
52
|
-
limit?: number;
|
|
53
|
-
}
|
|
54
|
-
interface SearchResult {
|
|
55
|
-
id: string;
|
|
56
|
-
title: string;
|
|
57
|
-
description?: string;
|
|
58
|
-
type: string;
|
|
59
|
-
data?: Record<string, unknown>;
|
|
60
|
-
score?: number;
|
|
61
|
-
}
|
|
62
|
-
declare enum PermissionStatus {
|
|
63
|
-
GRANTED = "granted",
|
|
64
|
-
DENIED = "denied",
|
|
65
|
-
ASK = "ask"
|
|
66
|
-
}
|
|
67
|
-
interface PermissionResponse {
|
|
68
|
-
status: PermissionStatus;
|
|
69
|
-
permanent: boolean;
|
|
70
|
-
}
|
|
71
|
-
interface DatabasePermission {
|
|
72
|
-
extensionId: string;
|
|
73
|
-
resource: string;
|
|
74
|
-
operation: "read" | "write";
|
|
75
|
-
path: string;
|
|
76
|
-
}
|
|
77
|
-
interface DatabasePermissionRequest {
|
|
78
|
-
resource: string;
|
|
79
|
-
operation: "read" | "write";
|
|
80
|
-
reason?: string;
|
|
81
|
-
}
|
|
82
|
-
interface DatabaseQueryParams {
|
|
83
|
-
query: string;
|
|
84
|
-
params?: unknown[];
|
|
85
|
-
}
|
|
86
|
-
interface DatabaseQueryResult {
|
|
87
|
-
rows: unknown[];
|
|
88
|
-
columns?: string[];
|
|
89
|
-
rowsAffected: number;
|
|
90
|
-
lastInsertId?: number;
|
|
91
|
-
}
|
|
92
|
-
interface DatabaseExecuteParams {
|
|
93
|
-
statements: string[];
|
|
94
|
-
}
|
|
95
|
-
interface MigrationResult {
|
|
96
|
-
appliedCount: number;
|
|
97
|
-
alreadyAppliedCount: number;
|
|
98
|
-
appliedMigrations: string[];
|
|
99
|
-
}
|
|
100
|
-
interface Migration {
|
|
101
|
-
name: string;
|
|
102
|
-
sql: string;
|
|
103
|
-
}
|
|
104
|
-
interface DatabaseTableInfo {
|
|
105
|
-
name: string;
|
|
106
|
-
columns: DatabaseColumnInfo[];
|
|
107
|
-
}
|
|
108
|
-
interface DatabaseColumnInfo {
|
|
109
|
-
name: string;
|
|
110
|
-
type: string;
|
|
111
|
-
notNull: boolean;
|
|
112
|
-
defaultValue?: unknown;
|
|
113
|
-
primaryKey: boolean;
|
|
114
|
-
}
|
|
115
|
-
interface HaexHubEvent {
|
|
116
|
-
type: string;
|
|
117
|
-
data: unknown;
|
|
118
|
-
timestamp: number;
|
|
119
|
-
}
|
|
120
|
-
interface ContextChangedEvent extends HaexHubEvent {
|
|
121
|
-
type: typeof HAEXTENSION_EVENTS.CONTEXT_CHANGED;
|
|
122
|
-
data: {
|
|
123
|
-
context: ApplicationContext;
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
interface SearchRequestEvent extends HaexHubEvent {
|
|
127
|
-
type: typeof HAEXTENSION_EVENTS.SEARCH_REQUEST;
|
|
128
|
-
data: {
|
|
129
|
-
query: SearchQuery;
|
|
130
|
-
requestId: string;
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
type EventCallback = (event: HaexHubEvent) => void;
|
|
134
|
-
interface ExtensionManifest {
|
|
135
|
-
name: string;
|
|
136
|
-
version: string;
|
|
137
|
-
author?: string | null;
|
|
138
|
-
entry?: string | null;
|
|
139
|
-
icon?: string | null;
|
|
140
|
-
publicKey: string;
|
|
141
|
-
signature: string;
|
|
142
|
-
permissions: {
|
|
143
|
-
database?: any[];
|
|
144
|
-
filesystem?: any[];
|
|
145
|
-
http?: any[];
|
|
146
|
-
shell?: any[];
|
|
147
|
-
};
|
|
148
|
-
homepage?: string | null;
|
|
149
|
-
description?: string | null;
|
|
150
|
-
singleInstance?: boolean | null;
|
|
151
|
-
displayMode?: "auto" | "window" | "iframe" | null;
|
|
152
|
-
/**
|
|
153
|
-
* Path to the migrations directory relative to the extension root.
|
|
154
|
-
* Contains Drizzle-style migrations with meta/_journal.json and *.sql files.
|
|
155
|
-
* These migrations will be applied when the extension is installed.
|
|
156
|
-
* Example: "database/migrations"
|
|
157
|
-
*/
|
|
158
|
-
migrationsDir?: string | null;
|
|
159
|
-
}
|
|
160
|
-
interface HaexHubConfig {
|
|
161
|
-
debug?: boolean;
|
|
162
|
-
timeout?: number;
|
|
163
|
-
/** Extension manifest data (auto-injected by framework integrations) */
|
|
164
|
-
manifest?: ExtensionManifest;
|
|
165
|
-
}
|
|
166
|
-
interface WebRequestOptions {
|
|
167
|
-
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
|
|
168
|
-
headers?: Record<string, string>;
|
|
169
|
-
body?: string | ArrayBuffer | Blob;
|
|
170
|
-
timeout?: number;
|
|
171
|
-
}
|
|
172
|
-
interface WebResponse {
|
|
173
|
-
status: number;
|
|
174
|
-
statusText: string;
|
|
175
|
-
headers: Record<string, string>;
|
|
176
|
-
body: ArrayBuffer;
|
|
177
|
-
url: string;
|
|
178
|
-
}
|
|
179
|
-
declare enum ErrorCode {
|
|
180
|
-
TIMEOUT = "TIMEOUT",
|
|
181
|
-
NOT_IN_IFRAME = "NOT_IN_IFRAME",
|
|
182
|
-
UNAUTHORIZED_ORIGIN = "UNAUTHORIZED_ORIGIN",
|
|
183
|
-
PERMISSION_DENIED = "PERMISSION_DENIED",
|
|
184
|
-
INVALID_PUBLIC_KEY = "INVALID_PUBLIC_KEY",
|
|
185
|
-
INVALID_EXTENSION_NAME = "INVALID_EXTENSION_NAME",
|
|
186
|
-
INVALID_TABLE_NAME = "INVALID_TABLE_NAME",
|
|
187
|
-
INVALID_PARAMS = "INVALID_PARAMS",
|
|
188
|
-
EXTENSION_NOT_INITIALIZED = "EXTENSION_NOT_INITIALIZED",
|
|
189
|
-
EXTENSION_INFO_UNAVAILABLE = "EXTENSION_INFO_UNAVAILABLE",
|
|
190
|
-
METHOD_NOT_FOUND = "METHOD_NOT_FOUND",
|
|
191
|
-
INTERNAL_ERROR = "INTERNAL_ERROR",
|
|
192
|
-
DATABASE_ERROR = "DATABASE_ERROR",
|
|
193
|
-
WEB_ERROR = "WEB_ERROR"
|
|
194
|
-
}
|
|
195
|
-
interface HaexHubError {
|
|
196
|
-
code: ErrorCode;
|
|
197
|
-
message: string;
|
|
198
|
-
details?: Record<string, unknown>;
|
|
199
|
-
}
|
|
200
|
-
declare class HaexHubError extends Error {
|
|
201
|
-
code: ErrorCode;
|
|
202
|
-
messageKey: string;
|
|
203
|
-
details?: Record<string, unknown> | undefined;
|
|
204
|
-
constructor(code: ErrorCode, messageKey: string, details?: Record<string, unknown> | undefined);
|
|
205
|
-
/**
|
|
206
|
-
* Get localized error message
|
|
207
|
-
* @param locale - Locale code (e.g., 'en', 'de')
|
|
208
|
-
* @param translations - Translation object
|
|
209
|
-
*/
|
|
210
|
-
getLocalizedMessage(locale?: string, translations?: Record<string, Record<string, string>>): string;
|
|
211
|
-
toJSON(): {
|
|
212
|
-
code: ErrorCode;
|
|
213
|
-
message: string;
|
|
214
|
-
details: Record<string, unknown> | undefined;
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
|
|
218
4
|
declare class StorageAPI {
|
|
219
5
|
private client;
|
|
220
6
|
constructor(client: HaexVaultClient);
|
|
@@ -511,4 +297,4 @@ declare class HaexVaultClient {
|
|
|
511
297
|
private log;
|
|
512
298
|
}
|
|
513
299
|
|
|
514
|
-
export {
|
|
300
|
+
export { DatabaseAPI as D, FilesystemAPI as F, HaexVaultClient as H, PermissionsAPI as P, StorageAPI as S, WebAPI as W };
|
|
@@ -1,220 +1,6 @@
|
|
|
1
|
+
import { D as DatabaseQueryResult, M as Migration, b as MigrationResult, W as WebRequestOptions, c as WebResponse, H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext, d as DatabasePermissionRequest, P as PermissionResponse, S as SearchResult, e as EventCallback } from './types-FE9ewl3r.js';
|
|
1
2
|
import { SqliteRemoteDatabase } from 'drizzle-orm/sqlite-proxy';
|
|
2
3
|
|
|
3
|
-
/**
|
|
4
|
-
* Central event name definitions for HaexHub extensions
|
|
5
|
-
*
|
|
6
|
-
* Event Naming Schema: haextension:{subject}:{predicate}
|
|
7
|
-
*
|
|
8
|
-
* IMPORTANT: Tauri event names can only contain:
|
|
9
|
-
* - Alphanumeric characters (a-z, A-Z, 0-9)
|
|
10
|
-
* - Hyphens (-)
|
|
11
|
-
* - Slashes (/)
|
|
12
|
-
* - Colons (:)
|
|
13
|
-
* - Underscores (_)
|
|
14
|
-
*
|
|
15
|
-
* NO dots (.) allowed!
|
|
16
|
-
*/
|
|
17
|
-
declare const HAEXTENSION_EVENTS: {
|
|
18
|
-
/** Context (theme, locale, platform) has changed */
|
|
19
|
-
readonly CONTEXT_CHANGED: "haextension:context:changed";
|
|
20
|
-
/** Search request from HaexHub */
|
|
21
|
-
readonly SEARCH_REQUEST: "haextension:search:request";
|
|
22
|
-
};
|
|
23
|
-
type HaextensionEvent = typeof HAEXTENSION_EVENTS[keyof typeof HAEXTENSION_EVENTS];
|
|
24
|
-
|
|
25
|
-
declare const DEFAULT_TIMEOUT = 30000;
|
|
26
|
-
declare const TABLE_SEPARATOR = "__";
|
|
27
|
-
interface HaexHubRequest {
|
|
28
|
-
method: string;
|
|
29
|
-
params: Record<string, unknown>;
|
|
30
|
-
timestamp: number;
|
|
31
|
-
}
|
|
32
|
-
interface HaexHubResponse<T = unknown> {
|
|
33
|
-
id: string;
|
|
34
|
-
result?: T;
|
|
35
|
-
error?: HaexHubError;
|
|
36
|
-
}
|
|
37
|
-
interface ExtensionInfo {
|
|
38
|
-
publicKey: string;
|
|
39
|
-
name: string;
|
|
40
|
-
version: string;
|
|
41
|
-
displayName?: string;
|
|
42
|
-
namespace?: string;
|
|
43
|
-
}
|
|
44
|
-
interface ApplicationContext {
|
|
45
|
-
theme: "light" | "dark" | "system";
|
|
46
|
-
locale: string;
|
|
47
|
-
platform: "linux" | "macos" | "ios" | "freebsd" | "dragonfly" | "netbsd" | "openbsd" | "solaris" | "android" | "windows" | undefined;
|
|
48
|
-
}
|
|
49
|
-
interface SearchQuery {
|
|
50
|
-
query: string;
|
|
51
|
-
filters?: Record<string, unknown>;
|
|
52
|
-
limit?: number;
|
|
53
|
-
}
|
|
54
|
-
interface SearchResult {
|
|
55
|
-
id: string;
|
|
56
|
-
title: string;
|
|
57
|
-
description?: string;
|
|
58
|
-
type: string;
|
|
59
|
-
data?: Record<string, unknown>;
|
|
60
|
-
score?: number;
|
|
61
|
-
}
|
|
62
|
-
declare enum PermissionStatus {
|
|
63
|
-
GRANTED = "granted",
|
|
64
|
-
DENIED = "denied",
|
|
65
|
-
ASK = "ask"
|
|
66
|
-
}
|
|
67
|
-
interface PermissionResponse {
|
|
68
|
-
status: PermissionStatus;
|
|
69
|
-
permanent: boolean;
|
|
70
|
-
}
|
|
71
|
-
interface DatabasePermission {
|
|
72
|
-
extensionId: string;
|
|
73
|
-
resource: string;
|
|
74
|
-
operation: "read" | "write";
|
|
75
|
-
path: string;
|
|
76
|
-
}
|
|
77
|
-
interface DatabasePermissionRequest {
|
|
78
|
-
resource: string;
|
|
79
|
-
operation: "read" | "write";
|
|
80
|
-
reason?: string;
|
|
81
|
-
}
|
|
82
|
-
interface DatabaseQueryParams {
|
|
83
|
-
query: string;
|
|
84
|
-
params?: unknown[];
|
|
85
|
-
}
|
|
86
|
-
interface DatabaseQueryResult {
|
|
87
|
-
rows: unknown[];
|
|
88
|
-
columns?: string[];
|
|
89
|
-
rowsAffected: number;
|
|
90
|
-
lastInsertId?: number;
|
|
91
|
-
}
|
|
92
|
-
interface DatabaseExecuteParams {
|
|
93
|
-
statements: string[];
|
|
94
|
-
}
|
|
95
|
-
interface MigrationResult {
|
|
96
|
-
appliedCount: number;
|
|
97
|
-
alreadyAppliedCount: number;
|
|
98
|
-
appliedMigrations: string[];
|
|
99
|
-
}
|
|
100
|
-
interface Migration {
|
|
101
|
-
name: string;
|
|
102
|
-
sql: string;
|
|
103
|
-
}
|
|
104
|
-
interface DatabaseTableInfo {
|
|
105
|
-
name: string;
|
|
106
|
-
columns: DatabaseColumnInfo[];
|
|
107
|
-
}
|
|
108
|
-
interface DatabaseColumnInfo {
|
|
109
|
-
name: string;
|
|
110
|
-
type: string;
|
|
111
|
-
notNull: boolean;
|
|
112
|
-
defaultValue?: unknown;
|
|
113
|
-
primaryKey: boolean;
|
|
114
|
-
}
|
|
115
|
-
interface HaexHubEvent {
|
|
116
|
-
type: string;
|
|
117
|
-
data: unknown;
|
|
118
|
-
timestamp: number;
|
|
119
|
-
}
|
|
120
|
-
interface ContextChangedEvent extends HaexHubEvent {
|
|
121
|
-
type: typeof HAEXTENSION_EVENTS.CONTEXT_CHANGED;
|
|
122
|
-
data: {
|
|
123
|
-
context: ApplicationContext;
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
interface SearchRequestEvent extends HaexHubEvent {
|
|
127
|
-
type: typeof HAEXTENSION_EVENTS.SEARCH_REQUEST;
|
|
128
|
-
data: {
|
|
129
|
-
query: SearchQuery;
|
|
130
|
-
requestId: string;
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
type EventCallback = (event: HaexHubEvent) => void;
|
|
134
|
-
interface ExtensionManifest {
|
|
135
|
-
name: string;
|
|
136
|
-
version: string;
|
|
137
|
-
author?: string | null;
|
|
138
|
-
entry?: string | null;
|
|
139
|
-
icon?: string | null;
|
|
140
|
-
publicKey: string;
|
|
141
|
-
signature: string;
|
|
142
|
-
permissions: {
|
|
143
|
-
database?: any[];
|
|
144
|
-
filesystem?: any[];
|
|
145
|
-
http?: any[];
|
|
146
|
-
shell?: any[];
|
|
147
|
-
};
|
|
148
|
-
homepage?: string | null;
|
|
149
|
-
description?: string | null;
|
|
150
|
-
singleInstance?: boolean | null;
|
|
151
|
-
displayMode?: "auto" | "window" | "iframe" | null;
|
|
152
|
-
/**
|
|
153
|
-
* Path to the migrations directory relative to the extension root.
|
|
154
|
-
* Contains Drizzle-style migrations with meta/_journal.json and *.sql files.
|
|
155
|
-
* These migrations will be applied when the extension is installed.
|
|
156
|
-
* Example: "database/migrations"
|
|
157
|
-
*/
|
|
158
|
-
migrationsDir?: string | null;
|
|
159
|
-
}
|
|
160
|
-
interface HaexHubConfig {
|
|
161
|
-
debug?: boolean;
|
|
162
|
-
timeout?: number;
|
|
163
|
-
/** Extension manifest data (auto-injected by framework integrations) */
|
|
164
|
-
manifest?: ExtensionManifest;
|
|
165
|
-
}
|
|
166
|
-
interface WebRequestOptions {
|
|
167
|
-
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
|
|
168
|
-
headers?: Record<string, string>;
|
|
169
|
-
body?: string | ArrayBuffer | Blob;
|
|
170
|
-
timeout?: number;
|
|
171
|
-
}
|
|
172
|
-
interface WebResponse {
|
|
173
|
-
status: number;
|
|
174
|
-
statusText: string;
|
|
175
|
-
headers: Record<string, string>;
|
|
176
|
-
body: ArrayBuffer;
|
|
177
|
-
url: string;
|
|
178
|
-
}
|
|
179
|
-
declare enum ErrorCode {
|
|
180
|
-
TIMEOUT = "TIMEOUT",
|
|
181
|
-
NOT_IN_IFRAME = "NOT_IN_IFRAME",
|
|
182
|
-
UNAUTHORIZED_ORIGIN = "UNAUTHORIZED_ORIGIN",
|
|
183
|
-
PERMISSION_DENIED = "PERMISSION_DENIED",
|
|
184
|
-
INVALID_PUBLIC_KEY = "INVALID_PUBLIC_KEY",
|
|
185
|
-
INVALID_EXTENSION_NAME = "INVALID_EXTENSION_NAME",
|
|
186
|
-
INVALID_TABLE_NAME = "INVALID_TABLE_NAME",
|
|
187
|
-
INVALID_PARAMS = "INVALID_PARAMS",
|
|
188
|
-
EXTENSION_NOT_INITIALIZED = "EXTENSION_NOT_INITIALIZED",
|
|
189
|
-
EXTENSION_INFO_UNAVAILABLE = "EXTENSION_INFO_UNAVAILABLE",
|
|
190
|
-
METHOD_NOT_FOUND = "METHOD_NOT_FOUND",
|
|
191
|
-
INTERNAL_ERROR = "INTERNAL_ERROR",
|
|
192
|
-
DATABASE_ERROR = "DATABASE_ERROR",
|
|
193
|
-
WEB_ERROR = "WEB_ERROR"
|
|
194
|
-
}
|
|
195
|
-
interface HaexHubError {
|
|
196
|
-
code: ErrorCode;
|
|
197
|
-
message: string;
|
|
198
|
-
details?: Record<string, unknown>;
|
|
199
|
-
}
|
|
200
|
-
declare class HaexHubError extends Error {
|
|
201
|
-
code: ErrorCode;
|
|
202
|
-
messageKey: string;
|
|
203
|
-
details?: Record<string, unknown> | undefined;
|
|
204
|
-
constructor(code: ErrorCode, messageKey: string, details?: Record<string, unknown> | undefined);
|
|
205
|
-
/**
|
|
206
|
-
* Get localized error message
|
|
207
|
-
* @param locale - Locale code (e.g., 'en', 'de')
|
|
208
|
-
* @param translations - Translation object
|
|
209
|
-
*/
|
|
210
|
-
getLocalizedMessage(locale?: string, translations?: Record<string, Record<string, string>>): string;
|
|
211
|
-
toJSON(): {
|
|
212
|
-
code: ErrorCode;
|
|
213
|
-
message: string;
|
|
214
|
-
details: Record<string, unknown> | undefined;
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
|
|
218
4
|
declare class StorageAPI {
|
|
219
5
|
private client;
|
|
220
6
|
constructor(client: HaexVaultClient);
|
|
@@ -511,4 +297,4 @@ declare class HaexVaultClient {
|
|
|
511
297
|
private log;
|
|
512
298
|
}
|
|
513
299
|
|
|
514
|
-
export {
|
|
300
|
+
export { DatabaseAPI as D, FilesystemAPI as F, HaexVaultClient as H, PermissionsAPI as P, StorageAPI as S, WebAPI as W };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
interface HaextensionConfig {
|
|
2
|
+
dev?: {
|
|
3
|
+
port?: number;
|
|
4
|
+
host?: string;
|
|
5
|
+
haextension_dir?: string;
|
|
6
|
+
};
|
|
7
|
+
keys?: {
|
|
8
|
+
public_key_path?: string;
|
|
9
|
+
private_key_path?: string;
|
|
10
|
+
};
|
|
11
|
+
build?: {
|
|
12
|
+
distDir?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Source path for migrations directory (relative to project root).
|
|
15
|
+
* If manifest.migrationsDir is set, this directory will be copied
|
|
16
|
+
* to the bundle at the path specified in migrationsDir.
|
|
17
|
+
* Default: "app/{migrationsDir}" (for Nuxt projects)
|
|
18
|
+
* Example: "app/database/migrations" -> copies to "database/migrations" in bundle
|
|
19
|
+
*/
|
|
20
|
+
migrationsSourceDir?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Read haextension.config.json from the project root
|
|
25
|
+
* Returns null if file doesn't exist
|
|
26
|
+
*/
|
|
27
|
+
declare function readHaextensionConfig(rootDir?: string): HaextensionConfig | null;
|
|
28
|
+
/**
|
|
29
|
+
* Get extension directory from config or use default
|
|
30
|
+
*/
|
|
31
|
+
declare function getExtensionDir(rootDir?: string): string;
|
|
32
|
+
|
|
33
|
+
export { type HaextensionConfig as H, getExtensionDir as g, readHaextensionConfig as r };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
interface HaextensionConfig {
|
|
2
|
+
dev?: {
|
|
3
|
+
port?: number;
|
|
4
|
+
host?: string;
|
|
5
|
+
haextension_dir?: string;
|
|
6
|
+
};
|
|
7
|
+
keys?: {
|
|
8
|
+
public_key_path?: string;
|
|
9
|
+
private_key_path?: string;
|
|
10
|
+
};
|
|
11
|
+
build?: {
|
|
12
|
+
distDir?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Source path for migrations directory (relative to project root).
|
|
15
|
+
* If manifest.migrationsDir is set, this directory will be copied
|
|
16
|
+
* to the bundle at the path specified in migrationsDir.
|
|
17
|
+
* Default: "app/{migrationsDir}" (for Nuxt projects)
|
|
18
|
+
* Example: "app/database/migrations" -> copies to "database/migrations" in bundle
|
|
19
|
+
*/
|
|
20
|
+
migrationsSourceDir?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Read haextension.config.json from the project root
|
|
25
|
+
* Returns null if file doesn't exist
|
|
26
|
+
*/
|
|
27
|
+
declare function readHaextensionConfig(rootDir?: string): HaextensionConfig | null;
|
|
28
|
+
/**
|
|
29
|
+
* Get extension directory from config or use default
|
|
30
|
+
*/
|
|
31
|
+
declare function getExtensionDir(rootDir?: string): string;
|
|
32
|
+
|
|
33
|
+
export { type HaextensionConfig as H, getExtensionDir as g, readHaextensionConfig as r };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { H as
|
|
2
|
-
export {
|
|
3
|
-
|
|
1
|
+
import { H as HaexVaultClient } from './client-BIiJwbdW.mjs';
|
|
2
|
+
export { D as DatabaseAPI, F as FilesystemAPI, P as PermissionsAPI, W as WebAPI } from './client-BIiJwbdW.mjs';
|
|
3
|
+
import { H as HaexHubConfig } from './types-FE9ewl3r.mjs';
|
|
4
|
+
export { A as ApplicationContext, C as ContextChangedEvent, r as DEFAULT_TIMEOUT, m as DatabaseColumnInfo, k as DatabaseExecuteParams, i as DatabasePermission, d as DatabasePermissionRequest, j as DatabaseQueryParams, D as DatabaseQueryResult, l as DatabaseTableInfo, q as ErrorCode, e as EventCallback, a as ExtensionInfo, E as ExtensionManifest, u as HAEXTENSION_EVENTS, t as HaexHubError, h as HaexHubEvent, f as HaexHubRequest, g as HaexHubResponse, v as HaextensionEvent, P as PermissionResponse, p as PermissionStatus, n as SearchQuery, o as SearchRequestEvent, S as SearchResult, T as TABLE_SEPARATOR, W as WebRequestOptions, c as WebResponse, s as getTableName } from './types-FE9ewl3r.mjs';
|
|
5
|
+
export { H as HaextensionConfig } from './config-D_HXjsEV.mjs';
|
|
4
6
|
import 'drizzle-orm/sqlite-proxy';
|
|
5
7
|
|
|
6
8
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { H as
|
|
2
|
-
export {
|
|
3
|
-
|
|
1
|
+
import { H as HaexVaultClient } from './client-D4hDL-PR.js';
|
|
2
|
+
export { D as DatabaseAPI, F as FilesystemAPI, P as PermissionsAPI, W as WebAPI } from './client-D4hDL-PR.js';
|
|
3
|
+
import { H as HaexHubConfig } from './types-FE9ewl3r.js';
|
|
4
|
+
export { A as ApplicationContext, C as ContextChangedEvent, r as DEFAULT_TIMEOUT, m as DatabaseColumnInfo, k as DatabaseExecuteParams, i as DatabasePermission, d as DatabasePermissionRequest, j as DatabaseQueryParams, D as DatabaseQueryResult, l as DatabaseTableInfo, q as ErrorCode, e as EventCallback, a as ExtensionInfo, E as ExtensionManifest, u as HAEXTENSION_EVENTS, t as HaexHubError, h as HaexHubEvent, f as HaexHubRequest, g as HaexHubResponse, v as HaextensionEvent, P as PermissionResponse, p as PermissionStatus, n as SearchQuery, o as SearchRequestEvent, S as SearchResult, T as TABLE_SEPARATOR, W as WebRequestOptions, c as WebResponse, s as getTableName } from './types-FE9ewl3r.js';
|
|
5
|
+
export { H as HaextensionConfig } from './config-D_HXjsEV.js';
|
|
4
6
|
import 'drizzle-orm/sqlite-proxy';
|
|
5
7
|
|
|
6
8
|
/**
|
package/dist/index.js
CHANGED
|
@@ -404,6 +404,9 @@ var HAEXTENSION_METHODS = {
|
|
|
404
404
|
// src/types.ts
|
|
405
405
|
var DEFAULT_TIMEOUT = 3e4;
|
|
406
406
|
var TABLE_SEPARATOR = "__";
|
|
407
|
+
function getTableName(publicKey, extensionName, tableName) {
|
|
408
|
+
return `${publicKey}${TABLE_SEPARATOR}${extensionName}${TABLE_SEPARATOR}${tableName}`;
|
|
409
|
+
}
|
|
407
410
|
var PermissionStatus = /* @__PURE__ */ ((PermissionStatus2) => {
|
|
408
411
|
PermissionStatus2["GRANTED"] = "granted";
|
|
409
412
|
PermissionStatus2["DENIED"] = "denied";
|
|
@@ -968,14 +971,13 @@ var HaexVaultClient = class {
|
|
|
968
971
|
}
|
|
969
972
|
this.validateTableName(tableName);
|
|
970
973
|
const { publicKey, name } = this._extensionInfo;
|
|
971
|
-
|
|
972
|
-
return `"${publicKey}${TABLE_SEPARATOR}${extensionName}${TABLE_SEPARATOR}${tableName}"`;
|
|
974
|
+
return `"${getTableName(publicKey, name, tableName)}"`;
|
|
973
975
|
}
|
|
974
976
|
getDependencyTableName(publicKey, extensionName, tableName) {
|
|
975
977
|
this.validatePublicKey(publicKey);
|
|
976
978
|
this.validateExtensionName(extensionName);
|
|
977
979
|
this.validateTableName(tableName);
|
|
978
|
-
return `"${publicKey
|
|
980
|
+
return `"${getTableName(publicKey, extensionName, tableName)}"`;
|
|
979
981
|
}
|
|
980
982
|
parseTableName(fullTableName) {
|
|
981
983
|
let cleanTableName = fullTableName;
|
|
@@ -1440,6 +1442,7 @@ exports.PermissionsAPI = PermissionsAPI;
|
|
|
1440
1442
|
exports.TABLE_SEPARATOR = TABLE_SEPARATOR;
|
|
1441
1443
|
exports.WebAPI = WebAPI;
|
|
1442
1444
|
exports.createHaexVaultClient = createHaexVaultClient;
|
|
1445
|
+
exports.getTableName = getTableName;
|
|
1443
1446
|
exports.installBaseTag = installBaseTag;
|
|
1444
1447
|
exports.installCookiePolyfill = installCookiePolyfill;
|
|
1445
1448
|
exports.installHistoryPolyfill = installHistoryPolyfill;
|