@iann29/rastro 0.1.0-alpha.1 → 0.1.0-alpha.11

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 (179) hide show
  1. package/README.md +693 -69
  2. package/agent/integration.md +801 -0
  3. package/agent/manifest.json +205 -0
  4. package/agent/manifest.schema.json +444 -0
  5. package/dist/client/federation.d.ts +381 -0
  6. package/dist/client/federation.d.ts.map +1 -0
  7. package/dist/client/federation.js +274 -0
  8. package/dist/client/federation.js.map +1 -0
  9. package/dist/client/index.d.ts +2673 -15
  10. package/dist/client/index.d.ts.map +1 -1
  11. package/dist/client/index.js +565 -33
  12. package/dist/client/index.js.map +1 -1
  13. package/dist/component/_generated/api.d.ts +22 -0
  14. package/dist/component/_generated/api.d.ts.map +1 -1
  15. package/dist/component/_generated/api.js.map +1 -1
  16. package/dist/component/_generated/component.d.ts +315 -4
  17. package/dist/component/_generated/component.d.ts.map +1 -1
  18. package/dist/component/_generated/server.d.ts +4 -0
  19. package/dist/component/_generated/server.d.ts.map +1 -1
  20. package/dist/component/_generated/server.js.map +1 -1
  21. package/dist/component/affiliates.d.ts.map +1 -1
  22. package/dist/component/affiliates.js +6 -2
  23. package/dist/component/affiliates.js.map +1 -1
  24. package/dist/component/cardinality.d.ts +12 -0
  25. package/dist/component/cardinality.d.ts.map +1 -0
  26. package/dist/component/cardinality.js +94 -0
  27. package/dist/component/cardinality.js.map +1 -0
  28. package/dist/component/constants.d.ts +28 -1
  29. package/dist/component/constants.d.ts.map +1 -1
  30. package/dist/component/constants.js +44 -1
  31. package/dist/component/constants.js.map +1 -1
  32. package/dist/component/convex.config.d.ts +6 -1
  33. package/dist/component/convex.config.js +9 -1
  34. package/dist/component/convex.config.js.map +1 -1
  35. package/dist/component/coverage.d.ts +27 -0
  36. package/dist/component/coverage.d.ts.map +1 -0
  37. package/dist/component/coverage.js +56 -0
  38. package/dist/component/coverage.js.map +1 -0
  39. package/dist/component/diagnostics.d.ts +9 -0
  40. package/dist/component/diagnostics.d.ts.map +1 -0
  41. package/dist/component/diagnostics.js +47 -0
  42. package/dist/component/diagnostics.js.map +1 -0
  43. package/dist/component/errors.d.ts +1 -1
  44. package/dist/component/errors.d.ts.map +1 -1
  45. package/dist/component/errors.js.map +1 -1
  46. package/dist/component/eventStore.d.ts +21 -9
  47. package/dist/component/eventStore.d.ts.map +1 -1
  48. package/dist/component/eventStore.js +142 -152
  49. package/dist/component/eventStore.js.map +1 -1
  50. package/dist/component/funnels.d.ts.map +1 -1
  51. package/dist/component/funnels.js +5 -3
  52. package/dist/component/funnels.js.map +1 -1
  53. package/dist/component/geo.d.ts +73 -0
  54. package/dist/component/geo.d.ts.map +1 -0
  55. package/dist/component/geo.js +648 -0
  56. package/dist/component/geo.js.map +1 -0
  57. package/dist/component/goals.d.ts.map +1 -1
  58. package/dist/component/goals.js +8 -5
  59. package/dist/component/goals.js.map +1 -1
  60. package/dist/component/guards.d.ts.map +1 -1
  61. package/dist/component/guards.js.map +1 -1
  62. package/dist/component/http.d.ts.map +1 -1
  63. package/dist/component/http.js +281 -62
  64. package/dist/component/http.js.map +1 -1
  65. package/dist/component/identity.d.ts +13 -0
  66. package/dist/component/identity.d.ts.map +1 -0
  67. package/dist/component/identity.js +58 -0
  68. package/dist/component/identity.js.map +1 -0
  69. package/dist/component/ingest.d.ts +3 -1
  70. package/dist/component/ingest.d.ts.map +1 -1
  71. package/dist/component/ingest.js +498 -95
  72. package/dist/component/ingest.js.map +1 -1
  73. package/dist/component/live.d.ts.map +1 -1
  74. package/dist/component/live.js +7 -6
  75. package/dist/component/live.js.map +1 -1
  76. package/dist/component/localTime.d.ts +25 -0
  77. package/dist/component/localTime.d.ts.map +1 -0
  78. package/dist/component/localTime.js +126 -0
  79. package/dist/component/localTime.js.map +1 -0
  80. package/dist/component/reports.d.ts +266 -10
  81. package/dist/component/reports.d.ts.map +1 -1
  82. package/dist/component/reports.js +1243 -137
  83. package/dist/component/reports.js.map +1 -1
  84. package/dist/component/retention.d.ts +75 -1
  85. package/dist/component/retention.d.ts.map +1 -1
  86. package/dist/component/retention.js +561 -38
  87. package/dist/component/retention.js.map +1 -1
  88. package/dist/component/rollupStore.d.ts +320 -0
  89. package/dist/component/rollupStore.d.ts.map +1 -0
  90. package/dist/component/rollupStore.js +596 -0
  91. package/dist/component/rollupStore.js.map +1 -0
  92. package/dist/component/rollups.d.ts +20 -0
  93. package/dist/component/rollups.d.ts.map +1 -0
  94. package/dist/component/rollups.js +73 -0
  95. package/dist/component/rollups.js.map +1 -0
  96. package/dist/component/sanitize.d.ts +24 -1
  97. package/dist/component/sanitize.d.ts.map +1 -1
  98. package/dist/component/sanitize.js +96 -16
  99. package/dist/component/sanitize.js.map +1 -1
  100. package/dist/component/schema.d.ts +687 -65
  101. package/dist/component/schema.js +187 -20
  102. package/dist/component/schema.js.map +1 -1
  103. package/dist/component/sites.d.ts +12 -0
  104. package/dist/component/sites.d.ts.map +1 -1
  105. package/dist/component/sites.js +41 -7
  106. package/dist/component/sites.js.map +1 -1
  107. package/dist/component/useragent.d.ts +9 -0
  108. package/dist/component/useragent.d.ts.map +1 -0
  109. package/dist/component/useragent.js +152 -0
  110. package/dist/component/useragent.js.map +1 -0
  111. package/dist/component/validators.d.ts +124 -69
  112. package/dist/component/validators.d.ts.map +1 -1
  113. package/dist/component/validators.js +35 -14
  114. package/dist/component/validators.js.map +1 -1
  115. package/dist/component/visitors.d.ts +19 -0
  116. package/dist/component/visitors.d.ts.map +1 -0
  117. package/dist/component/visitors.js +86 -0
  118. package/dist/component/visitors.js.map +1 -0
  119. package/dist/component/vitals.d.ts +41 -0
  120. package/dist/component/vitals.d.ts.map +1 -0
  121. package/dist/component/vitals.js +115 -0
  122. package/dist/component/vitals.js.map +1 -0
  123. package/dist/react/index.d.ts.map +1 -1
  124. package/dist/react/index.js.map +1 -1
  125. package/dist/tracker/generated.d.ts +11 -4
  126. package/dist/tracker/generated.d.ts.map +1 -1
  127. package/dist/tracker/generated.js +11 -4
  128. package/dist/tracker/generated.js.map +1 -1
  129. package/dist/tracker/tracker.d.ts +1 -1
  130. package/dist/tracker/tracker.d.ts.map +1 -1
  131. package/dist/tracker/tracker.js +57 -20
  132. package/dist/tracker/tracker.js.map +1 -1
  133. package/dist/tracker/vitals.d.ts +10 -0
  134. package/dist/tracker/vitals.d.ts.map +1 -0
  135. package/dist/tracker/vitals.js +140 -0
  136. package/dist/tracker/vitals.js.map +1 -0
  137. package/dist/tracker.min.js +1 -1
  138. package/dist/vitals.min.js +1 -0
  139. package/docs/benchmarks/2026-08-20-realistic.md +76 -76
  140. package/docs/benchmarks/2026-08-21-formal-certification.md +353 -0
  141. package/docs/benchmarks/2026-08-30-alpha6-recertification.md +206 -0
  142. package/docs/federation-setup.md +464 -0
  143. package/docs/federation.md +352 -0
  144. package/docs/upgrading.md +344 -0
  145. package/llms.txt +72 -0
  146. package/package.json +55 -11
  147. package/scripts/benchmark-ingest.mjs +175 -73
  148. package/scripts/generate-federation-keys.mjs +20 -0
  149. package/src/component/_generated/api.ts +22 -0
  150. package/src/component/_generated/component.ts +381 -4
  151. package/src/component/_generated/server.ts +4 -0
  152. package/src/component/affiliates.ts +20 -5
  153. package/src/component/cardinality.ts +117 -0
  154. package/src/component/constants.ts +44 -1
  155. package/src/component/convex.config.ts +11 -1
  156. package/src/component/coverage.ts +71 -0
  157. package/src/component/diagnostics.ts +65 -0
  158. package/src/component/errors.ts +2 -1
  159. package/src/component/eventStore.ts +217 -193
  160. package/src/component/funnels.ts +19 -16
  161. package/src/component/geo.ts +835 -0
  162. package/src/component/goals.ts +29 -21
  163. package/src/component/guards.ts +3 -1
  164. package/src/component/http.ts +404 -70
  165. package/src/component/identity.ts +74 -0
  166. package/src/component/ingest.ts +894 -188
  167. package/src/component/live.ts +13 -7
  168. package/src/component/localTime.ts +167 -0
  169. package/src/component/reports.ts +1872 -197
  170. package/src/component/retention.ts +788 -96
  171. package/src/component/rollupStore.ts +799 -0
  172. package/src/component/rollups.ts +82 -0
  173. package/src/component/sanitize.ts +144 -29
  174. package/src/component/schema.ts +217 -21
  175. package/src/component/sites.ts +59 -12
  176. package/src/component/useragent.ts +171 -0
  177. package/src/component/validators.ts +49 -14
  178. package/src/component/visitors.ts +116 -0
  179. package/src/component/vitals.ts +146 -0
