@primitivedotdev/sdk 0.2.4 → 0.3.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 (41) hide show
  1. package/README.md +65 -2
  2. package/bin/run.js +5 -0
  3. package/dist/api/generated/client/client.gen.js +235 -0
  4. package/dist/api/generated/client/index.js +6 -0
  5. package/dist/api/generated/client/types.gen.js +2 -0
  6. package/dist/api/generated/client/utils.gen.js +228 -0
  7. package/dist/api/generated/client.gen.js +3 -0
  8. package/dist/api/generated/core/auth.gen.js +14 -0
  9. package/dist/api/generated/core/bodySerializer.gen.js +57 -0
  10. package/dist/api/generated/core/params.gen.js +100 -0
  11. package/dist/api/generated/core/pathSerializer.gen.js +106 -0
  12. package/dist/api/generated/core/queryKeySerializer.gen.js +92 -0
  13. package/dist/api/generated/core/serverSentEvents.gen.js +132 -0
  14. package/dist/api/generated/core/types.gen.js +2 -0
  15. package/dist/api/generated/core/utils.gen.js +87 -0
  16. package/dist/api/generated/index.js +2 -0
  17. package/dist/api/generated/sdk.gen.js +344 -0
  18. package/dist/api/generated/types.gen.js +2 -0
  19. package/dist/api/index.d.ts +1832 -0
  20. package/dist/api/index.js +39 -0
  21. package/dist/chunk-Cl8Af3a2.js +11 -0
  22. package/dist/contract/index.d.ts +3 -3
  23. package/dist/contract/index.js +2 -2
  24. package/dist/{index-BdRIHaXz.d.ts → index-D2OuDGVz.d.ts} +81 -5
  25. package/dist/index.d.ts +3 -3
  26. package/dist/index.js +2 -2
  27. package/dist/oclif/api-command.js +154 -0
  28. package/dist/oclif/fish-completion.js +87 -0
  29. package/dist/oclif/index.js +42 -0
  30. package/dist/openapi/index.d.ts +41 -0
  31. package/dist/openapi/index.js +8 -0
  32. package/dist/openapi/openapi.generated.js +2644 -0
  33. package/dist/openapi/operations.generated.js +632 -0
  34. package/dist/parser/index.d.ts +1 -1
  35. package/dist/parser/index.js +40 -25
  36. package/dist/{types-B5IgP-Zx.d.ts → types-C3ms4R0d.d.ts} +4 -0
  37. package/dist/webhook/index.d.ts +3 -3
  38. package/dist/webhook/index.js +2 -2
  39. package/dist/{webhook-Be2vM0F-.js → webhook-uSco6pyX.js} +176 -11
  40. package/oclif.manifest.json +1255 -0
  41. package/package.json +81 -13
