@erdoai/cli 0.154.2 → 0.156.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 +31 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2009,6 +2009,9 @@ var ErdoClient = class {
|
|
|
2009
2009
|
if (audience) body.audience = audience;
|
|
2010
2010
|
return this.request("POST", "/v1/page-reviews", body);
|
|
2011
2011
|
}
|
|
2012
|
+
reviewAd(input) {
|
|
2013
|
+
return this.request("POST", "/v1/critic/reviews", input);
|
|
2014
|
+
}
|
|
2012
2015
|
getPageReview(id) {
|
|
2013
2016
|
return this.request("GET", `/v1/page-reviews/${encodeURIComponent(id)}`);
|
|
2014
2017
|
}
|
|
@@ -2297,7 +2300,8 @@ function formatIntegrationListRow(i) {
|
|
|
2297
2300
|
const provided = i.provided_by_organization_slug ? ` provided by ${i.provided_by_organization_slug}` : "";
|
|
2298
2301
|
const unreadable = i.identity_unreadable ? " identity unreadable" : "";
|
|
2299
2302
|
const unchecked = i.identity_unchecked ? " identity not checked" : "";
|
|
2300
|
-
|
|
2303
|
+
const connectorAccount = i.connector_account_id ? ` connector_account_id=${i.connector_account_id}` : "";
|
|
2304
|
+
return `${i.app} ${i.status} ${i.auth_type} ${i.name} ${i.id}${connectorAccount}${provided}${unreadable}${unchecked}`;
|
|
2301
2305
|
}
|
|
2302
2306
|
function identityNotes(rows) {
|
|
2303
2307
|
const notes = [];
|
|
@@ -5811,6 +5815,29 @@ reviewsCmd.command("decide <id>").description(
|
|
|
5811
5815
|
}
|
|
5812
5816
|
);
|
|
5813
5817
|
var pagesCmd = program.command("pages").description("Create and manage pages/artifacts");
|
|
5818
|
+
var criticCmd = program.command("critic").description("Review campaign creative");
|
|
5819
|
+
criticCmd.command("review").description("Review an ad creative request from a JSON file and print per-lens findings").requiredOption("-f, --file <path>", "JSON file containing the full critic review request envelope").option("--json", "print the complete raw JSON response").action(async (opts) => {
|
|
5820
|
+
try {
|
|
5821
|
+
const input = JSON.parse(readFileSync4(opts.file, "utf8"));
|
|
5822
|
+
const result = await new ErdoClient().reviewAd(input);
|
|
5823
|
+
if (opts.json) {
|
|
5824
|
+
print(result);
|
|
5825
|
+
return;
|
|
5826
|
+
}
|
|
5827
|
+
console.log(result.summary);
|
|
5828
|
+
for (const lens of result.lenses) {
|
|
5829
|
+
console.log(`
|
|
5830
|
+
${lens.lens_slug}: ${lens.summary}`);
|
|
5831
|
+
for (const finding of lens.findings) {
|
|
5832
|
+
console.log(` [${finding.severity}] ${finding.issue}`);
|
|
5833
|
+
console.log(` Evidence: ${finding.evidence}`);
|
|
5834
|
+
console.log(` Suggested rewrite: ${finding.suggested_rewrite}`);
|
|
5835
|
+
}
|
|
5836
|
+
}
|
|
5837
|
+
} catch (e) {
|
|
5838
|
+
fail(e);
|
|
5839
|
+
}
|
|
5840
|
+
});
|
|
5814
5841
|
function publicFlag(opts) {
|
|
5815
5842
|
if (opts.public) return true;
|
|
5816
5843
|
if (opts.private) return false;
|
|
@@ -7351,14 +7378,14 @@ providerLeadSourcesCmd.command("list").description("List LinkedIn lead form sour
|
|
|
7351
7378
|
fail(e);
|
|
7352
7379
|
}
|
|
7353
7380
|
});
|
|
7354
|
-
providerLeadSourcesCmd.command("forms").description("List LinkedIn lead forms available on a connected ad account").requiredOption("--connection-id <id>", "
|
|
7381
|
+
providerLeadSourcesCmd.command("forms").description("List LinkedIn lead forms available on a connected ad account").requiredOption("--connection-id <id>", "connector_account_id from erdo integrations status linkedin_ads or GET /v1/integrations").requiredOption("--account-id <id>", "numeric LinkedIn ad account id").action(async (opts) => {
|
|
7355
7382
|
try {
|
|
7356
7383
|
print(await new ErdoClient().listProviderLeadSourceForms(opts.connectionId, opts.accountId));
|
|
7357
7384
|
} catch (e) {
|
|
7358
7385
|
fail(e);
|
|
7359
7386
|
}
|
|
7360
7387
|
});
|
|
7361
|
-
providerLeadSourcesCmd.command("set").description("Replace a provider lead form source declaration from JSON or flags").option("-f, --file <path>", "one JSON declaration object; use - to read from stdin").option("--dataset <slug>", "lead dataset slug").option("--provider <provider>", "ad platform provider", "linkedin_ads").option("--connection-id <id>", "
|
|
7388
|
+
providerLeadSourcesCmd.command("set").description("Replace a provider lead form source declaration from JSON or flags").option("-f, --file <path>", "one JSON declaration object; use - to read from stdin").option("--dataset <slug>", "lead dataset slug").option("--provider <provider>", "ad platform provider", "linkedin_ads").option("--connection-id <id>", "connector_account_id from erdo integrations status linkedin_ads or GET /v1/integrations").option("--account-id <id>", "numeric LinkedIn ad account id").option("--form <id>", "LinkedIn lead gen form id (repeatable)", collect, []).option("--disabled", "save the declaration disabled").action(async (opts) => {
|
|
7362
7389
|
try {
|
|
7363
7390
|
let input;
|
|
7364
7391
|
if (opts.file) {
|
|
@@ -8991,7 +9018,7 @@ function printLead(lead) {
|
|
|
8991
9018
|
}
|
|
8992
9019
|
}
|
|
8993
9020
|
var integrationsCmd = program.command("integrations").description("Connect and inspect integrations");
|
|
8994
|
-
integrationsCmd.command("list").description("List connected integrations \u2014 app, status, auth type, name, then the connection's id (what --from-connection takes)").action(async () => {
|
|
9021
|
+
integrationsCmd.command("list").description("List connected integrations \u2014 app, status, auth type, name, then the connection's id (what --from-connection takes) and connector_account_id when available").action(async () => {
|
|
8995
9022
|
try {
|
|
8996
9023
|
const { integrations } = await new ErdoClient().listIntegrations();
|
|
8997
9024
|
for (const i of integrations) console.log(formatIntegrationListRow(i));
|