@primitivedotdev/sdk 0.2.4 → 0.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 +65 -2
- package/bin/run.js +5 -0
- package/dist/api/generated/client/client.gen.js +235 -0
- package/dist/api/generated/client/index.js +6 -0
- package/dist/api/generated/client/types.gen.js +2 -0
- package/dist/api/generated/client/utils.gen.js +228 -0
- package/dist/api/generated/client.gen.js +3 -0
- package/dist/api/generated/core/auth.gen.js +14 -0
- package/dist/api/generated/core/bodySerializer.gen.js +57 -0
- package/dist/api/generated/core/params.gen.js +100 -0
- package/dist/api/generated/core/pathSerializer.gen.js +106 -0
- package/dist/api/generated/core/queryKeySerializer.gen.js +92 -0
- package/dist/api/generated/core/serverSentEvents.gen.js +132 -0
- package/dist/api/generated/core/types.gen.js +2 -0
- package/dist/api/generated/core/utils.gen.js +87 -0
- package/dist/api/generated/index.js +2 -0
- package/dist/api/generated/sdk.gen.js +347 -0
- package/dist/api/generated/types.gen.js +2 -0
- package/dist/api/index.d.ts +1877 -0
- package/dist/api/index.js +39 -0
- package/dist/chunk-Cl8Af3a2.js +11 -0
- package/dist/contract/index.d.ts +3 -3
- package/dist/contract/index.js +2 -2
- package/dist/{index-BdRIHaXz.d.ts → index-D2OuDGVz.d.ts} +81 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/oclif/api-command.js +218 -0
- package/dist/oclif/fish-completion.js +87 -0
- package/dist/oclif/index.js +42 -0
- package/dist/openapi/index.d.ts +42 -0
- package/dist/openapi/index.js +8 -0
- package/dist/openapi/openapi.generated.js +2715 -0
- package/dist/openapi/operations.generated.js +671 -0
- package/dist/parser/index.d.ts +1 -1
- package/dist/parser/index.js +40 -25
- package/dist/{types-B5IgP-Zx.d.ts → types-C3ms4R0d.d.ts} +4 -0
- package/dist/webhook/index.d.ts +3 -3
- package/dist/webhook/index.js +2 -2
- package/dist/{webhook-Be2vM0F-.js → webhook-uSco6pyX.js} +176 -11
- package/oclif.manifest.json +1267 -0
- package/package.json +81 -13
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
import { client } from './client.gen.js';
|
|
3
|
+
/**
|
|
4
|
+
* Get account info
|
|
5
|
+
*/
|
|
6
|
+
export const getAccount = (options) => (options?.client ?? client).get({
|
|
7
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
8
|
+
url: '/account',
|
|
9
|
+
...options
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Update account settings
|
|
13
|
+
*/
|
|
14
|
+
export const updateAccount = (options) => (options.client ?? client).patch({
|
|
15
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
16
|
+
url: '/account',
|
|
17
|
+
...options,
|
|
18
|
+
headers: {
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
...options.headers
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Get storage usage
|
|
25
|
+
*/
|
|
26
|
+
export const getStorageStats = (options) => (options?.client ?? client).get({
|
|
27
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
28
|
+
url: '/account/storage',
|
|
29
|
+
...options
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Get webhook signing secret
|
|
33
|
+
*
|
|
34
|
+
* Returns the webhook signing secret for your account. If no secret
|
|
35
|
+
* exists yet, one is generated automatically on first access.
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export const getWebhookSecret = (options) => (options?.client ?? client).get({
|
|
39
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
40
|
+
url: '/account/webhook-secret',
|
|
41
|
+
...options
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* Rotate webhook signing secret
|
|
45
|
+
*
|
|
46
|
+
* Generates a new webhook signing secret, replacing the current one.
|
|
47
|
+
* Rate limited to once per 60 minutes.
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
export const rotateWebhookSecret = (options) => (options?.client ?? client).post({
|
|
51
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
52
|
+
url: '/account/webhook-secret/rotate',
|
|
53
|
+
...options
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* List all domains
|
|
57
|
+
*
|
|
58
|
+
* Returns all verified and unverified domains for your organization,
|
|
59
|
+
* sorted by creation date (newest first). Each domain includes a
|
|
60
|
+
* `verified` boolean to distinguish between the two states.
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
export const listDomains = (options) => (options?.client ?? client).get({
|
|
64
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
65
|
+
url: '/domains',
|
|
66
|
+
...options
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* Claim a new domain
|
|
70
|
+
*
|
|
71
|
+
* Creates an unverified domain claim. You will receive a
|
|
72
|
+
* `verification_token` to add as a DNS TXT record before
|
|
73
|
+
* calling the verify endpoint.
|
|
74
|
+
*
|
|
75
|
+
*/
|
|
76
|
+
export const addDomain = (options) => (options.client ?? client).post({
|
|
77
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
78
|
+
url: '/domains',
|
|
79
|
+
...options,
|
|
80
|
+
headers: {
|
|
81
|
+
'Content-Type': 'application/json',
|
|
82
|
+
...options.headers
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
/**
|
|
86
|
+
* Delete a domain
|
|
87
|
+
*
|
|
88
|
+
* Deletes a verified or unverified domain claim.
|
|
89
|
+
*/
|
|
90
|
+
export const deleteDomain = (options) => (options.client ?? client).delete({
|
|
91
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
92
|
+
url: '/domains/{id}',
|
|
93
|
+
...options
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* Update domain settings
|
|
97
|
+
*
|
|
98
|
+
* Update a verified domain's settings. Only verified domains can be
|
|
99
|
+
* updated. Per-domain spam thresholds require a Pro plan.
|
|
100
|
+
*
|
|
101
|
+
*/
|
|
102
|
+
export const updateDomain = (options) => (options.client ?? client).patch({
|
|
103
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
104
|
+
url: '/domains/{id}',
|
|
105
|
+
...options,
|
|
106
|
+
headers: {
|
|
107
|
+
'Content-Type': 'application/json',
|
|
108
|
+
...options.headers
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
/**
|
|
112
|
+
* Verify domain ownership
|
|
113
|
+
*
|
|
114
|
+
* Checks DNS records (MX and TXT) to verify domain ownership.
|
|
115
|
+
* On success, the domain is promoted from unverified to verified.
|
|
116
|
+
* On failure, returns which checks passed and which failed.
|
|
117
|
+
*
|
|
118
|
+
*/
|
|
119
|
+
export const verifyDomain = (options) => (options.client ?? client).post({
|
|
120
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
121
|
+
url: '/domains/{id}/verify',
|
|
122
|
+
...options
|
|
123
|
+
});
|
|
124
|
+
/**
|
|
125
|
+
* List emails
|
|
126
|
+
*
|
|
127
|
+
* Returns a paginated list of received emails. Supports filtering by
|
|
128
|
+
* domain, status, date range, and free-text search across subject,
|
|
129
|
+
* sender, and recipient fields.
|
|
130
|
+
*
|
|
131
|
+
*/
|
|
132
|
+
export const listEmails = (options) => (options?.client ?? client).get({
|
|
133
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
134
|
+
url: '/emails',
|
|
135
|
+
...options
|
|
136
|
+
});
|
|
137
|
+
/**
|
|
138
|
+
* Delete an email
|
|
139
|
+
*/
|
|
140
|
+
export const deleteEmail = (options) => (options.client ?? client).delete({
|
|
141
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
142
|
+
url: '/emails/{id}',
|
|
143
|
+
...options
|
|
144
|
+
});
|
|
145
|
+
/**
|
|
146
|
+
* Get email details
|
|
147
|
+
*/
|
|
148
|
+
export const getEmail = (options) => (options.client ?? client).get({
|
|
149
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
150
|
+
url: '/emails/{id}',
|
|
151
|
+
...options
|
|
152
|
+
});
|
|
153
|
+
/**
|
|
154
|
+
* Download raw email
|
|
155
|
+
*
|
|
156
|
+
* Downloads the raw RFC 822 email file (.eml). Authenticates via
|
|
157
|
+
* a signed download token (provided in webhook payloads) or a
|
|
158
|
+
* valid session.
|
|
159
|
+
*
|
|
160
|
+
*/
|
|
161
|
+
export const downloadRawEmail = (options) => (options.client ?? client).get({
|
|
162
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
163
|
+
in: 'query',
|
|
164
|
+
name: 'token',
|
|
165
|
+
type: 'apiKey'
|
|
166
|
+
}],
|
|
167
|
+
url: '/emails/{id}/raw',
|
|
168
|
+
...options
|
|
169
|
+
});
|
|
170
|
+
/**
|
|
171
|
+
* Download email attachments
|
|
172
|
+
*
|
|
173
|
+
* Downloads all attachments as a gzip-compressed tar archive.
|
|
174
|
+
* Authenticates via a signed download token (provided in webhook
|
|
175
|
+
* payloads) or a valid session.
|
|
176
|
+
*
|
|
177
|
+
*/
|
|
178
|
+
export const downloadAttachments = (options) => (options.client ?? client).get({
|
|
179
|
+
security: [{ scheme: 'bearer', type: 'http' }, {
|
|
180
|
+
in: 'query',
|
|
181
|
+
name: 'token',
|
|
182
|
+
type: 'apiKey'
|
|
183
|
+
}],
|
|
184
|
+
url: '/emails/{id}/attachments.tar.gz',
|
|
185
|
+
...options
|
|
186
|
+
});
|
|
187
|
+
/**
|
|
188
|
+
* Replay email webhooks
|
|
189
|
+
*
|
|
190
|
+
* Re-delivers the webhook payload for this email to all active
|
|
191
|
+
* endpoints matching the email's domain. Rate limited per-email
|
|
192
|
+
* (short cooldown between successive replays of the same email)
|
|
193
|
+
* and per-org (burst + sustained windows), sharing an org-wide
|
|
194
|
+
* budget with delivery replays.
|
|
195
|
+
*
|
|
196
|
+
*/
|
|
197
|
+
export const replayEmailWebhooks = (options) => (options.client ?? client).post({
|
|
198
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
199
|
+
url: '/emails/{id}/replay',
|
|
200
|
+
...options
|
|
201
|
+
});
|
|
202
|
+
/**
|
|
203
|
+
* List webhook endpoints
|
|
204
|
+
*
|
|
205
|
+
* Returns all active (non-deleted) webhook endpoints.
|
|
206
|
+
*/
|
|
207
|
+
export const listEndpoints = (options) => (options?.client ?? client).get({
|
|
208
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
209
|
+
url: '/endpoints',
|
|
210
|
+
...options
|
|
211
|
+
});
|
|
212
|
+
/**
|
|
213
|
+
* Create a webhook endpoint
|
|
214
|
+
*
|
|
215
|
+
* Creates a new webhook endpoint. If a deactivated endpoint with the
|
|
216
|
+
* same URL and domain exists, it is reactivated instead.
|
|
217
|
+
* Subject to plan limits on the number of active endpoints.
|
|
218
|
+
*
|
|
219
|
+
*/
|
|
220
|
+
export const createEndpoint = (options) => (options.client ?? client).post({
|
|
221
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
222
|
+
url: '/endpoints',
|
|
223
|
+
...options,
|
|
224
|
+
headers: {
|
|
225
|
+
'Content-Type': 'application/json',
|
|
226
|
+
...options.headers
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
/**
|
|
230
|
+
* Delete a webhook endpoint
|
|
231
|
+
*
|
|
232
|
+
* Soft-deletes a webhook endpoint. The endpoint will no longer
|
|
233
|
+
* receive webhook deliveries.
|
|
234
|
+
*
|
|
235
|
+
*/
|
|
236
|
+
export const deleteEndpoint = (options) => (options.client ?? client).delete({
|
|
237
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
238
|
+
url: '/endpoints/{id}',
|
|
239
|
+
...options
|
|
240
|
+
});
|
|
241
|
+
/**
|
|
242
|
+
* Update a webhook endpoint
|
|
243
|
+
*
|
|
244
|
+
* Updates an active webhook endpoint. If the URL is changed, the old
|
|
245
|
+
* endpoint is deactivated and a new one is created (or an existing
|
|
246
|
+
* deactivated endpoint with the new URL is reactivated).
|
|
247
|
+
*
|
|
248
|
+
*/
|
|
249
|
+
export const updateEndpoint = (options) => (options.client ?? client).patch({
|
|
250
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
251
|
+
url: '/endpoints/{id}',
|
|
252
|
+
...options,
|
|
253
|
+
headers: {
|
|
254
|
+
'Content-Type': 'application/json',
|
|
255
|
+
...options.headers
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
/**
|
|
259
|
+
* Send a test webhook
|
|
260
|
+
*
|
|
261
|
+
* Sends a sample `email.received` event to the endpoint. The request
|
|
262
|
+
* includes SSRF protection (private IP rejection and DNS pinning).
|
|
263
|
+
* Rate limited to 4 per minute and 30 per hour (non-exempt).
|
|
264
|
+
* Successful deliveries and verified-domain endpoints are exempt
|
|
265
|
+
* from the rate limit.
|
|
266
|
+
*
|
|
267
|
+
*/
|
|
268
|
+
export const testEndpoint = (options) => (options.client ?? client).post({
|
|
269
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
270
|
+
url: '/endpoints/{id}/test',
|
|
271
|
+
...options
|
|
272
|
+
});
|
|
273
|
+
/**
|
|
274
|
+
* List filter rules
|
|
275
|
+
*
|
|
276
|
+
* Returns all whitelist and blocklist filter rules.
|
|
277
|
+
*/
|
|
278
|
+
export const listFilters = (options) => (options?.client ?? client).get({
|
|
279
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
280
|
+
url: '/filters',
|
|
281
|
+
...options
|
|
282
|
+
});
|
|
283
|
+
/**
|
|
284
|
+
* Create a filter rule
|
|
285
|
+
*
|
|
286
|
+
* Creates a new whitelist or blocklist filter. Per-domain filters
|
|
287
|
+
* require a Pro plan. Patterns are stored as lowercase.
|
|
288
|
+
*
|
|
289
|
+
*/
|
|
290
|
+
export const createFilter = (options) => (options.client ?? client).post({
|
|
291
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
292
|
+
url: '/filters',
|
|
293
|
+
...options,
|
|
294
|
+
headers: {
|
|
295
|
+
'Content-Type': 'application/json',
|
|
296
|
+
...options.headers
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
/**
|
|
300
|
+
* Delete a filter rule
|
|
301
|
+
*/
|
|
302
|
+
export const deleteFilter = (options) => (options.client ?? client).delete({
|
|
303
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
304
|
+
url: '/filters/{id}',
|
|
305
|
+
...options
|
|
306
|
+
});
|
|
307
|
+
/**
|
|
308
|
+
* Update a filter rule
|
|
309
|
+
*
|
|
310
|
+
* Toggle a filter's enabled state.
|
|
311
|
+
*/
|
|
312
|
+
export const updateFilter = (options) => (options.client ?? client).patch({
|
|
313
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
314
|
+
url: '/filters/{id}',
|
|
315
|
+
...options,
|
|
316
|
+
headers: {
|
|
317
|
+
'Content-Type': 'application/json',
|
|
318
|
+
...options.headers
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
/**
|
|
322
|
+
* List webhook deliveries
|
|
323
|
+
*
|
|
324
|
+
* Returns a paginated list of webhook delivery attempts. Each delivery
|
|
325
|
+
* includes a nested `email` object with sender, recipient, and subject.
|
|
326
|
+
*
|
|
327
|
+
*/
|
|
328
|
+
export const listDeliveries = (options) => (options?.client ?? client).get({
|
|
329
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
330
|
+
url: '/webhooks/deliveries',
|
|
331
|
+
...options
|
|
332
|
+
});
|
|
333
|
+
/**
|
|
334
|
+
* Replay a webhook delivery
|
|
335
|
+
*
|
|
336
|
+
* Re-sends the stored webhook payload from a previous delivery attempt.
|
|
337
|
+
* If the original endpoint is still active, it is targeted. If the
|
|
338
|
+
* original endpoint was deleted, the oldest active endpoint is used.
|
|
339
|
+
* Deactivated endpoints cannot be replayed to. Rate limited per-org,
|
|
340
|
+
* sharing an org-wide budget with email replays.
|
|
341
|
+
*
|
|
342
|
+
*/
|
|
343
|
+
export const replayDelivery = (options) => (options.client ?? client).post({
|
|
344
|
+
security: [{ scheme: 'bearer', type: 'http' }],
|
|
345
|
+
url: '/webhooks/deliveries/{id}/replay',
|
|
346
|
+
...options
|
|
347
|
+
});
|