@sendmux/management 1.3.0 → 1.4.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
@@ -14,7 +14,7 @@ Generated TypeScript client for the Sendmux Management API.
14
14
 
15
15
  ## Requirements
16
16
 
17
- - A root Sendmux API key with the `smx_root_*` prefix.
17
+ - A root Sendmux API key with the `smx_root_*` prefix; alternatively, a REST OAuth grant for this surface.
18
18
  - A JavaScript runtime with the standard Fetch API.
19
19
 
20
20
  ## Installation
@@ -23,6 +23,20 @@ Generated TypeScript client for the Sendmux Management API.
23
23
  npm install @sendmux/management
24
24
  ```
25
25
 
26
+ ## OAuth access tokens
27
+
28
+ Pass `accessToken` instead of `apiKey` for a REST OAuth token or synchronous/asynchronous provider.
29
+
30
+ ```ts
31
+ import { createManagementClient } from "@sendmux/management";
32
+
33
+ const client = createManagementClient({
34
+ accessToken: () => process.env.SENDMUX_ACCESS_TOKEN!,
35
+ });
36
+ ```
37
+
38
+ The provider runs before each request. Your application owns token storage and refresh; required scopes still apply. See [OAuth setup](https://sendmux.ai/docs/developer-tools/oauth).
39
+
26
40
  ## Usage
27
41
 
28
42
  ```ts
