@erdoai/cli 0.29.0 → 0.30.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 +43 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -696,6 +696,14 @@ var ErdoClient = class {
|
|
|
696
696
|
deployPage(input) {
|
|
697
697
|
return this.request("POST", "/v1/pages", input);
|
|
698
698
|
}
|
|
699
|
+
// Start a review of external page URLs with the real landing critic; returns a
|
|
700
|
+
// review id immediately (poll getPageReview for the typed findings).
|
|
701
|
+
reviewPages(urls) {
|
|
702
|
+
return this.request("POST", "/v1/page-reviews", { urls });
|
|
703
|
+
}
|
|
704
|
+
getPageReview(id) {
|
|
705
|
+
return this.request("GET", `/v1/page-reviews/${encodeURIComponent(id)}`);
|
|
706
|
+
}
|
|
699
707
|
updatePage(pageID, input) {
|
|
700
708
|
return this.request("PUT", `/v1/pages/${encodeURIComponent(pageID)}`, input);
|
|
701
709
|
}
|
|
@@ -2241,6 +2249,41 @@ pagesCmd.command("get <id>").description("Show an artifact").action(async (id) =
|
|
|
2241
2249
|
fail(e);
|
|
2242
2250
|
}
|
|
2243
2251
|
});
|
|
2252
|
+
pagesCmd.command("review <url...>").description(
|
|
2253
|
+
"Review external landing page URLs with Erdo's real conversion critic \u2014 typed defects (severity, issue, why it costs conversions, evidence, fix) plus strengths, judged from fold + full-page captures on desktop and mobile. Returns a review id; use --wait to poll and print the findings."
|
|
2254
|
+
).option("--wait", "poll until the review is ready, then print the findings").action(async (urls, opts) => {
|
|
2255
|
+
try {
|
|
2256
|
+
const client = new ErdoClient();
|
|
2257
|
+
const started = await client.reviewPages(urls);
|
|
2258
|
+
if (!opts.wait) {
|
|
2259
|
+
print(started);
|
|
2260
|
+
return;
|
|
2261
|
+
}
|
|
2262
|
+
const deadline = Date.now() + 15 * 60 * 1e3;
|
|
2263
|
+
process.stderr.write("reviewing");
|
|
2264
|
+
while (Date.now() < deadline) {
|
|
2265
|
+
const res = await client.getPageReview(started.id);
|
|
2266
|
+
if (res.status === "ready" || res.status === "failed") {
|
|
2267
|
+
process.stderr.write("\n");
|
|
2268
|
+
print(res);
|
|
2269
|
+
return;
|
|
2270
|
+
}
|
|
2271
|
+
process.stderr.write(".");
|
|
2272
|
+
await sleep2(5e3);
|
|
2273
|
+
}
|
|
2274
|
+
process.stderr.write("\n");
|
|
2275
|
+
print(await client.getPageReview(started.id));
|
|
2276
|
+
} catch (e) {
|
|
2277
|
+
fail(e);
|
|
2278
|
+
}
|
|
2279
|
+
});
|
|
2280
|
+
pagesCmd.command("review-result <id>").description("Read a page review by id \u2014 its status and, once ready, the typed per-page findings").action(async (id) => {
|
|
2281
|
+
try {
|
|
2282
|
+
print(await new ErdoClient().getPageReview(id));
|
|
2283
|
+
} catch (e) {
|
|
2284
|
+
fail(e);
|
|
2285
|
+
}
|
|
2286
|
+
});
|
|
2244
2287
|
var datasetsCmd = program.command("datasets").description("Datasets");
|
|
2245
2288
|
datasetsCmd.command("list").description("List datasets").action(async () => {
|
|
2246
2289
|
try {
|