@erdoai/cli 0.205.1 → 0.206.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 +11 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1679,8 +1679,9 @@ var ErdoClient = class {
|
|
|
1679
1679
|
`/v1/provider-lead-sources${qs ? `?${qs}` : ""}`
|
|
1680
1680
|
);
|
|
1681
1681
|
}
|
|
1682
|
-
listProviderLeadSourceForms(connectionId, accountId) {
|
|
1682
|
+
listProviderLeadSourceForms(connectionId, accountId, provider) {
|
|
1683
1683
|
const q = new URLSearchParams({ connection_id: connectionId, account_id: accountId });
|
|
1684
|
+
if (provider) q.set("provider", provider);
|
|
1684
1685
|
return this.request(
|
|
1685
1686
|
"GET",
|
|
1686
1687
|
`/v1/provider-lead-sources/forms?${q.toString()}`
|
|
@@ -8426,7 +8427,7 @@ voiceWidgetsCmd.command("realtime-model <widget> <model>").description("Choose t
|
|
|
8426
8427
|
}
|
|
8427
8428
|
});
|
|
8428
8429
|
var datasetsCmd = program.command("datasets").description("Datasets");
|
|
8429
|
-
var providerLeadSourcesCmd = program.command("provider-lead-sources").description("Manage lead sources: LinkedIn lead forms, Google Sheets, webhooks and imports written into a lead dataset");
|
|
8430
|
+
var providerLeadSourcesCmd = program.command("provider-lead-sources").description("Manage lead sources: LinkedIn and Meta lead forms, Google Sheets, webhooks and imports written into a lead dataset");
|
|
8430
8431
|
providerLeadSourcesCmd.command("list").description("List lead source declarations").option("--provider <provider>", "filter by ad platform provider").option("--account-id <id>", "filter by provider ad account id").action(async (opts) => {
|
|
8431
8432
|
try {
|
|
8432
8433
|
print(await new ErdoClient().listProviderLeadSources({ provider: opts.provider, account_id: opts.accountId }));
|
|
@@ -8434,16 +8435,16 @@ providerLeadSourcesCmd.command("list").description("List lead source declaration
|
|
|
8434
8435
|
fail(e);
|
|
8435
8436
|
}
|
|
8436
8437
|
});
|
|
8437
|
-
providerLeadSourcesCmd.command("forms").description("List
|
|
8438
|
+
providerLeadSourcesCmd.command("forms").description("List the lead forms a connected ad account can declare: LinkedIn Lead Gen Forms, or with --provider meta_ads the Instant Forms on the Pages a Meta ad account promotes").option("--provider <provider>", "linkedin_ads (default) or meta_ads").requiredOption("--connection-id <id>", "native integration id from erdo integrations status linkedin_ads_sync (or meta_ads) or GET /v1/integrations").requiredOption("--account-id <id>", "numeric ad account id (a Meta id with or without act_)").action(async (opts) => {
|
|
8438
8439
|
try {
|
|
8439
|
-
print(await new ErdoClient().listProviderLeadSourceForms(opts.connectionId, opts.accountId));
|
|
8440
|
+
print(await new ErdoClient().listProviderLeadSourceForms(opts.connectionId, opts.accountId, opts.provider));
|
|
8440
8441
|
} catch (e) {
|
|
8441
8442
|
fail(e);
|
|
8442
8443
|
}
|
|
8443
8444
|
});
|
|
8444
8445
|
providerLeadSourcesCmd.command("set").description(
|
|
8445
|
-
"Save a lead source from JSON or flags. A LinkedIn source names a connection, ad account and forms; a google_sheets, webhook or import source names itself and carries a column mapping (use --file). --dry-run previews what it would write and saves nothing."
|
|
8446
|
-
).option("-f, --file <path>", "one JSON declaration object; use - to read from stdin").option("--dataset <slug>", "lead dataset slug").option("--provider <provider>", "linkedin_ads, google_sheets, webhook or import", "linkedin_ads").option("--connection-id <id>", "native integration id from erdo integrations status linkedin_ads_sync or GET /v1/integrations").option("--account-id <id>", "numeric
|
|
8446
|
+
"Save a lead source from JSON or flags. A LinkedIn or Meta (meta_ads) source names a connection, ad account and forms; a google_sheets, webhook or import source names itself and carries a column mapping (use --file). --dry-run previews what it would write and saves nothing."
|
|
8447
|
+
).option("-f, --file <path>", "one JSON declaration object; use - to read from stdin").option("--dataset <slug>", "lead dataset slug").option("--provider <provider>", "linkedin_ads, meta_ads, google_sheets, webhook or import", "linkedin_ads").option("--connection-id <id>", "native integration id from erdo integrations status linkedin_ads_sync (or meta_ads) or GET /v1/integrations").option("--account-id <id>", "numeric ad account id (a Meta id with or without act_)").option("--form <id>", "LinkedIn lead gen form or Meta Instant Form id (repeatable)", collect, []).option("--name <name>", "a google_sheets, webhook or import source's name").option("--sheet-url <url>", "a google_sheets source's tab, as its address in the browser (open to anyone with the link)").option("--dry-run", "preview what the source would write; save nothing").option("--rotate-secret", "issue a webhook source a new secret").option("--disabled", "save the declaration disabled").option("--create-only", "refuse the save if a source with this name already exists").action(async (opts) => {
|
|
8447
8448
|
try {
|
|
8448
8449
|
let input;
|
|
8449
8450
|
if (opts.file) {
|
|
@@ -8467,18 +8468,18 @@ providerLeadSourcesCmd.command("set").description(
|
|
|
8467
8468
|
const provider = typeof input.provider === "string" ? input.provider.trim() : "";
|
|
8468
8469
|
if (!dataset) throw new Error("dataset must be a non-empty string");
|
|
8469
8470
|
if (!provider) throw new Error("provider must be a non-empty string");
|
|
8470
|
-
if (provider === "linkedin_ads") {
|
|
8471
|
+
if (provider === "linkedin_ads" || provider === "meta_ads") {
|
|
8471
8472
|
const connectionID = typeof input.connection_id === "string" ? input.connection_id.trim() : "";
|
|
8472
8473
|
const accountID = typeof input.account_id === "string" ? input.account_id.trim() : "";
|
|
8473
8474
|
const forms = Array.isArray(input.forms) ? input.forms.filter((form) => typeof form === "string" && form.trim().length > 0) : [];
|
|
8474
8475
|
if (!connectionID) throw new Error("connection_id must be a non-empty string");
|
|
8475
8476
|
if (!accountID) throw new Error("account_id must be a non-empty string");
|
|
8476
8477
|
if (forms.length === 0) throw new Error("forms must contain at least one form");
|
|
8477
|
-
print(await new ErdoClient().setProviderLeadSource({ ...input, dataset, provider
|
|
8478
|
+
print(await new ErdoClient().setProviderLeadSource({ ...input, dataset, provider, connection_id: connectionID, account_id: accountID, forms }));
|
|
8478
8479
|
return;
|
|
8479
8480
|
}
|
|
8480
8481
|
if (provider !== "google_sheets" && provider !== "webhook" && provider !== "import") {
|
|
8481
|
-
throw new Error("provider must be linkedin_ads, google_sheets, webhook or import");
|
|
8482
|
+
throw new Error("provider must be linkedin_ads, meta_ads, google_sheets, webhook or import");
|
|
8482
8483
|
}
|
|
8483
8484
|
const name = typeof input.name === "string" ? input.name.trim() : "";
|
|
8484
8485
|
if (!name) throw new Error("name must be a non-empty string");
|
|
@@ -8578,7 +8579,7 @@ providerLeadSourcesCmd.command("import <name> <file>").description(
|
|
|
8578
8579
|
fail(e);
|
|
8579
8580
|
}
|
|
8580
8581
|
});
|
|
8581
|
-
providerLeadSourcesCmd.command("delete").description("Delete a lead source, by --name or by --provider and --account-id. Leads already written stay").option("--name <name>", "a google_sheets, webhook or import source's name").option("--provider <provider>", "ad platform provider", "linkedin_ads").option("--account-id <id>", "numeric provider ad account id").option("--if-updated-at <time>", "delete only the source with this updated_at from list").action(async (opts) => {
|
|
8582
|
+
providerLeadSourcesCmd.command("delete").description("Delete a lead source, by --name or by --provider and --account-id. Leads already written stay").option("--name <name>", "a google_sheets, webhook or import source's name").option("--provider <provider>", "ad platform provider: linkedin_ads or meta_ads", "linkedin_ads").option("--account-id <id>", "numeric provider ad account id").option("--if-updated-at <time>", "delete only the source with this updated_at from list").action(async (opts) => {
|
|
8582
8583
|
try {
|
|
8583
8584
|
if (opts.name) {
|
|
8584
8585
|
print(await new ErdoClient().deleteProviderLeadSource({ name: opts.name, ifUpdatedAt: opts.ifUpdatedAt }));
|