@geekmidas/testkit 10.0.0-alpha.140 → 10.0.0-alpha.142

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/dist/mailbox.cjs CHANGED
@@ -54,6 +54,7 @@ async function email(id, raw) {
54
54
  subject: message.subject ?? "",
55
55
  text,
56
56
  html,
57
+ headers: message.headers,
57
58
  links,
58
59
  link: links[0],
59
60
  attachments: message.attachments
@@ -1 +1 @@
1
- {"version":3,"file":"mailbox.cjs","names":[],"sources":["../src/mailbox.ts"],"sourcesContent":["/**\n * The mail a test sent, read from Mailpit.\n *\n * Locally, mail goes over real SMTP to Mailpit — the same client, the same\n * message, only the host differs. A test reads what arrived through Mailpit's\n * HTTP API, so a magic link is signed in with by opening the email that was\n * actually sent rather than a token pulled from somewhere else.\n *\n * Mailpit has one inbox for everything, and transactions do not reach it, so a\n * test keeps to its own mail by address: a unique recipient per test, read by\n * `to:`, and cleared afterwards.\n */\n\nimport type { ReceivedAttachment } from '@geekmidas/emailkit/inbound';\n\n/** How long `last()` waits for mail that is still on its way. */\nconst DEFAULT_TIMEOUT = 5_000;\nconst POLL_INTERVAL = 50;\n\nexport interface MailboxOptions {\n\t/** Mailpit's HTTP address — what `gkm test` injects as `<ID>_INBOX_URL`. */\n\tinbox: string;\n\t/** The `fetch` to read it with. Defaults to the global one. */\n\tfetch?: typeof fetch;\n\t/** How long `last()` waits for mail to arrive. */\n\ttimeout?: number;\n}\n\n/** One email, as it arrived. */\nexport interface Email {\n\tid: string;\n\tfrom: string;\n\tto: string[];\n\tsubject: string;\n\ttext: string;\n\thtml: string;\n\t/** Every `http(s)` link in the email, in order. */\n\tlinks: string[];\n\t/** The first link — the one a sign-in or confirmation email is about. */\n\tlink: string | undefined;\n\t/**\n\t * Its files, read from the raw message by the parser an inbox's handler\n\t * uses — so what survives one survives the other.\n\t */\n\tattachments: ReceivedAttachment[];\n}\n\nexport interface Mailbox {\n\t/** The newest email to this address, waiting for one if none has arrived. */\n\tlast(): Promise<Email>;\n\t/** Every email to this address, newest first. */\n\tall(): Promise<Email[]>;\n\t/** Delete every email to this address. */\n\tclear(): Promise<void>;\n}\n\n/** A way to read the mail sent to one address. */\nexport function createMailbox(\n\toptions: MailboxOptions,\n): (address: string) => Mailbox {\n\tconst inbox = options.inbox.replace(/\\/$/, '');\n\tconst timeout = options.timeout ?? DEFAULT_TIMEOUT;\n\tconst get = (path: string, init?: RequestInit) =>\n\t\t(options.fetch ?? globalThis.fetch)(`${inbox}${path}`, init);\n\n\treturn (address) => {\n\t\tconst query = `?query=${encodeURIComponent(`to:\"${address}\"`)}`;\n\n\t\tconst all = async (): Promise<Email[]> => {\n\t\t\tconst found = await json<SearchResult>(\n\t\t\t\tawait get(`/api/v1/search${query}`),\n\t\t\t\tinbox,\n\t\t\t);\n\t\t\treturn Promise.all(\n\t\t\t\tfound.messages.map(async ({ ID }) => {\n\t\t\t\t\tconst response = await get(`/api/v1/message/${ID}/raw`);\n\t\t\t\t\tif (!response.ok) {\n\t\t\t\t\t\tthrow new InboxUnreachable(inbox, response.status);\n\t\t\t\t\t}\n\t\t\t\t\treturn email(ID, new Uint8Array(await response.arrayBuffer()));\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\n\t\treturn {\n\t\t\tall,\n\t\t\tasync last() {\n\t\t\t\tconst deadline = Date.now() + timeout;\n\t\t\t\tfor (;;) {\n\t\t\t\t\tconst [newest] = await all();\n\t\t\t\t\tif (newest) return newest;\n\t\t\t\t\tif (Date.now() >= deadline) throw new NoMail(address, timeout);\n\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL));\n\t\t\t\t}\n\t\t\t},\n\t\t\tasync clear() {\n\t\t\t\tconst response = await get(`/api/v1/search${query}`, {\n\t\t\t\t\tmethod: 'DELETE',\n\t\t\t\t});\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tthrow new InboxUnreachable(inbox, response.status);\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t};\n}\n\ninterface SearchResult {\n\tmessages: { ID: string }[];\n}\n\nasync function json<T>(response: Response, inbox: string): Promise<T> {\n\tif (!response.ok) throw new InboxUnreachable(inbox, response.status);\n\treturn (await response.json()) as T;\n}\n\n/** The message, through the one MIME parser everything that reads mail uses. */\nasync function email(id: string, raw: Uint8Array): Promise<Email> {\n\tconst { parseEmail } = await import('@geekmidas/emailkit/inbound');\n\tconst message = await parseEmail(raw);\n\tconst html = message.html ?? '';\n\tconst text = message.text ?? '';\n\tconst links = [\n\t\t...new Set(\n\t\t\t[\n\t\t\t\t...html.matchAll(/href=\"(https?:\\/\\/[^\"]+)\"/g),\n\t\t\t\t...text.matchAll(/(https?:\\/\\/[^\\s<>\"]+)/g),\n\t\t\t].map(([, url]) => decodeEntities(url!)),\n\t\t),\n\t];\n\n\treturn {\n\t\tid,\n\t\tfrom: message.from?.address ?? '',\n\t\tto: message.to.map(({ address }) => address),\n\t\tsubject: message.subject ?? '',\n\t\ttext,\n\t\thtml,\n\t\tlinks,\n\t\tlink: links[0],\n\t\tattachments: message.attachments,\n\t};\n}\n\n/** `&amp;` in an HTML attribute is `&` in the URL it names. */\nfunction decodeEntities(url: string): string {\n\treturn url.replaceAll('&amp;', '&');\n}\n\n/** No email to an address arrived in time. */\nexport class NoMail extends Error {\n\tconstructor(\n\t\treadonly address: string,\n\t\treadonly timeout: number,\n\t) {\n\t\tsuper(\n\t\t\t`No email to ${address} arrived within ${timeout}ms. Check that the ` +\n\t\t\t\t`code under test sends it, and to that address.`,\n\t\t);\n\t\tthis.name = 'NoMail';\n\t}\n}\n\n/** Mailpit did not answer. */\nexport class InboxUnreachable extends Error {\n\tconstructor(\n\t\treadonly inbox: string,\n\t\treadonly status: number,\n\t) {\n\t\tsuper(\n\t\t\t`Mailpit at ${inbox} answered ${status}. Is it running? \\`gkm test\\` ` +\n\t\t\t\t`starts it when the app declares an Email construct.`,\n\t\t);\n\t\tthis.name = 'InboxUnreachable';\n\t}\n}\n"],"mappings":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M;CACnE,OAAQ,MAAM,SAAS,KAAK;AAC7B;;AAGA,eAAe,MAAM,IAAY,KAAiC;CACjE,MAAM,EAAE,eAAe,MAAM,OAAO;CACpC,MAAM,UAAU,MAAM,WAAW,GAAG;CACpC,MAAM,OAAO,QAAQ,QAAQ;CAC7B,MAAM,OAAO,QAAQ,QAAQ;CAC7B,MAAM,QAAQ,CACb,GAAG,IAAI,IACN,CACC,GAAG,KAAK,SAAS,4BAA4B,GAC7C,GAAG,KAAK,SAAS,yBAAyB,CAC3C,CAAC,CAAC,KAAK,GAAG,SAAS,eAAe,GAAI,CAAC,CACxC,CACD;CAEA,OAAO;EACN;EACA,MAAM,QAAQ,MAAM,WAAW;EAC/B,IAAI,QAAQ,GAAG,KAAK,EAAE,cAAc,OAAO;EAC3C,SAAS,QAAQ,WAAW;EAC5B;EACA;EACA;EACA,MAAM,MAAM;EACZ,aAAa,QAAQ;CACtB;AACD;;AAGA,SAAS,eAAe,KAAqB;CAC5C,OAAO,IAAI,WAAW,SAAS,GAAG;AACnC;;AAGA,IAAa,SAAb,cAA4B,MAAM;CAEvB;CACA;CAFV,YACC,SACA,SACC;EACD,MACC,eAAe,QAAQ,kBAAkB,QAAQ,kEAElD;EANS,KAAA,UAAA;EACA,KAAA,UAAA;EAMT,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,mBAAb,cAAsC,MAAM;CAEjC;CACA;CAFV,YACC,OACA,QACC;EACD,MACC,cAAc,MAAM,YAAY,OAAO,kFAExC;EANS,KAAA,QAAA;EACA,KAAA,SAAA;EAMT,KAAK,OAAO;CACb;AACD"}
1
+ {"version":3,"file":"mailbox.cjs","names":[],"sources":["../src/mailbox.ts"],"sourcesContent":["/**\n * The mail a test sent, read from Mailpit.\n *\n * Locally, mail goes over real SMTP to Mailpit — the same client, the same\n * message, only the host differs. A test reads what arrived through Mailpit's\n * HTTP API, so a magic link is signed in with by opening the email that was\n * actually sent rather than a token pulled from somewhere else.\n *\n * Mailpit has one inbox for everything, and transactions do not reach it, so a\n * test keeps to its own mail by address: a unique recipient per test, read by\n * `to:`, and cleared afterwards.\n */\n\nimport type { ReceivedAttachment } from '@geekmidas/emailkit/inbound';\n\n/** How long `last()` waits for mail that is still on its way. */\nconst DEFAULT_TIMEOUT = 5_000;\nconst POLL_INTERVAL = 50;\n\nexport interface MailboxOptions {\n\t/** Mailpit's HTTP address — what `gkm test` injects as `<ID>_INBOX_URL`. */\n\tinbox: string;\n\t/** The `fetch` to read it with. Defaults to the global one. */\n\tfetch?: typeof fetch;\n\t/** How long `last()` waits for mail to arrive. */\n\ttimeout?: number;\n}\n\n/** One email, as it arrived. */\nexport interface Email {\n\tid: string;\n\tfrom: string;\n\tto: string[];\n\tsubject: string;\n\ttext: string;\n\thtml: string;\n\t/** Every header, by lower-case name, as the parser an inbox uses reads them. */\n\theaders: Readonly<Record<string, readonly string[]>>;\n\t/** Every `http(s)` link in the email, in order. */\n\tlinks: string[];\n\t/** The first link — the one a sign-in or confirmation email is about. */\n\tlink: string | undefined;\n\t/**\n\t * Its files, read from the raw message by the parser an inbox's handler\n\t * uses — so what survives one survives the other.\n\t */\n\tattachments: ReceivedAttachment[];\n}\n\nexport interface Mailbox {\n\t/** The newest email to this address, waiting for one if none has arrived. */\n\tlast(): Promise<Email>;\n\t/** Every email to this address, newest first. */\n\tall(): Promise<Email[]>;\n\t/** Delete every email to this address. */\n\tclear(): Promise<void>;\n}\n\n/** A way to read the mail sent to one address. */\nexport function createMailbox(\n\toptions: MailboxOptions,\n): (address: string) => Mailbox {\n\tconst inbox = options.inbox.replace(/\\/$/, '');\n\tconst timeout = options.timeout ?? DEFAULT_TIMEOUT;\n\tconst get = (path: string, init?: RequestInit) =>\n\t\t(options.fetch ?? globalThis.fetch)(`${inbox}${path}`, init);\n\n\treturn (address) => {\n\t\tconst query = `?query=${encodeURIComponent(`to:\"${address}\"`)}`;\n\n\t\tconst all = async (): Promise<Email[]> => {\n\t\t\tconst found = await json<SearchResult>(\n\t\t\t\tawait get(`/api/v1/search${query}`),\n\t\t\t\tinbox,\n\t\t\t);\n\t\t\treturn Promise.all(\n\t\t\t\tfound.messages.map(async ({ ID }) => {\n\t\t\t\t\tconst response = await get(`/api/v1/message/${ID}/raw`);\n\t\t\t\t\tif (!response.ok) {\n\t\t\t\t\t\tthrow new InboxUnreachable(inbox, response.status);\n\t\t\t\t\t}\n\t\t\t\t\treturn email(ID, new Uint8Array(await response.arrayBuffer()));\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\n\t\treturn {\n\t\t\tall,\n\t\t\tasync last() {\n\t\t\t\tconst deadline = Date.now() + timeout;\n\t\t\t\tfor (;;) {\n\t\t\t\t\tconst [newest] = await all();\n\t\t\t\t\tif (newest) return newest;\n\t\t\t\t\tif (Date.now() >= deadline) throw new NoMail(address, timeout);\n\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL));\n\t\t\t\t}\n\t\t\t},\n\t\t\tasync clear() {\n\t\t\t\tconst response = await get(`/api/v1/search${query}`, {\n\t\t\t\t\tmethod: 'DELETE',\n\t\t\t\t});\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tthrow new InboxUnreachable(inbox, response.status);\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t};\n}\n\ninterface SearchResult {\n\tmessages: { ID: string }[];\n}\n\nasync function json<T>(response: Response, inbox: string): Promise<T> {\n\tif (!response.ok) throw new InboxUnreachable(inbox, response.status);\n\treturn (await response.json()) as T;\n}\n\n/** The message, through the one MIME parser everything that reads mail uses. */\nasync function email(id: string, raw: Uint8Array): Promise<Email> {\n\tconst { parseEmail } = await import('@geekmidas/emailkit/inbound');\n\tconst message = await parseEmail(raw);\n\tconst html = message.html ?? '';\n\tconst text = message.text ?? '';\n\tconst links = [\n\t\t...new Set(\n\t\t\t[\n\t\t\t\t...html.matchAll(/href=\"(https?:\\/\\/[^\"]+)\"/g),\n\t\t\t\t...text.matchAll(/(https?:\\/\\/[^\\s<>\"]+)/g),\n\t\t\t].map(([, url]) => decodeEntities(url!)),\n\t\t),\n\t];\n\n\treturn {\n\t\tid,\n\t\tfrom: message.from?.address ?? '',\n\t\tto: message.to.map(({ address }) => address),\n\t\tsubject: message.subject ?? '',\n\t\ttext,\n\t\thtml,\n\t\theaders: message.headers,\n\t\tlinks,\n\t\tlink: links[0],\n\t\tattachments: message.attachments,\n\t};\n}\n\n/** `&amp;` in an HTML attribute is `&` in the URL it names. */\nfunction decodeEntities(url: string): string {\n\treturn url.replaceAll('&amp;', '&');\n}\n\n/** No email to an address arrived in time. */\nexport class NoMail extends Error {\n\tconstructor(\n\t\treadonly address: string,\n\t\treadonly timeout: number,\n\t) {\n\t\tsuper(\n\t\t\t`No email to ${address} arrived within ${timeout}ms. Check that the ` +\n\t\t\t\t`code under test sends it, and to that address.`,\n\t\t);\n\t\tthis.name = 'NoMail';\n\t}\n}\n\n/** Mailpit did not answer. */\nexport class InboxUnreachable extends Error {\n\tconstructor(\n\t\treadonly inbox: string,\n\t\treadonly status: number,\n\t) {\n\t\tsuper(\n\t\t\t`Mailpit at ${inbox} answered ${status}. Is it running? \\`gkm test\\` ` +\n\t\t\t\t`starts it when the app declares an Email construct.`,\n\t\t);\n\t\tthis.name = 'InboxUnreachable';\n\t}\n}\n"],"mappings":";;;AAgBA,MAAM,kBAAkB;AACxB,MAAM,gBAAgB;;AA0CtB,SAAgB,cACf,SAC+B;CAC/B,MAAM,QAAQ,QAAQ,MAAM,QAAQ,OAAO,EAAE;CAC7C,MAAM,UAAU,QAAQ,WAAW;CACnC,MAAM,OAAO,MAAc,UACzB,QAAQ,SAAS,WAAW,MAAA,CAAO,GAAG,QAAQ,QAAQ,IAAI;CAE5D,QAAQ,YAAY;EACnB,MAAM,QAAQ,UAAU,mBAAmB,OAAO,QAAQ,EAAE;EAE5D,MAAM,MAAM,YAA8B;GACzC,MAAM,QAAQ,MAAM,KACnB,MAAM,IAAI,iBAAiB,OAAO,GAClC,KACD;GACA,OAAO,QAAQ,IACd,MAAM,SAAS,IAA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AG,KAAK,EAAE,cAAc,OAAO;EAC3C,SAAS,QAAQ,WAAW;EAC5B;EACA;EACA,SAAS,QAAQ;EACjB;EACA,MAAM,MAAM;EACZ,aAAa,QAAQ;CACtB;AACD;;AAGA,SAAS,eAAe,KAAqB;CAC5C,OAAO,IAAI,WAAW,SAAS,GAAG;AACnC;;AAGA,IAAa,SAAb,cAA4B,MAAM;CAEvB;CACA;CAFV,YACC,SACA,SACC;EACD,MACC,eAAe,QAAQ,kBAAkB,QAAQ,kEAElD;EANS,KAAA,UAAA;EACA,KAAA,UAAA;EAMT,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,mBAAb,cAAsC,MAAM;CAEjC;CACA;CAFV,YACC,OACA,QACC;EACD,MACC,cAAc,MAAM,YAAY,OAAO,kFAExC;EANS,KAAA,QAAA;EACA,KAAA,SAAA;EAMT,KAAK,OAAO;CACb;AACD"}
@@ -16,6 +16,8 @@ export interface Email {
16
16
  subject: string;
17
17
  text: string;
18
18
  html: string;
19
+ /** Every header, by lower-case name, as the parser an inbox uses reads them. */
20
+ headers: Readonly<Record<string, readonly string[]>>;
19
21
  /** Every `http(s)` link in the email, in order. */
20
22
  links: string[];
21
23
  /** The first link — the one a sign-in or confirmation email is about. */
@@ -1 +1 @@
1
- {"version":3,"file":"mailbox.d.cts","names":[],"sources":["../src/mailbox.ts"],"mappings":";;iBAmBiB;;EAEhB;;EAEA,eAAe;;EAEf;;;iBAIgB;EAChB;EACA;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;;;;EAKA,aAAa;;iBAGG;;EAEhB,QAAQ,QAAQ;;EAEhB,OAAO,QAAQ;;EAEf,SAAS;;;wBAIM,cACf,SAAS,kBACN,oBAAoB;;qBA2FX,eAAe;WAEjB;WACA;EAFV,YACU,iBACA;;;qBAWE,yBAAyB;WAE3B;WACA;EAFV,YACU,eACA"}
1
+ {"version":3,"file":"mailbox.d.cts","names":[],"sources":["../src/mailbox.ts"],"mappings":";;iBAmBiB;;EAEhB;;EAEA,eAAe;;EAEf;;;iBAIgB;EAChB;EACA;EACA;EACA;EACA;EACA;;EAEA,SAAS,SAAS;;EAElB;;EAEA;;;;;EAKA,aAAa;;iBAGG;;EAEhB,QAAQ,QAAQ;;EAEhB,OAAO,QAAQ;;EAEf,SAAS;;;wBAIM,cACf,SAAS,kBACN,oBAAoB;;qBA4FX,eAAe;WAEjB;WACA;EAFV,YACU,iBACA;;;qBAWE,yBAAyB;WAE3B;WACA;EAFV,YACU,eACA"}
@@ -16,6 +16,8 @@ export interface Email {
16
16
  subject: string;
17
17
  text: string;
18
18
  html: string;
19
+ /** Every header, by lower-case name, as the parser an inbox uses reads them. */
20
+ headers: Readonly<Record<string, readonly string[]>>;
19
21
  /** Every `http(s)` link in the email, in order. */
20
22
  links: string[];
21
23
  /** The first link — the one a sign-in or confirmation email is about. */
@@ -1 +1 @@
1
- {"version":3,"file":"mailbox.d.mts","names":[],"sources":["../src/mailbox.ts"],"mappings":";;iBAmBiB;;EAEhB;;EAEA,eAAe;;EAEf;;;iBAIgB;EAChB;EACA;EACA;EACA;EACA;EACA;;EAEA;;EAEA;;;;;EAKA,aAAa;;iBAGG;;EAEhB,QAAQ,QAAQ;;EAEhB,OAAO,QAAQ;;EAEf,SAAS;;;wBAIM,cACf,SAAS,kBACN,oBAAoB;;qBA2FX,eAAe;WAEjB;WACA;EAFV,YACU,iBACA;;;qBAWE,yBAAyB;WAE3B;WACA;EAFV,YACU,eACA"}
1
+ {"version":3,"file":"mailbox.d.mts","names":[],"sources":["../src/mailbox.ts"],"mappings":";;iBAmBiB;;EAEhB;;EAEA,eAAe;;EAEf;;;iBAIgB;EAChB;EACA;EACA;EACA;EACA;EACA;;EAEA,SAAS,SAAS;;EAElB;;EAEA;;;;;EAKA,aAAa;;iBAGG;;EAEhB,QAAQ,QAAQ;;EAEhB,OAAO,QAAQ;;EAEf,SAAS;;;wBAIM,cACf,SAAS,kBACN,oBAAoB;;qBA4FX,eAAe;WAEjB;WACA;EAFV,YACU,iBACA;;;qBAWE,yBAAyB;WAE3B;WACA;EAFV,YACU,eACA"}
package/dist/mailbox.mjs CHANGED
@@ -53,6 +53,7 @@ async function email(id, raw) {
53
53
  subject: message.subject ?? "",
54
54
  text,
55
55
  html,
56
+ headers: message.headers,
56
57
  links,
57
58
  link: links[0],
58
59
  attachments: message.attachments
@@ -1 +1 @@
1
- {"version":3,"file":"mailbox.mjs","names":[],"sources":["../src/mailbox.ts"],"sourcesContent":["/**\n * The mail a test sent, read from Mailpit.\n *\n * Locally, mail goes over real SMTP to Mailpit — the same client, the same\n * message, only the host differs. A test reads what arrived through Mailpit's\n * HTTP API, so a magic link is signed in with by opening the email that was\n * actually sent rather than a token pulled from somewhere else.\n *\n * Mailpit has one inbox for everything, and transactions do not reach it, so a\n * test keeps to its own mail by address: a unique recipient per test, read by\n * `to:`, and cleared afterwards.\n */\n\nimport type { ReceivedAttachment } from '@geekmidas/emailkit/inbound';\n\n/** How long `last()` waits for mail that is still on its way. */\nconst DEFAULT_TIMEOUT = 5_000;\nconst POLL_INTERVAL = 50;\n\nexport interface MailboxOptions {\n\t/** Mailpit's HTTP address — what `gkm test` injects as `<ID>_INBOX_URL`. */\n\tinbox: string;\n\t/** The `fetch` to read it with. Defaults to the global one. */\n\tfetch?: typeof fetch;\n\t/** How long `last()` waits for mail to arrive. */\n\ttimeout?: number;\n}\n\n/** One email, as it arrived. */\nexport interface Email {\n\tid: string;\n\tfrom: string;\n\tto: string[];\n\tsubject: string;\n\ttext: string;\n\thtml: string;\n\t/** Every `http(s)` link in the email, in order. */\n\tlinks: string[];\n\t/** The first link — the one a sign-in or confirmation email is about. */\n\tlink: string | undefined;\n\t/**\n\t * Its files, read from the raw message by the parser an inbox's handler\n\t * uses — so what survives one survives the other.\n\t */\n\tattachments: ReceivedAttachment[];\n}\n\nexport interface Mailbox {\n\t/** The newest email to this address, waiting for one if none has arrived. */\n\tlast(): Promise<Email>;\n\t/** Every email to this address, newest first. */\n\tall(): Promise<Email[]>;\n\t/** Delete every email to this address. */\n\tclear(): Promise<void>;\n}\n\n/** A way to read the mail sent to one address. */\nexport function createMailbox(\n\toptions: MailboxOptions,\n): (address: string) => Mailbox {\n\tconst inbox = options.inbox.replace(/\\/$/, '');\n\tconst timeout = options.timeout ?? DEFAULT_TIMEOUT;\n\tconst get = (path: string, init?: RequestInit) =>\n\t\t(options.fetch ?? globalThis.fetch)(`${inbox}${path}`, init);\n\n\treturn (address) => {\n\t\tconst query = `?query=${encodeURIComponent(`to:\"${address}\"`)}`;\n\n\t\tconst all = async (): Promise<Email[]> => {\n\t\t\tconst found = await json<SearchResult>(\n\t\t\t\tawait get(`/api/v1/search${query}`),\n\t\t\t\tinbox,\n\t\t\t);\n\t\t\treturn Promise.all(\n\t\t\t\tfound.messages.map(async ({ ID }) => {\n\t\t\t\t\tconst response = await get(`/api/v1/message/${ID}/raw`);\n\t\t\t\t\tif (!response.ok) {\n\t\t\t\t\t\tthrow new InboxUnreachable(inbox, response.status);\n\t\t\t\t\t}\n\t\t\t\t\treturn email(ID, new Uint8Array(await response.arrayBuffer()));\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\n\t\treturn {\n\t\t\tall,\n\t\t\tasync last() {\n\t\t\t\tconst deadline = Date.now() + timeout;\n\t\t\t\tfor (;;) {\n\t\t\t\t\tconst [newest] = await all();\n\t\t\t\t\tif (newest) return newest;\n\t\t\t\t\tif (Date.now() >= deadline) throw new NoMail(address, timeout);\n\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL));\n\t\t\t\t}\n\t\t\t},\n\t\t\tasync clear() {\n\t\t\t\tconst response = await get(`/api/v1/search${query}`, {\n\t\t\t\t\tmethod: 'DELETE',\n\t\t\t\t});\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tthrow new InboxUnreachable(inbox, response.status);\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t};\n}\n\ninterface SearchResult {\n\tmessages: { ID: string }[];\n}\n\nasync function json<T>(response: Response, inbox: string): Promise<T> {\n\tif (!response.ok) throw new InboxUnreachable(inbox, response.status);\n\treturn (await response.json()) as T;\n}\n\n/** The message, through the one MIME parser everything that reads mail uses. */\nasync function email(id: string, raw: Uint8Array): Promise<Email> {\n\tconst { parseEmail } = await import('@geekmidas/emailkit/inbound');\n\tconst message = await parseEmail(raw);\n\tconst html = message.html ?? '';\n\tconst text = message.text ?? '';\n\tconst links = [\n\t\t...new Set(\n\t\t\t[\n\t\t\t\t...html.matchAll(/href=\"(https?:\\/\\/[^\"]+)\"/g),\n\t\t\t\t...text.matchAll(/(https?:\\/\\/[^\\s<>\"]+)/g),\n\t\t\t].map(([, url]) => decodeEntities(url!)),\n\t\t),\n\t];\n\n\treturn {\n\t\tid,\n\t\tfrom: message.from?.address ?? '',\n\t\tto: message.to.map(({ address }) => address),\n\t\tsubject: message.subject ?? '',\n\t\ttext,\n\t\thtml,\n\t\tlinks,\n\t\tlink: links[0],\n\t\tattachments: message.attachments,\n\t};\n}\n\n/** `&amp;` in an HTML attribute is `&` in the URL it names. */\nfunction decodeEntities(url: string): string {\n\treturn url.replaceAll('&amp;', '&');\n}\n\n/** No email to an address arrived in time. */\nexport class NoMail extends Error {\n\tconstructor(\n\t\treadonly address: string,\n\t\treadonly timeout: number,\n\t) {\n\t\tsuper(\n\t\t\t`No email to ${address} arrived within ${timeout}ms. Check that the ` +\n\t\t\t\t`code under test sends it, and to that address.`,\n\t\t);\n\t\tthis.name = 'NoMail';\n\t}\n}\n\n/** Mailpit did not answer. */\nexport class InboxUnreachable extends Error {\n\tconstructor(\n\t\treadonly inbox: string,\n\t\treadonly status: number,\n\t) {\n\t\tsuper(\n\t\t\t`Mailpit at ${inbox} answered ${status}. Is it running? \\`gkm test\\` ` +\n\t\t\t\t`starts it when the app declares an Email construct.`,\n\t\t);\n\t\tthis.name = 'InboxUnreachable';\n\t}\n}\n"],"mappings":";;AAgBA,MAAM,kBAAkB;AACxB,MAAM,gBAAgB;;AAwCtB,SAAgB,cACf,SAC+B;CAC/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MAAM,EAAE,eAAe,MAAM,OAAO;CACpC,MAAM,UAAU,MAAM,WAAW,GAAG;CACpC,MAAM,OAAO,QAAQ,QAAQ;CAC7B,MAAM,OAAO,QAAQ,QAAQ;CAC7B,MAAM,QAAQ,CACb,GAAG,IAAI,IACN,CACC,GAAG,KAAK,SAAS,4BAA4B,GAC7C,GAAG,KAAK,SAAS,yBAAyB,CAC3C,CAAC,CAAC,KAAK,GAAG,SAAS,eAAe,GAAI,CAAC,CACxC,CACD;CAEA,OAAO;EACN;EACA,MAAM,QAAQ,MAAM,WAAW;EAC/B,IAAI,QAAQ,GAAG,KAAK,EAAE,cAAc,OAAO;EAC3C,SAAS,QAAQ,WAAW;EAC5B;EACA;EACA;EACA,MAAM,MAAM;EACZ,aAAa,QAAQ;CACtB;AACD;;AAGA,SAAS,eAAe,KAAqB;CAC5C,OAAO,IAAI,WAAW,SAAS,GAAG;AACnC;;AAGA,IAAa,SAAb,cAA4B,MAAM;CAEvB;CACA;CAFV,YACC,SACA,SACC;EACD,MACC,eAAe,QAAQ,kBAAkB,QAAQ,kEAElD;EANS,KAAA,UAAA;EACA,KAAA,UAAA;EAMT,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,mBAAb,cAAsC,MAAM;CAEjC;CACA;CAFV,YACC,OACA,QACC;EACD,MACC,cAAc,MAAM,YAAY,OAAO,kFAExC;EANS,KAAA,QAAA;EACA,KAAA,SAAA;EAMT,KAAK,OAAO;CACb;AACD"}
1
+ {"version":3,"file":"mailbox.mjs","names":[],"sources":["../src/mailbox.ts"],"sourcesContent":["/**\n * The mail a test sent, read from Mailpit.\n *\n * Locally, mail goes over real SMTP to Mailpit — the same client, the same\n * message, only the host differs. A test reads what arrived through Mailpit's\n * HTTP API, so a magic link is signed in with by opening the email that was\n * actually sent rather than a token pulled from somewhere else.\n *\n * Mailpit has one inbox for everything, and transactions do not reach it, so a\n * test keeps to its own mail by address: a unique recipient per test, read by\n * `to:`, and cleared afterwards.\n */\n\nimport type { ReceivedAttachment } from '@geekmidas/emailkit/inbound';\n\n/** How long `last()` waits for mail that is still on its way. */\nconst DEFAULT_TIMEOUT = 5_000;\nconst POLL_INTERVAL = 50;\n\nexport interface MailboxOptions {\n\t/** Mailpit's HTTP address — what `gkm test` injects as `<ID>_INBOX_URL`. */\n\tinbox: string;\n\t/** The `fetch` to read it with. Defaults to the global one. */\n\tfetch?: typeof fetch;\n\t/** How long `last()` waits for mail to arrive. */\n\ttimeout?: number;\n}\n\n/** One email, as it arrived. */\nexport interface Email {\n\tid: string;\n\tfrom: string;\n\tto: string[];\n\tsubject: string;\n\ttext: string;\n\thtml: string;\n\t/** Every header, by lower-case name, as the parser an inbox uses reads them. */\n\theaders: Readonly<Record<string, readonly string[]>>;\n\t/** Every `http(s)` link in the email, in order. */\n\tlinks: string[];\n\t/** The first link — the one a sign-in or confirmation email is about. */\n\tlink: string | undefined;\n\t/**\n\t * Its files, read from the raw message by the parser an inbox's handler\n\t * uses — so what survives one survives the other.\n\t */\n\tattachments: ReceivedAttachment[];\n}\n\nexport interface Mailbox {\n\t/** The newest email to this address, waiting for one if none has arrived. */\n\tlast(): Promise<Email>;\n\t/** Every email to this address, newest first. */\n\tall(): Promise<Email[]>;\n\t/** Delete every email to this address. */\n\tclear(): Promise<void>;\n}\n\n/** A way to read the mail sent to one address. */\nexport function createMailbox(\n\toptions: MailboxOptions,\n): (address: string) => Mailbox {\n\tconst inbox = options.inbox.replace(/\\/$/, '');\n\tconst timeout = options.timeout ?? DEFAULT_TIMEOUT;\n\tconst get = (path: string, init?: RequestInit) =>\n\t\t(options.fetch ?? globalThis.fetch)(`${inbox}${path}`, init);\n\n\treturn (address) => {\n\t\tconst query = `?query=${encodeURIComponent(`to:\"${address}\"`)}`;\n\n\t\tconst all = async (): Promise<Email[]> => {\n\t\t\tconst found = await json<SearchResult>(\n\t\t\t\tawait get(`/api/v1/search${query}`),\n\t\t\t\tinbox,\n\t\t\t);\n\t\t\treturn Promise.all(\n\t\t\t\tfound.messages.map(async ({ ID }) => {\n\t\t\t\t\tconst response = await get(`/api/v1/message/${ID}/raw`);\n\t\t\t\t\tif (!response.ok) {\n\t\t\t\t\t\tthrow new InboxUnreachable(inbox, response.status);\n\t\t\t\t\t}\n\t\t\t\t\treturn email(ID, new Uint8Array(await response.arrayBuffer()));\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\n\t\treturn {\n\t\t\tall,\n\t\t\tasync last() {\n\t\t\t\tconst deadline = Date.now() + timeout;\n\t\t\t\tfor (;;) {\n\t\t\t\t\tconst [newest] = await all();\n\t\t\t\t\tif (newest) return newest;\n\t\t\t\t\tif (Date.now() >= deadline) throw new NoMail(address, timeout);\n\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL));\n\t\t\t\t}\n\t\t\t},\n\t\t\tasync clear() {\n\t\t\t\tconst response = await get(`/api/v1/search${query}`, {\n\t\t\t\t\tmethod: 'DELETE',\n\t\t\t\t});\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tthrow new InboxUnreachable(inbox, response.status);\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t};\n}\n\ninterface SearchResult {\n\tmessages: { ID: string }[];\n}\n\nasync function json<T>(response: Response, inbox: string): Promise<T> {\n\tif (!response.ok) throw new InboxUnreachable(inbox, response.status);\n\treturn (await response.json()) as T;\n}\n\n/** The message, through the one MIME parser everything that reads mail uses. */\nasync function email(id: string, raw: Uint8Array): Promise<Email> {\n\tconst { parseEmail } = await import('@geekmidas/emailkit/inbound');\n\tconst message = await parseEmail(raw);\n\tconst html = message.html ?? '';\n\tconst text = message.text ?? '';\n\tconst links = [\n\t\t...new Set(\n\t\t\t[\n\t\t\t\t...html.matchAll(/href=\"(https?:\\/\\/[^\"]+)\"/g),\n\t\t\t\t...text.matchAll(/(https?:\\/\\/[^\\s<>\"]+)/g),\n\t\t\t].map(([, url]) => decodeEntities(url!)),\n\t\t),\n\t];\n\n\treturn {\n\t\tid,\n\t\tfrom: message.from?.address ?? '',\n\t\tto: message.to.map(({ address }) => address),\n\t\tsubject: message.subject ?? '',\n\t\ttext,\n\t\thtml,\n\t\theaders: message.headers,\n\t\tlinks,\n\t\tlink: links[0],\n\t\tattachments: message.attachments,\n\t};\n}\n\n/** `&amp;` in an HTML attribute is `&` in the URL it names. */\nfunction decodeEntities(url: string): string {\n\treturn url.replaceAll('&amp;', '&');\n}\n\n/** No email to an address arrived in time. */\nexport class NoMail extends Error {\n\tconstructor(\n\t\treadonly address: string,\n\t\treadonly timeout: number,\n\t) {\n\t\tsuper(\n\t\t\t`No email to ${address} arrived within ${timeout}ms. Check that the ` +\n\t\t\t\t`code under test sends it, and to that address.`,\n\t\t);\n\t\tthis.name = 'NoMail';\n\t}\n}\n\n/** Mailpit did not answer. */\nexport class InboxUnreachable extends Error {\n\tconstructor(\n\t\treadonly inbox: string,\n\t\treadonly status: number,\n\t) {\n\t\tsuper(\n\t\t\t`Mailpit at ${inbox} answered ${status}. Is it running? \\`gkm test\\` ` +\n\t\t\t\t`starts it when the app declares an Email construct.`,\n\t\t);\n\t\tthis.name = 'InboxUnreachable';\n\t}\n}\n"],"mappings":";;AAgBA,MAAM,kBAAkB;AACxB,MAAM,gBAAgB;;AA0CtB,SAAgB,cACf,SAC+B;CAC/B,MAAM,QAAQ,QAAQ,MAAM,QAAQ,OAAO,EAAE;CAC7C,MAAM,UAAU,QAAQ,WAAW;CACnC,MAAM,OAAO,MAAc,UACzB,QAAQ,SAAS,WAAW,MAAA,CAAO,GAAG,QAAQ,QAAQ,IAAI;CAE5D,QAAQ,YAAY;EACnB,MAAM,QAAQ,UAAU,mBAAmB,OAAO,QAAQ,EAAE;EAE5D,MAAM,MAAM,YAA8B;GACzC,MAAM,QAAQ,MAAM,KACnB,MAAM,IAAI,iBAAiB,OAAO,GAClC,KACD;GACA,OAAO,QAAQ,IACd,MAAM,SAAS,IAAI,OAAO,EAAE,SAAS;IACpC,MAAM,WAAW,MAAM,IAAI,mBAAmB,GAAG,KAAK;IACtD,IAA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Q;EACjB;EACA,MAAM,MAAM;EACZ,aAAa,QAAQ;CACtB;AACD;;AAGA,SAAS,eAAe,KAAqB;CAC5C,OAAO,IAAI,WAAW,SAAS,GAAG;AACnC;;AAGA,IAAa,SAAb,cAA4B,MAAM;CAEvB;CACA;CAFV,YACC,SACA,SACC;EACD,MACC,eAAe,QAAQ,kBAAkB,QAAQ,kEAElD;EANS,KAAA,UAAA;EACA,KAAA,UAAA;EAMT,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,mBAAb,cAAsC,MAAM;CAEjC;CACA;CAFV,YACC,OACA,QACC;EACD,MACC,cAAc,MAAM,YAAY,OAAO,kFAExC;EANS,KAAA,QAAA;EACA,KAAA,SAAA;EAMT,KAAK,OAAO;CACb;AACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/testkit",
3
- "version": "10.0.0-alpha.140",
3
+ "version": "10.0.0-alpha.142",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -161,18 +161,18 @@
161
161
  "dependencies": {
162
162
  "@faker-js/faker": "~10.6.0",
163
163
  "tough-cookie": "~6.0.2",
164
- "@geekmidas/envkit": "^10.0.0-alpha.140",
165
- "@geekmidas/logger": "^10.0.0-alpha.140",
166
- "@geekmidas/services": "^10.0.0-alpha.140"
164
+ "@geekmidas/envkit": "^10.0.0-alpha.142",
165
+ "@geekmidas/logger": "^10.0.0-alpha.142",
166
+ "@geekmidas/services": "^10.0.0-alpha.142"
167
167
  },
168
168
  "devDependencies": {
169
169
  "@better-auth/test-utils": "~1.7.6",
170
170
  "@types/pg": "~8.23.1",
171
171
  "better-auth": "~1.7.6",
172
- "@geekmidas/envkit": "^10.0.0-alpha.140",
173
- "@geekmidas/logger": "^10.0.0-alpha.140",
174
- "@geekmidas/services": "^10.0.0-alpha.140",
175
- "@geekmidas/emailkit": "^10.0.0-alpha.140"
172
+ "@geekmidas/envkit": "^10.0.0-alpha.142",
173
+ "@geekmidas/logger": "^10.0.0-alpha.142",
174
+ "@geekmidas/services": "^10.0.0-alpha.142",
175
+ "@geekmidas/emailkit": "^10.0.0-alpha.142"
176
176
  },
177
177
  "repository": {
178
178
  "type": "git",
@@ -191,7 +191,7 @@
191
191
  "vitest": "~5.0.2",
192
192
  "@types/aws-lambda": ">=8.10.163",
193
193
  "better-auth": ">=1.7.5",
194
- "@geekmidas/emailkit": "^10.0.0-alpha.140"
194
+ "@geekmidas/emailkit": "^10.0.0-alpha.142"
195
195
  },
196
196
  "peerDependenciesMeta": {
197
197
  "kysely": {