@haex-space/vault-sdk 4.3.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-pppDo5Q3.d.ts → client-D4VYF0bP.d.mts} +200 -13
  3. package/dist/{client-CDox5_KH.d.mts → client-Dw2uH1EM.d.ts} +200 -13
  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
@@ -1,7 +1,7 @@
1
1
  import * as nuxt_app from 'nuxt/app';
2
2
  import { ShallowRef } from 'vue';
3
- import { H as HaexVaultSdk } from '../client-CDox5_KH.mjs';
4
- import { A as ApplicationContext } from '../types-DoNvKiW_.mjs';
3
+ import { H as HaexVaultSdk } from '../client-D4VYF0bP.mjs';
4
+ import { A as ApplicationContext } from '../types-CYuW3glJ.mjs';
5
5
  import 'drizzle-orm/sqlite-proxy';
6
6
 
7
7
  declare const _default: nuxt_app.Plugin<{
@@ -1,7 +1,7 @@
1
1
  import * as nuxt_app from 'nuxt/app';
2
2
  import { ShallowRef } from 'vue';
3
- import { H as HaexVaultSdk } from '../client-pppDo5Q3.js';
4
- import { A as ApplicationContext } from '../types-DoNvKiW_.js';
3
+ import { H as HaexVaultSdk } from '../client-Dw2uH1EM.js';
4
+ import { A as ApplicationContext } from '../types-CYuW3glJ.js';
5
5
  import 'drizzle-orm/sqlite-proxy';
6
6
 
7
7
  declare const _default: nuxt_app.Plugin<{
@@ -316,6 +316,18 @@ var PASSWORD_COMMANDS = {
316
316
  delete: "extension_password_delete"
317
317
  };
318
318
 
319
+ // src/commands/contacts.ts
320
+ var CONTACT_COMMANDS = {
321
+ /** Contacts in scope, a page at a time, optionally of one group */
322
+ list: "extension_contacts_list",
323
+ /** One contact with all its values, by id */
324
+ read: "extension_contacts_read",
325
+ /** Contacts in scope whose name, organization, phone or e-mail matches */
326
+ search: "extension_contacts_search",
327
+ /** The JPEG of a contact's photo, by its hash */
328
+ photo: "extension_contacts_photo"
329
+ };
330
+
319
331
  // src/commands/mail.ts
320
332
  var MAIL_COMMANDS = {
321
333
  /** LIST mailboxes + optional STATUS counts */
@@ -1489,6 +1501,42 @@ var PasswordsAPI = class {
1489
1501
  }
1490
1502
  };
1491
1503
 
1504
+ // src/api/contacts.ts
1505
+ var ContactsAPI = class {
1506
+ constructor(client) {
1507
+ this.client = client;
1508
+ }
1509
+ /** One page of the contacts in scope, optionally of one group. */
1510
+ async listAsync(options = {}) {
1511
+ return this.client.request(CONTACT_COMMANDS.list, {
1512
+ ...options
1513
+ });
1514
+ }
1515
+ /** One contact with all its values. */
1516
+ async readAsync(id) {
1517
+ return this.client.request(CONTACT_COMMANDS.read, { id });
1518
+ }
1519
+ /**
1520
+ * The contacts in scope whose name, organization, phone number or e-mail
1521
+ * address contains `query`, regardless of case and accents. The host's
1522
+ * default limit is 20, its maximum 200.
1523
+ */
1524
+ async searchAsync(query, limit) {
1525
+ const answer = await this.client.request(
1526
+ CONTACT_COMMANDS.search,
1527
+ limit === void 0 ? { query } : { query, limit }
1528
+ );
1529
+ return answer.contacts;
1530
+ }
1531
+ /** The JPEG of a photo a readable contact uses, by its hash. */
1532
+ async photoAsync(hash) {
1533
+ const base64 = await this.client.request(CONTACT_COMMANDS.photo, {
1534
+ hash
1535
+ });
1536
+ return base64ToArrayBuffer(base64);
1537
+ }
1538
+ };
1539
+
1492
1540
  // src/api/mail.ts
1493
1541
  var MailAPI = class {
1494
1542
  constructor(client) {
@@ -2632,6 +2680,7 @@ var HaexVaultSdk = class {
2632
2680
  this.spaces = new SpacesAPI(this);
2633
2681
  this.shell = new ShellAPI(this);
2634
2682
  this.passwords = new PasswordsAPI(this);
2683
+ this.contacts = new ContactsAPI(this);
2635
2684
  this.mail = new MailAPI(this);
2636
2685
  this.notifications = new NotificationsAPI(this);
2637
2686
  this.tab = new TabAPI(this);