@erdoai/cli 0.273.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 +40 -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.
|
|
@@ -1769,6 +1772,11 @@ var ErdoClient = class {
|
|
|
1769
1772
|
upsertDeclaration(input) {
|
|
1770
1773
|
return this.request("PUT", "/v1/declarations", input, false);
|
|
1771
1774
|
}
|
|
1775
|
+
listDeclarations(params = {}) {
|
|
1776
|
+
const query = new URLSearchParams();
|
|
1777
|
+
for (const [key, value] of Object.entries(params)) if (value !== void 0) query.set(key, String(value));
|
|
1778
|
+
return this.request("GET", `/v1/declarations${query.size ? `?${query}` : ""}`, void 0, false);
|
|
1779
|
+
}
|
|
1772
1780
|
importLeadSourceRows(input) {
|
|
1773
1781
|
return this.request("POST", "/v1/provider-lead-sources/import", input, false);
|
|
1774
1782
|
}
|
|
@@ -7505,6 +7513,22 @@ emailCmd.command("received").description(
|
|
|
7505
7513
|
fail(e);
|
|
7506
7514
|
}
|
|
7507
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
|
+
});
|
|
7508
7532
|
var sentEmailsCmd = emailCmd.command("sent").description("Read the audited outbound email log and provider delivery evidence");
|
|
7509
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(
|
|
7510
7534
|
async (opts) => {
|
|
@@ -11572,6 +11596,22 @@ pipelinesCmd.command("mark-handled <slug>").description("Record that failed exec
|
|
|
11572
11596
|
}
|
|
11573
11597
|
});
|
|
11574
11598
|
var declarationsCmd = program.command("declarations").description("Metric and other declarations an app commits for this organization");
|
|
11599
|
+
declarationsCmd.command("list").description("List declarations and their semantic resolution").option("--namespace <namespace>", "exact namespace").option("--kind <kind>", "exact kind").option("--key <key>", "exact key").option("--source <source>", "exact source").option("--table <table>", "exact table").option("--limit <number>", "page size").option("--offset <number>", "page offset").action(async (opts) => {
|
|
11600
|
+
try {
|
|
11601
|
+
if (Boolean(opts.source) !== Boolean(opts.table)) throw new Error("--source and --table must be set together");
|
|
11602
|
+
print(await new ErdoClient().listDeclarations({
|
|
11603
|
+
namespace: opts.namespace,
|
|
11604
|
+
kind: opts.kind,
|
|
11605
|
+
key: opts.key,
|
|
11606
|
+
source: opts.source,
|
|
11607
|
+
table: opts.table,
|
|
11608
|
+
limit: opts.limit ? Number(opts.limit) : void 0,
|
|
11609
|
+
offset: opts.offset ? Number(opts.offset) : void 0
|
|
11610
|
+
}));
|
|
11611
|
+
} catch (e) {
|
|
11612
|
+
fail(e);
|
|
11613
|
+
}
|
|
11614
|
+
});
|
|
11575
11615
|
declarationsCmd.command("upsert").description("Write one declaration. The same namespace, kind, key and scope update the existing row").requiredOption("--namespace <namespace>", "the owning app's namespace").requiredOption("--kind <kind>", "declaration kind, for example metric").requiredOption("--key <key>", "what is declared, for example spend").option("--meaning <meaning>", "the expression; leave empty with --adopt to take the connector template").option("--status <status>", "confirmed only after the owning app merged it through a reviewed pull request; anything else is a draft", "draft").option("--source <source>", "synced source the declaration covers (requires --table)").option("--table <table>", "synced table the declaration covers (requires --source)").option("--adopt", "copy the connector template for this kind, key, source and table").option("--reasoning <text>", "why").option("--confidence <level>", "confidence in a proposal").action(async (opts) => {
|
|
11576
11616
|
try {
|
|
11577
11617
|
if (Boolean(opts.source) !== Boolean(opts.table)) throw new Error("--source and --table must be set together");
|