@crvouga/mockingbird-service-resend 2.0.0 → 2.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.
@@ -3,7 +3,7 @@ import {
3
3
  createRuntime,
4
4
  parseDuration,
5
5
  resolveAdminPrefix
6
- } from "./chunk-AVLXDCB3.js";
6
+ } from "./chunk-VMXQ2LLE.js";
7
7
 
8
8
  // ../../adapters/node/dist/cli.js
9
9
  import { readFile as readFile2 } from "node:fs/promises";
@@ -858,4 +858,4 @@ export {
858
858
  createServer2 as createServer,
859
859
  serveTarget
860
860
  };
861
- //# sourceMappingURL=chunk-K5P64BHJ.js.map
861
+ //# sourceMappingURL=chunk-X3KXLVOT.js.map
package/dist/cli.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  runCli,
4
4
  serveCommand,
5
5
  serveTarget
6
- } from "./chunk-K5P64BHJ.js";
7
- import "./chunk-AVLXDCB3.js";
6
+ } from "./chunk-X3KXLVOT.js";
7
+ import "./chunk-VMXQ2LLE.js";
8
8
 
9
9
  // src/cli.ts
10
10
  var code = await runCli(
package/dist/index.d.ts CHANGED
@@ -966,10 +966,10 @@ type OpenAPIDocument = {
966
966
  };
967
967
 
968
968
  declare const document: OpenAPIDocument;
969
- type OperationId = "SendEmail" | "GetEmail" | "GetReceivedEmail" | "ListReceivedEmailAttachments" | "DownloadReceivedAttachment";
970
- type SupportedOperationId = "SendEmail" | "GetEmail" | "GetReceivedEmail" | "ListReceivedEmailAttachments" | "DownloadReceivedAttachment";
971
- declare const operationIds: readonly ["SendEmail", "GetEmail", "GetReceivedEmail", "ListReceivedEmailAttachments", "DownloadReceivedAttachment"];
972
- declare const supportedOperationIds: readonly ["SendEmail", "GetEmail", "GetReceivedEmail", "ListReceivedEmailAttachments", "DownloadReceivedAttachment"];
969
+ type OperationId = "ListEmails" | "SendEmail" | "GetEmail" | "ListReceivedEmails" | "GetReceivedEmail" | "ListReceivedEmailAttachments" | "DownloadReceivedAttachment";
970
+ type SupportedOperationId = "ListEmails" | "SendEmail" | "GetEmail" | "ListReceivedEmails" | "GetReceivedEmail" | "ListReceivedEmailAttachments" | "DownloadReceivedAttachment";
971
+ declare const operationIds: readonly ["ListEmails", "SendEmail", "GetEmail", "ListReceivedEmails", "GetReceivedEmail", "ListReceivedEmailAttachments", "DownloadReceivedAttachment"];
972
+ declare const supportedOperationIds: readonly ["ListEmails", "SendEmail", "GetEmail", "ListReceivedEmails", "GetReceivedEmail", "ListReceivedEmailAttachments", "DownloadReceivedAttachment"];
973
973
 
974
974
  /**
975
975
  * Every named Resend misbehaviour our consumer branches on, switched on with
@@ -1137,6 +1137,9 @@ declare class ResendAPI implements FetchAPI$1 {
1137
1137
  private send;
1138
1138
  private create;
1139
1139
  private getEmail;
1140
+ private emailPage;
1141
+ private listEmails;
1142
+ private listReceivedEmails;
1140
1143
  /** Store an inbound email and build the `email.received` event for it. */
1141
1144
  receive(input: InboundInput, origin: string): {
1142
1145
  email: ReceivedEmail;
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  forwardToInbox,
10
10
  operationIds,
11
11
  supportedOperationIds
12
- } from "./chunk-AVLXDCB3.js";
12
+ } from "./chunk-VMXQ2LLE.js";
13
13
  export {
14
14
  DOWNLOAD_URL_TTL_MS,
15
15
  RESEND_NAMESPACE,
package/dist/server.d.ts CHANGED
@@ -1504,6 +1504,9 @@ declare class ResendAPI implements FetchAPI {
1504
1504
  private send;
1505
1505
  private create;
1506
1506
  private getEmail;
1507
+ private emailPage;
1508
+ private listEmails;
1509
+ private listReceivedEmails;
1507
1510
  /** Store an inbound email and build the `email.received` event for it. */
1508
1511
  receive(input: InboundInput, origin: string): {
1509
1512
  email: ReceivedEmail;
package/dist/server.js CHANGED
@@ -2,8 +2,8 @@ import {
2
2
  DEFAULT_PORT,
3
3
  createServer,
4
4
  serveTarget
5
- } from "./chunk-K5P64BHJ.js";
6
- import "./chunk-AVLXDCB3.js";
5
+ } from "./chunk-X3KXLVOT.js";
6
+ import "./chunk-VMXQ2LLE.js";
7
7
  export {
8
8
  DEFAULT_PORT,
9
9
  createServer,
package/openapi.yaml CHANGED
@@ -19,6 +19,70 @@ security:
19
19
  - bearerAuth: []
20
20
  paths:
21
21
  /emails:
22
+ get:
23
+ operationId: ListEmails
24
+ x-mockingbird:
25
+ supported: true
26
+ parity:
27
+ enabled: true
28
+ safe: true
29
+ parameters:
30
+ - name: limit
31
+ in: query
32
+ schema:
33
+ type: integer
34
+ minimum: 1
35
+ maximum: 100
36
+ - name: after
37
+ in: query
38
+ schema:
39
+ type: string
40
+ - name: before
41
+ in: query
42
+ schema:
43
+ type: string
44
+ responses:
45
+ "200":
46
+ description: Newest-first email metadata
47
+ content:
48
+ application/json:
49
+ schema:
50
+ type: object
51
+ required: [object, has_more, data]
52
+ properties:
53
+ object:
54
+ type: string
55
+ enum: [list]
56
+ has_more:
57
+ type: boolean
58
+ data:
59
+ type: array
60
+ items:
61
+ $ref: "#/components/schemas/SentEmailMetadata"
62
+ "401":
63
+ description: Request rejected
64
+ content:
65
+ application/json:
66
+ schema:
67
+ $ref: "#/components/schemas/Error"
68
+ "422":
69
+ description: Request rejected
70
+ content:
71
+ application/json:
72
+ schema:
73
+ $ref: "#/components/schemas/Error"
74
+ "429":
75
+ description: Request rejected
76
+ content:
77
+ application/json:
78
+ schema:
79
+ $ref: "#/components/schemas/Error"
80
+ "500":
81
+ description: Request rejected
82
+ content:
83
+ application/json:
84
+ schema:
85
+ $ref: "#/components/schemas/Error"
22
86
  post:
23
87
  operationId: SendEmail
24
88
  x-mockingbird:
@@ -115,6 +179,71 @@ paths:
115
179
  application/json:
116
180
  schema:
117
181
  $ref: "#/components/schemas/Error"
182
+ /emails/receiving:
183
+ get:
184
+ operationId: ListReceivedEmails
185
+ x-mockingbird:
186
+ supported: true
187
+ parity:
188
+ enabled: true
189
+ safe: true
190
+ parameters:
191
+ - name: limit
192
+ in: query
193
+ schema:
194
+ type: integer
195
+ minimum: 1
196
+ maximum: 100
197
+ - name: after
198
+ in: query
199
+ schema:
200
+ type: string
201
+ - name: before
202
+ in: query
203
+ schema:
204
+ type: string
205
+ responses:
206
+ "200":
207
+ description: Newest-first email metadata
208
+ content:
209
+ application/json:
210
+ schema:
211
+ type: object
212
+ required: [object, has_more, data]
213
+ properties:
214
+ object:
215
+ type: string
216
+ enum: [list]
217
+ has_more:
218
+ type: boolean
219
+ data:
220
+ type: array
221
+ items:
222
+ $ref: "#/components/schemas/ReceivedEmailMetadata"
223
+ "401":
224
+ description: Request rejected
225
+ content:
226
+ application/json:
227
+ schema:
228
+ $ref: "#/components/schemas/Error"
229
+ "422":
230
+ description: Request rejected
231
+ content:
232
+ application/json:
233
+ schema:
234
+ $ref: "#/components/schemas/Error"
235
+ "429":
236
+ description: Request rejected
237
+ content:
238
+ application/json:
239
+ schema:
240
+ $ref: "#/components/schemas/Error"
241
+ "500":
242
+ description: Request rejected
243
+ content:
244
+ application/json:
245
+ schema:
246
+ $ref: "#/components/schemas/Error"
118
247
  /emails/receiving/{email_id}:
119
248
  parameters:
120
249
  - $ref: "#/components/parameters/ReceivedEmailId"
@@ -331,6 +460,109 @@ components:
331
460
  inline_content_id:
332
461
  type: string
333
462
  maxLength: 100
463
+ SentEmailMetadata:
464
+ type: object
465
+ required: [id, to, from, created_at, subject, bcc, cc, reply_to, message_id, last_event, scheduled_at]
466
+ properties:
467
+ id:
468
+ type: string
469
+ x-mockingbird-resource:
470
+ type: email
471
+ identity: true
472
+ x-mockingbird-volatile:
473
+ kind: id
474
+ to:
475
+ type: array
476
+ items:
477
+ type: string
478
+ from:
479
+ type: string
480
+ created_at:
481
+ type: string
482
+ x-mockingbird-volatile:
483
+ kind: timestamp
484
+ subject:
485
+ type: string
486
+ message_id:
487
+ type: string
488
+ x-mockingbird-volatile:
489
+ kind: id
490
+ bcc:
491
+ type: ["array", "null"]
492
+ items:
493
+ type: string
494
+ cc:
495
+ type: ["array", "null"]
496
+ items:
497
+ type: string
498
+ reply_to:
499
+ type: ["array", "null"]
500
+ items:
501
+ type: string
502
+ last_event:
503
+ type: string
504
+ enum: [delivered, scheduled]
505
+ scheduled_at:
506
+ type: ["string", "null"]
507
+ ReceivedEmailMetadata:
508
+ type: object
509
+ required: [id, to, from, created_at, subject, bcc, cc, reply_to, message_id, attachments]
510
+ properties:
511
+ id:
512
+ type: string
513
+ x-mockingbird-resource:
514
+ type: received_email
515
+ identity: true
516
+ x-mockingbird-volatile:
517
+ kind: id
518
+ to:
519
+ type: array
520
+ items:
521
+ type: string
522
+ from:
523
+ type: string
524
+ created_at:
525
+ type: string
526
+ x-mockingbird-volatile:
527
+ kind: timestamp
528
+ subject:
529
+ type: ["string", "null"]
530
+ message_id:
531
+ type: string
532
+ x-mockingbird-volatile:
533
+ kind: id
534
+ bcc:
535
+ type: array
536
+ items:
537
+ type: string
538
+ cc:
539
+ type: array
540
+ items:
541
+ type: string
542
+ reply_to:
543
+ type: array
544
+ items:
545
+ type: string
546
+ attachments:
547
+ type: array
548
+ items:
549
+ type: object
550
+ required: [id, filename, content_type, content_id, content_disposition, size]
551
+ properties:
552
+ id:
553
+ type: string
554
+ x-mockingbird-volatile:
555
+ kind: id
556
+ filename:
557
+ type: string
558
+ content_type:
559
+ type: string
560
+ content_id:
561
+ type: ["string", "null"]
562
+ content_disposition:
563
+ type: ["string", "null"]
564
+ size:
565
+ type: integer
334
566
  Email:
335
567
  type: object
336
568
  required: [object, id, to, from, created_at, subject, html, text, bcc, cc, reply_to, last_event]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-resend",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Stateful mock of the Resend email API (send with idempotency, received emails, attachments) with an outbox and Svix-signed inbound webhooks (Mockingbird service contract).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -98,7 +98,7 @@
98
98
  "pack:check": "bun ../../../scripts/pack-check.ts"
99
99
  },
100
100
  "dependencies": {
101
- "@crvouga/mockingbird-service-sqlite": "2.0.0",
101
+ "@crvouga/mockingbird-service-sqlite": "2.1.0",
102
102
  "hono": "4.11.9"
103
103
  },
104
104
  "devDependencies": {