@erdoai/cli 0.136.0 → 0.137.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 +37 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -247,6 +247,13 @@ var ErdoClient = class {
|
|
|
247
247
|
this.orgPinned = Boolean(orgOverride || process.env.ERDO_ORG);
|
|
248
248
|
this.orgName = acct?.organizationName;
|
|
249
249
|
}
|
|
250
|
+
ensurePaidMediaConversionAction(input) {
|
|
251
|
+
return this.request(
|
|
252
|
+
"POST",
|
|
253
|
+
"/v1/paid-media/conversion-actions",
|
|
254
|
+
input
|
|
255
|
+
);
|
|
256
|
+
}
|
|
250
257
|
announceOrgOnce(method) {
|
|
251
258
|
if (announcedOrg) return;
|
|
252
259
|
if (method.toUpperCase() === "GET") return;
|
|
@@ -2599,6 +2606,36 @@ program.command("update").description("Update the CLI to the latest published ve
|
|
|
2599
2606
|
program.command(REFRESH_COMMAND, { hidden: true }).description("Internal: refresh the remembered latest published version").action(async () => {
|
|
2600
2607
|
await refreshVersionCache();
|
|
2601
2608
|
});
|
|
2609
|
+
var paidMedia = program.command("paid-media").description("Paid media setup and operations");
|
|
2610
|
+
paidMedia.command("conversion-actions").command("ensure").description("Find or approval-gate creation of an offline lead conversion action").requiredOption("--name <name>", "exact Google Ads conversion action name").option("--category <category>", "QUALIFIED_LEAD or SUBMIT_LEAD_FORM", "QUALIFIED_LEAD").option("--customer-id <id>", "Google Ads customer id (defaults to the selected account)").option("--json", "print the raw JSON result").action(async (opts) => {
|
|
2611
|
+
try {
|
|
2612
|
+
if (opts.category && opts.category !== "QUALIFIED_LEAD" && opts.category !== "SUBMIT_LEAD_FORM") {
|
|
2613
|
+
fail(new Error("--category must be QUALIFIED_LEAD or SUBMIT_LEAD_FORM"));
|
|
2614
|
+
}
|
|
2615
|
+
const body = {
|
|
2616
|
+
name: opts.name,
|
|
2617
|
+
type: "UPLOAD_CLICKS"
|
|
2618
|
+
};
|
|
2619
|
+
if (opts.category) body.category = opts.category;
|
|
2620
|
+
if (opts.customerId) body.customer_id = opts.customerId;
|
|
2621
|
+
const result = await new ErdoClient().ensurePaidMediaConversionAction(body);
|
|
2622
|
+
if (opts.json) {
|
|
2623
|
+
print(result);
|
|
2624
|
+
return;
|
|
2625
|
+
}
|
|
2626
|
+
console.log(`customer id: ${result.customer_id}`);
|
|
2627
|
+
console.log(`name: ${result.name}`);
|
|
2628
|
+
if (result.status === "ready") {
|
|
2629
|
+
console.log(`status: ready`);
|
|
2630
|
+
if (result.conversion_action_id) console.log(`conversion action id: ${result.conversion_action_id}`);
|
|
2631
|
+
} else {
|
|
2632
|
+
console.log(`status: pending approval`);
|
|
2633
|
+
console.log(`approval request id: ${result.approval_request_id}`);
|
|
2634
|
+
}
|
|
2635
|
+
} catch (e) {
|
|
2636
|
+
fail(e);
|
|
2637
|
+
}
|
|
2638
|
+
});
|
|
2602
2639
|
var org = program.command("org").description("Manage the active organization");
|
|
2603
2640
|
org.command("list").description("List your organizations (* = active)").action(async () => {
|
|
2604
2641
|
try {
|