@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/dist/cli.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  setGoogleAuthConfig,
27
27
  showFirstRunNotice,
28
28
  trackEvent
29
- } from "./chunk-5Q6LISDM.js";
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: ${result.propertyId}`);
1426
- console.log(` Service Account: ${result.clientEmail}`);
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('Run "canonry ga connect <project> --property-id <id> --key-file <path>" to connect.');
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: ${result.propertyId}`);
1452
- console.log(` Service Account: ${result.clientEmail}`);
1453
- console.log(` Last Synced: ${result.lastSyncedAt ?? "(never)"}`);
1454
- console.log(` Connected: ${result.createdAt ?? "unknown"}`);
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 { exec } = await import("child_process");
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
- exec(`${cmd} "${authUrl}"`);
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
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createServer,
3
3
  loadConfig
4
- } from "./chunk-5Q6LISDM.js";
4
+ } from "./chunk-4SRBJCNX.js";
5
5
  export {
6
6
  createServer,
7
7
  loadConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainyc/canonry",
3
- "version": "1.32.0",
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-provider-cdp": "0.0.0",
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-perplexity": "0.0.0"
69
+ "@ainyc/canonry-provider-cdp": "0.0.0"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "tsup && tsx build-web.ts",