@haex-space/vault-sdk 2.2.6 → 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.
@@ -22,6 +22,28 @@ type HaextensionEvent = typeof HAEXTENSION_EVENTS[keyof typeof HAEXTENSION_EVENT
22
22
 
23
23
  declare const DEFAULT_TIMEOUT = 30000;
24
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;
25
47
  interface HaexHubRequest {
26
48
  method: string;
27
49
  params: Record<string, unknown>;
@@ -213,4 +235,4 @@ declare class HaexHubError extends Error {
213
235
  };
214
236
  }
215
237
 
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 };
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,7 +1,7 @@
1
- import { H as HaexVaultClient, S as StorageAPI } from './client-wxMr0ONL.mjs';
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-DiGbHxTr.mjs';
4
+ import { H as HaexHubConfig } from './types-FE9ewl3r.mjs';
5
5
 
6
6
  /**
7
7
  * Vue 3 composable for HaexHub SDK
package/dist/vue.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { H as HaexVaultClient, S as StorageAPI } from './client-DeP-DCz5.js';
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-DiGbHxTr.js';
4
+ import { H as HaexHubConfig } from './types-FE9ewl3r.js';
5
5
 
6
6
  /**
7
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
- const extensionName = name;
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}${TABLE_SEPARATOR}${extensionName}${TABLE_SEPARATOR}${tableName}"`;
919
+ return `"${getTableName(publicKey, extensionName, tableName)}"`;
918
920
  }
919
921
  parseTableName(fullTableName) {
920
922
  let cleanTableName = fullTableName;