@haex-space/vault-sdk 2.2.5 → 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.
- package/dist/{client-UgMJJ4NT.d.mts → client-DeP-DCz5.d.ts} +2 -216
- package/dist/{client-UgMJJ4NT.d.ts → client-wxMr0ONL.d.mts} +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/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/runtime/nuxt.plugin.client.d.mts +2 -1
- package/dist/runtime/nuxt.plugin.client.d.ts +2 -1
- package/dist/svelte.d.mts +2 -1
- package/dist/svelte.d.ts +2 -1
- package/dist/types-DiGbHxTr.d.mts +216 -0
- package/dist/types-DiGbHxTr.d.ts +216 -0
- package/dist/vue.d.mts +2 -1
- package/dist/vue.d.ts +2 -1
- package/package.json +1 -1
package/dist/node.js
CHANGED
|
@@ -21,8 +21,63 @@ function getExtensionDir(rootDir = process.cwd()) {
|
|
|
21
21
|
const config = readHaextensionConfig(rootDir);
|
|
22
22
|
return config?.dev?.haextension_dir || "haextension";
|
|
23
23
|
}
|
|
24
|
+
function readManifest(options) {
|
|
25
|
+
const { rootDir, manifestPath, extensionDir = "haextension" } = options;
|
|
26
|
+
const resolvedManifestPath = manifestPath ? path.resolve(rootDir, manifestPath) : path.resolve(rootDir, extensionDir, "manifest.json");
|
|
27
|
+
try {
|
|
28
|
+
const manifestContent = fs.readFileSync(resolvedManifestPath, "utf-8");
|
|
29
|
+
const parsed = JSON.parse(manifestContent);
|
|
30
|
+
let packageJson = {};
|
|
31
|
+
try {
|
|
32
|
+
const packageJsonPath = path.resolve(rootDir, "package.json");
|
|
33
|
+
packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
34
|
+
} catch (pkgError) {
|
|
35
|
+
console.warn(`[@haexhub/sdk] Warning: Could not read package.json`);
|
|
36
|
+
}
|
|
37
|
+
const name = parsed.name ?? packageJson.name;
|
|
38
|
+
const version = parsed.version ?? packageJson.version;
|
|
39
|
+
const author = parsed.author ?? packageJson.author ?? null;
|
|
40
|
+
const homepage = parsed.homepage ?? packageJson.homepage ?? null;
|
|
41
|
+
if (!name) {
|
|
42
|
+
console.warn(`[@haexhub/sdk] Warning: No name found in manifest or package.json`);
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
if (!version) {
|
|
46
|
+
console.warn(`[@haexhub/sdk] Warning: No version found in manifest or package.json`);
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const manifest = {
|
|
50
|
+
name,
|
|
51
|
+
version,
|
|
52
|
+
author,
|
|
53
|
+
entry: parsed.entry ?? null,
|
|
54
|
+
icon: parsed.icon ?? null,
|
|
55
|
+
publicKey: parsed.publicKey ?? "",
|
|
56
|
+
signature: parsed.signature ?? "",
|
|
57
|
+
permissions: parsed.permissions ?? {
|
|
58
|
+
database: [],
|
|
59
|
+
filesystem: [],
|
|
60
|
+
http: [],
|
|
61
|
+
shell: []
|
|
62
|
+
},
|
|
63
|
+
homepage,
|
|
64
|
+
description: parsed.description ?? null,
|
|
65
|
+
singleInstance: parsed.singleInstance ?? null,
|
|
66
|
+
displayMode: parsed.displayMode ?? null,
|
|
67
|
+
migrationsDir: parsed.migrationsDir ?? null
|
|
68
|
+
};
|
|
69
|
+
console.log(`\u2713 [@haexhub/sdk] Loaded ${resolvedManifestPath}`);
|
|
70
|
+
return manifest;
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.warn(
|
|
73
|
+
`[@haexhub/sdk] Warning: manifest.json not found at ${resolvedManifestPath}, extension info will not be available`
|
|
74
|
+
);
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
24
78
|
|
|
25
79
|
exports.getExtensionDir = getExtensionDir;
|
|
26
80
|
exports.readHaextensionConfig = readHaextensionConfig;
|
|
81
|
+
exports.readManifest = readManifest;
|
|
27
82
|
//# sourceMappingURL=node.js.map
|
|
28
83
|
//# sourceMappingURL=node.js.map
|
package/dist/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.ts"],"names":["resolve","existsSync","readFileSync"],"mappings":";;;;;;AAiCO,SAAS,qBAAA,CAAsB,OAAA,GAAkB,OAAA,CAAQ,GAAA,EAAI,EAA6B;AAC/F,EAAA,MAAM,UAAA,GAAaA,YAAA,CAAQ,OAAA,EAAS,yBAAyB,CAAA;AAE7D,EAAA,IAAI,CAACC,aAAA,CAAW,UAAU,CAAA,EAAG;AAC3B,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,OAAA,GAAUC,eAAA,CAAa,UAAA,EAAY,OAAO,CAAA;AAChD,IAAA,OAAO,IAAA,CAAK,MAAM,OAAO,CAAA;AAAA,EAC3B,SAAS,KAAA,EAAO;AACd,IAAA,OAAA,CAAQ,IAAA,CAAK,CAAA,yCAAA,EAA4C,KAAK,CAAA,CAAE,CAAA;AAChE,IAAA,OAAO,IAAA;AAAA,EACT;AACF;AAKO,SAAS,eAAA,CAAgB,OAAA,GAAkB,OAAA,CAAQ,GAAA,EAAI,EAAW;AACvE,EAAA,MAAM,MAAA,GAAS,sBAAsB,OAAO,CAAA;AAC5C,EAAA,OAAO,MAAA,EAAQ,KAAK,eAAA,IAAmB,aAAA;AACzC","file":"node.js","sourcesContent":["/**\n * Utility to read haextension.config.json\n */\nimport { readFileSync, existsSync } from 'fs'\nimport { resolve } from 'path'\n\nexport interface HaextensionConfig {\n dev?: {\n port?: number\n host?: string\n haextension_dir?: string\n }\n keys?: {\n public_key_path?: string\n private_key_path?: string\n }\n build?: {\n distDir?: string\n /**\n * Source path for migrations directory (relative to project root).\n * If manifest.migrationsDir is set, this directory will be copied\n * to the bundle at the path specified in migrationsDir.\n * Default: \"app/{migrationsDir}\" (for Nuxt projects)\n * Example: \"app/database/migrations\" -> copies to \"database/migrations\" in bundle\n */\n migrationsSourceDir?: string\n }\n}\n\n/**\n * Read haextension.config.json from the project root\n * Returns null if file doesn't exist\n */\nexport function readHaextensionConfig(rootDir: string = process.cwd()): HaextensionConfig | null {\n const configPath = resolve(rootDir, 'haextension.config.json')\n \n if (!existsSync(configPath)) {\n return null\n }\n\n try {\n const content = readFileSync(configPath, 'utf-8')\n return JSON.parse(content)\n } catch (error) {\n console.warn(`Failed to parse haextension.config.json: ${error}`)\n return null\n }\n}\n\n/**\n * Get extension directory from config or use default\n */\nexport function getExtensionDir(rootDir: string = process.cwd()): string {\n const config = readHaextensionConfig(rootDir)\n return config?.dev?.haextension_dir || 'haextension'\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/config.ts","../src/manifest.ts"],"names":["resolve","existsSync","readFileSync","resolvePath"],"mappings":"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","file":"node.js","sourcesContent":["/**\n * Utility to read haextension.config.json\n */\nimport { readFileSync, existsSync } from 'fs'\nimport { resolve } from 'path'\n\nexport interface HaextensionConfig {\n dev?: {\n port?: number\n host?: string\n haextension_dir?: string\n }\n keys?: {\n public_key_path?: string\n private_key_path?: string\n }\n build?: {\n distDir?: string\n /**\n * Source path for migrations directory (relative to project root).\n * If manifest.migrationsDir is set, this directory will be copied\n * to the bundle at the path specified in migrationsDir.\n * Default: \"app/{migrationsDir}\" (for Nuxt projects)\n * Example: \"app/database/migrations\" -> copies to \"database/migrations\" in bundle\n */\n migrationsSourceDir?: string\n }\n}\n\n/**\n * Read haextension.config.json from the project root\n * Returns null if file doesn't exist\n */\nexport function readHaextensionConfig(rootDir: string = process.cwd()): HaextensionConfig | null {\n const configPath = resolve(rootDir, 'haextension.config.json')\n \n if (!existsSync(configPath)) {\n return null\n }\n\n try {\n const content = readFileSync(configPath, 'utf-8')\n return JSON.parse(content)\n } catch (error) {\n console.warn(`Failed to parse haextension.config.json: ${error}`)\n return null\n }\n}\n\n/**\n * Get extension directory from config or use default\n */\nexport function getExtensionDir(rootDir: string = process.cwd()): string {\n const config = readHaextensionConfig(rootDir)\n return config?.dev?.haextension_dir || 'haextension'\n}\n","/**\n * Utility for reading and processing extension manifest files\n */\nimport { readFileSync } from \"node:fs\";\nimport { resolve as resolvePath } from \"node:path\";\nimport type { ExtensionManifest } from \"./types\";\n\nexport interface ReadManifestOptions {\n /** Root directory of the project */\n rootDir: string;\n /** Path to manifest.json (if not provided, will use extensionDir) */\n manifestPath?: string;\n /** Directory containing extension files (default: \"haextension\") */\n extensionDir?: string;\n}\n\n/**\n * Reads and processes the extension manifest.json file\n * Falls back to package.json version if manifest doesn't specify one\n */\nexport function readManifest(options: ReadManifestOptions): ExtensionManifest | null {\n const { rootDir, manifestPath, extensionDir = \"haextension\" } = options;\n\n // Determine manifest path\n const resolvedManifestPath = manifestPath\n ? resolvePath(rootDir, manifestPath)\n : resolvePath(rootDir, extensionDir, \"manifest.json\");\n\n try {\n const manifestContent = readFileSync(resolvedManifestPath, \"utf-8\");\n const parsed: Partial<ExtensionManifest> = JSON.parse(manifestContent);\n\n // Read fallback values from package.json\n let packageJson: { name?: string; version?: string; author?: string; homepage?: string } = {};\n try {\n const packageJsonPath = resolvePath(rootDir, \"package.json\");\n packageJson = JSON.parse(readFileSync(packageJsonPath, \"utf-8\"));\n } catch (pkgError) {\n console.warn(`[@haexhub/sdk] Warning: Could not read package.json`);\n }\n\n // Use manifest values with fallback to package.json\n const name = parsed.name ?? packageJson.name;\n const version = parsed.version ?? packageJson.version;\n const author = parsed.author ?? packageJson.author ?? null;\n const homepage = parsed.homepage ?? packageJson.homepage ?? null;\n\n if (!name) {\n console.warn(`[@haexhub/sdk] Warning: No name found in manifest or package.json`);\n return null;\n }\n\n if (!version) {\n console.warn(`[@haexhub/sdk] Warning: No version found in manifest or package.json`);\n return null;\n }\n\n const manifest: ExtensionManifest = {\n name,\n version,\n author,\n entry: parsed.entry ?? null,\n icon: parsed.icon ?? null,\n publicKey: parsed.publicKey ?? \"\",\n signature: parsed.signature ?? \"\",\n permissions: parsed.permissions ?? {\n database: [],\n filesystem: [],\n http: [],\n shell: [],\n },\n homepage,\n description: parsed.description ?? null,\n singleInstance: parsed.singleInstance ?? null,\n displayMode: parsed.displayMode ?? null,\n migrationsDir: parsed.migrationsDir ?? null,\n };\n\n console.log(`✓ [@haexhub/sdk] Loaded ${resolvedManifestPath}`);\n return manifest;\n } catch (error) {\n console.warn(\n `[@haexhub/sdk] Warning: manifest.json not found at ${resolvedManifestPath}, extension info will not be available`\n );\n return null;\n }\n}\n"]}
|
package/dist/node.mjs
CHANGED
|
@@ -19,7 +19,61 @@ function getExtensionDir(rootDir = process.cwd()) {
|
|
|
19
19
|
const config = readHaextensionConfig(rootDir);
|
|
20
20
|
return config?.dev?.haextension_dir || "haextension";
|
|
21
21
|
}
|
|
22
|
+
function readManifest(options) {
|
|
23
|
+
const { rootDir, manifestPath, extensionDir = "haextension" } = options;
|
|
24
|
+
const resolvedManifestPath = manifestPath ? resolve(rootDir, manifestPath) : resolve(rootDir, extensionDir, "manifest.json");
|
|
25
|
+
try {
|
|
26
|
+
const manifestContent = readFileSync(resolvedManifestPath, "utf-8");
|
|
27
|
+
const parsed = JSON.parse(manifestContent);
|
|
28
|
+
let packageJson = {};
|
|
29
|
+
try {
|
|
30
|
+
const packageJsonPath = resolve(rootDir, "package.json");
|
|
31
|
+
packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
32
|
+
} catch (pkgError) {
|
|
33
|
+
console.warn(`[@haexhub/sdk] Warning: Could not read package.json`);
|
|
34
|
+
}
|
|
35
|
+
const name = parsed.name ?? packageJson.name;
|
|
36
|
+
const version = parsed.version ?? packageJson.version;
|
|
37
|
+
const author = parsed.author ?? packageJson.author ?? null;
|
|
38
|
+
const homepage = parsed.homepage ?? packageJson.homepage ?? null;
|
|
39
|
+
if (!name) {
|
|
40
|
+
console.warn(`[@haexhub/sdk] Warning: No name found in manifest or package.json`);
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
if (!version) {
|
|
44
|
+
console.warn(`[@haexhub/sdk] Warning: No version found in manifest or package.json`);
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
const manifest = {
|
|
48
|
+
name,
|
|
49
|
+
version,
|
|
50
|
+
author,
|
|
51
|
+
entry: parsed.entry ?? null,
|
|
52
|
+
icon: parsed.icon ?? null,
|
|
53
|
+
publicKey: parsed.publicKey ?? "",
|
|
54
|
+
signature: parsed.signature ?? "",
|
|
55
|
+
permissions: parsed.permissions ?? {
|
|
56
|
+
database: [],
|
|
57
|
+
filesystem: [],
|
|
58
|
+
http: [],
|
|
59
|
+
shell: []
|
|
60
|
+
},
|
|
61
|
+
homepage,
|
|
62
|
+
description: parsed.description ?? null,
|
|
63
|
+
singleInstance: parsed.singleInstance ?? null,
|
|
64
|
+
displayMode: parsed.displayMode ?? null,
|
|
65
|
+
migrationsDir: parsed.migrationsDir ?? null
|
|
66
|
+
};
|
|
67
|
+
console.log(`\u2713 [@haexhub/sdk] Loaded ${resolvedManifestPath}`);
|
|
68
|
+
return manifest;
|
|
69
|
+
} catch (error) {
|
|
70
|
+
console.warn(
|
|
71
|
+
`[@haexhub/sdk] Warning: manifest.json not found at ${resolvedManifestPath}, extension info will not be available`
|
|
72
|
+
);
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
22
76
|
|
|
23
|
-
export { getExtensionDir, readHaextensionConfig };
|
|
77
|
+
export { getExtensionDir, readHaextensionConfig, readManifest };
|
|
24
78
|
//# sourceMappingURL=node.mjs.map
|
|
25
79
|
//# sourceMappingURL=node.mjs.map
|
package/dist/node.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.ts"],"names":[],"mappings":";;;;AAiCO,SAAS,qBAAA,CAAsB,OAAA,GAAkB,OAAA,CAAQ,GAAA,EAAI,EAA6B;AAC/F,EAAA,MAAM,UAAA,GAAa,OAAA,CAAQ,OAAA,EAAS,yBAAyB,CAAA;AAE7D,EAAA,IAAI,CAAC,UAAA,CAAW,UAAU,CAAA,EAAG;AAC3B,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,OAAA,GAAU,YAAA,CAAa,UAAA,EAAY,OAAO,CAAA;AAChD,IAAA,OAAO,IAAA,CAAK,MAAM,OAAO,CAAA;AAAA,EAC3B,SAAS,KAAA,EAAO;AACd,IAAA,OAAA,CAAQ,IAAA,CAAK,CAAA,yCAAA,EAA4C,KAAK,CAAA,CAAE,CAAA;AAChE,IAAA,OAAO,IAAA;AAAA,EACT;AACF;AAKO,SAAS,eAAA,CAAgB,OAAA,GAAkB,OAAA,CAAQ,GAAA,EAAI,EAAW;AACvE,EAAA,MAAM,MAAA,GAAS,sBAAsB,OAAO,CAAA;AAC5C,EAAA,OAAO,MAAA,EAAQ,KAAK,eAAA,IAAmB,aAAA;AACzC","file":"node.mjs","sourcesContent":["/**\n * Utility to read haextension.config.json\n */\nimport { readFileSync, existsSync } from 'fs'\nimport { resolve } from 'path'\n\nexport interface HaextensionConfig {\n dev?: {\n port?: number\n host?: string\n haextension_dir?: string\n }\n keys?: {\n public_key_path?: string\n private_key_path?: string\n }\n build?: {\n distDir?: string\n /**\n * Source path for migrations directory (relative to project root).\n * If manifest.migrationsDir is set, this directory will be copied\n * to the bundle at the path specified in migrationsDir.\n * Default: \"app/{migrationsDir}\" (for Nuxt projects)\n * Example: \"app/database/migrations\" -> copies to \"database/migrations\" in bundle\n */\n migrationsSourceDir?: string\n }\n}\n\n/**\n * Read haextension.config.json from the project root\n * Returns null if file doesn't exist\n */\nexport function readHaextensionConfig(rootDir: string = process.cwd()): HaextensionConfig | null {\n const configPath = resolve(rootDir, 'haextension.config.json')\n \n if (!existsSync(configPath)) {\n return null\n }\n\n try {\n const content = readFileSync(configPath, 'utf-8')\n return JSON.parse(content)\n } catch (error) {\n console.warn(`Failed to parse haextension.config.json: ${error}`)\n return null\n }\n}\n\n/**\n * Get extension directory from config or use default\n */\nexport function getExtensionDir(rootDir: string = process.cwd()): string {\n const config = readHaextensionConfig(rootDir)\n return config?.dev?.haextension_dir || 'haextension'\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/config.ts","../src/manifest.ts"],"names":["resolvePath","readFileSync"],"mappings":"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","file":"node.mjs","sourcesContent":["/**\n * Utility to read haextension.config.json\n */\nimport { readFileSync, existsSync } from 'fs'\nimport { resolve } from 'path'\n\nexport interface HaextensionConfig {\n dev?: {\n port?: number\n host?: string\n haextension_dir?: string\n }\n keys?: {\n public_key_path?: string\n private_key_path?: string\n }\n build?: {\n distDir?: string\n /**\n * Source path for migrations directory (relative to project root).\n * If manifest.migrationsDir is set, this directory will be copied\n * to the bundle at the path specified in migrationsDir.\n * Default: \"app/{migrationsDir}\" (for Nuxt projects)\n * Example: \"app/database/migrations\" -> copies to \"database/migrations\" in bundle\n */\n migrationsSourceDir?: string\n }\n}\n\n/**\n * Read haextension.config.json from the project root\n * Returns null if file doesn't exist\n */\nexport function readHaextensionConfig(rootDir: string = process.cwd()): HaextensionConfig | null {\n const configPath = resolve(rootDir, 'haextension.config.json')\n \n if (!existsSync(configPath)) {\n return null\n }\n\n try {\n const content = readFileSync(configPath, 'utf-8')\n return JSON.parse(content)\n } catch (error) {\n console.warn(`Failed to parse haextension.config.json: ${error}`)\n return null\n }\n}\n\n/**\n * Get extension directory from config or use default\n */\nexport function getExtensionDir(rootDir: string = process.cwd()): string {\n const config = readHaextensionConfig(rootDir)\n return config?.dev?.haextension_dir || 'haextension'\n}\n","/**\n * Utility for reading and processing extension manifest files\n */\nimport { readFileSync } from \"node:fs\";\nimport { resolve as resolvePath } from \"node:path\";\nimport type { ExtensionManifest } from \"./types\";\n\nexport interface ReadManifestOptions {\n /** Root directory of the project */\n rootDir: string;\n /** Path to manifest.json (if not provided, will use extensionDir) */\n manifestPath?: string;\n /** Directory containing extension files (default: \"haextension\") */\n extensionDir?: string;\n}\n\n/**\n * Reads and processes the extension manifest.json file\n * Falls back to package.json version if manifest doesn't specify one\n */\nexport function readManifest(options: ReadManifestOptions): ExtensionManifest | null {\n const { rootDir, manifestPath, extensionDir = \"haextension\" } = options;\n\n // Determine manifest path\n const resolvedManifestPath = manifestPath\n ? resolvePath(rootDir, manifestPath)\n : resolvePath(rootDir, extensionDir, \"manifest.json\");\n\n try {\n const manifestContent = readFileSync(resolvedManifestPath, \"utf-8\");\n const parsed: Partial<ExtensionManifest> = JSON.parse(manifestContent);\n\n // Read fallback values from package.json\n let packageJson: { name?: string; version?: string; author?: string; homepage?: string } = {};\n try {\n const packageJsonPath = resolvePath(rootDir, \"package.json\");\n packageJson = JSON.parse(readFileSync(packageJsonPath, \"utf-8\"));\n } catch (pkgError) {\n console.warn(`[@haexhub/sdk] Warning: Could not read package.json`);\n }\n\n // Use manifest values with fallback to package.json\n const name = parsed.name ?? packageJson.name;\n const version = parsed.version ?? packageJson.version;\n const author = parsed.author ?? packageJson.author ?? null;\n const homepage = parsed.homepage ?? packageJson.homepage ?? null;\n\n if (!name) {\n console.warn(`[@haexhub/sdk] Warning: No name found in manifest or package.json`);\n return null;\n }\n\n if (!version) {\n console.warn(`[@haexhub/sdk] Warning: No version found in manifest or package.json`);\n return null;\n }\n\n const manifest: ExtensionManifest = {\n name,\n version,\n author,\n entry: parsed.entry ?? null,\n icon: parsed.icon ?? null,\n publicKey: parsed.publicKey ?? \"\",\n signature: parsed.signature ?? \"\",\n permissions: parsed.permissions ?? {\n database: [],\n filesystem: [],\n http: [],\n shell: [],\n },\n homepage,\n description: parsed.description ?? null,\n singleInstance: parsed.singleInstance ?? null,\n displayMode: parsed.displayMode ?? null,\n migrationsDir: parsed.migrationsDir ?? null,\n };\n\n console.log(`✓ [@haexhub/sdk] Loaded ${resolvedManifestPath}`);\n return manifest;\n } catch (error) {\n console.warn(\n `[@haexhub/sdk] Warning: manifest.json not found at ${resolvedManifestPath}, extension info will not be available`\n );\n return null;\n }\n}\n"]}
|
package/dist/react.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { H as
|
|
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
|
+
import { H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext } from './types-DiGbHxTr.mjs';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* React hook for HaexHub SDK
|
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { H as
|
|
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
|
+
import { H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext } from './types-DiGbHxTr.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* React hook for HaexHub SDK
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as nuxt_app from 'nuxt/app';
|
|
2
2
|
import { ShallowRef } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { H as HaexVaultClient } from '../client-wxMr0ONL.mjs';
|
|
4
|
+
import { A as ApplicationContext } from '../types-DiGbHxTr.mjs';
|
|
4
5
|
import 'drizzle-orm/sqlite-proxy';
|
|
5
6
|
|
|
6
7
|
declare const _default: nuxt_app.Plugin<{
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as nuxt_app from 'nuxt/app';
|
|
2
2
|
import { ShallowRef } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { H as HaexVaultClient } from '../client-DeP-DCz5.js';
|
|
4
|
+
import { A as ApplicationContext } from '../types-DiGbHxTr.js';
|
|
4
5
|
import 'drizzle-orm/sqlite-proxy';
|
|
5
6
|
|
|
6
7
|
declare const _default: nuxt_app.Plugin<{
|
package/dist/svelte.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { H as
|
|
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 { Readable } from 'svelte/store';
|
|
4
|
+
import { H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext } from './types-DiGbHxTr.mjs';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Initialize the HaexHub SDK for Svelte
|
package/dist/svelte.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { H as
|
|
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 { Readable } from 'svelte/store';
|
|
4
|
+
import { H as HaexHubConfig, a as ExtensionInfo, A as ApplicationContext } from './types-DiGbHxTr.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Initialize the HaexHub SDK for Svelte
|
|
@@ -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
|
|
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
|