@ainyc/canonry 1.41.0 → 1.44.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/index.html CHANGED
@@ -12,8 +12,8 @@
12
12
  <link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
13
13
  <link rel="apple-touch-icon" href="./apple-touch-icon.png" />
14
14
  <title>Canonry</title>
15
- <script type="module" crossorigin src="./assets/index-iy29Cmx8.js"></script>
16
- <link rel="stylesheet" crossorigin href="./assets/index-Djm1st6N.css">
15
+ <script type="module" crossorigin src="./assets/index-BAzKj_9S.js"></script>
16
+ <link rel="stylesheet" crossorigin href="./assets/index--ev1Bjls.css">
17
17
  </head>
18
18
  <body>
19
19
  <div id="root"></div>
@@ -24,6 +24,7 @@ __export(schema_exports, {
24
24
  competitors: () => competitors,
25
25
  gaAiReferrals: () => gaAiReferrals,
26
26
  gaConnections: () => gaConnections,
27
+ gaSocialReferrals: () => gaSocialReferrals,
27
28
  gaTrafficSnapshots: () => gaTrafficSnapshots,
28
29
  gaTrafficSummaries: () => gaTrafficSummaries,
29
30
  googleConnections: () => googleConnections,
@@ -318,6 +319,22 @@ var gaAiReferrals = sqliteTable("ga_ai_referrals", {
318
319
  index("idx_ga_ai_ref_source").on(table.source),
319
320
  uniqueIndex("idx_ga_ai_ref_unique_v2").on(table.projectId, table.date, table.source, table.medium, table.sourceDimension)
320
321
  ]);
322
+ var gaSocialReferrals = sqliteTable("ga_social_referrals", {
323
+ id: text("id").primaryKey(),
324
+ projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
325
+ date: text("date").notNull(),
326
+ source: text("source").notNull(),
327
+ medium: text("medium").notNull(),
328
+ /** GA4 default channel group (e.g. 'Organic Social', 'Paid Social') */
329
+ channelGroup: text("channel_group").notNull().default("Organic Social"),
330
+ sessions: integer("sessions").notNull().default(0),
331
+ users: integer("users").notNull().default(0),
332
+ syncedAt: text("synced_at").notNull()
333
+ }, (table) => [
334
+ index("idx_ga_social_ref_project_date").on(table.projectId, table.date),
335
+ index("idx_ga_social_ref_source").on(table.source),
336
+ uniqueIndex("idx_ga_social_ref_unique").on(table.projectId, table.date, table.source, table.medium, table.channelGroup)
337
+ ]);
321
338
  var gaTrafficSummaries = sqliteTable("ga_traffic_summaries", {
322
339
  id: text("id").primaryKey(),
323
340
  projectId: text("project_id").notNull().references(() => projects.id, { onDelete: "cascade" }),
@@ -762,7 +779,23 @@ var MIGRATIONS = [
762
779
  `ALTER TABLE insights ADD COLUMN run_id TEXT REFERENCES runs(id) ON DELETE CASCADE`,
763
780
  `CREATE INDEX IF NOT EXISTS idx_insights_run ON insights(run_id)`,
764
781
  `ALTER TABLE health_snapshots ADD COLUMN run_id TEXT REFERENCES runs(id) ON DELETE CASCADE`,
765
- `CREATE INDEX IF NOT EXISTS idx_health_snapshots_run ON health_snapshots(run_id)`
782
+ `CREATE INDEX IF NOT EXISTS idx_health_snapshots_run ON health_snapshots(run_id)`,
783
+ // v25: Social media referral tracking — ga_social_referrals table
784
+ // Uses GA4's native sessionDefaultChannelGroup for social classification
785
+ `CREATE TABLE IF NOT EXISTS ga_social_referrals (
786
+ id TEXT PRIMARY KEY,
787
+ project_id TEXT NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
788
+ date TEXT NOT NULL,
789
+ source TEXT NOT NULL,
790
+ medium TEXT NOT NULL,
791
+ channel_group TEXT NOT NULL DEFAULT 'Organic Social',
792
+ sessions INTEGER NOT NULL DEFAULT 0,
793
+ users INTEGER NOT NULL DEFAULT 0,
794
+ synced_at TEXT NOT NULL
795
+ )`,
796
+ `CREATE INDEX IF NOT EXISTS idx_ga_social_ref_project_date ON ga_social_referrals(project_id, date)`,
797
+ `CREATE INDEX IF NOT EXISTS idx_ga_social_ref_source ON ga_social_referrals(source)`,
798
+ `CREATE UNIQUE INDEX IF NOT EXISTS idx_ga_social_ref_unique ON ga_social_referrals(project_id, date, source, medium, channel_group)`
766
799
  ];
767
800
  function isDuplicateColumnError(err) {
768
801
  if (!(err instanceof Error)) return false;
@@ -1209,6 +1242,7 @@ export {
1209
1242
  bingUrlInspections,
1210
1243
  gaTrafficSnapshots,
1211
1244
  gaAiReferrals,
1245
+ gaSocialReferrals,
1212
1246
  gaTrafficSummaries,
1213
1247
  usageCounters,
1214
1248
  insights,