@@ -64,7 +78,7 @@ const client = createManagementClient({
64
78
  const domain = await managementGetDomain({
65
79
  client,
66
80
  path: { public_id: "mdom_123" },
67
- headers: conditionalHeaders({ ifNoneMatch: 'W/"etag"' }),
81
+ headers: { ...conditionalHeaders({ ifNoneMatch: 'W/"etag"' }) },
68
82
  });
69
83
 
70
84
  console.log(domain.data);
@@ -81,7 +81,7 @@ export const getParseAs = (contentType) => {
81
81
  };
82
82
  const checkForExistence = (options, name) => {
83
83
  if (!name) {
84
- return false;
84
+ return options.headers.has('Authorization');
85
85
  }
86
86
  if (options.headers.has(name) ||
87
87
  options.query?.[name] ||
@@ -6,7 +6,7 @@ import { client } from './client.gen.js';
6
6
  * Returns the current spendable balance.
7
7
  */
8
8
  export const managementListBalance = (options) => (options?.client ?? client).get({
9
- security: [{ scheme: 'bearer', type: 'http' }],
9
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
10
10
  url: '/billing/balance',
11
11
  ...options
12
12
  });
@@ -16,7 +16,7 @@ export const managementListBalance = (options) => (options?.client ?? client).ge
16
16
  * Returns a spend summary over a configurable lookback period.
17
17
  */
18
18
  export const managementGetSpendSummary = (options) => (options?.client ?? client).get({
19
- security: [{ scheme: 'bearer', type: 'http' }],
19
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
20
20
  url: '/billing/summary',
21
21
  ...options
22
22
  });
@@ -26,7 +26,7 @@ export const managementGetSpendSummary = (options) => (options?.client ?? client
26
26
  * Returns paginated credit transaction history with optional type filter. Uses cursor-based pagination ordered by created_at descending — pass `cursor=<next_cursor>` from the previous response to fetch the next page.
27
27
  */
28
28
  export const managementListTransactions = (options) => (options?.client ?? client).get({
29
- security: [{ scheme: 'bearer', type: 'http' }],
29
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
30
30
  url: '/billing/transactions',
31
31
  ...options
32
32
  });
@@ -36,7 +36,7 @@ export const managementListTransactions = (options) => (options?.client ?? clien
36
36
  * Returns a cursor-paginated list of sending domains configured for the team, ordered by `created_at` descending. Each entry includes the DNS records the customer must place, the current verification status, and the SES DKIM state. Pass `cursor=<next_cursor>` from the previous response to fetch the next page.
37
37
  */
38
38
  export const managementListDomains = (options) => (options?.client ?? client).get({
39
- security: [{ scheme: 'bearer', type: 'http' }],
39
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
40
40
  url: '/domains',
41
41
  ...options
42
42
  });
@@ -48,7 +48,7 @@ export const managementListDomains = (options) => (options?.client ?? client).ge
48
48
  * Supply an `Idempotency-Key` header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return `409 idempotency_conflict`.
49
49
  */
50
50
  export const managementCreateDomain = (options) => (options?.client ?? client).post({
51
- security: [{ scheme: 'bearer', type: 'http' }],
51
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
52
52
  url: '/domains',
53
53
  ...options,
54
54
  headers: {
@@ -62,7 +62,7 @@ export const managementCreateDomain = (options) => (options?.client ?? client).p
62
62
  * Removes a domain from our mail platform, Amazon SES, and Sendmux. Blocked if any active mailbox still uses the domain — delete those mailboxes first.
63
63
  */
64
64
  export const managementDeleteDomain = (options) => (options.client ?? client).delete({
65
- security: [{ scheme: 'bearer', type: 'http' }],
65
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
66
66
  url: '/domains/{public_id}',
67
67
  ...options
68
68
  });
@@ -72,7 +72,7 @@ export const managementDeleteDomain = (options) => (options.client ?? client).de
72
72
  * Returns a single domain including its DNS records and latest verification state. Responses carry a weak `ETag` header — send it back as `If-None-Match` on the next request and the server will return `304 Not Modified` (no body) when the resource has not changed.
73
73
  */
74
74
  export const managementGetDomain = (options) => (options.client ?? client).get({
75
- security: [{ scheme: 'bearer', type: 'http' }],
75
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
76
76
  url: '/domains/{public_id}',
77
77
  ...options
78
78
  });
@@ -82,7 +82,7 @@ export const managementGetDomain = (options) => (options.client ?? client).get({
82
82
  * Upgrades a send-only domain to sending and receiving. Downgrades are rejected. After upgrade, the domain returns to `pending` until the required MX record verifies.
83
83
  */
84
84
  export const managementUpdateDomain = (options) => (options.client ?? client).patch({
85
- security: [{ scheme: 'bearer', type: 'http' }],
85
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
86
86
  url: '/domains/{public_id}',
87
87
  ...options,
88
88
  headers: {
@@ -98,7 +98,7 @@ export const managementUpdateDomain = (options) => (options.client ?? client).pa
98
98
  * Responses carry a weak `ETag` — send it as `If-None-Match` to skip the body when the filter set has not changed (returns `304 Not Modified`). The same ETag is the value to use in `If-Match` on the corresponding PUT for optimistic concurrency.
99
99
  */
100
100
  export const managementGetDomainFilters = (options) => (options.client ?? client).get({
101
- security: [{ scheme: 'bearer', type: 'http' }],
101
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
102
102
  url: '/domains/{public_id}/filters',
103
103
  ...options
104
104
  });
@@ -110,7 +110,7 @@ export const managementGetDomainFilters = (options) => (options.client ?? client
110
110
  * For optimistic concurrency, send `If-Match: <etag>` using the ETag from a prior GET. A mismatched `If-Match` returns `409 conflict` (the server's ETag is echoed back so you can decide whether to re-fetch). Responses carry the new ETag so chained edits can pipeline without a re-GET.
111
111
  */
112
112
  export const managementSetDomainFilters = (options) => (options.client ?? client).put({
113
- security: [{ scheme: 'bearer', type: 'http' }],
113
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
114
114
  url: '/domains/{public_id}/filters',
115
115
  ...options,
116
116
  headers: {
@@ -124,7 +124,7 @@ export const managementSetDomainFilters = (options) => (options.client ?? client
124
124
  * Checks the domain's published DNS records and latest Amazon SES DKIM and MAIL FROM statuses. If every required check passes, the domain is marked verified. A previously failed domain remains failed until a complete check succeeds. Domains automatically re-verify every 6 hours — this endpoint is only needed to trigger a check on demand.
125
125
  */
126
126
  export const managementVerifyDomain = (options) => (options.client ?? client).post({
127
- security: [{ scheme: 'bearer', type: 'http' }],
127
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
128
128
  url: '/domains/{public_id}/verify',
129
129
  ...options
130
130
  });
@@ -134,7 +134,7 @@ export const managementVerifyDomain = (options) => (options.client ?? client).po
134
134
  * Returns the domain's DNS records formatted as a BIND-style zone file fragment. Suitable for direct paste into a DNS provider that accepts zone-file imports.
135
135
  */
136
136
  export const managementGetDomainZoneFile = (options) => (options.client ?? client).get({
137
- security: [{ scheme: 'bearer', type: 'http' }],
137
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
138
138
  url: '/domains/{public_id}/zone-file',
139
139
  ...options
140
140
  });
@@ -144,7 +144,7 @@ export const managementGetDomainZoneFile = (options) => (options.client ?? clien
144
144
  * Returns paginated delivery logs with cursor-based pagination and filters.
145
145
  */
146
146
  export const managementListEmailLogs = (options) => (options?.client ?? client).get({
147
- security: [{ scheme: 'bearer', type: 'http' }],
147
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
148
148
  url: '/emails/logs',
149
149
  ...options
150
150
  });
@@ -154,7 +154,7 @@ export const managementListEmailLogs = (options) => (options?.client ?? client).
154
154
  * Returns a single delivery log by its public ID. Responses carry a weak `ETag` header — send it back as `If-None-Match` on the next request and the server will return `304 Not Modified` (no body) when the log has not changed. Logs in a terminal status (sent/failed/rejected) stop changing, so 304 replay is a real bandwidth win on repeated polls.
155
155
  */
156
156
  export const managementGetEmailLog = (options) => (options.client ?? client).get({
157
- security: [{ scheme: 'bearer', type: 'http' }],
157
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
158
158
  url: '/emails/logs/{public_id}',
159
159
  ...options
160
160
  });
@@ -164,7 +164,7 @@ export const managementGetEmailLog = (options) => (options.client ?? client).get
164
164
  * Returns aggregated email delivery counts with flexible time windowing and comparison period.
165
165
  */
166
166
  export const managementGetEmailMetrics = (options) => (options?.client ?? client).get({
167
- security: [{ scheme: 'bearer', type: 'http' }],
167
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
168
168
  url: '/emails/metrics',
169
169
  ...options
170
170
  });
@@ -174,7 +174,7 @@ export const managementGetEmailMetrics = (options) => (options?.client ?? client
174
174
  * Returns paginated incoming message logs for billing accountability.
175
175
  */
176
176
  export const managementListInboxLogs = (options) => (options?.client ?? client).get({
177
- security: [{ scheme: 'bearer', type: 'http' }],
177
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
178
178
  url: '/inboxes/logs',
179
179
  ...options
180
180
  });
@@ -184,7 +184,7 @@ export const managementListInboxLogs = (options) => (options?.client ?? client).
184
184
  * Returns one incoming message log by public ID.
185
185
  */
186
186
  export const managementGetInboxLog = (options) => (options.client ?? client).get({
187
- security: [{ scheme: 'bearer', type: 'http' }],
187
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
188
188
  url: '/inboxes/logs/{public_id}',
189
189
  ...options
190
190
  });
@@ -194,7 +194,7 @@ export const managementGetInboxLog = (options) => (options.client ?? client).get
194
194
  * Returns a cursor-paginated list of mailboxes configured for the team, ordered by `created_at` descending. Pass `cursor=<next_cursor>` from the previous response to fetch the next page.
195
195
  */
196
196
  export const managementListMailboxes = (options) => (options?.client ?? client).get({
197
- security: [{ scheme: 'bearer', type: 'http' }],
197
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
198
198
  url: '/mailboxes',
199
199
  ...options
200
200
  });
@@ -206,7 +206,7 @@ export const managementListMailboxes = (options) => (options?.client ?? client).
206
206
  * Supply an `Idempotency-Key` header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return `409 idempotency_conflict`.
207
207
  */
208
208
  export const managementCreateMailbox = (options) => (options?.client ?? client).post({
209
- security: [{ scheme: 'bearer', type: 'http' }],
209
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
210
210
  url: '/mailboxes',
211
211
  ...options,
212
212
  headers: {
@@ -220,7 +220,7 @@ export const managementCreateMailbox = (options) => (options?.client ?? client).
220
220
  * Removes a mailbox from our mail platform, Amazon SES (for `@myagent.mx` addresses), and Sendmux. All associated API keys are revoked.
221
221
  */
222
222
  export const managementDeleteMailbox = (options) => (options.client ?? client).delete({
223
- security: [{ scheme: 'bearer', type: 'http' }],
223
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
224
224
  url: '/mailboxes/{public_id}',
225
225
  ...options
226
226
  });
@@ -230,7 +230,7 @@ export const managementDeleteMailbox = (options) => (options.client ?? client).d
230
230
  * Returns a single mailbox, tenant-scoped to the caller's team. Responses carry a weak `ETag` header — send it back as `If-None-Match` on the next request and the server will return `304 Not Modified` (no body) when the resource has not changed. The same ETag is the value to use in `If-Match` on PATCH for optimistic concurrency.
231
231
  */
232
232
  export const managementGetMailbox = (options) => (options.client ?? client).get({
233
- security: [{ scheme: 'bearer', type: 'http' }],
233
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
234
234
  url: '/mailboxes/{public_id}',
235
235
  ...options
236
236
  });
@@ -242,7 +242,7 @@ export const managementGetMailbox = (options) => (options.client ?? client).get(
242
242
  * For optimistic concurrency, send `If-Match: <etag>` using the ETag from a prior GET. A mismatched `If-Match` returns `409 conflict` (the server's ETag is echoed back so you can decide whether to re-fetch). Responses carry the new ETag so chained edits can pipeline without a re-GET.
243
243
  */
244
244
  export const managementUpdateMailbox = (options) => (options.client ?? client).patch({
245
- security: [{ scheme: 'bearer', type: 'http' }],
245
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
246
246
  url: '/mailboxes/{public_id}',
247
247
  ...options,
248
248
  headers: {
@@ -258,7 +258,7 @@ export const managementUpdateMailbox = (options) => (options.client ?? client).p
258
258
  * Responses carry a weak `ETag` — send it as `If-None-Match` to skip the body when the filter set has not changed (returns `304 Not Modified`). The same ETag is the value to use in `If-Match` on the corresponding PUT for optimistic concurrency.
259
259
  */
260
260
  export const managementGetMailboxFilters = (options) => (options.client ?? client).get({
261
- security: [{ scheme: 'bearer', type: 'http' }],
261
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
262
262
  url: '/mailboxes/{public_id}/filters',
263
263
  ...options
264
264
  });
@@ -270,7 +270,7 @@ export const managementGetMailboxFilters = (options) => (options.client ?? clien
270
270
  * For optimistic concurrency, send `If-Match: <etag>` using the ETag from a prior GET. A mismatched `If-Match` returns `409 conflict` (the server's ETag is echoed back so you can decide whether to re-fetch). Responses carry the new ETag so chained edits can pipeline without a re-GET.
271
271
  */
272
272
  export const managementSetMailboxFilters = (options) => (options.client ?? client).put({
273
- security: [{ scheme: 'bearer', type: 'http' }],
273
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
274
274
  url: '/mailboxes/{public_id}/filters',
275
275
  ...options,
276
276
  headers: {
@@ -286,7 +286,7 @@ export const managementSetMailboxFilters = (options) => (options.client ?? clien
286
286
  * Supply an `Idempotency-Key` header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return `409 idempotency_conflict`.
287
287
  */
288
288
  export const managementCreateMailboxKey = (options) => (options.client ?? client).post({
289
- security: [{ scheme: 'bearer', type: 'http' }],
289
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
290
290
  url: '/mailboxes/{public_id}/keys',
291
291
  ...options,
292
292
  headers: {
@@ -300,7 +300,7 @@ export const managementCreateMailboxKey = (options) => (options.client ?? client
300
300
  * Revokes a specific bearer token + matching mailbox password. Idempotent on already-revoked keys.
301
301
  */
302
302
  export const managementDeleteMailboxKey = (options) => (options.client ?? client).delete({
303
- security: [{ scheme: 'bearer', type: 'http' }],
303
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
304
304
  url: '/mailboxes/{public_id}/keys/{key_id}',
305
305
  ...options
306
306
  });
@@ -310,7 +310,7 @@ export const managementDeleteMailboxKey = (options) => (options.client ?? client
310
310
  * Restores a suspended mailbox so it can authenticate, receive mail, and send from the mailbox address again. The operation is idempotent and accepts `Idempotency-Key` for safe retries.
311
311
  */
312
312
  export const managementResumeMailbox = (options) => (options.client ?? client).post({
313
- security: [{ scheme: 'bearer', type: 'http' }],
313
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
314
314
  url: '/mailboxes/{public_id}/resume',
315
315
  ...options
316
316
  });
@@ -320,7 +320,7 @@ export const managementResumeMailbox = (options) => (options.client ?? client).p
320
320
  * Suspends a mailbox without deleting messages, credentials, or settings. Suspended mailboxes cannot receive mail, authenticate to mailbox protocols, or send from the mailbox address. The operation is idempotent and accepts `Idempotency-Key` for safe retries.
321
321
  */
322
322
  export const managementSuspendMailbox = (options) => (options.client ?? client).post({
323
- security: [{ scheme: 'bearer', type: 'http' }],
323
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
324
324
  url: '/mailboxes/{public_id}/suspend',
325
325
  ...options
326
326
  });
@@ -330,7 +330,7 @@ export const managementSuspendMailbox = (options) => (options.client ?? client).
330
330
  * Checks whether an email address can be reserved for mailbox creation. `@myagent.mx` availability is global across all teams; custom-domain availability is scoped to the caller's team and requires a verified send/receive mailbox domain.
331
331
  */
332
332
  export const managementCheckMailboxAvailability = (options) => (options.client ?? client).get({
333
- security: [{ scheme: 'bearer', type: 'http' }],
333
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
334
334
  url: '/mailboxes/availability',
335
335
  ...options
336
336
  });
@@ -340,7 +340,7 @@ export const managementCheckMailboxAvailability = (options) => (options.client ?
340
340
  * Validate this credential and return its team, connection label, permissions and authorised mailboxes. No additional read permission or mailbox selection is required. Mailbox storage and sending availability are not checked. No user profile or secrets are returned.
341
341
  */
342
342
  export const managementGetConnection = (options) => (options?.client ?? client).get({
343
- security: [{ scheme: 'bearer', type: 'http' }],
343
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
344
344
  url: '/me',
345
345
  ...options
346
346
  });
@@ -350,7 +350,7 @@ export const managementGetConnection = (options) => (options?.client ?? client).
350
350
  * Returns a cursor-paginated list of sending accounts. Credentials are never returned. The shared Amazon SES account is included and marked with `is_shared: true`.
351
351
  */
352
352
  export const managementListProviders = (options) => (options?.client ?? client).get({
353
- security: [{ scheme: 'bearer', type: 'http' }],
353
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
354
354
  url: '/providers',
355
355
  ...options
356
356
  });
@@ -360,7 +360,7 @@ export const managementListProviders = (options) => (options?.client ?? client).
360
360
  * Creates a custom SMTP sending account. Supply an `Idempotency-Key` header to safely retry on network errors. The SMTP password is stored securely and is never returned.
361
361
  */
362
362
  export const managementCreateProvider = (options) => (options?.client ?? client).post({
363
- security: [{ scheme: 'bearer', type: 'http' }],
363
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
364
364
  url: '/providers',
365
365
  ...options,
366
366
  headers: {
@@ -374,7 +374,7 @@ export const managementCreateProvider = (options) => (options?.client ?? client)
374
374
  * Deletes a custom or connected sending account. The shared Amazon SES account cannot be deleted.
375
375
  */
376
376
  export const managementDeleteProvider = (options) => (options.client ?? client).delete({
377
- security: [{ scheme: 'bearer', type: 'http' }],
377
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
378
378
  url: '/providers/{public_id}',
379
379
  ...options
380
380
  });
@@ -384,7 +384,7 @@ export const managementDeleteProvider = (options) => (options.client ?? client).
384
384
  * Returns one sending account. Responses include an ETag for conditional GET and optimistic PATCH.
385
385
  */
386
386
  export const managementGetProvider = (options) => (options.client ?? client).get({
387
- security: [{ scheme: 'bearer', type: 'http' }],
387
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
388
388
  url: '/providers/{public_id}',
389
389
  ...options
390
390
  });
@@ -394,7 +394,7 @@ export const managementGetProvider = (options) => (options.client ?? client).get
394
394
  * Updates a custom sending account. The shared Amazon SES account cannot be edited here; use activate/deactivate and the limit-request endpoint for the allowed shared-account actions.
395
395
  */
396
396
  export const managementUpdateProvider = (options) => (options.client ?? client).patch({
397
- security: [{ scheme: 'bearer', type: 'http' }],
397
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
398
398
  url: '/providers/{public_id}',
399
399
  ...options,
400
400
  headers: {
@@ -408,7 +408,7 @@ export const managementUpdateProvider = (options) => (options.client ?? client).
408
408
  * Enables a sending account. OAuth accounts without an active connection are moved to pending until reconnected in the dashboard. The shared Amazon SES account can be activated.
409
409
  */
410
410
  export const managementActivateProvider = (options) => (options.client ?? client).post({
411
- security: [{ scheme: 'bearer', type: 'http' }],
411
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
412
412
  url: '/providers/{public_id}/activate',
413
413
  ...options
414
414
  });
@@ -418,7 +418,7 @@ export const managementActivateProvider = (options) => (options.client ?? client
418
418
  * Disables a sending account. The shared Amazon SES account can be deactivated.
419
419
  */
420
420
  export const managementDeactivateProvider = (options) => (options.client ?? client).post({
421
- security: [{ scheme: 'bearer', type: 'http' }],
421
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
422
422
  url: '/providers/{public_id}/deactivate',
423
423
  ...options
424
424
  });
@@ -428,7 +428,7 @@ export const managementDeactivateProvider = (options) => (options.client ?? clie
428
428
  * Runs a connection test for a custom SMTP account. The shared Amazon SES account and OAuth accounts cannot be tested through this endpoint.
429
429
  */
430
430
  export const managementTestProvider = (options) => (options.client ?? client).post({
431
- security: [{ scheme: 'bearer', type: 'http' }],
431
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
432
432
  url: '/providers/{public_id}/test',
433
433
  ...options
434
434
  });
@@ -438,7 +438,7 @@ export const managementTestProvider = (options) => (options.client ?? client).po
438
438
  * Returns custom-account capacity and shared Amazon SES daily sending limit state.
439
439
  */
440
440
  export const managementGetProviderLimits = (options) => (options?.client ?? client).get({
441
- security: [{ scheme: 'bearer', type: 'http' }],
441
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
442
442
  url: '/providers/limits',
443
443
  ...options
444
444
  });
@@ -448,7 +448,7 @@ export const managementGetProviderLimits = (options) => (options?.client ?? clie
448
448
  * Creates a request to increase the number of custom or connected sending accounts allowed for the team.
449
449
  */
450
450
  export const managementRequestSendingAccountLimitIncrease = (options) => (options?.client ?? client).post({
451
- security: [{ scheme: 'bearer', type: 'http' }],
451
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
452
452
  url: '/providers/limits/sending-accounts/request-increase',
453
453
  ...options
454
454
  });
@@ -458,7 +458,7 @@ export const managementRequestSendingAccountLimitIncrease = (options) => (option
458
458
  * Returns the shared Amazon SES daily limit state and any pending increase request.
459
459
  */
460
460
  export const managementGetSharedAmazonSesLimitRequest = (options) => (options?.client ?? client).get({
461
- security: [{ scheme: 'bearer', type: 'http' }],
461
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
462
462
  url: '/providers/shared-amazon-ses-limit-request',
463
463
  ...options
464
464
  });
@@ -468,7 +468,7 @@ export const managementGetSharedAmazonSesLimitRequest = (options) => (options?.c
468
468
  * Creates a review request for the shared Amazon SES daily sending limit. This does not modify the limit directly.
469
469
  */
470
470
  export const managementCreateSharedAmazonSesLimitRequest = (options) => (options?.client ?? client).post({
471
- security: [{ scheme: 'bearer', type: 'http' }],
471
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
472
472
  url: '/providers/shared-amazon-ses-limit-request',
473
473
  ...options
474
474
  });
@@ -478,7 +478,7 @@ export const managementCreateSharedAmazonSesLimitRequest = (options) => (options
478
478
  * Cancels a pending shared Amazon SES daily limit increase request for the caller's team. Approved or denied requests cannot be cancelled.
479
479
  */
480
480
  export const managementCancelSharedAmazonSesLimitRequest = (options) => (options.client ?? client).delete({
481
- security: [{ scheme: 'bearer', type: 'http' }],
481
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
482
482
  url: '/providers/shared-amazon-ses-limit-request/{request_id}',
483
483
  ...options
484
484
  });
@@ -488,7 +488,7 @@ export const managementCancelSharedAmazonSesLimitRequest = (options) => (options
488
488
  * Returns aggregate counts of configured sending accounts with breakdowns by type and status.
489
489
  */
490
490
  export const managementGetProviderStats = (options) => (options?.client ?? client).get({
491
- security: [{ scheme: 'bearer', type: 'http' }],
491
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
492
492
  url: '/providers/stats',
493
493
  ...options
494
494
  });
@@ -498,7 +498,7 @@ export const managementGetProviderStats = (options) => (options?.client ?? clien
498
498
  * Returns per-account delivery-log counts for today and the trailing 7-day window.
499
499
  */
500
500
  export const managementGetProviderUsage = (options) => (options?.client ?? client).get({
501
- security: [{ scheme: 'bearer', type: 'http' }],
501
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
502
502
  url: '/providers/usage',
503
503
  ...options
504
504
  });
@@ -508,7 +508,7 @@ export const managementGetProviderUsage = (options) => (options?.client ?? clien
508
508
  * Returns a cursor-paginated list of webhook subscriptions configured for the team, ordered by `created_at` descending. The signing secret is never included. Pass `cursor=<next_cursor>` from the previous response to fetch the next page.
509
509
  */
510
510
  export const managementListWebhooks = (options) => (options?.client ?? client).get({
511
- security: [{ scheme: 'bearer', type: 'http' }],
511
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
512
512
  url: '/webhooks',
513
513
  ...options
514
514
  });
@@ -520,7 +520,7 @@ export const managementListWebhooks = (options) => (options?.client ?? client).g
520
520
  * Supply an `Idempotency-Key` header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return `409 idempotency_conflict`.
521
521
  */
522
522
  export const managementCreateWebhook = (options) => (options?.client ?? client).post({
523
- security: [{ scheme: 'bearer', type: 'http' }],
523
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
524
524
  url: '/webhooks',
525
525
  ...options,
526
526
  headers: {
@@ -534,7 +534,7 @@ export const managementCreateWebhook = (options) => (options?.client ?? client).
534
534
  * Permanently removes the subscription. In-flight retries are dropped.
535
535
  */
536
536
  export const managementDeleteWebhook = (options) => (options.client ?? client).delete({
537
- security: [{ scheme: 'bearer', type: 'http' }],
537
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
538
538
  url: '/webhooks/{public_id}',
539
539
  ...options
540
540
  });
@@ -544,7 +544,7 @@ export const managementDeleteWebhook = (options) => (options.client ?? client).d
544
544
  * Returns a single webhook subscription. The signing secret is never included. Responses carry a weak `ETag` header — send it back as `If-None-Match` on the next request and the server will return `304 Not Modified` (no body) when the resource has not changed. The same ETag is the value to use in `If-Match` on PATCH for optimistic concurrency.
545
545
  */
546
546
  export const managementGetWebhook = (options) => (options.client ?? client).get({
547
- security: [{ scheme: 'bearer', type: 'http' }],
547
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
548
548
  url: '/webhooks/{public_id}',
549
549
  ...options
550
550
  });
@@ -556,7 +556,7 @@ export const managementGetWebhook = (options) => (options.client ?? client).get(
556
556
  * For optimistic concurrency, send `If-Match: <etag>` using the ETag from a prior GET. A mismatched `If-Match` returns `409 conflict` (the server's ETag is echoed back so you can decide whether to re-fetch). Responses carry the new ETag so chained edits can pipeline without a re-GET.
557
557
  */
558
558
  export const managementUpdateWebhook = (options) => (options.client ?? client).patch({
559
- security: [{ scheme: 'bearer', type: 'http' }],
559
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
560
560
  url: '/webhooks/{public_id}',
561
561
  ...options,
562
562
  headers: {
@@ -570,7 +570,7 @@ export const managementUpdateWebhook = (options) => (options.client ?? client).p
570
570
  * Returns recent delivery attempts for one webhook subscription, ordered by `created_at` descending. Delivery metadata is retained for 7 days. Use the payload endpoint while `payload_available` is true to inspect the exact JSON request body that was delivered.
571
571
  */
572
572
  export const managementListDelivery = (options) => (options.client ?? client).get({
573
- security: [{ scheme: 'bearer', type: 'http' }],
573
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
574
574
  url: '/webhooks/{public_id}/deliveries',
575
575
  ...options
576
576
  });
@@ -580,7 +580,7 @@ export const managementListDelivery = (options) => (options.client ?? client).ge
580
580
  * Returns the retained JSON request body for one delivery attempt. Payloads are retained for 7 days and may no longer be available after `payload_expires_at`.
581
581
  */
582
582
  export const managementGetDeliveryPayload = (options) => (options.client ?? client).get({
583
- security: [{ scheme: 'bearer', type: 'http' }],
583
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
584
584
  url: '/webhooks/{public_id}/deliveries/{delivery_id}/payload',
585
585
  ...options
586
586
  });
@@ -592,7 +592,7 @@ export const managementGetDeliveryPayload = (options) => (options.client ?? clie
592
592
  * Supply an `Idempotency-Key` header to safely retry on network errors — replays under the same key return the original rotation response rather than minting a fresh secret. Replays against a different `public_id` under the same key return `409 idempotency_conflict`.
593
593
  */
594
594
  export const managementRotateWebhookSecret = (options) => (options.client ?? client).post({
595
- security: [{ scheme: 'bearer', type: 'http' }],
595
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
596
596
  url: '/webhooks/{public_id}/rotate-secret',
597
597
  ...options
598
598
  });
@@ -604,7 +604,7 @@ export const managementRotateWebhookSecret = (options) => (options.client ?? cli
604
604
  * Supply an `Idempotency-Key` header to safely retry on network errors — replays under the same key return the original `event_id` rather than publishing a second test event.
605
605
  */
606
606
  export const managementTestWebhook = (options) => (options.client ?? client).post({
607
- security: [{ scheme: 'bearer', type: 'http' }],
607
+ security: [{ scheme: 'bearer', type: 'http' }, { scheme: 'bearer', type: 'http' }],
608
608
  url: '/webhooks/{public_id}/test',
609
609
  ...options
610
610
  });
@@ -2461,7 +2461,7 @@ export type ManagementResumeMailboxData = {
2461
2461
  };
2462
2462
  export type ManagementResumeMailboxErrors = {
2463
2463
  /**
2464
- * Root API key required
2464
+ * Management API access required
2465
2465
  */
2466
2466
  403: ApiError;
2467
2467
  /**
@@ -2504,7 +2504,7 @@ export type ManagementSuspendMailboxData = {
2504
2504
  };
2505
2505
  export type ManagementSuspendMailboxErrors = {
2506
2506
  /**
2507
- * Root API key required
2507
+ * Management API access required
2508
2508
  */
2509
2509
  403: ApiError;
2510
2510
  /**
@@ -2545,7 +2545,7 @@ export type ManagementCheckMailboxAvailabilityErrors = {
2545
2545
  */
2546
2546
  401: ApiError;
2547
2547
  /**
2548
- * Root API key with mailbox.admin.create is required
2548
+ * Management API access with mailbox.admin.create is required
2549
2549
  */
2550
2550
  403: ApiError;
2551
2551
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sendmux/management",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -11,7 +11,7 @@
11
11
  "dist"
12
12
  ],
13
13
  "dependencies": {
14
- "@sendmux/core": "1.1.0"
14
+ "@sendmux/core": "1.2.0"
15
15
  },
16
16
  "repository": {
17
17
  "type": "git",