@haex-space/vault-sdk 4.4.0 → 4.5.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.
Files changed (44) hide show
  1. package/dist/cli/index.mjs.map +1 -1
  2. package/dist/{client-BCUfRZvU.d.mts → client-D4VYF0bP.d.mts} +105 -2
  3. package/dist/{client-C44dqakd.d.ts → client-Dw2uH1EM.d.ts} +105 -2
  4. package/dist/haex_bundle_bg.wasm +0 -0
  5. package/dist/index.d.mts +33 -6
  6. package/dist/index.d.ts +33 -6
  7. package/dist/index.js +57 -2
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +55 -2
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/node.d.mts +1 -1
  12. package/dist/node.d.ts +1 -1
  13. package/dist/node.mjs +1 -1
  14. package/dist/node.mjs.map +1 -1
  15. package/dist/nuxt.js +1 -1
  16. package/dist/nuxt.js.map +1 -1
  17. package/dist/nuxt.mjs.map +1 -1
  18. package/dist/react.d.mts +2 -2
  19. package/dist/react.d.ts +2 -2
  20. package/dist/react.js +54 -2
  21. package/dist/react.js.map +1 -1
  22. package/dist/react.mjs +53 -1
  23. package/dist/react.mjs.map +1 -1
  24. package/dist/runtime/nuxt.plugin.client.d.mts +2 -2
  25. package/dist/runtime/nuxt.plugin.client.d.ts +2 -2
  26. package/dist/runtime/nuxt.plugin.client.js +49 -0
  27. package/dist/runtime/nuxt.plugin.client.js.map +1 -1
  28. package/dist/runtime/nuxt.plugin.client.mjs +49 -0
  29. package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
  30. package/dist/svelte.d.mts +2 -2
  31. package/dist/svelte.d.ts +2 -2
  32. package/dist/svelte.js +54 -2
  33. package/dist/svelte.js.map +1 -1
  34. package/dist/svelte.mjs +53 -1
  35. package/dist/svelte.mjs.map +1 -1
  36. package/dist/{types-DoNvKiW_.d.mts → types-CYuW3glJ.d.mts} +5 -0
  37. package/dist/{types-DoNvKiW_.d.ts → types-CYuW3glJ.d.ts} +5 -0
  38. package/dist/vue.d.mts +2 -2
  39. package/dist/vue.d.ts +2 -2
  40. package/dist/vue.js +54 -2
  41. package/dist/vue.js.map +1 -1
  42. package/dist/vue.mjs +53 -1
  43. package/dist/vue.mjs.map +1 -1
  44. package/package.json +1 -1
package/dist/svelte.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { H as HaexVaultSdk, S as StorageAPI } from './client-BCUfRZvU.mjs';
1
+ import { H as HaexVaultSdk, S as StorageAPI } from './client-D4VYF0bP.mjs';
2
2
  import * as drizzle_orm_sqlite_proxy from 'drizzle-orm/sqlite-proxy';
3
3
  import { Readable } from 'svelte/store';
4
- import { A as ApplicationContext, E as ExtensionInfo, H as HaexHubConfig } from './types-DoNvKiW_.mjs';
4
+ import { A as ApplicationContext, E as ExtensionInfo, H as HaexHubConfig } from './types-CYuW3glJ.mjs';
5
5
 
