@ainyc/canonry 1.32.0 → 1.34.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/assets/assets/index-BPuIj1DV.js +246 -0
- package/assets/assets/index-CxMuEW6I.css +1 -0
- package/assets/index.html +2 -2
- package/dist/{chunk-5Q6LISDM.js → chunk-4SRBJCNX.js} +710 -623
- package/dist/cli.js +23 -20
- package/dist/index.js +1 -1
- package/package.json +6 -6
- package/assets/assets/index-BuSiyI7z.js +0 -246
- package/assets/assets/index-r6biprHB.css +0 -1
package/dist/cli.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
setGoogleAuthConfig,
|
|
27
27
|
showFirstRunNotice,
|
|
28
28
|
trackEvent
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-4SRBJCNX.js";
|
|
30
30
|
|
|
31
31
|
// src/cli.ts
|
|
32
32
|
import { pathToFileURL } from "url";
|
|
@@ -1386,14 +1386,6 @@ async function gaConnect(project, opts) {
|
|
|
1386
1386
|
details: { project }
|
|
1387
1387
|
});
|
|
1388
1388
|
}
|
|
1389
|
-
if (!opts.keyFile && !opts.keyJson) {
|
|
1390
|
-
throw new CliError({
|
|
1391
|
-
code: "GA_KEY_REQUIRED",
|
|
1392
|
-
message: "Service account key is required (pass --key-file or --key-json)",
|
|
1393
|
-
displayMessage: "Error: --key-file or --key-json is required",
|
|
1394
|
-
details: { project }
|
|
1395
|
-
});
|
|
1396
|
-
}
|
|
1397
1389
|
const body = {
|
|
1398
1390
|
propertyId: opts.propertyId
|
|
1399
1391
|
};
|
|
@@ -1422,8 +1414,12 @@ async function gaConnect(project, opts) {
|
|
|
1422
1414
|
return;
|
|
1423
1415
|
}
|
|
1424
1416
|
console.log(`GA4 connected for project "${project}".`);
|
|
1425
|
-
console.log(` Property ID:
|
|
1426
|
-
|
|
1417
|
+
console.log(` Property ID: ${result.propertyId}`);
|
|
1418
|
+
if (result.authMethod === "service-account" && result.clientEmail) {
|
|
1419
|
+
console.log(` Auth: service account (${result.clientEmail})`);
|
|
1420
|
+
} else {
|
|
1421
|
+
console.log(` Auth: OAuth (canonry google connect --type ga4)`);
|
|
1422
|
+
}
|
|
1427
1423
|
}
|
|
1428
1424
|
async function gaDisconnect(project, format) {
|
|
1429
1425
|
const client = getClient3();
|
|
@@ -1443,15 +1439,22 @@ async function gaStatus(project, format) {
|
|
|
1443
1439
|
}
|
|
1444
1440
|
if (!result.connected) {
|
|
1445
1441
|
console.log(`No GA4 connection for project "${project}".`);
|
|
1446
|
-
console.log(
|
|
1442
|
+
console.log("Options:");
|
|
1443
|
+
console.log(" With service account: canonry ga connect <project> --property-id <id> --key-file <path>");
|
|
1444
|
+
console.log(" With OAuth: canonry google connect <project> --type ga4");
|
|
1445
|
+
console.log(" canonry ga connect <project> --property-id <id>");
|
|
1447
1446
|
return;
|
|
1448
1447
|
}
|
|
1449
1448
|
console.log(`GA4 for "${project}":
|
|
1450
1449
|
`);
|
|
1451
|
-
console.log(` Property ID:
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1450
|
+
console.log(` Property ID: ${result.propertyId}`);
|
|
1451
|
+
if (result.authMethod === "service-account") {
|
|
1452
|
+
console.log(` Auth: service account (${result.clientEmail})`);
|
|
1453
|
+
} else {
|
|
1454
|
+
console.log(` Auth: OAuth`);
|
|
1455
|
+
}
|
|
1456
|
+
console.log(` Last Synced: ${result.lastSyncedAt ?? "(never)"}`);
|
|
1457
|
+
console.log(` Connected: ${result.createdAt ?? "unknown"}`);
|
|
1455
1458
|
}
|
|
1456
1459
|
async function gaSync(project, opts) {
|
|
1457
1460
|
const client = getClient3();
|
|
@@ -1776,10 +1779,10 @@ Open this URL in your browser to authorize Google ${opts.type.toUpperCase()} acc
|
|
|
1776
1779
|
console.log("(Ensure this URI is listed in your Google Cloud Console OAuth client's authorized redirect URIs)\n");
|
|
1777
1780
|
}
|
|
1778
1781
|
try {
|
|
1779
|
-
const {
|
|
1782
|
+
const { spawn: spawn2 } = await import("child_process");
|
|
1780
1783
|
const platform = process.platform;
|
|
1781
|
-
const cmd = platform === "darwin" ? "open" : platform === "win32" ? "start" : "xdg-open";
|
|
1782
|
-
|
|
1784
|
+
const [cmd, ...extraArgs] = platform === "darwin" ? ["open", authUrl] : platform === "win32" ? ["cmd", "/c", "start", "", authUrl] : ["xdg-open", authUrl];
|
|
1785
|
+
spawn2(cmd, [...extraArgs], { detached: true, stdio: "ignore" }).unref();
|
|
1783
1786
|
console.log("(Browser opened automatically)");
|
|
1784
1787
|
} catch {
|
|
1785
1788
|
console.log("(Could not open browser automatically \u2014 please copy the URL above)");
|
|
@@ -4025,7 +4028,7 @@ async function showSchedule(project, format) {
|
|
|
4025
4028
|
async function enableSchedule(project, format) {
|
|
4026
4029
|
const client = getClient14();
|
|
4027
4030
|
const current = await client.getSchedule(project);
|
|
4028
|
-
const body = { timezone: current.timezone };
|
|
4031
|
+
const body = { timezone: current.timezone, enabled: true };
|
|
4029
4032
|
if (current.preset) body.preset = current.preset;
|
|
4030
4033
|
else body.cron = current.cronExpr;
|
|
4031
4034
|
if (current.providers.length) body.providers = current.providers;
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ainyc/canonry",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.34.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The ultimate open-source AEO monitoring tool - track how answer engines cite your domain",
|
|
6
6
|
"license": "FSL-1.1-ALv2",
|
|
@@ -55,18 +55,18 @@
|
|
|
55
55
|
"tsup": "^8.5.1",
|
|
56
56
|
"tsx": "^4.19.0",
|
|
57
57
|
"@ainyc/canonry-api-routes": "0.0.0",
|
|
58
|
-
"@ainyc/canonry-config": "0.0.0",
|
|
59
58
|
"@ainyc/canonry-contracts": "0.0.0",
|
|
60
|
-
"@ainyc/canonry-integration-google": "0.0.0",
|
|
61
59
|
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
62
60
|
"@ainyc/canonry-db": "0.0.0",
|
|
63
|
-
"@ainyc/canonry-
|
|
61
|
+
"@ainyc/canonry-integration-google": "0.0.0",
|
|
64
62
|
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
63
|
+
"@ainyc/canonry-config": "0.0.0",
|
|
65
64
|
"@ainyc/canonry-provider-claude": "0.0.0",
|
|
66
|
-
"@ainyc/canonry-provider-gemini": "0.0.0",
|
|
67
65
|
"@ainyc/canonry-provider-local": "0.0.0",
|
|
66
|
+
"@ainyc/canonry-provider-gemini": "0.0.0",
|
|
67
|
+
"@ainyc/canonry-provider-perplexity": "0.0.0",
|
|
68
68
|
"@ainyc/canonry-provider-openai": "0.0.0",
|
|
69
|
-
"@ainyc/canonry-provider-
|
|
69
|
+
"@ainyc/canonry-provider-cdp": "0.0.0"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "tsup && tsx build-web.ts",
|