@haex-space/vault-sdk 3.2.8 → 3.3.0
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-BBD-YsPv.d.ts → client-BW3ayV19.d.mts} +82 -2
- package/dist/{client-DaS2fAf-.d.mts → client-Cm23j1wm.d.ts} +82 -2
- package/dist/index.d.mts +30 -6
- package/dist/index.d.ts +30 -6
- package/dist/index.js +51 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +49 -2
- package/dist/index.mjs.map +1 -1
- package/dist/node.d.mts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +46 -0
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +46 -0
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.d.mts +2 -2
- package/dist/runtime/nuxt.plugin.client.d.ts +2 -2
- package/dist/runtime/nuxt.plugin.client.js +46 -0
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +46 -0
- package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
- package/dist/svelte.d.mts +2 -2
- package/dist/svelte.d.ts +2 -2
- package/dist/svelte.js +46 -0
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +46 -0
- package/dist/svelte.mjs.map +1 -1
- package/dist/{types-Cji-mUN0.d.mts → types-fHuxbqa4.d.mts} +9 -1
- package/dist/{types-Cji-mUN0.d.ts → types-fHuxbqa4.d.ts} +9 -1
- package/dist/vue.d.mts +2 -2
- package/dist/vue.d.ts +2 -2
- package/dist/vue.js +46 -0
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +46 -0
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -27,6 +27,14 @@ declare const HAEXTENSION_EVENTS: {
|
|
|
27
27
|
readonly PERMISSION_RESOLVED: "extension:permission-resolved";
|
|
28
28
|
};
|
|
29
29
|
type HaextensionEvent = typeof HAEXTENSION_EVENTS[keyof typeof HAEXTENSION_EVENTS];
|
|
30
|
+
/**
|
|
31
|
+
* Events for the generic notifications API.
|
|
32
|
+
*/
|
|
33
|
+
declare const NOTIFICATION_EVENTS: {
|
|
34
|
+
/** A click on one of this extension's notifications (body or action button). */
|
|
35
|
+
readonly CLICK: "haextension:notification:click";
|
|
36
|
+
};
|
|
37
|
+
type NotificationEvent = typeof NOTIFICATION_EVENTS[keyof typeof NOTIFICATION_EVENTS];
|
|
30
38
|
/**
|
|
31
39
|
* Events for external client communication (browser extensions, CLI tools, servers, etc.)
|
|
32
40
|
*/
|
|
@@ -399,4 +407,4 @@ declare class HaexVaultSdkError extends Error {
|
|
|
399
407
|
};
|
|
400
408
|
}
|
|
401
409
|
|
|
402
|
-
export { type ApplicationContext as A, type ManifestI18nEntry as B, type ClaimRequirement as C, type DatabaseQueryResult as D, type ExtensionManifest as E, type FileChangeEvent as F, type
|
|
410
|
+
export { isPermissionError as $, type ApplicationContext as A, type ManifestI18nEntry as B, type ClaimRequirement as C, type DatabaseQueryResult as D, type ExtensionManifest as E, type FileChangeEvent as F, type NotificationEvent as G, type HaexHubConfig as H, type IdentityClaim as I, type PermissionDeniedError as J, type PermissionErrorBase as K, PermissionErrorCode as L, type Migration as M, NOTIFICATION_EVENTS as N, type PermissionPromptError as O, type PermissionResponse as P, PermissionStatus as Q, SHELL_EVENTS as R, type SearchResult as S, type SearchQuery as T, type SearchRequestEvent as U, type ShellEvent as V, type WebRequestOptions as W, type SyncTablesUpdatedEvent as X, TABLE_SEPARATOR as Y, getTableName as Z, isPermissionDeniedError as _, type ExtensionInfo as a, isPermissionPromptError as a0, type HaexHubEvent as b, EXTERNAL_EVENTS as c, type MigrationResult as d, type WebResponse as e, type EventCallback as f, type DatabasePermissionRequest as g, type SignedClaimPresentation as h, type ContextChangedEvent as i, DEFAULT_TIMEOUT as j, type DatabaseColumnInfo as k, type DatabaseExecuteParams as l, type DatabasePermission as m, type DatabaseQueryParams as n, type DatabaseTableInfo as o, ErrorCode as p, type ExtensionRuntimeMode as q, type ExternalEvent as r, type FileChangePayload as s, type FileChangeType as t, type FilteredSyncTablesResult as u, HAEXTENSION_EVENTS as v, type HaexHubRequest as w, type HaexHubResponse as x, HaexVaultSdkError as y, type HaextensionEvent as z };
|
|
@@ -27,6 +27,14 @@ declare const HAEXTENSION_EVENTS: {
|
|
|
27
27
|
readonly PERMISSION_RESOLVED: "extension:permission-resolved";
|
|
28
28
|
};
|
|
29
29
|
type HaextensionEvent = typeof HAEXTENSION_EVENTS[keyof typeof HAEXTENSION_EVENTS];
|
|
30
|
+
/**
|
|
31
|
+
* Events for the generic notifications API.
|
|
32
|
+
*/
|
|
33
|
+
declare const NOTIFICATION_EVENTS: {
|
|
34
|
+
/** A click on one of this extension's notifications (body or action button). */
|
|
35
|
+
readonly CLICK: "haextension:notification:click";
|
|
36
|
+
};
|
|
37
|
+
type NotificationEvent = typeof NOTIFICATION_EVENTS[keyof typeof NOTIFICATION_EVENTS];
|
|
30
38
|
/**
|
|
31
39
|
* Events for external client communication (browser extensions, CLI tools, servers, etc.)
|
|
32
40
|
*/
|
|
@@ -399,4 +407,4 @@ declare class HaexVaultSdkError extends Error {
|
|
|
399
407
|
};
|
|
400
408
|
}
|
|
401
409
|
|
|
402
|
-
export { type ApplicationContext as A, type ManifestI18nEntry as B, type ClaimRequirement as C, type DatabaseQueryResult as D, type ExtensionManifest as E, type FileChangeEvent as F, type
|
|
410
|
+
export { isPermissionError as $, type ApplicationContext as A, type ManifestI18nEntry as B, type ClaimRequirement as C, type DatabaseQueryResult as D, type ExtensionManifest as E, type FileChangeEvent as F, type NotificationEvent as G, type HaexHubConfig as H, type IdentityClaim as I, type PermissionDeniedError as J, type PermissionErrorBase as K, PermissionErrorCode as L, type Migration as M, NOTIFICATION_EVENTS as N, type PermissionPromptError as O, type PermissionResponse as P, PermissionStatus as Q, SHELL_EVENTS as R, type SearchResult as S, type SearchQuery as T, type SearchRequestEvent as U, type ShellEvent as V, type WebRequestOptions as W, type SyncTablesUpdatedEvent as X, TABLE_SEPARATOR as Y, getTableName as Z, isPermissionDeniedError as _, type ExtensionInfo as a, isPermissionPromptError as a0, type HaexHubEvent as b, EXTERNAL_EVENTS as c, type MigrationResult as d, type WebResponse as e, type EventCallback as f, type DatabasePermissionRequest as g, type SignedClaimPresentation as h, type ContextChangedEvent as i, DEFAULT_TIMEOUT as j, type DatabaseColumnInfo as k, type DatabaseExecuteParams as l, type DatabasePermission as m, type DatabaseQueryParams as n, type DatabaseTableInfo as o, ErrorCode as p, type ExtensionRuntimeMode as q, type ExternalEvent as r, type FileChangePayload as s, type FileChangeType as t, type FilteredSyncTablesResult as u, HAEXTENSION_EVENTS as v, type HaexHubRequest as w, type HaexHubResponse as x, HaexVaultSdkError as y, type HaextensionEvent as z };
|
package/dist/vue.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { H as HaexVaultSdk, S as StorageAPI } from './client-
|
|
1
|
+
import { H as HaexVaultSdk, S as StorageAPI } from './client-BW3ayV19.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-
|
|
4
|
+
import { H as HaexHubConfig } from './types-fHuxbqa4.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Vue 3 composable for HaexVault SDK
|
package/dist/vue.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { H as HaexVaultSdk, S as StorageAPI } from './client-
|
|
1
|
+
import { H as HaexVaultSdk, S as StorageAPI } from './client-Cm23j1wm.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-
|
|
4
|
+
import { H as HaexHubConfig } from './types-fHuxbqa4.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Vue 3 composable for HaexVault SDK
|
package/dist/vue.js
CHANGED
|
@@ -404,6 +404,10 @@ var HAEXTENSION_EVENTS = {
|
|
|
404
404
|
* subscribe via `client.on(HAEXTENSION_EVENTS.PERMISSION_RESOLVED, ...)`. */
|
|
405
405
|
PERMISSION_RESOLVED: "extension:permission-resolved"
|
|
406
406
|
};
|
|
407
|
+
var NOTIFICATION_EVENTS = {
|
|
408
|
+
/** A click on one of this extension's notifications (body or action button). */
|
|
409
|
+
CLICK: "haextension:notification:click"
|
|
410
|
+
};
|
|
407
411
|
var EXTERNAL_EVENTS = {
|
|
408
412
|
/** External request from authorized client */
|
|
409
413
|
REQUEST: "haextension:external:request",
|
|
@@ -688,6 +692,14 @@ var MAIL_COMMANDS = {
|
|
|
688
692
|
buildRfc822: "extension_mail_build_rfc822"
|
|
689
693
|
};
|
|
690
694
|
|
|
695
|
+
// src/commands/notifications.ts
|
|
696
|
+
var NOTIFICATION_COMMANDS = {
|
|
697
|
+
/** Show an OS notification. Returns the assigned notification id. */
|
|
698
|
+
show: "extension_notifications_show",
|
|
699
|
+
/** Dismiss a previously shown notification (only own notifications). */
|
|
700
|
+
dismiss: "extension_notifications_dismiss"
|
|
701
|
+
};
|
|
702
|
+
|
|
691
703
|
// src/api/storage.ts
|
|
692
704
|
var StorageAPI = class {
|
|
693
705
|
constructor(client) {
|
|
@@ -1762,6 +1774,38 @@ var MailAPI = class {
|
|
|
1762
1774
|
}
|
|
1763
1775
|
};
|
|
1764
1776
|
|
|
1777
|
+
// src/api/notifications.ts
|
|
1778
|
+
var NotificationsAPI = class {
|
|
1779
|
+
constructor(client) {
|
|
1780
|
+
this.client = client;
|
|
1781
|
+
}
|
|
1782
|
+
/** Show a notification. Returns its id so it can be dismissed later. */
|
|
1783
|
+
async show(opts) {
|
|
1784
|
+
return this.client.request(NOTIFICATION_COMMANDS.show, {
|
|
1785
|
+
options: opts
|
|
1786
|
+
});
|
|
1787
|
+
}
|
|
1788
|
+
/** Dismiss a previously shown notification (only own notifications). */
|
|
1789
|
+
async dismiss(id) {
|
|
1790
|
+
return this.client.request(NOTIFICATION_COMMANDS.dismiss, { id });
|
|
1791
|
+
}
|
|
1792
|
+
/**
|
|
1793
|
+
* Listen for clicks on this extension's notifications. Useful when the
|
|
1794
|
+
* extension is already open and wants to react in-app (e.g. router.push the
|
|
1795
|
+
* `path`) instead of relying on the host to focus the webview.
|
|
1796
|
+
*
|
|
1797
|
+
* Returns an unsubscribe function.
|
|
1798
|
+
*/
|
|
1799
|
+
onClick(handler) {
|
|
1800
|
+
const wrapped = (event) => {
|
|
1801
|
+
const data = event.data;
|
|
1802
|
+
if (data) handler(data);
|
|
1803
|
+
};
|
|
1804
|
+
this.client.on(NOTIFICATION_EVENTS.CLICK, wrapped);
|
|
1805
|
+
return () => this.client.off(NOTIFICATION_EVENTS.CLICK, wrapped);
|
|
1806
|
+
}
|
|
1807
|
+
};
|
|
1808
|
+
|
|
1765
1809
|
// src/client/tableName.ts
|
|
1766
1810
|
function validatePublicKey(publicKey) {
|
|
1767
1811
|
if (!publicKey || typeof publicKey !== "string" || publicKey.trim() === "") {
|
|
@@ -1929,6 +1973,7 @@ async function setupTauriEventListeners(ctx, log, onEvent, onContextChange) {
|
|
|
1929
1973
|
HAEXTENSION_EVENTS.PERMISSION_RESOLVED,
|
|
1930
1974
|
EXTERNAL_EVENTS.REQUEST,
|
|
1931
1975
|
EXTERNAL_EVENTS.ACTION_REQUEST,
|
|
1976
|
+
NOTIFICATION_EVENTS.CLICK,
|
|
1932
1977
|
...Object.values(LOCALSEND_EVENTS)
|
|
1933
1978
|
]) {
|
|
1934
1979
|
await forwardEvent(listen, log, onEvent, listenOptions, eventName);
|
|
@@ -2404,6 +2449,7 @@ var HaexVaultSdk = class {
|
|
|
2404
2449
|
this.shell = new ShellAPI(this);
|
|
2405
2450
|
this.passwords = new PasswordsAPI(this);
|
|
2406
2451
|
this.mail = new MailAPI(this);
|
|
2452
|
+
this.notifications = new NotificationsAPI(this);
|
|
2407
2453
|
installConsoleForwarding(this.config.debug);
|
|
2408
2454
|
this.on(HAEXTENSION_EVENTS.PERMISSION_RESOLVED, (event) => {
|
|
2409
2455
|
const data = event.data;
|