@@ -0,0 +1,344 @@
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. Includes rate limiting
192
+ * to prevent stampeding.
193
+ *
194
+ */
195
+ export const replayEmailWebhooks = (options) => (options.client ?? client).post({
196
+ security: [{ scheme: 'bearer', type: 'http' }],
197
+ url: '/emails/{id}/replay',
198
+ ...options
199
+ });
200
+ /**
201
+ * List webhook endpoints
202
+ *
203
+ * Returns all active (non-deleted) webhook endpoints.
204
+ */
205
+ export const listEndpoints = (options) => (options?.client ?? client).get({
206
+ security: [{ scheme: 'bearer', type: 'http' }],
207
+ url: '/endpoints',
208
+ ...options
209
+ });
210
+ /**
211
+ * Create a webhook endpoint
212
+ *
213
+ * Creates a new webhook endpoint. If a deactivated endpoint with the
214
+ * same URL and domain exists, it is reactivated instead.
215
+ * Subject to plan limits on the number of active endpoints.
216
+ *
217
+ */
218
+ export const createEndpoint = (options) => (options.client ?? client).post({
219
+ security: [{ scheme: 'bearer', type: 'http' }],
220
+ url: '/endpoints',
221
+ ...options,
222
+ headers: {
223
+ 'Content-Type': 'application/json',
224
+ ...options.headers
225
+ }
226
+ });
227
+ /**
228
+ * Delete a webhook endpoint
229
+ *
230
+ * Soft-deletes a webhook endpoint. The endpoint will no longer
231
+ * receive webhook deliveries.
232
+ *
233
+ */
234
+ export const deleteEndpoint = (options) => (options.client ?? client).delete({
235
+ security: [{ scheme: 'bearer', type: 'http' }],
236
+ url: '/endpoints/{id}',
237
+ ...options
238
+ });
239
+ /**
240
+ * Update a webhook endpoint
241
+ *
242
+ * Updates an active webhook endpoint. If the URL is changed, the old
243
+ * endpoint is deactivated and a new one is created (or an existing
244
+ * deactivated endpoint with the new URL is reactivated).
245
+ *
246
+ */
247
+ export const updateEndpoint = (options) => (options.client ?? client).patch({
248
+ security: [{ scheme: 'bearer', type: 'http' }],
249
+ url: '/endpoints/{id}',
250
+ ...options,
251
+ headers: {
252
+ 'Content-Type': 'application/json',
253
+ ...options.headers
254
+ }
255
+ });
256
+ /**
257
+ * Send a test webhook
258
+ *
259
+ * Sends a sample `email.received` event to the endpoint. The request
260
+ * includes SSRF protection (private IP rejection and DNS pinning).
261
+ * Rate limited to 4 per minute and 30 per hour (non-exempt).
262
+ * Successful deliveries and verified-domain endpoints are exempt
263
+ * from the rate limit.
264
+ *
265
+ */
266
+ export const testEndpoint = (options) => (options.client ?? client).post({
267
+ security: [{ scheme: 'bearer', type: 'http' }],
268
+ url: '/endpoints/{id}/test',
269
+ ...options
270
+ });
271
+ /**
272
+ * List filter rules
273
+ *
274
+ * Returns all whitelist and blocklist filter rules.
275
+ */
276
+ export const listFilters = (options) => (options?.client ?? client).get({
277
+ security: [{ scheme: 'bearer', type: 'http' }],
278
+ url: '/filters',
279
+ ...options
280
+ });
281
+ /**
282
+ * Create a filter rule
283
+ *
284
+ * Creates a new whitelist or blocklist filter. Per-domain filters
285
+ * require a Pro plan. Patterns are stored as lowercase.
286
+ *
287
+ */
288
+ export const createFilter = (options) => (options.client ?? client).post({
289
+ security: [{ scheme: 'bearer', type: 'http' }],
290
+ url: '/filters',
291
+ ...options,
292
+ headers: {
293
+ 'Content-Type': 'application/json',
294
+ ...options.headers
295
+ }
296
+ });
297
+ /**
298
+ * Delete a filter rule
299
+ */
300
+ export const deleteFilter = (options) => (options.client ?? client).delete({
301
+ security: [{ scheme: 'bearer', type: 'http' }],
302
+ url: '/filters/{id}',
303
+ ...options
304
+ });
305
+ /**
306
+ * Update a filter rule
307
+ *
308
+ * Toggle a filter's enabled state.
309
+ */
310
+ export const updateFilter = (options) => (options.client ?? client).patch({
311
+ security: [{ scheme: 'bearer', type: 'http' }],
312
+ url: '/filters/{id}',
313
+ ...options,
314
+ headers: {
315
+ 'Content-Type': 'application/json',
316
+ ...options.headers
317
+ }
318
+ });
319
+ /**
320
+ * List webhook deliveries
321
+ *
322
+ * Returns a paginated list of webhook delivery attempts. Each delivery
323
+ * includes a nested `email` object with sender, recipient, and subject.
324
+ *
325
+ */
326
+ export const listDeliveries = (options) => (options?.client ?? client).get({
327
+ security: [{ scheme: 'bearer', type: 'http' }],
328
+ url: '/webhooks/deliveries',
329
+ ...options
330
+ });
331
+ /**
332
+ * Replay a webhook delivery
333
+ *
334
+ * Re-sends the stored webhook payload from a previous delivery attempt.
335
+ * If the original endpoint is still active, it is targeted. If the
336
+ * original endpoint was deleted, the first active endpoint is used.
337
+ * Deactivated endpoints cannot be replayed to.
338
+ *
339
+ */
340
+ export const replayDelivery = (options) => (options.client ?? client).post({
341
+ security: [{ scheme: 'bearer', type: 'http' }],
342
+ url: '/webhooks/deliveries/{id}/replay',
343
+ ...options
344
+ });
@@ -0,0 +1,2 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ export {};