@@ -0,0 +1,381 @@
1
+ import type { UserIdentity } from "convex/server";
2
+ import type { AnalyticsAuthorizationContext } from "./index.js";
3
+ export declare const FEDERATED_ANALYTICS_CLAIMS: Readonly<{
4
+ readonly connectionId: "rastro_connection_id";
5
+ readonly organizationId: "rastro_organization_id";
6
+ readonly permissions: "rastro_permissions";
7
+ }>;
8
+ export declare const FEDERATED_ANALYTICS_READ_PERMISSION = "analytics:read";
9
+ /**
10
+ * The opt-in write scope. A token carries it only for organization owners and
11
+ * admins, and a host honors it only when its local grant lists it too: both
12
+ * sides must agree before any configuration function runs.
13
+ */
14
+ export declare const FEDERATED_ANALYTICS_CONFIGURE_PERMISSION = "analytics:configure";
15
+ export declare const FEDERATED_ANALYTICS_PERMISSIONS: readonly ["analytics:read", "analytics:configure"];
16
+ export declare const FEDERATED_ANALYTICS_ERROR_CODES: Readonly<{
17
+ readonly UNAUTHENTICATED: "FEDERATION_UNAUTHENTICATED";
18
+ readonly ISSUER_MISMATCH: "FEDERATION_ISSUER_MISMATCH";
19
+ readonly INVALID_CLAIMS: "FEDERATION_INVALID_CLAIMS";
20
+ readonly CONNECTION_DENIED: "FEDERATION_CONNECTION_DENIED";
21
+ readonly INVALID_SCOPE: "FEDERATION_INVALID_SCOPE";
22
+ readonly SITE_DENIED: "FEDERATION_SITE_DENIED";
23
+ readonly CONFIGURE_FORBIDDEN: "FEDERATION_CONFIGURE_FORBIDDEN";
24
+ }>;
25
+ /**
26
+ * The protocol-v1 baseline every compatible host must serve. Newer hosts may
27
+ * advertise more functions and capabilities; a dashboard must require only
28
+ * this frozen set, or older hosts would fail verification on every addition.
29
+ */
30
+ export declare const FEDERATED_ANALYTICS_REQUIRED_FUNCTIONS: Readonly<{
31
+ readonly manifest: "manifest";
32
+ readonly connectionStatus: "connectionStatus";
33
+ readonly listSites: "listSites";
34
+ readonly overview: "overview";
35
+ readonly liveVisitors: "liveVisitors";
36
+ readonly listSessions: "listSessions";
37
+ readonly sessionJourney: "sessionJourney";
38
+ readonly listConversions: "listConversions";
39
+ readonly visitorJourney: "visitorJourney";
40
+ readonly goalsReport: "goalsReport";
41
+ readonly funnelsReport: "funnelsReport";
42
+ readonly affiliatesReport: "affiliatesReport";
43
+ readonly dataCoverage: "dataCoverage";
44
+ }>;
45
+ export declare const FEDERATED_ANALYTICS_REQUIRED_CAPABILITIES: readonly ["siteSummaries", "overview", "liveVisitors", "sessions", "sessionJourney", "conversions", "visitorJourney", "goals", "funnels", "affiliates", "dataCoverage"];
46
+ /**
47
+ * The optional configuration surface behind the `configure` capability. Every
48
+ * function here requires the configure permission on the token and on the
49
+ * host's grant; a host that keeps its grants read-only never runs them.
50
+ */
51
+ export declare const FEDERATED_ANALYTICS_CONFIGURE_FUNCTIONS: Readonly<{
52
+ readonly siteSettings: "siteSettings";
53
+ readonly updateSite: "updateSite";
54
+ readonly listGoals: "listGoals";
55
+ readonly upsertGoal: "upsertGoal";
56
+ readonly removeGoal: "removeGoal";
57
+ readonly listFunnels: "listFunnels";
58
+ readonly upsertFunnel: "upsertFunnel";
59
+ readonly removeFunnel: "removeFunnel";
60
+ readonly listAffiliates: "listAffiliates";
61
+ readonly upsertAffiliate: "upsertAffiliate";
62
+ readonly removeAffiliate: "removeAffiliate";
63
+ readonly retentionStatus: "retentionStatus";
64
+ readonly setRetentionPolicy: "setRetentionPolicy";
65
+ readonly disableRetentionPolicy: "disableRetentionPolicy";
66
+ }>;
67
+ export declare const FEDERATED_ANALYTICS_CONNECTOR_MANIFEST: Readonly<{
68
+ readonly protocol: "amage-rastro-analytics";
69
+ readonly protocolVersion: 1;
70
+ readonly moduleName: "rastroFederation";
71
+ readonly functions: Readonly<{
72
+ readonly manifest: "manifest";
73
+ readonly connectionStatus: "connectionStatus";
74
+ readonly listSites: "listSites";
75
+ readonly overview: "overview";
76
+ readonly liveVisitors: "liveVisitors";
77
+ readonly listSessions: "listSessions";
78
+ readonly sessionJourney: "sessionJourney";
79
+ readonly listConversions: "listConversions";
80
+ readonly visitorJourney: "visitorJourney";
81
+ readonly goalsReport: "goalsReport";
82
+ readonly funnelsReport: "funnelsReport";
83
+ readonly affiliatesReport: "affiliatesReport";
84
+ readonly dataCoverage: "dataCoverage";
85
+ readonly siteSettings: "siteSettings";
86
+ readonly updateSite: "updateSite";
87
+ readonly listGoals: "listGoals";
88
+ readonly upsertGoal: "upsertGoal";
89
+ readonly removeGoal: "removeGoal";
90
+ readonly listFunnels: "listFunnels";
91
+ readonly upsertFunnel: "upsertFunnel";
92
+ readonly removeFunnel: "removeFunnel";
93
+ readonly listAffiliates: "listAffiliates";
94
+ readonly upsertAffiliate: "upsertAffiliate";
95
+ readonly removeAffiliate: "removeAffiliate";
96
+ readonly retentionStatus: "retentionStatus";
97
+ readonly setRetentionPolicy: "setRetentionPolicy";
98
+ readonly disableRetentionPolicy: "disableRetentionPolicy";
99
+ readonly vitalsReport: "vitalsReport";
100
+ readonly siteMap: "siteMap";
101
+ }>;
102
+ readonly capabilities: readonly ["siteSummaries", "overview", "liveVisitors", "sessions", "sessionJourney", "conversions", "visitorJourney", "goals", "funnels", "affiliates", "dataCoverage", "vitals", "siteMap", "localDays", "configure"];
103
+ readonly limits: Readonly<{
104
+ readonly maxSitesPerRequest: 10;
105
+ readonly maxSitesPerConnection: 10;
106
+ readonly maxReportRangeDays: 366;
107
+ readonly maxLiveVisitors: 500;
108
+ readonly maxJourneyEvents: 500;
109
+ }>;
110
+ }>;
111
+ export type FederatedAnalyticsErrorCode = (typeof FEDERATED_ANALYTICS_ERROR_CODES)[keyof typeof FEDERATED_ANALYTICS_ERROR_CODES];
112
+ export type FederatedAnalyticsCapability = (typeof FEDERATED_ANALYTICS_CONNECTOR_MANIFEST.capabilities)[number];
113
+ export type FederatedAnalyticsPermission = (typeof FEDERATED_ANALYTICS_PERMISSIONS)[number];
114
+ export type FederatedAnalyticsManifest = ReturnType<typeof createFederatedAnalyticsManifest>;
115
+ export interface FederatedAnalyticsConnection {
116
+ connectionId: string;
117
+ organizationId: string;
118
+ siteIds: readonly string[];
119
+ /**
120
+ * What the host lets this connection do. Absent means read only; listing
121
+ * `analytics:configure` lets owners and admins of the dashboard organization
122
+ * manage goals, funnels, affiliates, site settings, and retention.
123
+ */
124
+ permissions?: readonly FederatedAnalyticsPermission[];
125
+ revokedAt?: number;
126
+ }
127
+ export interface FederatedAnalyticsIdentity {
128
+ connectionId: string;
129
+ organizationId: string;
130
+ identity: UserIdentity;
131
+ }
132
+ export interface FederatedSiteSummary {
133
+ siteId: string;
134
+ name: string;
135
+ currency: string;
136
+ timezone: string | null;
137
+ cookieless: boolean;
138
+ /**
139
+ * The site's calendar days, when the host keeps them (alpha.11): the
140
+ * timezone its daily overview buckets follow and the instant from which
141
+ * they are complete. `null` for a site without a timezone, or whose zone
142
+ * never leaves UTC. Hosts before alpha.11 omit the field.
143
+ */
144
+ localDays: {
145
+ timezone: string;
146
+ since: number;
147
+ } | null;
148
+ }
149
+ export interface FederatedAnalyticsConnectionStatus {
150
+ status: "connected";
151
+ protocolVersion: 1;
152
+ capabilities: FederatedAnalyticsCapability[];
153
+ /** The permissions both the token and the host's grant agree on. */
154
+ permissions: FederatedAnalyticsPermission[];
155
+ siteCount: number;
156
+ }
157
+ /** A resolved connection plus the permissions this request may act with. */
158
+ export type AuthorizedFederatedAnalyticsConnection = FederatedAnalyticsConnection & {
159
+ effectivePermissions: FederatedAnalyticsPermission[];
160
+ };
161
+ export type ResolveFederatedAnalyticsConnection = (ctx: AnalyticsAuthorizationContext, identity: FederatedAnalyticsIdentity) => FederatedAnalyticsConnection | null | Promise<FederatedAnalyticsConnection | null>;
162
+ export interface FederatedAnalyticsAuthorizerOptions {
163
+ issuer: string;
164
+ resolveConnection: ResolveFederatedAnalyticsConnection;
165
+ }
166
+ export declare const federatedAnalyticsPermissionValidator: import("convex/values").VUnion<"analytics:configure" | "analytics:read", [import("convex/values").VLiteral<"analytics:read", "required">, import("convex/values").VLiteral<"analytics:configure", "required">], "required", never>;
167
+ export declare const federatedAnalyticsManifestValidator: import("convex/values").VObject<{
168
+ capabilities: ("affiliates" | "configure" | "conversions" | "dataCoverage" | "funnels" | "goals" | "liveVisitors" | "localDays" | "overview" | "sessionJourney" | "sessions" | "siteMap" | "siteSummaries" | "visitorJourney" | "vitals")[];
169
+ functions: {
170
+ affiliatesReport: "affiliatesReport";
171
+ connectionStatus: "connectionStatus";
172
+ dataCoverage: "dataCoverage";
173
+ disableRetentionPolicy: "disableRetentionPolicy";
174
+ funnelsReport: "funnelsReport";
175
+ goalsReport: "goalsReport";
176
+ listAffiliates: "listAffiliates";
177
+ listConversions: "listConversions";
178
+ listFunnels: "listFunnels";
179
+ listGoals: "listGoals";
180
+ listSessions: "listSessions";
181
+ listSites: "listSites";
182
+ liveVisitors: "liveVisitors";
183
+ manifest: "manifest";
184
+ overview: "overview";
185
+ removeAffiliate: "removeAffiliate";
186
+ removeFunnel: "removeFunnel";
187
+ removeGoal: "removeGoal";
188
+ retentionStatus: "retentionStatus";
189
+ sessionJourney: "sessionJourney";
190
+ setRetentionPolicy: "setRetentionPolicy";
191
+ siteMap: "siteMap";
192
+ siteSettings: "siteSettings";
193
+ updateSite: "updateSite";
194
+ upsertAffiliate: "upsertAffiliate";
195
+ upsertFunnel: "upsertFunnel";
196
+ upsertGoal: "upsertGoal";
197
+ visitorJourney: "visitorJourney";
198
+ vitalsReport: "vitalsReport";
199
+ };
200
+ limits: {
201
+ maxJourneyEvents: number;
202
+ maxLiveVisitors: number;
203
+ maxReportRangeDays: number;
204
+ maxSitesPerConnection: number;
205
+ maxSitesPerRequest: number;
206
+ };
207
+ moduleName: "rastroFederation";
208
+ protocol: "amage-rastro-analytics";
209
+ protocolVersion: 1;
210
+ }, {
211
+ protocol: import("convex/values").VLiteral<"amage-rastro-analytics", "required">;
212
+ protocolVersion: import("convex/values").VLiteral<1, "required">;
213
+ moduleName: import("convex/values").VLiteral<"rastroFederation", "required">;
214
+ functions: import("convex/values").VObject<{
215
+ affiliatesReport: "affiliatesReport";
216
+ connectionStatus: "connectionStatus";
217
+ dataCoverage: "dataCoverage";
218
+ disableRetentionPolicy: "disableRetentionPolicy";
219
+ funnelsReport: "funnelsReport";
220
+ goalsReport: "goalsReport";
221
+ listAffiliates: "listAffiliates";
222
+ listConversions: "listConversions";
223
+ listFunnels: "listFunnels";
224
+ listGoals: "listGoals";
225
+ listSessions: "listSessions";
226
+ listSites: "listSites";
227
+ liveVisitors: "liveVisitors";
228
+ manifest: "manifest";
229
+ overview: "overview";
230
+ removeAffiliate: "removeAffiliate";
231
+ removeFunnel: "removeFunnel";
232
+ removeGoal: "removeGoal";
233
+ retentionStatus: "retentionStatus";
234
+ sessionJourney: "sessionJourney";
235
+ setRetentionPolicy: "setRetentionPolicy";
236
+ siteMap: "siteMap";
237
+ siteSettings: "siteSettings";
238
+ updateSite: "updateSite";
239
+ upsertAffiliate: "upsertAffiliate";
240
+ upsertFunnel: "upsertFunnel";
241
+ upsertGoal: "upsertGoal";
242
+ visitorJourney: "visitorJourney";
243
+ vitalsReport: "vitalsReport";
244
+ }, {
245
+ manifest: import("convex/values").VLiteral<"manifest", "required">;
246
+ connectionStatus: import("convex/values").VLiteral<"connectionStatus", "required">;
247
+ listSites: import("convex/values").VLiteral<"listSites", "required">;
248
+ overview: import("convex/values").VLiteral<"overview", "required">;
249
+ liveVisitors: import("convex/values").VLiteral<"liveVisitors", "required">;
250
+ listSessions: import("convex/values").VLiteral<"listSessions", "required">;
251
+ sessionJourney: import("convex/values").VLiteral<"sessionJourney", "required">;
252
+ listConversions: import("convex/values").VLiteral<"listConversions", "required">;
253
+ visitorJourney: import("convex/values").VLiteral<"visitorJourney", "required">;
254
+ goalsReport: import("convex/values").VLiteral<"goalsReport", "required">;
255
+ funnelsReport: import("convex/values").VLiteral<"funnelsReport", "required">;
256
+ affiliatesReport: import("convex/values").VLiteral<"affiliatesReport", "required">;
257
+ dataCoverage: import("convex/values").VLiteral<"dataCoverage", "required">;
258
+ vitalsReport: import("convex/values").VLiteral<"vitalsReport", "required">;
259
+ siteMap: import("convex/values").VLiteral<"siteMap", "required">;
260
+ siteSettings: import("convex/values").VLiteral<"siteSettings", "required">;
261
+ updateSite: import("convex/values").VLiteral<"updateSite", "required">;
262
+ listGoals: import("convex/values").VLiteral<"listGoals", "required">;
263
+ upsertGoal: import("convex/values").VLiteral<"upsertGoal", "required">;
264
+ removeGoal: import("convex/values").VLiteral<"removeGoal", "required">;
265
+ listFunnels: import("convex/values").VLiteral<"listFunnels", "required">;
266
+ upsertFunnel: import("convex/values").VLiteral<"upsertFunnel", "required">;
267
+ removeFunnel: import("convex/values").VLiteral<"removeFunnel", "required">;
268
+ listAffiliates: import("convex/values").VLiteral<"listAffiliates", "required">;
269
+ upsertAffiliate: import("convex/values").VLiteral<"upsertAffiliate", "required">;
270
+ removeAffiliate: import("convex/values").VLiteral<"removeAffiliate", "required">;
271
+ retentionStatus: import("convex/values").VLiteral<"retentionStatus", "required">;
272
+ setRetentionPolicy: import("convex/values").VLiteral<"setRetentionPolicy", "required">;
273
+ disableRetentionPolicy: import("convex/values").VLiteral<"disableRetentionPolicy", "required">;
274
+ }, "required", "affiliatesReport" | "connectionStatus" | "dataCoverage" | "disableRetentionPolicy" | "funnelsReport" | "goalsReport" | "listAffiliates" | "listConversions" | "listFunnels" | "listGoals" | "listSessions" | "listSites" | "liveVisitors" | "manifest" | "overview" | "removeAffiliate" | "removeFunnel" | "removeGoal" | "retentionStatus" | "sessionJourney" | "setRetentionPolicy" | "siteMap" | "siteSettings" | "updateSite" | "upsertAffiliate" | "upsertFunnel" | "upsertGoal" | "visitorJourney" | "vitalsReport">;
275
+ capabilities: import("convex/values").VArray<("affiliates" | "configure" | "conversions" | "dataCoverage" | "funnels" | "goals" | "liveVisitors" | "localDays" | "overview" | "sessionJourney" | "sessions" | "siteMap" | "siteSummaries" | "visitorJourney" | "vitals")[], import("convex/values").VUnion<"affiliates" | "configure" | "conversions" | "dataCoverage" | "funnels" | "goals" | "liveVisitors" | "localDays" | "overview" | "sessionJourney" | "sessions" | "siteMap" | "siteSummaries" | "visitorJourney" | "vitals", [import("convex/values").VLiteral<"siteSummaries", "required">, import("convex/values").VLiteral<"overview", "required">, import("convex/values").VLiteral<"liveVisitors", "required">, import("convex/values").VLiteral<"sessions", "required">, import("convex/values").VLiteral<"sessionJourney", "required">, import("convex/values").VLiteral<"conversions", "required">, import("convex/values").VLiteral<"visitorJourney", "required">, import("convex/values").VLiteral<"goals", "required">, import("convex/values").VLiteral<"funnels", "required">, import("convex/values").VLiteral<"affiliates", "required">, import("convex/values").VLiteral<"dataCoverage", "required">, import("convex/values").VLiteral<"vitals", "required">, import("convex/values").VLiteral<"siteMap", "required">, import("convex/values").VLiteral<"localDays", "required">, import("convex/values").VLiteral<"configure", "required">], "required", never>, "required">;
276
+ limits: import("convex/values").VObject<{
277
+ maxJourneyEvents: number;
278
+ maxLiveVisitors: number;
279
+ maxReportRangeDays: number;
280
+ maxSitesPerConnection: number;
281
+ maxSitesPerRequest: number;
282
+ }, {
283
+ maxSitesPerRequest: import("convex/values").VFloat64<number, "required">;
284
+ maxSitesPerConnection: import("convex/values").VFloat64<number, "required">;
285
+ maxReportRangeDays: import("convex/values").VFloat64<number, "required">;
286
+ maxLiveVisitors: import("convex/values").VFloat64<number, "required">;
287
+ maxJourneyEvents: import("convex/values").VFloat64<number, "required">;
288
+ }, "required", "maxJourneyEvents" | "maxLiveVisitors" | "maxReportRangeDays" | "maxSitesPerConnection" | "maxSitesPerRequest">;
289
+ }, "required", "capabilities" | "functions" | "functions.affiliatesReport" | "functions.connectionStatus" | "functions.dataCoverage" | "functions.disableRetentionPolicy" | "functions.funnelsReport" | "functions.goalsReport" | "functions.listAffiliates" | "functions.listConversions" | "functions.listFunnels" | "functions.listGoals" | "functions.listSessions" | "functions.listSites" | "functions.liveVisitors" | "functions.manifest" | "functions.overview" | "functions.removeAffiliate" | "functions.removeFunnel" | "functions.removeGoal" | "functions.retentionStatus" | "functions.sessionJourney" | "functions.setRetentionPolicy" | "functions.siteMap" | "functions.siteSettings" | "functions.updateSite" | "functions.upsertAffiliate" | "functions.upsertFunnel" | "functions.upsertGoal" | "functions.visitorJourney" | "functions.vitalsReport" | "limits" | "limits.maxJourneyEvents" | "limits.maxLiveVisitors" | "limits.maxReportRangeDays" | "limits.maxSitesPerConnection" | "limits.maxSitesPerRequest" | "moduleName" | "protocol" | "protocolVersion">;
290
+ export declare const federatedAnalyticsConnectionStatusValidator: import("convex/values").VObject<{
291
+ capabilities: ("affiliates" | "configure" | "conversions" | "dataCoverage" | "funnels" | "goals" | "liveVisitors" | "localDays" | "overview" | "sessionJourney" | "sessions" | "siteMap" | "siteSummaries" | "visitorJourney" | "vitals")[];
292
+ permissions: ("analytics:configure" | "analytics:read")[];
293
+ protocolVersion: 1;
294
+ siteCount: number;
295
+ status: "connected";
296
+ }, {
297
+ status: import("convex/values").VLiteral<"connected", "required">;
298
+ protocolVersion: import("convex/values").VLiteral<1, "required">;
299
+ capabilities: import("convex/values").VArray<("affiliates" | "configure" | "conversions" | "dataCoverage" | "funnels" | "goals" | "liveVisitors" | "localDays" | "overview" | "sessionJourney" | "sessions" | "siteMap" | "siteSummaries" | "visitorJourney" | "vitals")[], import("convex/values").VUnion<"affiliates" | "configure" | "conversions" | "dataCoverage" | "funnels" | "goals" | "liveVisitors" | "localDays" | "overview" | "sessionJourney" | "sessions" | "siteMap" | "siteSummaries" | "visitorJourney" | "vitals", [import("convex/values").VLiteral<"siteSummaries", "required">, import("convex/values").VLiteral<"overview", "required">, import("convex/values").VLiteral<"liveVisitors", "required">, import("convex/values").VLiteral<"sessions", "required">, import("convex/values").VLiteral<"sessionJourney", "required">, import("convex/values").VLiteral<"conversions", "required">, import("convex/values").VLiteral<"visitorJourney", "required">, import("convex/values").VLiteral<"goals", "required">, import("convex/values").VLiteral<"funnels", "required">, import("convex/values").VLiteral<"affiliates", "required">, import("convex/values").VLiteral<"dataCoverage", "required">, import("convex/values").VLiteral<"vitals", "required">, import("convex/values").VLiteral<"siteMap", "required">, import("convex/values").VLiteral<"localDays", "required">, import("convex/values").VLiteral<"configure", "required">], "required", never>, "required">;
300
+ permissions: import("convex/values").VArray<("analytics:configure" | "analytics:read")[], import("convex/values").VUnion<"analytics:configure" | "analytics:read", [import("convex/values").VLiteral<"analytics:read", "required">, import("convex/values").VLiteral<"analytics:configure", "required">], "required", never>, "required">;
301
+ siteCount: import("convex/values").VFloat64<number, "required">;
302
+ }, "required", "capabilities" | "permissions" | "protocolVersion" | "siteCount" | "status">;
303
+ /**
304
+ * The permissions a request may act with: those the token claims that the
305
+ * host's grant also lists. Reading needs no listing — a grant is a read grant
306
+ * by definition — so the read permission is always present.
307
+ */
308
+ export declare function effectiveFederatedPermissions(claimed: readonly string[], connection: Pick<FederatedAnalyticsConnection, "permissions">): FederatedAnalyticsPermission[];
309
+ export declare const federatedSiteSummaryValidator: import("convex/values").VObject<{
310
+ cookieless: boolean;
311
+ currency: string;
312
+ localDays: {
313
+ since: number;
314
+ timezone: string;
315
+ } | null;
316
+ name: string;
317
+ siteId: string;
318
+ timezone: string | null;
319
+ }, {
320
+ siteId: import("convex/values").VString<string, "required">;
321
+ name: import("convex/values").VString<string, "required">;
322
+ currency: import("convex/values").VString<string, "required">;
323
+ timezone: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
324
+ cookieless: import("convex/values").VBoolean<boolean, "required">;
325
+ localDays: import("convex/values").VUnion<{
326
+ since: number;
327
+ timezone: string;
328
+ } | null, [import("convex/values").VObject<{
329
+ since: number;
330
+ timezone: string;
331
+ }, {
332
+ timezone: import("convex/values").VString<string, "required">;
333
+ since: import("convex/values").VFloat64<number, "required">;
334
+ }, "required", "since" | "timezone">, import("convex/values").VNull<null, "required">], "required", "since" | "timezone">;
335
+ }, "required", "cookieless" | "currency" | "localDays" | "localDays.since" | "localDays.timezone" | "name" | "siteId" | "timezone">;
336
+ export declare function createFederatedAnalyticsManifest(): {
337
+ protocol: "amage-rastro-analytics";
338
+ protocolVersion: 1;
339
+ moduleName: "rastroFederation";
340
+ functions: {
341
+ manifest: "manifest";
342
+ connectionStatus: "connectionStatus";
343
+ listSites: "listSites";
344
+ overview: "overview";
345
+ liveVisitors: "liveVisitors";
346
+ listSessions: "listSessions";
347
+ sessionJourney: "sessionJourney";
348
+ listConversions: "listConversions";
349
+ visitorJourney: "visitorJourney";
350
+ goalsReport: "goalsReport";
351
+ funnelsReport: "funnelsReport";
352
+ affiliatesReport: "affiliatesReport";
353
+ dataCoverage: "dataCoverage";
354
+ siteSettings: "siteSettings";
355
+ updateSite: "updateSite";
356
+ listGoals: "listGoals";
357
+ upsertGoal: "upsertGoal";
358
+ removeGoal: "removeGoal";
359
+ listFunnels: "listFunnels";
360
+ upsertFunnel: "upsertFunnel";
361
+ removeFunnel: "removeFunnel";
362
+ listAffiliates: "listAffiliates";
363
+ upsertAffiliate: "upsertAffiliate";
364
+ removeAffiliate: "removeAffiliate";
365
+ retentionStatus: "retentionStatus";
366
+ setRetentionPolicy: "setRetentionPolicy";
367
+ disableRetentionPolicy: "disableRetentionPolicy";
368
+ vitalsReport: "vitalsReport";
369
+ siteMap: "siteMap";
370
+ };
371
+ capabilities: ("affiliates" | "configure" | "conversions" | "dataCoverage" | "funnels" | "goals" | "liveVisitors" | "localDays" | "overview" | "sessionJourney" | "sessions" | "siteMap" | "siteSummaries" | "visitorJourney" | "vitals")[];
372
+ limits: {
373
+ maxSitesPerRequest: 10;
374
+ maxSitesPerConnection: 10;
375
+ maxReportRangeDays: 366;
376
+ maxLiveVisitors: 500;
377
+ maxJourneyEvents: 500;
378
+ };
379
+ };
380
+ export declare function createFederatedAnalyticsConnectionAuthorizer(options: FederatedAnalyticsAuthorizerOptions): (ctx: AnalyticsAuthorizationContext, requestedSiteIds?: readonly string[], requiredPermission?: FederatedAnalyticsPermission) => Promise<AuthorizedFederatedAnalyticsConnection>;
381
+ //# sourceMappingURL=federation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"federation.d.ts","sourceRoot":"","sources":["../../src/client/federation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAQlD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAEhE,eAAO,MAAM,0BAA0B;2BACvB,sBAAsB;6BACpB,wBAAwB;0BAC3B,oBAAoB;EACxB,CAAC;AAEZ,eAAO,MAAM,mCAAmC,mBAAmB,CAAC;AACpE;;;;GAIG;AACH,eAAO,MAAM,wCAAwC,wBAAwB,CAAC;AAC9E,eAAO,MAAM,+BAA+B,oDAGjC,CAAC;AAEZ,eAAO,MAAM,+BAA+B;8BACzB,4BAA4B;8BAC5B,4BAA4B;6BAC7B,2BAA2B;gCACxB,8BAA8B;4BAClC,0BAA0B;0BAC5B,wBAAwB;kCAChB,gCAAgC;EAC5C,CAAC;AAGZ;;;;GAIG;AACH,eAAO,MAAM,sCAAsC;uBACvC,UAAU;+BACF,kBAAkB;wBACzB,WAAW;uBACZ,UAAU;2BACN,cAAc;2BACd,cAAc;6BACZ,gBAAgB;8BACf,iBAAiB;6BAClB,gBAAgB;0BACnB,aAAa;4BACX,eAAe;+BACZ,kBAAkB;2BACtB,cAAc;EACnB,CAAC;AACZ,eAAO,MAAM,yCAAyC,yKAY3C,CAAC;AACZ;;;;GAIG;AACH,eAAO,MAAM,uCAAuC;2BACpC,cAAc;yBAChB,YAAY;wBACb,WAAW;yBACV,YAAY;yBACZ,YAAY;0BACX,aAAa;2BACZ,cAAc;2BACd,cAAc;6BACZ,gBAAgB;8BACf,iBAAiB;8BACjB,iBAAiB;8BACjB,iBAAiB;iCACd,oBAAoB;qCAChB,wBAAwB;EACvC,CAAC;AAwBZ,eAAO,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