@erdoai/cli 0.274.0 → 0.275.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/dist/index.js +19 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -922,6 +922,9 @@ var ErdoClient = class {
|
|
|
922
922
|
`/v1/received-emails${qs ? `?${qs}` : ""}`
|
|
923
923
|
);
|
|
924
924
|
}
|
|
925
|
+
sendTransactionalEmail(input) {
|
|
926
|
+
return this.request("POST", "/v1/transactional-emails", input, false);
|
|
927
|
+
}
|
|
925
928
|
// The audited outbound side of email. Listing omits bodies; get reads the
|
|
926
929
|
// exact stored message. The scalar filters use the GET mirror of the same
|
|
927
930
|
// service that backs MCP's erdo_list_emails.
|
|
@@ -7510,6 +7513,22 @@ emailCmd.command("received").description(
|
|
|
7510
7513
|
fail(e);
|
|
7511
7514
|
}
|
|
7512
7515
|
});
|
|
7516
|
+
emailCmd.command("send").description("Send one transactional email from the org's verified identity; requires an unscoped org API key").requiredOption("-f, --file <path>", "JSON message with to, subject, body blocks, idempotency_key and optional cc/bcc; use - for stdin").action(async (opts) => {
|
|
7517
|
+
try {
|
|
7518
|
+
const input = await readJSONInput(opts.file, "--file");
|
|
7519
|
+
for (const field of ["to", "subject", "idempotency_key"]) {
|
|
7520
|
+
if (typeof input[field] !== "string" || !input[field].trim()) {
|
|
7521
|
+
throw new Error(`${field} must be a non-empty string`);
|
|
7522
|
+
}
|
|
7523
|
+
}
|
|
7524
|
+
if (!Array.isArray(input.body) || input.body.length === 0) {
|
|
7525
|
+
throw new Error("body must be a non-empty array of blocks");
|
|
7526
|
+
}
|
|
7527
|
+
print(await new ErdoClient().sendTransactionalEmail(input));
|
|
7528
|
+
} catch (e) {
|
|
7529
|
+
fail(e);
|
|
7530
|
+
}
|
|
7531
|
+
});
|
|
7513
7532
|
var sentEmailsCmd = emailCmd.command("sent").description("Read the audited outbound email log and provider delivery evidence");
|
|
7514
7533
|
sentEmailsCmd.command("list").description("List sent email, newest first, including immutable delivered_at evidence").option("--to <email>", "only mail sent to this address").option("--since <timestamp>", "only mail created at or after this RFC 3339 timestamp").option("--search <text>", "case-insensitive subject substring").option("--limit <n>", "page size (default 25, max 200)").option("--offset <n>", "rows to skip").option("--json", "print the raw JSON result instead of a table").action(
|
|
7515
7534
|
async (opts) => {
|