@erdoai/cli 0.199.0 → 0.199.2
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 +28 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3196,13 +3196,21 @@ paidMedia.command("audiences").description("Read live audience lists, eligibilit
|
|
|
3196
3196
|
fail(e);
|
|
3197
3197
|
}
|
|
3198
3198
|
});
|
|
3199
|
-
paidMedia.command("negative-coverage").description("Read live Google Ads negative keyword coverage. Does not add or remove keywords").option("--provider <provider>", "ad platform", "google_ads").option("--customer-id <id>", "Google Ads customer id (defaults to the selected account)").option("--campaign-id <id>", "one Search campaign; omit to read Search campaigns in the account").option(
|
|
3199
|
+
paidMedia.command("negative-coverage").description("Read live Google Ads negative keyword coverage. Does not add or remove keywords").option("--provider <provider>", "ad platform", "google_ads").option("--customer-id <id>", "Google Ads customer id (defaults to the selected account)").option("--campaign-id <id>", "one Search campaign; omit to read Search campaigns in the account").option(
|
|
3200
|
+
"--negative-plan <json|@file>",
|
|
3201
|
+
"compare one campaign against a plan: {classes:[{id,label,terms:[{text,match_type}]}],protected_queries:[...]} from the offer's industry skill"
|
|
3202
|
+
).option("--json", "print the raw JSON result, including unreadable scopes").action(async (opts) => {
|
|
3200
3203
|
try {
|
|
3201
|
-
const
|
|
3204
|
+
const input = {
|
|
3202
3205
|
provider: opts.provider,
|
|
3203
3206
|
customer_id: opts.customerId,
|
|
3204
3207
|
campaign_id: opts.campaignId
|
|
3205
|
-
}
|
|
3208
|
+
};
|
|
3209
|
+
if (opts.negativePlan !== void 0) {
|
|
3210
|
+
if (!opts.campaignId) throw new Error("--negative-plan compares one campaign; pass --campaign-id");
|
|
3211
|
+
input.negative_plan = parseNegativePlan(readMaybeFile(opts.negativePlan) ?? "");
|
|
3212
|
+
}
|
|
3213
|
+
const result = await new ErdoClient().auditPaidMediaNegativeCoverage(input);
|
|
3206
3214
|
if (opts.json) {
|
|
3207
3215
|
print(result);
|
|
3208
3216
|
return;
|
|
@@ -3259,6 +3267,18 @@ paidMediaCampaigns.command("list").description("List the organization's owned Go
|
|
|
3259
3267
|
fail(e);
|
|
3260
3268
|
}
|
|
3261
3269
|
});
|
|
3270
|
+
function parseNegativePlan(raw) {
|
|
3271
|
+
let parsed;
|
|
3272
|
+
try {
|
|
3273
|
+
parsed = JSON.parse(raw);
|
|
3274
|
+
} catch {
|
|
3275
|
+
throw new Error("--negative-plan must be JSON or @file containing JSON");
|
|
3276
|
+
}
|
|
3277
|
+
if (!parsed || typeof parsed !== "object" || !Array.isArray(parsed.classes)) {
|
|
3278
|
+
throw new Error("--negative-plan must be an object with a classes array");
|
|
3279
|
+
}
|
|
3280
|
+
return parsed;
|
|
3281
|
+
}
|
|
3262
3282
|
function parsePaidMediaBool(value, name) {
|
|
3263
3283
|
if (value === "true") return true;
|
|
3264
3284
|
if (value === "false") return false;
|
|
@@ -3347,16 +3367,16 @@ paidMediaCampaigns.command("conversion-goals <campaignId>").description("Set a c
|
|
|
3347
3367
|
fail(e);
|
|
3348
3368
|
}
|
|
3349
3369
|
});
|
|
3350
|
-
paidMedia.command("conversion-actions").command("ensure").description("Find or approval-gate creation of an offline
|
|
3370
|
+
paidMedia.command("conversion-actions").command("ensure").description("Find or approval-gate creation of an offline conversion upload action").requiredOption("--name <name>", "exact Google Ads conversion action name").option(
|
|
3371
|
+
"--category <category>",
|
|
3372
|
+
"Google Ads conversion category for the outcome, e.g. PURCHASE, SIGNUP, SUBSCRIBE_PAID, SUBMIT_LEAD_FORM or QUALIFIED_LEAD (server default QUALIFIED_LEAD)"
|
|
3373
|
+
).option("--customer-id <id>", "Google Ads customer id (defaults to the selected account)").option("--json", "print the raw JSON result").action(async (opts) => {
|
|
3351
3374
|
try {
|
|
3352
|
-
if (opts.category && opts.category !== "QUALIFIED_LEAD" && opts.category !== "SUBMIT_LEAD_FORM") {
|
|
3353
|
-
fail(new Error("--category must be QUALIFIED_LEAD or SUBMIT_LEAD_FORM"));
|
|
3354
|
-
}
|
|
3355
3375
|
const body = {
|
|
3356
3376
|
name: opts.name,
|
|
3357
3377
|
type: "UPLOAD_CLICKS"
|
|
3358
3378
|
};
|
|
3359
|
-
if (opts.category) body.category = opts.category;
|
|
3379
|
+
if (opts.category) body.category = opts.category.trim().toUpperCase();
|
|
3360
3380
|
if (opts.customerId) body.customer_id = opts.customerId;
|
|
3361
3381
|
const result = await new ErdoClient().ensurePaidMediaConversionAction(body);
|
|
3362
3382
|
if (opts.json) {
|