6
6
  /**
7
7
  * Initialize the HaexVault SDK for Svelte
package/dist/svelte.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { H as HaexVaultSdk, S as StorageAPI } from './client-C44dqakd.js';
1
+ import { H as HaexVaultSdk, S as StorageAPI } from './client-Dw2uH1EM.js';
2
2
  import * as drizzle_orm_sqlite_proxy from 'drizzle-orm/sqlite-proxy';
3
3
  import { Readable } from 'svelte/store';
4
- import { A as ApplicationContext, E as ExtensionInfo, H as HaexHubConfig } from './types-DoNvKiW_.js';
4
+ import { A as ApplicationContext, E as ExtensionInfo, H as HaexHubConfig } from './types-CYuW3glJ.js';
5
5
 
6
6
  /**
7
7
  * Initialize the HaexVault SDK for Svelte
package/dist/svelte.js CHANGED
@@ -8,9 +8,9 @@ var __esm = (fn, res) => function __init() {
8
8
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
9
  };
10
10
 
11
- // node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.29_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js
11
+ // node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.30_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js
12
12
  var init_cjs_shims = __esm({
13
- "node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.29_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js"() {
13
+ "node_modules/.pnpm/tsup@8.5.1_jiti@2.7.0_postcss@8.5.30_typescript@6.0.3_yaml@2.9.0/node_modules/tsup/assets/cjs_shims.js"() {
14
14
  }
15
15
  });
16
16
 
@@ -763,6 +763,19 @@ var PASSWORD_COMMANDS = {
763
763
  delete: "extension_password_delete"
764
764
  };
765
765
 
766
+ // src/commands/contacts.ts
767
+ init_cjs_shims();
768
+ var CONTACT_COMMANDS = {
769
+ /** Contacts in scope, a page at a time, optionally of one group */
770
+ list: "extension_contacts_list",
771
+ /** One contact with all its values, by id */
772
+ read: "extension_contacts_read",
773
+ /** Contacts in scope whose name, organization, phone or e-mail matches */
774
+ search: "extension_contacts_search",
775
+ /** The JPEG of a contact's photo, by its hash */
776
+ photo: "extension_contacts_photo"
777
+ };
778
+
766
779
  // src/commands/mail.ts
767
780
  init_cjs_shims();
768
781
  var MAIL_COMMANDS = {
@@ -1924,6 +1937,44 @@ var PasswordsAPI = class {
1924
1937
  }
1925
1938
  };
1926
1939
 
1940
+ // src/api/contacts.ts
1941
+ init_cjs_shims();
1942
+ init_vaultKey();
1943
+ var ContactsAPI = class {
1944
+ constructor(client) {
1945
+ this.client = client;
1946
+ }
1947
+ /** One page of the contacts in scope, optionally of one group. */
1948
+ async listAsync(options = {}) {
1949
+ return this.client.request(CONTACT_COMMANDS.list, {
1950
+ ...options
1951
+ });
1952
+ }
1953
+ /** One contact with all its values. */
1954
+ async readAsync(id) {
1955
+ return this.client.request(CONTACT_COMMANDS.read, { id });
1956
+ }
1957
+ /**
1958
+ * The contacts in scope whose name, organization, phone number or e-mail
1959
+ * address contains `query`, regardless of case and accents. The host's
1960
+ * default limit is 20, its maximum 200.
1961
+ */
1962
+ async searchAsync(query, limit) {
1963
+ const answer = await this.client.request(
1964
+ CONTACT_COMMANDS.search,
1965
+ limit === void 0 ? { query } : { query, limit }
1966
+ );
1967
+ return answer.contacts;
1968
+ }
1969
+ /** The JPEG of a photo a readable contact uses, by its hash. */
1970
+ async photoAsync(hash) {
1971
+ const base64 = await this.client.request(CONTACT_COMMANDS.photo, {
1972
+ hash
1973
+ });
1974
+ return base64ToArrayBuffer(base64);
1975
+ }
1976
+ };
1977
+
1927
1978
  // src/api/mail.ts
1928
1979
  init_cjs_shims();
1929
1980
  var MailAPI = class {
@@ -2990,6 +3041,7 @@ var HaexVaultSdk = class {
2990
3041
  this.spaces = new SpacesAPI(this);
2991
3042
  this.shell = new ShellAPI(this);
2992
3043
  this.passwords = new PasswordsAPI(this);
3044
+ this.contacts = new ContactsAPI(this);
2993
3045
  this.mail = new MailAPI(this);
2994
3046
  this.notifications = new NotificationsAPI(this);
2995
3047
  this.tab = new TabAPI(this);