ezship 0.1.12 → 0.1.13

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/connections.mjs CHANGED
@@ -285,8 +285,8 @@ export function extractTarget(words) {
285
285
  /** @type {Record<string, keyof typeof target>} */
286
286
  const fields = { "--instance": "instance", "--site": "site", "--account": "account" };
287
287
  for (let i = 0; i < words.length; i++) {
288
- // `audit --site` is a result filter, not a Working Copy target.
289
- if (words[0] === "audit" && words[i] === "--site") {
288
+ // `audit --site` and `email list --site` are result filters, not a Working Copy target.
289
+ if ((words[0] === "audit" || words[0] === "email") && words[i] === "--site") {
290
290
  args.push(words[i], words[++i]);
291
291
  continue;
292
292
  }
Binary file
package/ez.mjs CHANGED
@@ -1019,7 +1019,7 @@ async function dev(creds, args, dir) {
1019
1019
  */
1020
1020
  function needsSite(cmd, args) {
1021
1021
  if (cmd === "site" && args[0] === "access") return true;
1022
- if (cmd === "audit" || cmd === "db" || cmd === "support") return false;
1022
+ if (cmd === "audit" || cmd === "db" || cmd === "support" || cmd === "email") return false;
1023
1023
  return !["instance", "builders", "builder", "users", "user", "site", "help", "asset"].includes(
1024
1024
  cmd,
1025
1025
  );
@@ -1187,7 +1187,7 @@ async function main() {
1187
1187
 
1188
1188
  if (!COMMAND_NAMES.includes(cmd)) {
1189
1189
  console.log(
1190
- "Usage: ez login|logout|logins|switch|adopt|whoami|sites|use|clone|init|dev|instance|site or ez help|status|pull|push|deploy|versions|check|preview|ls|cat|put|edit|delete|mv|config|builders|builder|users|user|audit|db|support",
1190
+ "Usage: ez login|logout|logins|switch|adopt|whoami|sites|use|clone|init|dev|instance|site or ez help|status|pull|push|deploy|versions|check|preview|ls|cat|put|edit|delete|mv|config|builders|builder|users|user|audit|db|support|email",
1191
1191
  );
1192
1192
  process.exitCode = 1;
1193
1193
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezship",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "ez, the ezship command line. The same files as @ezship/cli.",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
package/types.d.mts CHANGED
@@ -766,6 +766,47 @@ export type RenderRow = {
766
766
  createdAt: number;
767
767
  finishedAt: number | null;
768
768
  };
769
+ /**
770
+ * An Email (docs/adr/0149): `queued` until the runner hands it on, `sending` while it does; `sent` (the mail
771
+ * service accepted it) and `logged` (a Host whose transport is the log) are delivered; `failed` was refused or
772
+ * never delivered within a day; `uncertain` was handed on but its answer was lost, and is never retried;
773
+ * `dropped` was never sent, `reason` says why.
774
+ */
775
+ export type EmailStatus =
776
+ | "queued"
777
+ | "sending"
778
+ | "sent"
779
+ | "logged"
780
+ | "failed"
781
+ | "uncertain"
782
+ | "dropped";
783
+ /**
784
+ * One Email as Builders list it. `site` is the sending Site or `global` (a job); `sender` the entry, such as
785
+ * `functions/notify` or `jobs/digest`; `member` the recipient's MEMBER value when they are a Member.
786
+ */
787
+ export type EmailRow = {
788
+ id: string;
789
+ site: string;
790
+ preview: boolean;
791
+ sender: string;
792
+ member: string | null;
793
+ recipient: string;
794
+ subject: string;
795
+ status: EmailStatus;
796
+ reason: string | null;
797
+ attempts: number;
798
+ createdAt: number;
799
+ finishedAt: number | null;
800
+ };
801
+ /** One Email with what it said: the Markdown body, its button, and the message as rendered. */
802
+ export type EmailInfo = EmailRow & {
803
+ body: string;
804
+ button: { label: string; href: string } | null;
805
+ text: string;
806
+ html: string;
807
+ };
808
+ /** `listEmails`: newest first, at most `limit` (default 50, at most 200), since an epoch-ms time. */
809
+ export type EmailFilter = { site?: string; status?: EmailStatus; since?: number; limit?: number };
769
810
  /** What the Builder answers: errors (and warnings), or the Deployed Files with their manifest (empty for a check). */
770
811
  export type BuildResult =
771
812
  | { ok: false; diagnostics: Diagnostic[] }