shipmail 0.1.33 → 0.2.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/README.md CHANGED
@@ -144,6 +144,12 @@ const forwarding = await shipmail.mailboxes.createForwarding("mbx_...", {
144
144
  });
145
145
  const forwardingList = await shipmail.mailboxes.listForwarding("mbx_...");
146
146
  await shipmail.mailboxes.deleteForwarding("mbx_...", forwarding.id);
147
+ const appPassword = await shipmail.mailboxes.createAppPassword("mbx_...", {
148
+ name: "Desktop mail",
149
+ expires_at: "2026-10-01T00:00:00Z",
150
+ });
151
+ const appPasswords = await shipmail.mailboxes.listAppPasswords("mbx_...");
152
+ await shipmail.mailboxes.revokeAppPassword("mbx_...", appPassword.id);
147
153
  const folders = await shipmail.mailboxes.listFolders("mbx_...");
148
154
  const folder = await shipmail.mailboxes.createFolder("mbx_...", {
149
155
  name: "VIP",
@@ -379,6 +385,10 @@ await delegated.mailboxes.create({
379
385
  address: "support",
380
386
  generate_password: true,
381
387
  });
388
+ const grants = await shipmail.partner.listMailboxCredentialGrants();
389
+ const credential = await shipmail.partner.consumeMailboxCredentialGrant(grants.data[0]!.id, {
390
+ name: "Embedded webmail",
391
+ });
382
392
  await shipmail.partner.usage();
383
393
  ```
384
394
 
@@ -386,6 +396,10 @@ Use a separate client for delegated infrastructure. Partner target context is no
386
396
  message, thread, calendar, contacts, export, suppression, billing, or password endpoints. The beta
387
397
  requires Shipmail approval and externally owned domains. Delegated mailbox creation must use
388
398
  `generate_password: true`; the generated primary password is never returned to the partner.
399
+ The operator creates a one-time credential grant. Consuming it requires the exact
400
+ `partner:mailbox_credentials:issue` scope and returns the app-password secret once. App-password
401
+ creation and grant consumption do not accept idempotency keys because their plaintext response must
402
+ never be cached.
389
403
 
390
404
  ## Status
391
405
 
package/dist/index.cjs CHANGED
@@ -681,6 +681,28 @@ var Mailboxes = class extends ApiResource {
681
681
  methodOptions: options
682
682
  });
683
683
  }
684
+ listAppPasswords(id, options) {
685
+ return this.client.request({
686
+ method: "GET",
687
+ path: `/mailboxes/${encodeURIComponent(id)}/app-passwords`,
688
+ methodOptions: options
689
+ });
690
+ }
691
+ createAppPassword(id, params, options) {
692
+ return this.client.request({
693
+ method: "POST",
694
+ path: `/mailboxes/${encodeURIComponent(id)}/app-passwords`,
695
+ body: params,
696
+ methodOptions: options
697
+ });
698
+ }
699
+ revokeAppPassword(id, appPasswordId, options) {
700
+ return this.client.request({
701
+ method: "DELETE",
702
+ path: `/mailboxes/${encodeURIComponent(id)}/app-passwords/${encodeURIComponent(appPasswordId)}`,
703
+ methodOptions: options
704
+ });
705
+ }
684
706
  getRules(id, options) {
685
707
  return this.client.request({
686
708
  method: "GET",
@@ -1039,6 +1061,21 @@ var Partner = class extends ApiResource {
1039
1061
  methodOptions: options
1040
1062
  });
1041
1063
  }
1064
+ listMailboxCredentialGrants(options) {
1065
+ return this.client.request({
1066
+ method: "GET",
1067
+ path: "/partner/mailbox-credential-grants",
1068
+ methodOptions: options
1069
+ });
1070
+ }
1071
+ consumeMailboxCredentialGrant(grantId, params = {}, options) {
1072
+ return this.client.request({
1073
+ method: "POST",
1074
+ path: `/partner/mailbox-credential-grants/${encodeURIComponent(grantId)}/consume`,
1075
+ body: params,
1076
+ methodOptions: options
1077
+ });
1078
+ }
1042
1079
  usage(options) {
1043
1080
  return this.client.request({ method: "GET", path: "/partner/usage", methodOptions: options });
1044
1081
  }
@@ -1226,7 +1263,7 @@ var Webhooks = class extends ApiResource {
1226
1263
  };
1227
1264
 
1228
1265
  // src/version.ts
1229
- var VERSION = "0.1.33";
1266
+ var VERSION = "0.2.0";
1230
1267
 
1231
1268
  // src/client.ts
1232
1269
  var DEFAULT_BASE_URL = "https://shipmail.to/api/v1";