@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
@@ -314,6 +314,18 @@ var PASSWORD_COMMANDS = {
314
314
  delete: "extension_password_delete"
315
315
  };
316
316
 
317
+ // src/commands/contacts.ts
318
+ var CONTACT_COMMANDS = {
319
+ /** Contacts in scope, a page at a time, optionally of one group */
320
+ list: "extension_contacts_list",
321
+ /** One contact with all its values, by id */
322
+ read: "extension_contacts_read",
323
+ /** Contacts in scope whose name, organization, phone or e-mail matches */
324
+ search: "extension_contacts_search",
325
+ /** The JPEG of a contact's photo, by its hash */
326
+ photo: "extension_contacts_photo"
327
+ };
328
+
317
329
  // src/commands/mail.ts
318
330
  var MAIL_COMMANDS = {
319
331
  /** LIST mailboxes + optional STATUS counts */
@@ -1487,6 +1499,42 @@ var PasswordsAPI = class {
1487
1499
  }
1488
1500
  };
1489
1501
 
1502
+ // src/api/contacts.ts
1503
+ var ContactsAPI = class {
1504
+ constructor(client) {
1505
+ this.client = client;
1506
+ }
1507
+ /** One page of the contacts in scope, optionally of one group. */
1508
+ async listAsync(options = {}) {
1509
+ return this.client.request(CONTACT_COMMANDS.list, {
1510
+ ...options
1511
+ });
1512
+ }
1513
+ /** One contact with all its values. */
1514
+ async readAsync(id) {
1515
+ return this.client.request(CONTACT_COMMANDS.read, { id });
1516
+ }
1517
+ /**
1518
+ * The contacts in scope whose name, organization, phone number or e-mail
1519
+ * address contains `query`, regardless of case and accents. The host's
1520
+ * default limit is 20, its maximum 200.
1521
+ */
1522
+ async searchAsync(query, limit) {
1523
+ const answer = await this.client.request(
1524
+ CONTACT_COMMANDS.search,
1525
+ limit === void 0 ? { query } : { query, limit }
1526
+ );
1527
+ return answer.contacts;
1528
+ }
1529
+ /** The JPEG of a photo a readable contact uses, by its hash. */
1530
+ async photoAsync(hash) {
1531
+ const base64 = await this.client.request(CONTACT_COMMANDS.photo, {
1532
+ hash
1533
+ });
1534
+ return base64ToArrayBuffer(base64);
1535
+ }
1536
+ };
1537
+
1490
1538
  // src/api/mail.ts
1491
1539
  var MailAPI = class {
1492
1540
  constructor(client) {
@@ -2630,6 +2678,7 @@ var HaexVaultSdk = class {
2630
2678
  this.spaces = new SpacesAPI(this);
2631
2679
  this.shell = new ShellAPI(this);
2632
2680
  this.passwords = new PasswordsAPI(this);
2681
+ this.contacts = new ContactsAPI(this);
2633
2682
  this.mail = new MailAPI(this);
2634
2683
  this.notifications = new NotificationsAPI(this);
2635
2684
  this.tab = new TabAPI(this);