@erdoai/cli 0.274.0 → 0.276.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 +27 -2
- 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) => {
|
|
@@ -11292,11 +11311,17 @@ ${notes.join("\n")}`);
|
|
|
11292
11311
|
fail(e);
|
|
11293
11312
|
}
|
|
11294
11313
|
});
|
|
11295
|
-
integrationsCmd.command("managed-access <integration-id> <owner_only|managed_organizations>").option("--managed-organization <id>", "Limit this operation to one managed organization").option("--
|
|
11296
|
-
"Lend an API key to managed organizations, or
|
|
11314
|
+
integrationsCmd.command("managed-access <integration-id> <owner_only|managed_organizations>").option("--managed-organization <id>", "Limit this operation to one managed organization").option("--managed-organization-slug <slug>", "Delegate to this actively managed organization").option("--account <id>", "Existing provider account to delegate; requires --account-type").option("--account-type <type>", "Provider segment type, e.g. account for Google Ads or ad_account for LinkedIn").option("--replace-current-account", "Consent to leaving a different current account and its campaigns behind").option("--ad-account <id>", "Legacy LinkedIn account assignment; use --account and --account-type for new calls").option("--client-integration <id>", "Use the managed organization's existing integration").option("--preserve-client-grant", "Assert the existing client's OAuth grant is independent of the manager and retain it on revoke").description(
|
|
11315
|
+
"Lend an API key to managed organizations, or delegate one OAuth account with --managed-organization-slug, --account and --account-type"
|
|
11297
11316
|
).action(async (integrationId, managedAccess, opts) => {
|
|
11298
11317
|
try {
|
|
11318
|
+
if (Boolean(opts.account) !== Boolean(opts.accountType)) throw new Error("--account and --account-type are required together");
|
|
11319
|
+
if (opts.account && opts.adAccount) throw new Error("Use --account or --ad-account, not both");
|
|
11320
|
+
if (opts.managedOrganization && opts.managedOrganizationSlug) throw new Error("Use --managed-organization-slug or --managed-organization, not both");
|
|
11299
11321
|
const res = await new ErdoClient().setIntegrationManagedAccess(integrationId, managedAccess, {
|
|
11322
|
+
managed_organization_slug: opts.managedOrganizationSlug,
|
|
11323
|
+
selected_segments: opts.account ? [{ type: opts.accountType, id: opts.account }] : void 0,
|
|
11324
|
+
replace_current_account: opts.replaceCurrentAccount,
|
|
11300
11325
|
managed_organization_id: opts.managedOrganization,
|
|
11301
11326
|
ad_account_id: opts.adAccount,
|
|
11302
11327
|
client_integration_id: opts.clientIntegration,
|