@gscdump/contracts 0.11.4 → 0.12.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.
Files changed (3) hide show
  1. package/dist/index.d.mts +190 -778
  2. package/dist/index.mjs +102 -236
  3. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -1,4 +1,110 @@
1
1
  import { z } from "zod";
2
+ declare const GSCDUMP_ONBOARDING_CONTRACT_VERSION: "2026-05-11";
3
+ declare const GSCDUMP_REQUIRED_ANALYTICS_SCOPE: "https://www.googleapis.com/auth/webmasters.readonly";
4
+ declare const GSCDUMP_OPTIONAL_INDEXING_SCOPE: "https://www.googleapis.com/auth/indexing";
5
+ declare const accountStatuses: readonly ["disconnected", "oauth_received", "scope_missing", "refresh_missing", "db_provisioning", "ready", "reauth_required"];
6
+ declare const accountNextActions: readonly ["connect_google", "reconnect_google", "wait_for_provisioning", "none"];
7
+ declare const propertyStatuses: readonly ["no_local_site", "no_gsc_property", "unverified_property", "verified_candidate", "registered", "linked"];
8
+ declare const propertyNextActions: readonly ["create_site", "verify_gsc_property", "choose_property", "register_site", "none"];
9
+ declare const analyticsStatuses: readonly ["not_registered", "queued", "preparing", "syncing", "queryable_live", "queryable_partial", "ready", "failed"];
10
+ declare const analyticsNextActions: readonly ["wait_for_sync", "retry_sync", "none"];
11
+ declare const querySourceModes: readonly ["none", "live", "d1", "r2", "mixed"];
12
+ declare const sitemapStatuses: readonly ["unknown", "discovering", "none_found", "auto_submitted", "syncing", "ready", "failed"];
13
+ declare const sitemapNextActions: readonly ["submit_sitemap", "wait_for_sitemaps", "retry_sitemaps", "none"];
14
+ declare const indexingStatuses: readonly ["not_requested", "missing_scope", "insufficient_permission", "waiting_for_sitemaps", "discovering", "checking", "ready", "budget_exhausted", "no_urls", "failed"];
15
+ declare const indexingNextActions: readonly ["reconnect_google", "fix_gsc_permission", "wait_for_sitemaps", "wait_for_indexing", "retry_indexing", "none"];
16
+ declare const lifecycleWebhookEvents: readonly ["user.lifecycle.changed", "site.lifecycle.changed", "site.analytics.ready", "site.indexing.ready", "site.auth.failed", "job.failed"];
17
+ declare const lifecycleErrorCodes: readonly ["missing_refresh_token", "missing_analytics_scope", "missing_indexing_scope", "token_refresh_failed", "permission_lost", "insufficient_gsc_permission", "gsc_property_not_found", "gsc_property_unverified", "user_database_not_provisioned", "sync_failed", "sitemap_sync_failed", "indexing_failed"];
18
+ type AccountStatus = typeof accountStatuses[number];
19
+ type AccountNextAction = typeof accountNextActions[number];
20
+ type PropertyStatus = typeof propertyStatuses[number];
21
+ type PropertyNextAction = typeof propertyNextActions[number];
22
+ type AnalyticsStatus = typeof analyticsStatuses[number];
23
+ type AnalyticsNextAction = typeof analyticsNextActions[number];
24
+ type QuerySourceMode = typeof querySourceModes[number];
25
+ type SitemapStatus = typeof sitemapStatuses[number];
26
+ type SitemapNextAction = typeof sitemapNextActions[number];
27
+ type IndexingStatus = typeof indexingStatuses[number];
28
+ type IndexingNextAction = typeof indexingNextActions[number];
29
+ type LifecycleWebhookEvent = typeof lifecycleWebhookEvents[number];
30
+ type LifecycleErrorCode = typeof lifecycleErrorCodes[number];
31
+ interface LifecycleProgress {
32
+ completed: number;
33
+ failed: number;
34
+ total: number;
35
+ percent: number;
36
+ }
37
+ interface LifecycleError {
38
+ code: LifecycleErrorCode;
39
+ message: string;
40
+ retryable: boolean;
41
+ }
42
+ interface PartnerLifecycleAccount {
43
+ status: AccountStatus;
44
+ grantedScopes: string[];
45
+ missingScopes: string[];
46
+ nextAction: AccountNextAction;
47
+ }
48
+ interface PartnerLifecycleSite {
49
+ siteId: string;
50
+ externalSiteId: string | null;
51
+ requestedUrl: string;
52
+ gscPropertyUrl: string | null;
53
+ permissionLevel: string | null;
54
+ property: {
55
+ status: PropertyStatus;
56
+ nextAction: PropertyNextAction;
57
+ };
58
+ analytics: {
59
+ status: AnalyticsStatus;
60
+ progress: LifecycleProgress;
61
+ queryable: boolean;
62
+ sourceMode: QuerySourceMode;
63
+ syncedRange: {
64
+ oldest: string | null;
65
+ newest: string | null;
66
+ };
67
+ nextAction: AnalyticsNextAction;
68
+ };
69
+ sitemaps: {
70
+ status: SitemapStatus;
71
+ discoveredCount: number;
72
+ nextAction: SitemapNextAction;
73
+ };
74
+ indexing: {
75
+ status: IndexingStatus;
76
+ eligible: boolean;
77
+ reason: string | null;
78
+ progress: LifecycleProgress;
79
+ nextAction: IndexingNextAction;
80
+ };
81
+ latestError: LifecycleError | null;
82
+ lifecycleRevision: number;
83
+ updatedAt: string;
84
+ }
85
+ interface PartnerLifecycleResponse {
86
+ contractVersion: typeof GSCDUMP_ONBOARDING_CONTRACT_VERSION;
87
+ userId: string;
88
+ partnerId: string | null;
89
+ account: PartnerLifecycleAccount;
90
+ sites: PartnerLifecycleSite[];
91
+ }
92
+ interface LifecycleWebhookEnvelope<TData extends Record<string, unknown> = Record<string, unknown>> {
93
+ contractVersion: typeof GSCDUMP_ONBOARDING_CONTRACT_VERSION;
94
+ deliveryId: string;
95
+ event: LifecycleWebhookEvent;
96
+ partnerId: string;
97
+ userId: string;
98
+ siteId?: string;
99
+ externalUserId?: string | null;
100
+ externalSiteId?: string | null;
101
+ lifecycleRevision: number;
102
+ occurredAt: string;
103
+ data: TData;
104
+ }
105
+ declare function parseGrantedScopes(scopes: string | null | undefined): string[];
106
+ declare function hasRequiredAnalyticsScope(scopes: string | string[] | null | undefined): boolean;
107
+ declare function hasOptionalIndexingScope(scopes: string | string[] | null | undefined): boolean;
2
108
  declare const partnerRoutes: {
3
109
  readonly partner: {
4
110
  readonly users: {
@@ -78,6 +184,8 @@ declare const analyticsRoutes: {
78
184
  readonly inspectionHistory: (siteId: string, hash: string) => string;
79
185
  readonly indexingUrls: (siteId: string) => string;
80
186
  readonly indexingDiagnostics: (siteId: string) => string;
187
+ readonly countries: (siteId: string) => string;
188
+ readonly searchAppearance: (siteId: string) => string;
81
189
  };
82
190
  };
83
191
  declare const builderStateSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -466,16 +574,16 @@ declare const gscdumpUserRegistrationSchema: z.ZodObject<{
466
574
  apiKey: z.ZodOptional<z.ZodString>;
467
575
  isNew: z.ZodOptional<z.ZodBoolean>;
468
576
  status: z.ZodOptional<z.ZodEnum<{
469
- provisioning: "provisioning";
470
577
  ready: "ready";
578
+ provisioning: "provisioning";
471
579
  }>>;
472
580
  }, z.core.$loose>;
473
581
  declare const gscdumpUserStatusSchema: z.ZodObject<{
474
582
  userId: z.ZodString;
475
583
  status: z.ZodEnum<{
476
- provisioning: "provisioning";
477
584
  ready: "ready";
478
585
  reauth_required: "reauth_required";
586
+ provisioning: "provisioning";
479
587
  }>;
480
588
  databaseReady: z.ZodOptional<z.ZodBoolean>;
481
589
  needsReauth: z.ZodOptional<z.ZodBoolean>;
@@ -514,21 +622,21 @@ declare const lifecycleErrorSchema: z.ZodObject<{
514
622
  }, z.core.$strip>;
515
623
  declare const partnerLifecycleAccountSchema: z.ZodObject<{
516
624
  status: z.ZodEnum<{
517
- ready: "ready";
518
- reauth_required: "reauth_required";
519
625
  disconnected: "disconnected";
520
626
  oauth_received: "oauth_received";
521
627
  scope_missing: "scope_missing";
522
628
  refresh_missing: "refresh_missing";
523
629
  db_provisioning: "db_provisioning";
630
+ ready: "ready";
631
+ reauth_required: "reauth_required";
524
632
  }>;
525
633
  grantedScopes: z.ZodArray<z.ZodString>;
526
634
  missingScopes: z.ZodArray<z.ZodString>;
527
635
  nextAction: z.ZodEnum<{
528
- reconnect_google: "reconnect_google";
529
- none: "none";
530
636
  connect_google: "connect_google";
637
+ reconnect_google: "reconnect_google";
531
638
  wait_for_provisioning: "wait_for_provisioning";
639
+ none: "none";
532
640
  }>;
533
641
  }, z.core.$loose>;
534
642
  declare const partnerLifecycleSiteSchema: z.ZodObject<{
@@ -556,14 +664,14 @@ declare const partnerLifecycleSiteSchema: z.ZodObject<{
556
664
  }, z.core.$loose>;
557
665
  analytics: z.ZodObject<{
558
666
  status: z.ZodEnum<{
559
- queued: "queued";
560
667
  ready: "ready";
561
- failed: "failed";
562
668
  not_registered: "not_registered";
669
+ queued: "queued";
563
670
  preparing: "preparing";
564
671
  syncing: "syncing";
565
672
  queryable_live: "queryable_live";
566
673
  queryable_partial: "queryable_partial";
674
+ failed: "failed";
567
675
  }>;
568
676
  progress: z.ZodObject<{
569
677
  completed: z.ZodNumber;
@@ -573,10 +681,10 @@ declare const partnerLifecycleSiteSchema: z.ZodObject<{
573
681
  }, z.core.$strip>;
574
682
  queryable: z.ZodBoolean;
575
683
  sourceMode: z.ZodEnum<{
576
- d1: "d1";
577
- r2: "r2";
578
684
  none: "none";
579
685
  live: "live";
686
+ d1: "d1";
687
+ r2: "r2";
580
688
  mixed: "mixed";
581
689
  }>;
582
690
  syncedRange: z.ZodObject<{
@@ -591,10 +699,10 @@ declare const partnerLifecycleSiteSchema: z.ZodObject<{
591
699
  }, z.core.$loose>;
592
700
  sitemaps: z.ZodObject<{
593
701
  status: z.ZodEnum<{
594
- unknown: "unknown";
595
702
  ready: "ready";
596
- failed: "failed";
597
703
  syncing: "syncing";
704
+ failed: "failed";
705
+ unknown: "unknown";
598
706
  discovering: "discovering";
599
707
  none_found: "none_found";
600
708
  auto_submitted: "auto_submitted";
@@ -664,21 +772,21 @@ declare const partnerLifecycleResponseSchema: z.ZodObject<{
664
772
  partnerId: z.ZodNullable<z.ZodString>;
665
773
  account: z.ZodObject<{
666
774
  status: z.ZodEnum<{
667
- ready: "ready";
668
- reauth_required: "reauth_required";
669
775
  disconnected: "disconnected";
670
776
  oauth_received: "oauth_received";
671
777
  scope_missing: "scope_missing";
672
778
  refresh_missing: "refresh_missing";
673
779
  db_provisioning: "db_provisioning";
780
+ ready: "ready";
781
+ reauth_required: "reauth_required";
674
782
  }>;
675
783
  grantedScopes: z.ZodArray<z.ZodString>;
676
784
  missingScopes: z.ZodArray<z.ZodString>;
677
785
  nextAction: z.ZodEnum<{
678
- reconnect_google: "reconnect_google";
679
- none: "none";
680
786
  connect_google: "connect_google";
787
+ reconnect_google: "reconnect_google";
681
788
  wait_for_provisioning: "wait_for_provisioning";
789
+ none: "none";
682
790
  }>;
683
791
  }, z.core.$loose>;
684
792
  sites: z.ZodArray<z.ZodObject<{
@@ -706,14 +814,14 @@ declare const partnerLifecycleResponseSchema: z.ZodObject<{
706
814
  }, z.core.$loose>;
707
815
  analytics: z.ZodObject<{
708
816
  status: z.ZodEnum<{
709
- queued: "queued";
710
817
  ready: "ready";
711
- failed: "failed";
712
818
  not_registered: "not_registered";
819
+ queued: "queued";
713
820
  preparing: "preparing";
714
821
  syncing: "syncing";
715
822
  queryable_live: "queryable_live";
716
823
  queryable_partial: "queryable_partial";
824
+ failed: "failed";
717
825
  }>;
718
826
  progress: z.ZodObject<{
719
827
  completed: z.ZodNumber;
@@ -723,10 +831,10 @@ declare const partnerLifecycleResponseSchema: z.ZodObject<{
723
831
  }, z.core.$strip>;
724
832
  queryable: z.ZodBoolean;
725
833
  sourceMode: z.ZodEnum<{
726
- d1: "d1";
727
- r2: "r2";
728
834
  none: "none";
729
835
  live: "live";
836
+ d1: "d1";
837
+ r2: "r2";
730
838
  mixed: "mixed";
731
839
  }>;
732
840
  syncedRange: z.ZodObject<{
@@ -741,10 +849,10 @@ declare const partnerLifecycleResponseSchema: z.ZodObject<{
741
849
  }, z.core.$loose>;
742
850
  sitemaps: z.ZodObject<{
743
851
  status: z.ZodEnum<{
744
- unknown: "unknown";
745
852
  ready: "ready";
746
- failed: "failed";
747
853
  syncing: "syncing";
854
+ failed: "failed";
855
+ unknown: "unknown";
748
856
  discovering: "discovering";
749
857
  none_found: "none_found";
750
858
  auto_submitted: "auto_submitted";
@@ -815,9 +923,9 @@ declare const gscdumpAvailableSiteSchema: z.ZodObject<{
815
923
  registered: z.ZodBoolean;
816
924
  siteId: z.ZodOptional<z.ZodString>;
817
925
  syncStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
926
+ syncing: "syncing";
818
927
  pending: "pending";
819
928
  error: "error";
820
- syncing: "syncing";
821
929
  synced: "synced";
822
930
  }>>>;
823
931
  syncProgress: z.ZodOptional<z.ZodObject<{
@@ -834,9 +942,9 @@ declare const gscdumpUserSiteSchema: z.ZodObject<{
834
942
  siteId: z.ZodString;
835
943
  siteUrl: z.ZodString;
836
944
  syncStatus: z.ZodEnum<{
945
+ syncing: "syncing";
837
946
  pending: "pending";
838
947
  error: "error";
839
- syncing: "syncing";
840
948
  synced: "synced";
841
949
  idle: "idle";
842
950
  }>;
@@ -847,9 +955,9 @@ declare const gscdumpUserSiteSchema: z.ZodObject<{
847
955
  declare const gscdumpSiteRegistrationSchema: z.ZodObject<{
848
956
  siteId: z.ZodString;
849
957
  status: z.ZodEnum<{
958
+ syncing: "syncing";
850
959
  pending: "pending";
851
960
  error: "error";
852
- syncing: "syncing";
853
961
  synced: "synced";
854
962
  idle: "idle";
855
963
  }>;
@@ -878,10 +986,6 @@ declare const registerPartnerSiteSchema: z.ZodObject<{
878
986
  "site.indexing.ready": "site.indexing.ready";
879
987
  "site.auth.failed": "site.auth.failed";
880
988
  "job.failed": "job.failed";
881
- "job.completed": "job.completed";
882
- "site.completed": "site.completed";
883
- "indexing.completed": "indexing.completed";
884
- "auth.failed": "auth.failed";
885
989
  }>>>;
886
990
  teamId: z.ZodOptional<z.ZodString>;
887
991
  }, z.core.$strip>;
@@ -902,10 +1006,6 @@ declare const bulkRegisterPartnerSitesSchema: z.ZodObject<{
902
1006
  "site.indexing.ready": "site.indexing.ready";
903
1007
  "site.auth.failed": "site.auth.failed";
904
1008
  "job.failed": "job.failed";
905
- "job.completed": "job.completed";
906
- "site.completed": "site.completed";
907
- "indexing.completed": "indexing.completed";
908
- "auth.failed": "auth.failed";
909
1009
  }>>>;
910
1010
  }, z.core.$loose>>>;
911
1011
  }, z.core.$strip>;
@@ -914,8 +1014,8 @@ declare const bulkRegisterPartnerSitesResponseSchema: z.ZodObject<{
914
1014
  siteUrl: z.ZodString;
915
1015
  siteId: z.ZodOptional<z.ZodString>;
916
1016
  status: z.ZodEnum<{
917
- error: "error";
918
1017
  registered: "registered";
1018
+ error: "error";
919
1019
  already_exists: "already_exists";
920
1020
  not_found: "not_found";
921
1021
  }>;
@@ -1156,19 +1256,19 @@ declare const gscdumpUserMeResponseSchema: z.ZodObject<{
1156
1256
  databaseReady: z.ZodBoolean;
1157
1257
  plan: z.ZodString;
1158
1258
  accountStatus: z.ZodEnum<{
1159
- ready: "ready";
1160
- reauth_required: "reauth_required";
1161
1259
  disconnected: "disconnected";
1162
1260
  oauth_received: "oauth_received";
1163
1261
  scope_missing: "scope_missing";
1164
1262
  refresh_missing: "refresh_missing";
1165
1263
  db_provisioning: "db_provisioning";
1264
+ ready: "ready";
1265
+ reauth_required: "reauth_required";
1166
1266
  }>;
1167
1267
  accountNextAction: z.ZodEnum<{
1168
- reconnect_google: "reconnect_google";
1169
- none: "none";
1170
1268
  connect_google: "connect_google";
1269
+ reconnect_google: "reconnect_google";
1171
1270
  wait_for_provisioning: "wait_for_provisioning";
1271
+ none: "none";
1172
1272
  }>;
1173
1273
  missingScopes: z.ZodArray<z.ZodString>;
1174
1274
  browserAnalyzerEnabled: z.ZodBoolean;
@@ -1268,8 +1368,8 @@ declare const gscdumpSyncProgressResponseSchema: z.ZodObject<{
1268
1368
  date: z.ZodString;
1269
1369
  status: z.ZodEnum<{
1270
1370
  queued: "queued";
1271
- completed: "completed";
1272
1371
  failed: "failed";
1372
+ completed: "completed";
1273
1373
  processing: "processing";
1274
1374
  }>;
1275
1375
  }, z.core.$loose>>;
@@ -1292,8 +1392,8 @@ declare const gscdumpSyncJobsResponseSchema: z.ZodObject<{
1292
1392
  priority: z.ZodOptional<z.ZodString>;
1293
1393
  status: z.ZodEnum<{
1294
1394
  queued: "queued";
1295
- completed: "completed";
1296
1395
  failed: "failed";
1396
+ completed: "completed";
1297
1397
  processing: "processing";
1298
1398
  scheduled: "scheduled";
1299
1399
  }>;
@@ -1593,13 +1693,6 @@ declare const canonicalWebhookEventTypeSchema: z.ZodEnum<{
1593
1693
  "site.auth.failed": "site.auth.failed";
1594
1694
  "job.failed": "job.failed";
1595
1695
  }>;
1596
- declare const legacyWebhookEventTypeSchema: z.ZodEnum<{
1597
- "job.failed": "job.failed";
1598
- "job.completed": "job.completed";
1599
- "site.completed": "site.completed";
1600
- "indexing.completed": "indexing.completed";
1601
- "auth.failed": "auth.failed";
1602
- }>;
1603
1696
  declare const webhookEventTypeSchema: z.ZodEnum<{
1604
1697
  "user.lifecycle.changed": "user.lifecycle.changed";
1605
1698
  "site.lifecycle.changed": "site.lifecycle.changed";
@@ -1607,21 +1700,7 @@ declare const webhookEventTypeSchema: z.ZodEnum<{
1607
1700
  "site.indexing.ready": "site.indexing.ready";
1608
1701
  "site.auth.failed": "site.auth.failed";
1609
1702
  "job.failed": "job.failed";
1610
- "job.completed": "job.completed";
1611
- "site.completed": "site.completed";
1612
- "indexing.completed": "indexing.completed";
1613
- "auth.failed": "auth.failed";
1614
1703
  }>;
1615
- declare const jobCompletedWebhookPayloadSchema: z.ZodObject<{
1616
- event: z.ZodLiteral<"job.completed">;
1617
- siteId: z.ZodString;
1618
- siteUrl: z.ZodString;
1619
- table: z.ZodOptional<z.ZodString>;
1620
- date: z.ZodString;
1621
- rowsFetched: z.ZodNumber;
1622
- rowsInserted: z.ZodNumber;
1623
- timestamp: z.ZodNumber;
1624
- }, z.core.$loose>;
1625
1704
  declare const jobFailedWebhookPayloadSchema: z.ZodObject<{
1626
1705
  event: z.ZodLiteral<"job.failed">;
1627
1706
  siteId: z.ZodString;
@@ -1631,202 +1710,7 @@ declare const jobFailedWebhookPayloadSchema: z.ZodObject<{
1631
1710
  error: z.ZodString;
1632
1711
  timestamp: z.ZodNumber;
1633
1712
  }, z.core.$loose>;
1634
- declare const siteCompletedWebhookPayloadSchema: z.ZodObject<{
1635
- event: z.ZodLiteral<"site.completed">;
1636
- siteId: z.ZodString;
1637
- siteUrl: z.ZodString;
1638
- status: z.ZodString;
1639
- daysSynced: z.ZodNumber;
1640
- failedJobs: z.ZodNumber;
1641
- oldestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1642
- newestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1643
- timestamp: z.ZodNumber;
1644
- }, z.core.$loose>;
1645
- declare const indexingCompletedWebhookPayloadSchema: z.ZodObject<{
1646
- event: z.ZodLiteral<"indexing.completed">;
1647
- siteId: z.ZodString;
1648
- siteUrl: z.ZodString;
1649
- totalUrls: z.ZodNumber;
1650
- indexedCount: z.ZodNumber;
1651
- notIndexedCount: z.ZodNumber;
1652
- errorCount: z.ZodNumber;
1653
- urlsChecked: z.ZodNumber;
1654
- timestamp: z.ZodNumber;
1655
- }, z.core.$loose>;
1656
- declare const authFailedWebhookPayloadSchema: z.ZodObject<{
1657
- event: z.ZodLiteral<"auth.failed">;
1658
- siteId: z.ZodString;
1659
- siteUrl: z.ZodString;
1660
- reason: z.ZodOptional<z.ZodString>;
1661
- message: z.ZodOptional<z.ZodString>;
1662
- reauthRequired: z.ZodOptional<z.ZodBoolean>;
1663
- authFailureCount: z.ZodOptional<z.ZodNumber>;
1664
- error: z.ZodOptional<z.ZodString>;
1665
- timestamp: z.ZodOptional<z.ZodNumber>;
1666
- }, z.core.$loose>;
1667
- declare const legacyWebhookPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1668
- event: z.ZodLiteral<"job.completed">;
1669
- siteId: z.ZodString;
1670
- siteUrl: z.ZodString;
1671
- table: z.ZodOptional<z.ZodString>;
1672
- date: z.ZodString;
1673
- rowsFetched: z.ZodNumber;
1674
- rowsInserted: z.ZodNumber;
1675
- timestamp: z.ZodNumber;
1676
- }, z.core.$loose>, z.ZodObject<{
1677
- event: z.ZodLiteral<"job.failed">;
1678
- siteId: z.ZodString;
1679
- siteUrl: z.ZodString;
1680
- table: z.ZodString;
1681
- date: z.ZodString;
1682
- error: z.ZodString;
1683
- timestamp: z.ZodNumber;
1684
- }, z.core.$loose>, z.ZodObject<{
1685
- event: z.ZodLiteral<"site.completed">;
1686
- siteId: z.ZodString;
1687
- siteUrl: z.ZodString;
1688
- status: z.ZodString;
1689
- daysSynced: z.ZodNumber;
1690
- failedJobs: z.ZodNumber;
1691
- oldestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1692
- newestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1693
- timestamp: z.ZodNumber;
1694
- }, z.core.$loose>, z.ZodObject<{
1695
- event: z.ZodLiteral<"indexing.completed">;
1696
- siteId: z.ZodString;
1697
- siteUrl: z.ZodString;
1698
- totalUrls: z.ZodNumber;
1699
- indexedCount: z.ZodNumber;
1700
- notIndexedCount: z.ZodNumber;
1701
- errorCount: z.ZodNumber;
1702
- urlsChecked: z.ZodNumber;
1703
- timestamp: z.ZodNumber;
1704
- }, z.core.$loose>, z.ZodObject<{
1705
- event: z.ZodLiteral<"auth.failed">;
1706
- siteId: z.ZodString;
1707
- siteUrl: z.ZodString;
1708
- reason: z.ZodOptional<z.ZodString>;
1709
- message: z.ZodOptional<z.ZodString>;
1710
- reauthRequired: z.ZodOptional<z.ZodBoolean>;
1711
- authFailureCount: z.ZodOptional<z.ZodNumber>;
1712
- error: z.ZodOptional<z.ZodString>;
1713
- timestamp: z.ZodOptional<z.ZodNumber>;
1714
- }, z.core.$loose>], "event">;
1715
- declare const partnerWebhookDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1716
- legacyEvent: z.ZodLiteral<"job.completed">;
1717
- legacyPayload: z.ZodObject<{
1718
- event: z.ZodLiteral<"job.completed">;
1719
- siteId: z.ZodString;
1720
- siteUrl: z.ZodString;
1721
- table: z.ZodOptional<z.ZodString>;
1722
- date: z.ZodString;
1723
- rowsFetched: z.ZodNumber;
1724
- rowsInserted: z.ZodNumber;
1725
- timestamp: z.ZodNumber;
1726
- }, z.core.$loose>;
1727
- event: z.ZodOptional<z.ZodLiteral<"job.completed">>;
1728
- siteId: z.ZodString;
1729
- siteUrl: z.ZodString;
1730
- table: z.ZodOptional<z.ZodString>;
1731
- date: z.ZodString;
1732
- rowsFetched: z.ZodNumber;
1733
- rowsInserted: z.ZodNumber;
1734
- timestamp: z.ZodNumber;
1735
- }, z.core.$loose>, z.ZodObject<{
1736
- legacyEvent: z.ZodLiteral<"job.failed">;
1737
- legacyPayload: z.ZodObject<{
1738
- event: z.ZodLiteral<"job.failed">;
1739
- siteId: z.ZodString;
1740
- siteUrl: z.ZodString;
1741
- table: z.ZodString;
1742
- date: z.ZodString;
1743
- error: z.ZodString;
1744
- timestamp: z.ZodNumber;
1745
- }, z.core.$loose>;
1746
- event: z.ZodOptional<z.ZodLiteral<"job.failed">>;
1747
- siteId: z.ZodString;
1748
- siteUrl: z.ZodString;
1749
- table: z.ZodString;
1750
- date: z.ZodString;
1751
- error: z.ZodString;
1752
- timestamp: z.ZodNumber;
1753
- }, z.core.$loose>, z.ZodObject<{
1754
- legacyEvent: z.ZodLiteral<"site.completed">;
1755
- legacyPayload: z.ZodObject<{
1756
- event: z.ZodLiteral<"site.completed">;
1757
- siteId: z.ZodString;
1758
- siteUrl: z.ZodString;
1759
- status: z.ZodString;
1760
- daysSynced: z.ZodNumber;
1761
- failedJobs: z.ZodNumber;
1762
- oldestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1763
- newestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1764
- timestamp: z.ZodNumber;
1765
- }, z.core.$loose>;
1766
- event: z.ZodOptional<z.ZodLiteral<"site.completed">>;
1767
- siteId: z.ZodString;
1768
- siteUrl: z.ZodString;
1769
- status: z.ZodString;
1770
- daysSynced: z.ZodNumber;
1771
- failedJobs: z.ZodNumber;
1772
- oldestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1773
- newestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1774
- timestamp: z.ZodNumber;
1775
- }, z.core.$loose>, z.ZodObject<{
1776
- legacyEvent: z.ZodLiteral<"indexing.completed">;
1777
- legacyPayload: z.ZodObject<{
1778
- event: z.ZodLiteral<"indexing.completed">;
1779
- siteId: z.ZodString;
1780
- siteUrl: z.ZodString;
1781
- totalUrls: z.ZodNumber;
1782
- indexedCount: z.ZodNumber;
1783
- notIndexedCount: z.ZodNumber;
1784
- errorCount: z.ZodNumber;
1785
- urlsChecked: z.ZodNumber;
1786
- timestamp: z.ZodNumber;
1787
- }, z.core.$loose>;
1788
- event: z.ZodOptional<z.ZodLiteral<"indexing.completed">>;
1789
- siteId: z.ZodString;
1790
- siteUrl: z.ZodString;
1791
- totalUrls: z.ZodNumber;
1792
- indexedCount: z.ZodNumber;
1793
- notIndexedCount: z.ZodNumber;
1794
- errorCount: z.ZodNumber;
1795
- urlsChecked: z.ZodNumber;
1796
- timestamp: z.ZodNumber;
1797
- }, z.core.$loose>, z.ZodObject<{
1798
- legacyEvent: z.ZodLiteral<"auth.failed">;
1799
- legacyPayload: z.ZodObject<{
1800
- event: z.ZodLiteral<"auth.failed">;
1801
- siteId: z.ZodString;
1802
- siteUrl: z.ZodString;
1803
- reason: z.ZodOptional<z.ZodString>;
1804
- message: z.ZodOptional<z.ZodString>;
1805
- reauthRequired: z.ZodOptional<z.ZodBoolean>;
1806
- authFailureCount: z.ZodOptional<z.ZodNumber>;
1807
- error: z.ZodOptional<z.ZodString>;
1808
- timestamp: z.ZodOptional<z.ZodNumber>;
1809
- }, z.core.$loose>;
1810
- event: z.ZodOptional<z.ZodLiteral<"auth.failed">>;
1811
- siteId: z.ZodString;
1812
- siteUrl: z.ZodString;
1813
- reason: z.ZodOptional<z.ZodString>;
1814
- message: z.ZodOptional<z.ZodString>;
1815
- reauthRequired: z.ZodOptional<z.ZodBoolean>;
1816
- authFailureCount: z.ZodOptional<z.ZodNumber>;
1817
- error: z.ZodOptional<z.ZodString>;
1818
- timestamp: z.ZodOptional<z.ZodNumber>;
1819
- }, z.core.$loose>, z.ZodObject<{
1820
- legacyEvent: z.ZodLiteral<"user.lifecycle.changed">;
1821
- }, z.core.$loose>, z.ZodObject<{
1822
- legacyEvent: z.ZodLiteral<"site.lifecycle.changed">;
1823
- }, z.core.$loose>, z.ZodObject<{
1824
- legacyEvent: z.ZodLiteral<"site.analytics.ready">;
1825
- }, z.core.$loose>, z.ZodObject<{
1826
- legacyEvent: z.ZodLiteral<"site.indexing.ready">;
1827
- }, z.core.$loose>, z.ZodObject<{
1828
- legacyEvent: z.ZodLiteral<"site.auth.failed">;
1829
- }, z.core.$loose>], "legacyEvent">;
1713
+ declare const partnerWebhookDataSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1830
1714
  declare const partnerWebhookEnvelopeSchema: z.ZodObject<{
1831
1715
  contractVersion: z.ZodLiteral<"2026-05-11">;
1832
1716
  deliveryId: z.ZodString;
@@ -1845,121 +1729,7 @@ declare const partnerWebhookEnvelopeSchema: z.ZodObject<{
1845
1729
  externalSiteId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1846
1730
  lifecycleRevision: z.ZodNumber;
1847
1731
  occurredAt: z.ZodISODateTime;
1848
- data: z.ZodDiscriminatedUnion<[z.ZodObject<{
1849
- legacyEvent: z.ZodLiteral<"job.completed">;
1850
- legacyPayload: z.ZodObject<{
1851
- event: z.ZodLiteral<"job.completed">;
1852
- siteId: z.ZodString;
1853
- siteUrl: z.ZodString;
1854
- table: z.ZodOptional<z.ZodString>;
1855
- date: z.ZodString;
1856
- rowsFetched: z.ZodNumber;
1857
- rowsInserted: z.ZodNumber;
1858
- timestamp: z.ZodNumber;
1859
- }, z.core.$loose>;
1860
- event: z.ZodOptional<z.ZodLiteral<"job.completed">>;
1861
- siteId: z.ZodString;
1862
- siteUrl: z.ZodString;
1863
- table: z.ZodOptional<z.ZodString>;
1864
- date: z.ZodString;
1865
- rowsFetched: z.ZodNumber;
1866
- rowsInserted: z.ZodNumber;
1867
- timestamp: z.ZodNumber;
1868
- }, z.core.$loose>, z.ZodObject<{
1869
- legacyEvent: z.ZodLiteral<"job.failed">;
1870
- legacyPayload: z.ZodObject<{
1871
- event: z.ZodLiteral<"job.failed">;
1872
- siteId: z.ZodString;
1873
- siteUrl: z.ZodString;
1874
- table: z.ZodString;
1875
- date: z.ZodString;
1876
- error: z.ZodString;
1877
- timestamp: z.ZodNumber;
1878
- }, z.core.$loose>;
1879
- event: z.ZodOptional<z.ZodLiteral<"job.failed">>;
1880
- siteId: z.ZodString;
1881
- siteUrl: z.ZodString;
1882
- table: z.ZodString;
1883
- date: z.ZodString;
1884
- error: z.ZodString;
1885
- timestamp: z.ZodNumber;
1886
- }, z.core.$loose>, z.ZodObject<{
1887
- legacyEvent: z.ZodLiteral<"site.completed">;
1888
- legacyPayload: z.ZodObject<{
1889
- event: z.ZodLiteral<"site.completed">;
1890
- siteId: z.ZodString;
1891
- siteUrl: z.ZodString;
1892
- status: z.ZodString;
1893
- daysSynced: z.ZodNumber;
1894
- failedJobs: z.ZodNumber;
1895
- oldestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1896
- newestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1897
- timestamp: z.ZodNumber;
1898
- }, z.core.$loose>;
1899
- event: z.ZodOptional<z.ZodLiteral<"site.completed">>;
1900
- siteId: z.ZodString;
1901
- siteUrl: z.ZodString;
1902
- status: z.ZodString;
1903
- daysSynced: z.ZodNumber;
1904
- failedJobs: z.ZodNumber;
1905
- oldestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1906
- newestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1907
- timestamp: z.ZodNumber;
1908
- }, z.core.$loose>, z.ZodObject<{
1909
- legacyEvent: z.ZodLiteral<"indexing.completed">;
1910
- legacyPayload: z.ZodObject<{
1911
- event: z.ZodLiteral<"indexing.completed">;
1912
- siteId: z.ZodString;
1913
- siteUrl: z.ZodString;
1914
- totalUrls: z.ZodNumber;
1915
- indexedCount: z.ZodNumber;
1916
- notIndexedCount: z.ZodNumber;
1917
- errorCount: z.ZodNumber;
1918
- urlsChecked: z.ZodNumber;
1919
- timestamp: z.ZodNumber;
1920
- }, z.core.$loose>;
1921
- event: z.ZodOptional<z.ZodLiteral<"indexing.completed">>;
1922
- siteId: z.ZodString;
1923
- siteUrl: z.ZodString;
1924
- totalUrls: z.ZodNumber;
1925
- indexedCount: z.ZodNumber;
1926
- notIndexedCount: z.ZodNumber;
1927
- errorCount: z.ZodNumber;
1928
- urlsChecked: z.ZodNumber;
1929
- timestamp: z.ZodNumber;
1930
- }, z.core.$loose>, z.ZodObject<{
1931
- legacyEvent: z.ZodLiteral<"auth.failed">;
1932
- legacyPayload: z.ZodObject<{
1933
- event: z.ZodLiteral<"auth.failed">;
1934
- siteId: z.ZodString;
1935
- siteUrl: z.ZodString;
1936
- reason: z.ZodOptional<z.ZodString>;
1937
- message: z.ZodOptional<z.ZodString>;
1938
- reauthRequired: z.ZodOptional<z.ZodBoolean>;
1939
- authFailureCount: z.ZodOptional<z.ZodNumber>;
1940
- error: z.ZodOptional<z.ZodString>;
1941
- timestamp: z.ZodOptional<z.ZodNumber>;
1942
- }, z.core.$loose>;
1943
- event: z.ZodOptional<z.ZodLiteral<"auth.failed">>;
1944
- siteId: z.ZodString;
1945
- siteUrl: z.ZodString;
1946
- reason: z.ZodOptional<z.ZodString>;
1947
- message: z.ZodOptional<z.ZodString>;
1948
- reauthRequired: z.ZodOptional<z.ZodBoolean>;
1949
- authFailureCount: z.ZodOptional<z.ZodNumber>;
1950
- error: z.ZodOptional<z.ZodString>;
1951
- timestamp: z.ZodOptional<z.ZodNumber>;
1952
- }, z.core.$loose>, z.ZodObject<{
1953
- legacyEvent: z.ZodLiteral<"user.lifecycle.changed">;
1954
- }, z.core.$loose>, z.ZodObject<{
1955
- legacyEvent: z.ZodLiteral<"site.lifecycle.changed">;
1956
- }, z.core.$loose>, z.ZodObject<{
1957
- legacyEvent: z.ZodLiteral<"site.analytics.ready">;
1958
- }, z.core.$loose>, z.ZodObject<{
1959
- legacyEvent: z.ZodLiteral<"site.indexing.ready">;
1960
- }, z.core.$loose>, z.ZodObject<{
1961
- legacyEvent: z.ZodLiteral<"site.auth.failed">;
1962
- }, z.core.$loose>], "legacyEvent">;
1732
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1963
1733
  }, z.core.$loose>;
1964
1734
  declare const partnerEndpointSchemas: {
1965
1735
  readonly appUser: {
@@ -1972,19 +1742,19 @@ declare const partnerEndpointSchemas: {
1972
1742
  databaseReady: z.ZodBoolean;
1973
1743
  plan: z.ZodString;
1974
1744
  accountStatus: z.ZodEnum<{
1975
- ready: "ready";
1976
- reauth_required: "reauth_required";
1977
1745
  disconnected: "disconnected";
1978
1746
  oauth_received: "oauth_received";
1979
1747
  scope_missing: "scope_missing";
1980
1748
  refresh_missing: "refresh_missing";
1981
1749
  db_provisioning: "db_provisioning";
1750
+ ready: "ready";
1751
+ reauth_required: "reauth_required";
1982
1752
  }>;
1983
1753
  accountNextAction: z.ZodEnum<{
1984
- reconnect_google: "reconnect_google";
1985
- none: "none";
1986
1754
  connect_google: "connect_google";
1755
+ reconnect_google: "reconnect_google";
1987
1756
  wait_for_provisioning: "wait_for_provisioning";
1757
+ none: "none";
1988
1758
  }>;
1989
1759
  missingScopes: z.ZodArray<z.ZodString>;
1990
1760
  browserAnalyzerEnabled: z.ZodBoolean;
@@ -2088,8 +1858,8 @@ declare const partnerEndpointSchemas: {
2088
1858
  date: z.ZodString;
2089
1859
  status: z.ZodEnum<{
2090
1860
  queued: "queued";
2091
- completed: "completed";
2092
1861
  failed: "failed";
1862
+ completed: "completed";
2093
1863
  processing: "processing";
2094
1864
  }>;
2095
1865
  }, z.core.$loose>>;
@@ -2114,8 +1884,8 @@ declare const partnerEndpointSchemas: {
2114
1884
  priority: z.ZodOptional<z.ZodString>;
2115
1885
  status: z.ZodEnum<{
2116
1886
  queued: "queued";
2117
- completed: "completed";
2118
1887
  failed: "failed";
1888
+ completed: "completed";
2119
1889
  processing: "processing";
2120
1890
  scheduled: "scheduled";
2121
1891
  }>;
@@ -2399,8 +2169,8 @@ declare const partnerEndpointSchemas: {
2399
2169
  apiKey: z.ZodOptional<z.ZodString>;
2400
2170
  isNew: z.ZodOptional<z.ZodBoolean>;
2401
2171
  status: z.ZodOptional<z.ZodEnum<{
2402
- provisioning: "provisioning";
2403
2172
  ready: "ready";
2173
+ provisioning: "provisioning";
2404
2174
  }>>;
2405
2175
  }, z.core.$loose>;
2406
2176
  };
@@ -2419,9 +2189,9 @@ declare const partnerEndpointSchemas: {
2419
2189
  registered: z.ZodBoolean;
2420
2190
  siteId: z.ZodOptional<z.ZodString>;
2421
2191
  syncStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
2192
+ syncing: "syncing";
2422
2193
  pending: "pending";
2423
2194
  error: "error";
2424
- syncing: "syncing";
2425
2195
  synced: "synced";
2426
2196
  }>>>;
2427
2197
  syncProgress: z.ZodOptional<z.ZodObject<{
@@ -2440,9 +2210,9 @@ declare const partnerEndpointSchemas: {
2440
2210
  readonly response: z.ZodObject<{
2441
2211
  userId: z.ZodString;
2442
2212
  status: z.ZodEnum<{
2443
- provisioning: "provisioning";
2444
2213
  ready: "ready";
2445
2214
  reauth_required: "reauth_required";
2215
+ provisioning: "provisioning";
2446
2216
  }>;
2447
2217
  databaseReady: z.ZodOptional<z.ZodBoolean>;
2448
2218
  needsReauth: z.ZodOptional<z.ZodBoolean>;
@@ -2463,21 +2233,21 @@ declare const partnerEndpointSchemas: {
2463
2233
  partnerId: z.ZodNullable<z.ZodString>;
2464
2234
  account: z.ZodObject<{
2465
2235
  status: z.ZodEnum<{
2466
- ready: "ready";
2467
- reauth_required: "reauth_required";
2468
2236
  disconnected: "disconnected";
2469
2237
  oauth_received: "oauth_received";
2470
2238
  scope_missing: "scope_missing";
2471
2239
  refresh_missing: "refresh_missing";
2472
2240
  db_provisioning: "db_provisioning";
2241
+ ready: "ready";
2242
+ reauth_required: "reauth_required";
2473
2243
  }>;
2474
2244
  grantedScopes: z.ZodArray<z.ZodString>;
2475
2245
  missingScopes: z.ZodArray<z.ZodString>;
2476
2246
  nextAction: z.ZodEnum<{
2477
- reconnect_google: "reconnect_google";
2478
- none: "none";
2479
2247
  connect_google: "connect_google";
2248
+ reconnect_google: "reconnect_google";
2480
2249
  wait_for_provisioning: "wait_for_provisioning";
2250
+ none: "none";
2481
2251
  }>;
2482
2252
  }, z.core.$loose>;
2483
2253
  sites: z.ZodArray<z.ZodObject<{
@@ -2505,14 +2275,14 @@ declare const partnerEndpointSchemas: {
2505
2275
  }, z.core.$loose>;
2506
2276
  analytics: z.ZodObject<{
2507
2277
  status: z.ZodEnum<{
2508
- queued: "queued";
2509
2278
  ready: "ready";
2510
- failed: "failed";
2511
2279
  not_registered: "not_registered";
2280
+ queued: "queued";
2512
2281
  preparing: "preparing";
2513
2282
  syncing: "syncing";
2514
2283
  queryable_live: "queryable_live";
2515
2284
  queryable_partial: "queryable_partial";
2285
+ failed: "failed";
2516
2286
  }>;
2517
2287
  progress: z.ZodObject<{
2518
2288
  completed: z.ZodNumber;
@@ -2522,10 +2292,10 @@ declare const partnerEndpointSchemas: {
2522
2292
  }, z.core.$strip>;
2523
2293
  queryable: z.ZodBoolean;
2524
2294
  sourceMode: z.ZodEnum<{
2525
- d1: "d1";
2526
- r2: "r2";
2527
2295
  none: "none";
2528
2296
  live: "live";
2297
+ d1: "d1";
2298
+ r2: "r2";
2529
2299
  mixed: "mixed";
2530
2300
  }>;
2531
2301
  syncedRange: z.ZodObject<{
@@ -2540,10 +2310,10 @@ declare const partnerEndpointSchemas: {
2540
2310
  }, z.core.$loose>;
2541
2311
  sitemaps: z.ZodObject<{
2542
2312
  status: z.ZodEnum<{
2543
- unknown: "unknown";
2544
2313
  ready: "ready";
2545
- failed: "failed";
2546
2314
  syncing: "syncing";
2315
+ failed: "failed";
2316
+ unknown: "unknown";
2547
2317
  discovering: "discovering";
2548
2318
  none_found: "none_found";
2549
2319
  auto_submitted: "auto_submitted";
@@ -2615,9 +2385,9 @@ declare const partnerEndpointSchemas: {
2615
2385
  siteId: z.ZodString;
2616
2386
  siteUrl: z.ZodString;
2617
2387
  syncStatus: z.ZodEnum<{
2388
+ syncing: "syncing";
2618
2389
  pending: "pending";
2619
2390
  error: "error";
2620
- syncing: "syncing";
2621
2391
  synced: "synced";
2622
2392
  idle: "idle";
2623
2393
  }>;
@@ -2635,9 +2405,9 @@ declare const partnerEndpointSchemas: {
2635
2405
  registered: z.ZodBoolean;
2636
2406
  siteId: z.ZodOptional<z.ZodString>;
2637
2407
  syncStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
2408
+ syncing: "syncing";
2638
2409
  pending: "pending";
2639
2410
  error: "error";
2640
- syncing: "syncing";
2641
2411
  synced: "synced";
2642
2412
  }>>>;
2643
2413
  syncProgress: z.ZodOptional<z.ZodObject<{
@@ -2668,19 +2438,15 @@ declare const partnerEndpointSchemas: {
2668
2438
  "site.indexing.ready": "site.indexing.ready";
2669
2439
  "site.auth.failed": "site.auth.failed";
2670
2440
  "job.failed": "job.failed";
2671
- "job.completed": "job.completed";
2672
- "site.completed": "site.completed";
2673
- "indexing.completed": "indexing.completed";
2674
- "auth.failed": "auth.failed";
2675
2441
  }>>>;
2676
2442
  teamId: z.ZodOptional<z.ZodString>;
2677
2443
  }, z.core.$strip>;
2678
2444
  readonly response: z.ZodObject<{
2679
2445
  siteId: z.ZodString;
2680
2446
  status: z.ZodEnum<{
2447
+ syncing: "syncing";
2681
2448
  pending: "pending";
2682
2449
  error: "error";
2683
- syncing: "syncing";
2684
2450
  synced: "synced";
2685
2451
  idle: "idle";
2686
2452
  }>;
@@ -2713,10 +2479,6 @@ declare const partnerEndpointSchemas: {
2713
2479
  "site.indexing.ready": "site.indexing.ready";
2714
2480
  "site.auth.failed": "site.auth.failed";
2715
2481
  "job.failed": "job.failed";
2716
- "job.completed": "job.completed";
2717
- "site.completed": "site.completed";
2718
- "indexing.completed": "indexing.completed";
2719
- "auth.failed": "auth.failed";
2720
2482
  }>>>;
2721
2483
  }, z.core.$loose>>>;
2722
2484
  }, z.core.$strip>;
@@ -2725,8 +2487,8 @@ declare const partnerEndpointSchemas: {
2725
2487
  siteUrl: z.ZodString;
2726
2488
  siteId: z.ZodOptional<z.ZodString>;
2727
2489
  status: z.ZodEnum<{
2728
- error: "error";
2729
2490
  registered: "registered";
2491
+ error: "error";
2730
2492
  already_exists: "already_exists";
2731
2493
  not_found: "not_found";
2732
2494
  }>;
@@ -3354,293 +3116,9 @@ declare const partnerEndpointSchemas: {
3354
3116
  externalSiteId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3355
3117
  lifecycleRevision: z.ZodNumber;
3356
3118
  occurredAt: z.ZodISODateTime;
3357
- data: z.ZodDiscriminatedUnion<[z.ZodObject<{
3358
- legacyEvent: z.ZodLiteral<"job.completed">;
3359
- legacyPayload: z.ZodObject<{
3360
- event: z.ZodLiteral<"job.completed">;
3361
- siteId: z.ZodString;
3362
- siteUrl: z.ZodString;
3363
- table: z.ZodOptional<z.ZodString>;
3364
- date: z.ZodString;
3365
- rowsFetched: z.ZodNumber;
3366
- rowsInserted: z.ZodNumber;
3367
- timestamp: z.ZodNumber;
3368
- }, z.core.$loose>;
3369
- event: z.ZodOptional<z.ZodLiteral<"job.completed">>;
3370
- siteId: z.ZodString;
3371
- siteUrl: z.ZodString;
3372
- table: z.ZodOptional<z.ZodString>;
3373
- date: z.ZodString;
3374
- rowsFetched: z.ZodNumber;
3375
- rowsInserted: z.ZodNumber;
3376
- timestamp: z.ZodNumber;
3377
- }, z.core.$loose>, z.ZodObject<{
3378
- legacyEvent: z.ZodLiteral<"job.failed">;
3379
- legacyPayload: z.ZodObject<{
3380
- event: z.ZodLiteral<"job.failed">;
3381
- siteId: z.ZodString;
3382
- siteUrl: z.ZodString;
3383
- table: z.ZodString;
3384
- date: z.ZodString;
3385
- error: z.ZodString;
3386
- timestamp: z.ZodNumber;
3387
- }, z.core.$loose>;
3388
- event: z.ZodOptional<z.ZodLiteral<"job.failed">>;
3389
- siteId: z.ZodString;
3390
- siteUrl: z.ZodString;
3391
- table: z.ZodString;
3392
- date: z.ZodString;
3393
- error: z.ZodString;
3394
- timestamp: z.ZodNumber;
3395
- }, z.core.$loose>, z.ZodObject<{
3396
- legacyEvent: z.ZodLiteral<"site.completed">;
3397
- legacyPayload: z.ZodObject<{
3398
- event: z.ZodLiteral<"site.completed">;
3399
- siteId: z.ZodString;
3400
- siteUrl: z.ZodString;
3401
- status: z.ZodString;
3402
- daysSynced: z.ZodNumber;
3403
- failedJobs: z.ZodNumber;
3404
- oldestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3405
- newestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3406
- timestamp: z.ZodNumber;
3407
- }, z.core.$loose>;
3408
- event: z.ZodOptional<z.ZodLiteral<"site.completed">>;
3409
- siteId: z.ZodString;
3410
- siteUrl: z.ZodString;
3411
- status: z.ZodString;
3412
- daysSynced: z.ZodNumber;
3413
- failedJobs: z.ZodNumber;
3414
- oldestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3415
- newestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3416
- timestamp: z.ZodNumber;
3417
- }, z.core.$loose>, z.ZodObject<{
3418
- legacyEvent: z.ZodLiteral<"indexing.completed">;
3419
- legacyPayload: z.ZodObject<{
3420
- event: z.ZodLiteral<"indexing.completed">;
3421
- siteId: z.ZodString;
3422
- siteUrl: z.ZodString;
3423
- totalUrls: z.ZodNumber;
3424
- indexedCount: z.ZodNumber;
3425
- notIndexedCount: z.ZodNumber;
3426
- errorCount: z.ZodNumber;
3427
- urlsChecked: z.ZodNumber;
3428
- timestamp: z.ZodNumber;
3429
- }, z.core.$loose>;
3430
- event: z.ZodOptional<z.ZodLiteral<"indexing.completed">>;
3431
- siteId: z.ZodString;
3432
- siteUrl: z.ZodString;
3433
- totalUrls: z.ZodNumber;
3434
- indexedCount: z.ZodNumber;
3435
- notIndexedCount: z.ZodNumber;
3436
- errorCount: z.ZodNumber;
3437
- urlsChecked: z.ZodNumber;
3438
- timestamp: z.ZodNumber;
3439
- }, z.core.$loose>, z.ZodObject<{
3440
- legacyEvent: z.ZodLiteral<"auth.failed">;
3441
- legacyPayload: z.ZodObject<{
3442
- event: z.ZodLiteral<"auth.failed">;
3443
- siteId: z.ZodString;
3444
- siteUrl: z.ZodString;
3445
- reason: z.ZodOptional<z.ZodString>;
3446
- message: z.ZodOptional<z.ZodString>;
3447
- reauthRequired: z.ZodOptional<z.ZodBoolean>;
3448
- authFailureCount: z.ZodOptional<z.ZodNumber>;
3449
- error: z.ZodOptional<z.ZodString>;
3450
- timestamp: z.ZodOptional<z.ZodNumber>;
3451
- }, z.core.$loose>;
3452
- event: z.ZodOptional<z.ZodLiteral<"auth.failed">>;
3453
- siteId: z.ZodString;
3454
- siteUrl: z.ZodString;
3455
- reason: z.ZodOptional<z.ZodString>;
3456
- message: z.ZodOptional<z.ZodString>;
3457
- reauthRequired: z.ZodOptional<z.ZodBoolean>;
3458
- authFailureCount: z.ZodOptional<z.ZodNumber>;
3459
- error: z.ZodOptional<z.ZodString>;
3460
- timestamp: z.ZodOptional<z.ZodNumber>;
3461
- }, z.core.$loose>, z.ZodObject<{
3462
- legacyEvent: z.ZodLiteral<"user.lifecycle.changed">;
3463
- }, z.core.$loose>, z.ZodObject<{
3464
- legacyEvent: z.ZodLiteral<"site.lifecycle.changed">;
3465
- }, z.core.$loose>, z.ZodObject<{
3466
- legacyEvent: z.ZodLiteral<"site.analytics.ready">;
3467
- }, z.core.$loose>, z.ZodObject<{
3468
- legacyEvent: z.ZodLiteral<"site.indexing.ready">;
3469
- }, z.core.$loose>, z.ZodObject<{
3470
- legacyEvent: z.ZodLiteral<"site.auth.failed">;
3471
- }, z.core.$loose>], "legacyEvent">;
3119
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3472
3120
  }, z.core.$loose>;
3473
- readonly legacyMessage: z.ZodDiscriminatedUnion<[z.ZodObject<{
3474
- event: z.ZodLiteral<"job.completed">;
3475
- siteId: z.ZodString;
3476
- siteUrl: z.ZodString;
3477
- table: z.ZodOptional<z.ZodString>;
3478
- date: z.ZodString;
3479
- rowsFetched: z.ZodNumber;
3480
- rowsInserted: z.ZodNumber;
3481
- timestamp: z.ZodNumber;
3482
- }, z.core.$loose>, z.ZodObject<{
3483
- event: z.ZodLiteral<"job.failed">;
3484
- siteId: z.ZodString;
3485
- siteUrl: z.ZodString;
3486
- table: z.ZodString;
3487
- date: z.ZodString;
3488
- error: z.ZodString;
3489
- timestamp: z.ZodNumber;
3490
- }, z.core.$loose>, z.ZodObject<{
3491
- event: z.ZodLiteral<"site.completed">;
3492
- siteId: z.ZodString;
3493
- siteUrl: z.ZodString;
3494
- status: z.ZodString;
3495
- daysSynced: z.ZodNumber;
3496
- failedJobs: z.ZodNumber;
3497
- oldestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3498
- newestDateSynced: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3499
- timestamp: z.ZodNumber;
3500
- }, z.core.$loose>, z.ZodObject<{
3501
- event: z.ZodLiteral<"indexing.completed">;
3502
- siteId: z.ZodString;
3503
- siteUrl: z.ZodString;
3504
- totalUrls: z.ZodNumber;
3505
- indexedCount: z.ZodNumber;
3506
- notIndexedCount: z.ZodNumber;
3507
- errorCount: z.ZodNumber;
3508
- urlsChecked: z.ZodNumber;
3509
- timestamp: z.ZodNumber;
3510
- }, z.core.$loose>, z.ZodObject<{
3511
- event: z.ZodLiteral<"auth.failed">;
3512
- siteId: z.ZodString;
3513
- siteUrl: z.ZodString;
3514
- reason: z.ZodOptional<z.ZodString>;
3515
- message: z.ZodOptional<z.ZodString>;
3516
- reauthRequired: z.ZodOptional<z.ZodBoolean>;
3517
- authFailureCount: z.ZodOptional<z.ZodNumber>;
3518
- error: z.ZodOptional<z.ZodString>;
3519
- timestamp: z.ZodOptional<z.ZodNumber>;
3520
- }, z.core.$loose>], "event">;
3521
- };
3522
- };
3523
- declare const GSCDUMP_ONBOARDING_CONTRACT_VERSION: "2026-05-11";
3524
- declare const GSCDUMP_REQUIRED_ANALYTICS_SCOPE: "https://www.googleapis.com/auth/webmasters.readonly";
3525
- declare const GSCDUMP_OPTIONAL_INDEXING_SCOPE: "https://www.googleapis.com/auth/indexing";
3526
- declare const accountStatuses: readonly ["disconnected", "oauth_received", "scope_missing", "refresh_missing", "db_provisioning", "ready", "reauth_required"];
3527
- declare const accountNextActions: readonly ["connect_google", "reconnect_google", "wait_for_provisioning", "none"];
3528
- declare const propertyStatuses: readonly ["no_local_site", "no_gsc_property", "unverified_property", "verified_candidate", "registered", "linked"];
3529
- declare const propertyNextActions: readonly ["create_site", "verify_gsc_property", "choose_property", "register_site", "none"];
3530
- declare const analyticsStatuses: readonly ["not_registered", "queued", "preparing", "syncing", "queryable_live", "queryable_partial", "ready", "failed"];
3531
- declare const analyticsNextActions: readonly ["wait_for_sync", "retry_sync", "none"];
3532
- declare const querySourceModes: readonly ["none", "live", "d1", "r2", "mixed"];
3533
- declare const sitemapStatuses: readonly ["unknown", "discovering", "none_found", "auto_submitted", "syncing", "ready", "failed"];
3534
- declare const sitemapNextActions: readonly ["submit_sitemap", "wait_for_sitemaps", "retry_sitemaps", "none"];
3535
- declare const indexingStatuses: readonly ["not_requested", "missing_scope", "insufficient_permission", "waiting_for_sitemaps", "discovering", "checking", "ready", "budget_exhausted", "no_urls", "failed"];
3536
- declare const indexingNextActions: readonly ["reconnect_google", "fix_gsc_permission", "wait_for_sitemaps", "wait_for_indexing", "retry_indexing", "none"];
3537
- declare const lifecycleWebhookEvents: readonly ["user.lifecycle.changed", "site.lifecycle.changed", "site.analytics.ready", "site.indexing.ready", "site.auth.failed", "job.failed"];
3538
- declare const lifecycleErrorCodes: readonly ["missing_refresh_token", "missing_analytics_scope", "missing_indexing_scope", "token_refresh_failed", "permission_lost", "insufficient_gsc_permission", "gsc_property_not_found", "gsc_property_unverified", "user_database_not_provisioned", "sync_failed", "sitemap_sync_failed", "indexing_failed"];
3539
- type AccountStatus = typeof accountStatuses[number];
3540
- type AccountNextAction = typeof accountNextActions[number];
3541
- type PropertyStatus = typeof propertyStatuses[number];
3542
- type PropertyNextAction = typeof propertyNextActions[number];
3543
- type AnalyticsStatus = typeof analyticsStatuses[number];
3544
- type AnalyticsNextAction = typeof analyticsNextActions[number];
3545
- type QuerySourceMode = typeof querySourceModes[number];
3546
- type SitemapStatus = typeof sitemapStatuses[number];
3547
- type SitemapNextAction = typeof sitemapNextActions[number];
3548
- type IndexingStatus = typeof indexingStatuses[number];
3549
- type IndexingNextAction = typeof indexingNextActions[number];
3550
- type LifecycleWebhookEvent = typeof lifecycleWebhookEvents[number];
3551
- type LifecycleErrorCode = typeof lifecycleErrorCodes[number];
3552
- interface LifecycleProgress {
3553
- completed: number;
3554
- failed: number;
3555
- total: number;
3556
- percent: number;
3557
- }
3558
- interface LifecycleError {
3559
- code: LifecycleErrorCode;
3560
- message: string;
3561
- retryable: boolean;
3562
- }
3563
- interface PartnerLifecycleAccount {
3564
- status: AccountStatus;
3565
- grantedScopes: string[];
3566
- missingScopes: string[];
3567
- nextAction: AccountNextAction;
3568
- }
3569
- interface PartnerLifecycleSite {
3570
- siteId: string;
3571
- externalSiteId: string | null;
3572
- requestedUrl: string;
3573
- gscPropertyUrl: string | null;
3574
- permissionLevel: string | null;
3575
- property: {
3576
- status: PropertyStatus;
3577
- nextAction: PropertyNextAction;
3578
- };
3579
- analytics: {
3580
- status: AnalyticsStatus;
3581
- progress: LifecycleProgress;
3582
- queryable: boolean;
3583
- sourceMode: QuerySourceMode;
3584
- syncedRange: {
3585
- oldest: string | null;
3586
- newest: string | null;
3587
- };
3588
- nextAction: AnalyticsNextAction;
3589
- };
3590
- sitemaps: {
3591
- status: SitemapStatus;
3592
- discoveredCount: number;
3593
- nextAction: SitemapNextAction;
3594
- };
3595
- indexing: {
3596
- status: IndexingStatus;
3597
- eligible: boolean;
3598
- reason: string | null;
3599
- progress: LifecycleProgress;
3600
- nextAction: IndexingNextAction;
3601
3121
  };
3602
- latestError: LifecycleError | null;
3603
- lifecycleRevision: number;
3604
- updatedAt: string;
3605
- }
3606
- interface PartnerLifecycleResponse {
3607
- contractVersion: typeof GSCDUMP_ONBOARDING_CONTRACT_VERSION;
3608
- userId: string;
3609
- partnerId: string | null;
3610
- account: PartnerLifecycleAccount;
3611
- sites: PartnerLifecycleSite[];
3612
- }
3613
- interface LifecycleWebhookEnvelope<TData extends Record<string, unknown> = Record<string, unknown>> {
3614
- contractVersion: typeof GSCDUMP_ONBOARDING_CONTRACT_VERSION;
3615
- deliveryId: string;
3616
- event: LifecycleWebhookEvent;
3617
- partnerId: string;
3618
- userId: string;
3619
- siteId?: string;
3620
- externalUserId?: string | null;
3621
- externalSiteId?: string | null;
3622
- lifecycleRevision: number;
3623
- occurredAt: string;
3624
- data: TData;
3625
- }
3626
- declare function parseGrantedScopes(scopes: string | null | undefined): string[];
3627
- declare function hasRequiredAnalyticsScope(scopes: string | string[] | null | undefined): boolean;
3628
- declare function hasOptionalIndexingScope(scopes: string | string[] | null | undefined): boolean;
3629
- declare const WEBHOOK_CONTRACT_VERSION = "2026-05-11";
3630
- declare const WEBHOOK_SIGNATURE_HEADER = "X-GSCDump-Signature";
3631
- declare const WEBHOOK_EVENT_HEADER = "X-GSCDump-Event";
3632
- declare const WEBHOOK_DELIVERY_HEADER = "X-GSCDump-Delivery";
3633
- declare const WEBHOOK_CONTRACT_VERSION_HEADER = "X-GSCDump-Contract-Version";
3634
- declare const WEBHOOK_TIMESTAMP_HEADER = "X-GSCDump-Timestamp";
3635
- declare const CANONICAL_WEBHOOK_EVENTS: readonly ["user.lifecycle.changed", "site.lifecycle.changed", "site.analytics.ready", "site.indexing.ready", "site.auth.failed", "job.failed"];
3636
- declare const LEGACY_WEBHOOK_EVENTS: readonly ["job.completed", "job.failed", "site.completed", "indexing.completed", "auth.failed"];
3637
- declare const VALID_WEBHOOK_EVENTS: readonly ["job.completed", "job.failed", "site.completed", "indexing.completed", "auth.failed", ...("user.lifecycle.changed" | "site.lifecycle.changed" | "site.analytics.ready" | "site.indexing.ready" | "site.auth.failed" | "job.failed")[]];
3638
- declare const WEBHOOK_EVENT_ALIASES: {
3639
- readonly 'job.completed': "site.lifecycle.changed";
3640
- readonly 'job.failed': "job.failed";
3641
- readonly 'site.completed': "site.analytics.ready";
3642
- readonly 'indexing.completed': "site.indexing.ready";
3643
- readonly 'auth.failed': "site.auth.failed";
3644
3122
  };
3645
3123
  type TableName = 'pages' | 'keywords' | 'countries' | 'devices' | 'page_keywords' | 'search_appearance';
3646
3124
  type Row = Record<string, unknown>;
@@ -3660,19 +3138,19 @@ interface TenantCtx {
3660
3138
  userId: string;
3661
3139
  siteId?: string;
3662
3140
  }
3663
- type Dimension = 'page' | 'query' | 'country' | 'device' | 'date' | 'searchAppearance';
3141
+ type Dimension = 'page' | 'query' | 'queryCanonical' | 'country' | 'device' | 'date' | 'searchAppearance';
3664
3142
  type Metric = 'clicks' | 'impressions' | 'ctr' | 'position';
3665
- type Filter = Record<string, unknown>;
3143
+ type Filter = unknown;
3666
3144
  interface BuilderState {
3667
3145
  dimensions: Dimension[];
3668
3146
  metrics?: Metric[];
3669
3147
  filter?: Filter;
3670
3148
  orderBy?: {
3671
3149
  column: Metric | 'date';
3672
- direction: 'asc' | 'desc';
3150
+ dir: 'asc' | 'desc';
3673
3151
  };
3674
- limit?: number;
3675
3152
  rowLimit?: number;
3153
+ startRow?: number;
3676
3154
  }
3677
3155
  interface GscApiRange {
3678
3156
  start: string;
@@ -3913,6 +3391,14 @@ interface AnalyticsClient {
3913
3391
  search?: string;
3914
3392
  }) => Promise<IndexingUrlsResponse>;
3915
3393
  getIndexingDiagnostics: (siteId: string) => Promise<IndexingDiagnostics>;
3394
+ getCountries: (siteId: string, range: {
3395
+ start: string;
3396
+ end: string;
3397
+ }) => Promise<CountriesResponse>;
3398
+ getSearchAppearance: (siteId: string, range: {
3399
+ start: string;
3400
+ end: string;
3401
+ }) => Promise<SearchAppearanceResponse>;
3916
3402
  }
3917
3403
  type GscSearchAnalyticsDimension = 'page' | 'query' | 'country' | 'device' | 'date' | 'searchAppearance';
3918
3404
  type GscSearchAnalyticsFilterOperator = 'equals' | 'notEquals' | 'contains' | 'notContains' | 'includingRegex' | 'excludingRegex';
@@ -4928,8 +4414,7 @@ interface RealtimeErrorMessage {
4928
4414
  }
4929
4415
  type PartnerRealtimeMessage = PartnerRealtimeEvent | RealtimeAuthRequiredMessage | RealtimeConnectedMessage | RealtimeSubscribedMessage | RealtimePongMessage | RealtimeErrorMessage;
4930
4416
  type CanonicalWebhookEventType = 'user.lifecycle.changed' | 'site.lifecycle.changed' | 'site.analytics.ready' | 'site.indexing.ready' | 'site.auth.failed' | 'job.failed';
4931
- type LegacyWebhookEventType = 'job.completed' | 'job.failed' | 'site.completed' | 'indexing.completed' | 'auth.failed';
4932
- type WebhookEventType = CanonicalWebhookEventType | LegacyWebhookEventType;
4417
+ type WebhookEventType = CanonicalWebhookEventType;
4933
4418
  interface WebhookEnvelope<TData extends Record<string, unknown> = Record<string, unknown>> {
4934
4419
  contractVersion: string;
4935
4420
  deliveryId: string;
@@ -4943,90 +4428,9 @@ interface WebhookEnvelope<TData extends Record<string, unknown> = Record<string,
4943
4428
  occurredAt: string;
4944
4429
  data: TData;
4945
4430
  }
4946
- interface BaseWebhookData {
4947
- legacyEvent: WebhookEventType;
4948
- legacyPayload?: Record<string, unknown> & {
4949
- event?: LegacyWebhookEventType;
4950
- };
4951
- }
4952
- interface JobCompletedWebhookData extends BaseWebhookData {
4953
- legacyEvent: 'job.completed';
4954
- legacyPayload: Record<string, unknown> & {
4955
- event: 'job.completed';
4956
- };
4957
- event?: 'job.completed';
4958
- siteId: string;
4959
- siteUrl: string;
4960
- table?: string;
4961
- date: string;
4962
- rowsFetched: number;
4963
- rowsInserted: number;
4964
- timestamp: number;
4965
- }
4966
- interface JobFailedWebhookData extends BaseWebhookData {
4967
- legacyEvent: 'job.failed';
4968
- legacyPayload: Record<string, unknown> & {
4969
- event: 'job.failed';
4970
- };
4971
- event?: 'job.failed';
4972
- siteId: string;
4973
- siteUrl: string;
4974
- table: string;
4975
- date: string;
4976
- error: string;
4977
- timestamp: number;
4978
- }
4979
- interface SiteAnalyticsReadyWebhookData extends BaseWebhookData {
4980
- legacyEvent: 'site.completed';
4981
- legacyPayload: Record<string, unknown> & {
4982
- event: 'site.completed';
4983
- };
4984
- event?: 'site.completed';
4985
- siteId: string;
4986
- siteUrl: string;
4987
- status: string;
4988
- daysSynced: number;
4989
- failedJobs: number;
4990
- oldestDateSynced?: string | null;
4991
- newestDateSynced?: string | null;
4992
- timestamp: number;
4993
- }
4994
- interface SiteIndexingReadyWebhookData extends BaseWebhookData {
4995
- legacyEvent: 'indexing.completed';
4996
- legacyPayload: Record<string, unknown> & {
4997
- event: 'indexing.completed';
4998
- };
4999
- event?: 'indexing.completed';
5000
- siteId: string;
5001
- siteUrl: string;
5002
- totalUrls: number;
5003
- indexedCount: number;
5004
- notIndexedCount: number;
5005
- errorCount: number;
5006
- urlsChecked: number;
5007
- timestamp: number;
5008
- }
5009
- interface SiteAuthFailedWebhookData extends BaseWebhookData {
5010
- legacyEvent: 'auth.failed';
5011
- legacyPayload: Record<string, unknown> & {
5012
- event: 'auth.failed';
5013
- };
5014
- event?: 'auth.failed';
5015
- siteId: string;
5016
- siteUrl: string;
5017
- reason?: string;
5018
- message?: string;
5019
- reauthRequired?: boolean;
5020
- authFailureCount?: number;
5021
- error?: string;
5022
- timestamp?: number;
5023
- }
5024
- interface LifecycleWebhookData extends BaseWebhookData {
5025
- legacyEvent: 'user.lifecycle.changed' | 'site.lifecycle.changed' | 'site.analytics.ready' | 'site.indexing.ready' | 'site.auth.failed';
5026
- }
5027
- type PartnerWebhookData = JobCompletedWebhookData | JobFailedWebhookData | SiteAnalyticsReadyWebhookData | SiteIndexingReadyWebhookData | SiteAuthFailedWebhookData | LifecycleWebhookData;
4431
+ type PartnerWebhookData = Record<string, unknown>;
5028
4432
  interface CreateWebhookEnvelopeOptions<TData extends Record<string, unknown> = Record<string, unknown>> {
5029
- event: WebhookEventType;
4433
+ event: CanonicalWebhookEventType;
5030
4434
  partnerId: string;
5031
4435
  userId: string | null;
5032
4436
  siteId?: string;
@@ -5045,4 +4449,12 @@ interface PartnerWebhookHeaders {
5045
4449
  timestamp?: string | null;
5046
4450
  signature?: string | null;
5047
4451
  }
5048
- export { AccountNextAction, AccountStatus, AddPartnerTeamMemberParams, AnalysisSourcesResponse, AnalyticsClient, AnalyticsNextAction, AnalyticsStatus, BackfillRange, BackfillResponse, BaseWebhookData, BindPartnerSiteTeamParams, BuilderState, BulkRegisterPartnerSiteResult, BulkRegisterPartnerSitesParams, BulkRegisterPartnerSitesResponse, CANONICAL_WEBHOOK_EVENTS, CanonicalWebhookEventType, ColumnDef, ColumnType, CountriesResponse, CountryRow, CreatePartnerTeamParams, CreateWebhookEnvelopeOptions, DataDetailOptions, DataQueryOptions, DeletePartnerUserResponse, Dimension, Filter, GSCDUMP_ONBOARDING_CONTRACT_VERSION, GSCDUMP_OPTIONAL_INDEXING_SCOPE, GSCDUMP_REQUIRED_ANALYTICS_SCOPE, GscApiRange, GscComparisonFilter, GscRowQueryMeta, GscRowQueryResponse, GscSearchAnalyticsDimension, GscSearchAnalyticsFilter, GscSearchAnalyticsFilterGroup, GscSearchAnalyticsFilterOperator, GscSearchAnalyticsRequest, GscSearchAnalyticsResponse, GscSearchAnalyticsRow, GscSearchType, GscdumpAnalysisParams, GscdumpAnalysisPreset, GscdumpAnalysisResponse, GscdumpAnalysisSourcesResponse, GscdumpAvailableSite, GscdumpCanonicalMismatchRow, GscdumpCanonicalMismatchesResponse, GscdumpDataDetailResponse, GscdumpDataResponse, GscdumpDataRow, GscdumpDateRangeParams, GscdumpHealthResponse, GscdumpIndexPercentResponse, GscdumpIndexPercentSitemap, GscdumpIndexPercentTrendPoint, GscdumpIndexingDiagnosticsResponse, GscdumpIndexingResponse, GscdumpIndexingTrendPoint, GscdumpIndexingUrl, GscdumpIndexingUrlStatus, GscdumpIndexingUrlsResponse, GscdumpInvisibleUrlRow, GscdumpKeywordSparklinesParams, GscdumpKeywordSparklinesResponse, GscdumpMeta, GscdumpOrphanPageRow, GscdumpPerSitemapHistoryEntry, GscdumpPermissionRecovery, GscdumpQueryTrendParams, GscdumpQueryTrendResponse, GscdumpSiteRegistration, GscdumpSiteReportResponse, GscdumpSitemap, GscdumpSitemapChangesResponse, GscdumpSitemapHistory, GscdumpSitemapsResponse, GscdumpSyncJobItem, GscdumpSyncJobStatus, GscdumpSyncJobsQueueCounts, GscdumpSyncJobsResponse, GscdumpSyncProgressDateStatus, GscdumpSyncProgressPhaseCounts, GscdumpSyncProgressResponse, GscdumpSyncProgressSite, GscdumpSyncStatusResponse, GscdumpTeamMemberRow, GscdumpTeamRow, GscdumpTopAssociationParams, GscdumpTopAssociationResponse, GscdumpTotals, GscdumpUserMeResponse, GscdumpUserRegistration, GscdumpUserSettings, GscdumpUserSite, GscdumpUserStatus, GscdumpUserTokenUpdate, IndexingDiagnostics, IndexingIssue, IndexingIssueSeverity, IndexingNextAction, IndexingStatus, IndexingUrlRow, IndexingUrlStatus, IndexingUrlsParams, IndexingUrlsResponse, InspectionHistoryRecord, InspectionHistoryResponse, InspectionIndex, JobCompletedWebhookData, JobFailedWebhookData, LEGACY_WEBHOOK_EVENTS, LegacyWebhookEventType, LifecycleError, LifecycleErrorCode, LifecycleProgress, LifecycleWebhookData, LifecycleWebhookEnvelope, LifecycleWebhookEvent, Metric, PartnerClient, type PartnerLifecycleAccount, type PartnerLifecycleResponse, type PartnerLifecycleSite, PartnerRealtimeEvent, PartnerRealtimeEventType, PartnerRealtimeMessage, PartnerWebhookData, PartnerWebhookHeaders, PropertyNextAction, PropertyStatus, QuerySourceMode, RealtimeAuthFailedEvent, RealtimeAuthRequiredMessage, RealtimeConnectedMessage, RealtimeEnrichmentCompleteEvent, RealtimeErrorMessage, RealtimeJobFailedEvent, RealtimeNeedsReauthEvent, RealtimePongMessage, RealtimeSiteAddedEvent, RealtimeSiteRemovedEvent, RealtimeSubscribedMessage, RealtimeSyncCompleteEvent, RealtimeSyncFailedEvent, RealtimeSyncJobCompleteEvent, RealtimeSyncProgressEvent, RealtimeSyncSiteCompleteEvent, RegisterPartnerSiteParams, RegisterPartnerUserParams, RollupEnvelope, Row, ScheduleState, SearchAppearanceResponse, SearchAppearanceRow, SiteAnalyticsReadyWebhookData, SiteAuthFailedWebhookData, SiteIndexingReadyWebhookData, SiteListItem, SitemapAddedRow, SitemapChangesResponse, SitemapHistoryRecord, SitemapHistoryResponse, SitemapIndex, SitemapNextAction, SitemapRemovedRow, SitemapStatus, SourceInfoResponse, TableName, TableSchema, TenantCtx, UpdatePartnerUserTokensParams, VALID_WEBHOOK_EVENTS, WEBHOOK_CONTRACT_VERSION, WEBHOOK_CONTRACT_VERSION_HEADER, WEBHOOK_DELIVERY_HEADER, WEBHOOK_EVENT_ALIASES, WEBHOOK_EVENT_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, WebhookEnvelope, WebhookEventType, WhoamiResponse, accountNextActions, accountStatuses, addPartnerTeamMemberSchema, analyticsNextActions, analyticsRoutes, analyticsStatuses, authFailedWebhookPayloadSchema, backfillRangeSchema, backfillResponseSchema, bindPartnerSiteTeamSchema, builderStateSchema, bulkRegisterPartnerSitesResponseSchema, bulkRegisterPartnerSitesSchema, canonicalWebhookEventTypeSchema, countriesResponseSchema, countryRowSchema, createPartnerTeamSchema, dataDetailOptionsSchema, dataQueryOptionsSchema, gscApiRangeSchema, gscComparisonFilterSchema, gscRowQueryMetaSchema, gscRowQueryResponseSchema, gscdumpAnalysisParamsSchema, gscdumpAnalysisPresetSchema, gscdumpAnalysisResponseSchema, gscdumpAnalysisSourcesResponseSchema, gscdumpAvailableSiteSchema, gscdumpCanonicalMismatchesResponseSchema, gscdumpDataDetailResponseSchema, gscdumpDataResponseSchema, gscdumpDataRowSchema, gscdumpDateRangeParamsSchema, gscdumpDeletePartnerUserResponseSchema, gscdumpHealthResponseSchema, gscdumpIndexPercentParamsSchema, gscdumpIndexPercentResponseSchema, gscdumpIndexingDiagnosticsResponseSchema, gscdumpIndexingResponseSchema, gscdumpIndexingUrlsResponseSchema, gscdumpKeywordSparklinesParamsSchema, gscdumpKeywordSparklinesResponseSchema, gscdumpMetaSchema, gscdumpPermissionRecoverySchema, gscdumpQueryTrendParamsSchema, gscdumpQueryTrendResponseSchema, gscdumpSiteRegistrationSchema, gscdumpSiteReportResponseSchema, gscdumpSitemapChangesResponseSchema, gscdumpSitemapsResponseSchema, gscdumpSyncJobsResponseSchema, gscdumpSyncProgressResponseSchema, gscdumpTeamMemberRowSchema, gscdumpTeamRoleSchema, gscdumpTeamRowSchema, gscdumpTopAssociationParamsSchema, gscdumpTopAssociationResponseSchema, gscdumpTotalsSchema, gscdumpUserMeResponseSchema, gscdumpUserRegistrationSchema, gscdumpUserSettingsSchema, gscdumpUserSiteSchema, gscdumpUserStatusSchema, hasOptionalIndexingScope, hasRequiredAnalyticsScope, indexingCompletedWebhookPayloadSchema, indexingDiagnosticsSchema, indexingIssueSchema, indexingNextActions, indexingStatuses, indexingUrlRowSchema, indexingUrlStatusSchema, indexingUrlsParamsSchema, indexingUrlsResponseSchema, inspectionHistoryRecordSchema, inspectionHistoryResponseSchema, inspectionIndexSchema, jobCompletedWebhookPayloadSchema, jobFailedWebhookPayloadSchema, legacyWebhookEventTypeSchema, legacyWebhookPayloadSchema, lifecycleErrorCodes, lifecycleErrorSchema, lifecycleProgressSchema, lifecycleWebhookEvents, parseGrantedScopes, partnerEndpointSchemas, partnerLifecycleAccountSchema, partnerLifecycleResponseSchema, partnerLifecycleSiteSchema, partnerRealtimeEventSchema, partnerRoutes, partnerWebhookDataSchema, partnerWebhookEnvelopeSchema, propertyNextActions, propertyStatuses, querySourceModes, registerPartnerSiteSchema, registerPartnerUserSchema, rollupEnvelopeSchema, searchAppearanceResponseSchema, searchAppearanceRowSchema, siteCompletedWebhookPayloadSchema, siteListItemSchema, sitemapChangesResponseSchema, sitemapHistoryRecordSchema, sitemapHistoryResponseSchema, sitemapIndexSchema, sitemapNextActions, sitemapStatuses, sourceInfoResponseSchema, updatePartnerUserTokensSchema, webhookEventTypeSchema, whoamiResponseSchema };
4452
+ declare const WEBHOOK_CONTRACT_VERSION = "2026-05-11";
4453
+ declare const WEBHOOK_SIGNATURE_HEADER = "X-GSCDump-Signature";
4454
+ declare const WEBHOOK_EVENT_HEADER = "X-GSCDump-Event";
4455
+ declare const WEBHOOK_DELIVERY_HEADER = "X-GSCDump-Delivery";
4456
+ declare const WEBHOOK_CONTRACT_VERSION_HEADER = "X-GSCDump-Contract-Version";
4457
+ declare const WEBHOOK_TIMESTAMP_HEADER = "X-GSCDump-Timestamp";
4458
+ declare const CANONICAL_WEBHOOK_EVENTS: readonly ["user.lifecycle.changed", "site.lifecycle.changed", "site.analytics.ready", "site.indexing.ready", "site.auth.failed", "job.failed"];
4459
+ declare const VALID_WEBHOOK_EVENTS: readonly ["user.lifecycle.changed", "site.lifecycle.changed", "site.analytics.ready", "site.indexing.ready", "site.auth.failed", "job.failed"];
4460
+ export { AccountNextAction, AccountStatus, AddPartnerTeamMemberParams, AnalysisSourcesResponse, AnalyticsClient, AnalyticsNextAction, AnalyticsStatus, BackfillRange, BackfillResponse, BindPartnerSiteTeamParams, BuilderState, BulkRegisterPartnerSiteResult, BulkRegisterPartnerSitesParams, BulkRegisterPartnerSitesResponse, CANONICAL_WEBHOOK_EVENTS, CanonicalWebhookEventType, ColumnDef, ColumnType, CountriesResponse, CountryRow, CreatePartnerTeamParams, CreateWebhookEnvelopeOptions, DataDetailOptions, DataQueryOptions, DeletePartnerUserResponse, Dimension, Filter, GSCDUMP_ONBOARDING_CONTRACT_VERSION, GSCDUMP_OPTIONAL_INDEXING_SCOPE, GSCDUMP_REQUIRED_ANALYTICS_SCOPE, GscApiRange, GscComparisonFilter, GscRowQueryMeta, GscRowQueryResponse, GscSearchAnalyticsDimension, GscSearchAnalyticsFilter, GscSearchAnalyticsFilterGroup, GscSearchAnalyticsFilterOperator, GscSearchAnalyticsRequest, GscSearchAnalyticsResponse, GscSearchAnalyticsRow, GscSearchType, GscdumpAnalysisParams, GscdumpAnalysisPreset, GscdumpAnalysisResponse, GscdumpAnalysisSourcesResponse, GscdumpAvailableSite, GscdumpCanonicalMismatchRow, GscdumpCanonicalMismatchesResponse, GscdumpDataDetailResponse, GscdumpDataResponse, GscdumpDataRow, GscdumpDateRangeParams, GscdumpHealthResponse, GscdumpIndexPercentResponse, GscdumpIndexPercentSitemap, GscdumpIndexPercentTrendPoint, GscdumpIndexingDiagnosticsResponse, GscdumpIndexingResponse, GscdumpIndexingTrendPoint, GscdumpIndexingUrl, GscdumpIndexingUrlStatus, GscdumpIndexingUrlsResponse, GscdumpInvisibleUrlRow, GscdumpKeywordSparklinesParams, GscdumpKeywordSparklinesResponse, GscdumpMeta, GscdumpOrphanPageRow, GscdumpPerSitemapHistoryEntry, GscdumpPermissionRecovery, GscdumpQueryTrendParams, GscdumpQueryTrendResponse, GscdumpSiteRegistration, GscdumpSiteReportResponse, GscdumpSitemap, GscdumpSitemapChangesResponse, GscdumpSitemapHistory, GscdumpSitemapsResponse, GscdumpSyncJobItem, GscdumpSyncJobStatus, GscdumpSyncJobsQueueCounts, GscdumpSyncJobsResponse, GscdumpSyncProgressDateStatus, GscdumpSyncProgressPhaseCounts, GscdumpSyncProgressResponse, GscdumpSyncProgressSite, GscdumpSyncStatusResponse, GscdumpTeamMemberRow, GscdumpTeamRow, GscdumpTopAssociationParams, GscdumpTopAssociationResponse, GscdumpTotals, GscdumpUserMeResponse, GscdumpUserRegistration, GscdumpUserSettings, GscdumpUserSite, GscdumpUserStatus, GscdumpUserTokenUpdate, IndexingDiagnostics, IndexingIssue, IndexingIssueSeverity, IndexingNextAction, IndexingStatus, IndexingUrlRow, IndexingUrlStatus, IndexingUrlsParams, IndexingUrlsResponse, InspectionHistoryRecord, InspectionHistoryResponse, InspectionIndex, LifecycleError, LifecycleErrorCode, LifecycleProgress, LifecycleWebhookEnvelope, LifecycleWebhookEvent, Metric, PartnerClient, type PartnerLifecycleAccount, type PartnerLifecycleResponse, type PartnerLifecycleSite, PartnerRealtimeEvent, PartnerRealtimeEventType, PartnerRealtimeMessage, PartnerWebhookData, PartnerWebhookHeaders, PropertyNextAction, PropertyStatus, QuerySourceMode, RealtimeAuthFailedEvent, RealtimeAuthRequiredMessage, RealtimeConnectedMessage, RealtimeEnrichmentCompleteEvent, RealtimeErrorMessage, RealtimeJobFailedEvent, RealtimeNeedsReauthEvent, RealtimePongMessage, RealtimeSiteAddedEvent, RealtimeSiteRemovedEvent, RealtimeSubscribedMessage, RealtimeSyncCompleteEvent, RealtimeSyncFailedEvent, RealtimeSyncJobCompleteEvent, RealtimeSyncProgressEvent, RealtimeSyncSiteCompleteEvent, RegisterPartnerSiteParams, RegisterPartnerUserParams, RollupEnvelope, Row, ScheduleState, SearchAppearanceResponse, SearchAppearanceRow, SiteListItem, SitemapAddedRow, SitemapChangesResponse, SitemapHistoryRecord, SitemapHistoryResponse, SitemapIndex, SitemapNextAction, SitemapRemovedRow, SitemapStatus, SourceInfoResponse, TableName, TableSchema, TenantCtx, UpdatePartnerUserTokensParams, VALID_WEBHOOK_EVENTS, WEBHOOK_CONTRACT_VERSION, WEBHOOK_CONTRACT_VERSION_HEADER, WEBHOOK_DELIVERY_HEADER, WEBHOOK_EVENT_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_TIMESTAMP_HEADER, WebhookEnvelope, WebhookEventType, WhoamiResponse, accountNextActions, accountStatuses, addPartnerTeamMemberSchema, analyticsNextActions, analyticsRoutes, analyticsStatuses, backfillRangeSchema, backfillResponseSchema, bindPartnerSiteTeamSchema, builderStateSchema, bulkRegisterPartnerSitesResponseSchema, bulkRegisterPartnerSitesSchema, canonicalWebhookEventTypeSchema, countriesResponseSchema, countryRowSchema, createPartnerTeamSchema, dataDetailOptionsSchema, dataQueryOptionsSchema, gscApiRangeSchema, gscComparisonFilterSchema, gscRowQueryMetaSchema, gscRowQueryResponseSchema, gscdumpAnalysisParamsSchema, gscdumpAnalysisPresetSchema, gscdumpAnalysisResponseSchema, gscdumpAnalysisSourcesResponseSchema, gscdumpAvailableSiteSchema, gscdumpCanonicalMismatchesResponseSchema, gscdumpDataDetailResponseSchema, gscdumpDataResponseSchema, gscdumpDataRowSchema, gscdumpDateRangeParamsSchema, gscdumpDeletePartnerUserResponseSchema, gscdumpHealthResponseSchema, gscdumpIndexPercentParamsSchema, gscdumpIndexPercentResponseSchema, gscdumpIndexingDiagnosticsResponseSchema, gscdumpIndexingResponseSchema, gscdumpIndexingUrlsResponseSchema, gscdumpKeywordSparklinesParamsSchema, gscdumpKeywordSparklinesResponseSchema, gscdumpMetaSchema, gscdumpPermissionRecoverySchema, gscdumpQueryTrendParamsSchema, gscdumpQueryTrendResponseSchema, gscdumpSiteRegistrationSchema, gscdumpSiteReportResponseSchema, gscdumpSitemapChangesResponseSchema, gscdumpSitemapsResponseSchema, gscdumpSyncJobsResponseSchema, gscdumpSyncProgressResponseSchema, gscdumpTeamMemberRowSchema, gscdumpTeamRoleSchema, gscdumpTeamRowSchema, gscdumpTopAssociationParamsSchema, gscdumpTopAssociationResponseSchema, gscdumpTotalsSchema, gscdumpUserMeResponseSchema, gscdumpUserRegistrationSchema, gscdumpUserSettingsSchema, gscdumpUserSiteSchema, gscdumpUserStatusSchema, hasOptionalIndexingScope, hasRequiredAnalyticsScope, indexingDiagnosticsSchema, indexingIssueSchema, indexingNextActions, indexingStatuses, indexingUrlRowSchema, indexingUrlStatusSchema, indexingUrlsParamsSchema, indexingUrlsResponseSchema, inspectionHistoryRecordSchema, inspectionHistoryResponseSchema, inspectionIndexSchema, jobFailedWebhookPayloadSchema, lifecycleErrorCodes, lifecycleErrorSchema, lifecycleProgressSchema, lifecycleWebhookEvents, parseGrantedScopes, partnerEndpointSchemas, partnerLifecycleAccountSchema, partnerLifecycleResponseSchema, partnerLifecycleSiteSchema, partnerRealtimeEventSchema, partnerRoutes, partnerWebhookDataSchema, partnerWebhookEnvelopeSchema, propertyNextActions, propertyStatuses, querySourceModes, registerPartnerSiteSchema, registerPartnerUserSchema, rollupEnvelopeSchema, searchAppearanceResponseSchema, searchAppearanceRowSchema, siteListItemSchema, sitemapChangesResponseSchema, sitemapHistoryRecordSchema, sitemapHistoryResponseSchema, sitemapIndexSchema, sitemapNextActions, sitemapStatuses, sourceInfoResponseSchema, updatePartnerUserTokensSchema, webhookEventTypeSchema, whoamiResponseSchema };