@iann29/rastro 0.1.0-alpha.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 (126) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +352 -0
  3. package/assets/rastro-live-atlas.png +0 -0
  4. package/dist/client/_generated/_ignore.d.ts +1 -0
  5. package/dist/client/_generated/_ignore.d.ts.map +1 -0
  6. package/dist/client/_generated/_ignore.js +3 -0
  7. package/dist/client/_generated/_ignore.js.map +1 -0
  8. package/dist/client/index.d.ts +960 -0
  9. package/dist/client/index.d.ts.map +1 -0
  10. package/dist/client/index.js +591 -0
  11. package/dist/client/index.js.map +1 -0
  12. package/dist/component/_generated/api.d.ts +60 -0
  13. package/dist/component/_generated/api.d.ts.map +1 -0
  14. package/dist/component/_generated/api.js +31 -0
  15. package/dist/component/_generated/api.js.map +1 -0
  16. package/dist/component/_generated/component.d.ts +569 -0
  17. package/dist/component/_generated/component.d.ts.map +1 -0
  18. package/dist/component/_generated/component.js +11 -0
  19. package/dist/component/_generated/component.js.map +1 -0
  20. package/dist/component/_generated/dataModel.d.ts +46 -0
  21. package/dist/component/_generated/dataModel.d.ts.map +1 -0
  22. package/dist/component/_generated/dataModel.js +11 -0
  23. package/dist/component/_generated/dataModel.js.map +1 -0
  24. package/dist/component/_generated/server.d.ts +133 -0
  25. package/dist/component/_generated/server.d.ts.map +1 -0
  26. package/dist/component/_generated/server.js +80 -0
  27. package/dist/component/_generated/server.js.map +1 -0
  28. package/dist/component/affiliates.d.ts +28 -0
  29. package/dist/component/affiliates.d.ts.map +1 -0
  30. package/dist/component/affiliates.js +110 -0
  31. package/dist/component/affiliates.js.map +1 -0
  32. package/dist/component/constants.d.ts +28 -0
  33. package/dist/component/constants.d.ts.map +1 -0
  34. package/dist/component/constants.js +28 -0
  35. package/dist/component/constants.js.map +1 -0
  36. package/dist/component/convex.config.d.ts +3 -0
  37. package/dist/component/convex.config.d.ts.map +1 -0
  38. package/dist/component/convex.config.js +3 -0
  39. package/dist/component/convex.config.js.map +1 -0
  40. package/dist/component/errors.d.ts +3 -0
  41. package/dist/component/errors.d.ts.map +1 -0
  42. package/dist/component/errors.js +5 -0
  43. package/dist/component/errors.js.map +1 -0
  44. package/dist/component/funnels.d.ts +36 -0
  45. package/dist/component/funnels.d.ts.map +1 -0
  46. package/dist/component/funnels.js +117 -0
  47. package/dist/component/funnels.js.map +1 -0
  48. package/dist/component/goals.d.ts +30 -0
  49. package/dist/component/goals.d.ts.map +1 -0
  50. package/dist/component/goals.js +110 -0
  51. package/dist/component/goals.js.map +1 -0
  52. package/dist/component/guards.d.ts +2 -0
  53. package/dist/component/guards.d.ts.map +1 -0
  54. package/dist/component/guards.js +4 -0
  55. package/dist/component/guards.js.map +1 -0
  56. package/dist/component/http.d.ts +3 -0
  57. package/dist/component/http.d.ts.map +1 -0
  58. package/dist/component/http.js +270 -0
  59. package/dist/component/http.js.map +1 -0
  60. package/dist/component/ingest.d.ts +51 -0
  61. package/dist/component/ingest.d.ts.map +1 -0
  62. package/dist/component/ingest.js +991 -0
  63. package/dist/component/ingest.js.map +1 -0
  64. package/dist/component/live.d.ts +9 -0
  65. package/dist/component/live.d.ts.map +1 -0
  66. package/dist/component/live.js +36 -0
  67. package/dist/component/live.js.map +1 -0
  68. package/dist/component/reports.d.ts +330 -0
  69. package/dist/component/reports.d.ts.map +1 -0
  70. package/dist/component/reports.js +595 -0
  71. package/dist/component/reports.js.map +1 -0
  72. package/dist/component/retention.d.ts +10 -0
  73. package/dist/component/retention.d.ts.map +1 -0
  74. package/dist/component/retention.js +107 -0
  75. package/dist/component/retention.js.map +1 -0
  76. package/dist/component/sanitize.d.ts +20 -0
  77. package/dist/component/sanitize.d.ts.map +1 -0
  78. package/dist/component/sanitize.js +269 -0
  79. package/dist/component/sanitize.js.map +1 -0
  80. package/dist/component/schema.d.ts +517 -0
  81. package/dist/component/schema.d.ts.map +1 -0
  82. package/dist/component/schema.js +209 -0
  83. package/dist/component/schema.js.map +1 -0
  84. package/dist/component/sites.d.ts +54 -0
  85. package/dist/component/sites.d.ts.map +1 -0
  86. package/dist/component/sites.js +164 -0
  87. package/dist/component/sites.js.map +1 -0
  88. package/dist/component/validators.d.ts +377 -0
  89. package/dist/component/validators.d.ts.map +1 -0
  90. package/dist/component/validators.js +176 -0
  91. package/dist/component/validators.js.map +1 -0
  92. package/dist/react/index.d.ts +40 -0
  93. package/dist/react/index.d.ts.map +1 -0
  94. package/dist/react/index.js +31 -0
  95. package/dist/react/index.js.map +1 -0
  96. package/dist/tracker/generated.d.ts +5 -0
  97. package/dist/tracker/generated.d.ts.map +1 -0
  98. package/dist/tracker/generated.js +6 -0
  99. package/dist/tracker/generated.js.map +1 -0
  100. package/dist/tracker/tracker.d.ts +27 -0
  101. package/dist/tracker/tracker.d.ts.map +1 -0
  102. package/dist/tracker/tracker.js +108 -0
  103. package/dist/tracker/tracker.js.map +1 -0
  104. package/dist/tracker.min.js +1 -0
  105. package/package.json +121 -0
  106. package/src/component/_generated/api.ts +76 -0
  107. package/src/component/_generated/component.ts +706 -0
  108. package/src/component/_generated/dataModel.ts +60 -0
  109. package/src/component/_generated/server.ts +169 -0
  110. package/src/component/affiliates.ts +119 -0
  111. package/src/component/constants.ts +28 -0
  112. package/src/component/convex.config.ts +3 -0
  113. package/src/component/errors.ts +20 -0
  114. package/src/component/funnels.ts +134 -0
  115. package/src/component/goals.ts +122 -0
  116. package/src/component/guards.ts +3 -0
  117. package/src/component/http.ts +301 -0
  118. package/src/component/ingest.ts +1364 -0
  119. package/src/component/live.ts +36 -0
  120. package/src/component/reports.ts +720 -0
  121. package/src/component/retention.ts +180 -0
  122. package/src/component/sanitize.ts +278 -0
  123. package/src/component/schema.ts +232 -0
  124. package/src/component/sites.ts +188 -0
  125. package/src/component/validators.ts +226 -0
  126. package/src/test.ts +19 -0
@@ -0,0 +1,377 @@
1
+ import { type Infer } from "convex/values";
2
+ export declare const eventTypeValidator: import("convex/values").VUnion<"click" | "conversion" | "custom" | "heartbeat" | "outbound" | "pageview", [import("convex/values").VLiteral<"pageview", "required">, import("convex/values").VLiteral<"click", "required">, import("convex/values").VLiteral<"custom", "required">, import("convex/values").VLiteral<"conversion", "required">, import("convex/values").VLiteral<"heartbeat", "required">, import("convex/values").VLiteral<"outbound", "required">], "required", never>;
3
+ export declare const propertyValueValidator: import("convex/values").VUnion<string | number | boolean | null, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">, import("convex/values").VNull<null, "required">], "required", never>;
4
+ export declare const eventPropertiesValidator: import("convex/values").VRecord<Record<string, string | number | boolean | null>, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean | null, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">, import("convex/values").VNull<null, "required">], "required", never>, "required", string>;
5
+ export declare const trackerEventValidator: import("convex/values").VObject<{
6
+ affiliateSlug?: string | undefined;
7
+ currency?: string | undefined;
8
+ eventId: string;
9
+ href?: string | undefined;
10
+ name?: string | undefined;
11
+ path: string;
12
+ properties?: Record<string, string | number | boolean | null> | undefined;
13
+ referrer?: string | undefined;
14
+ revenueCents?: number | undefined;
15
+ sequence: number;
16
+ sessionId: string;
17
+ target?: string | undefined;
18
+ timestamp: number;
19
+ type: "click" | "conversion" | "custom" | "heartbeat" | "outbound" | "pageview";
20
+ visitorId: string;
21
+ }, {
22
+ eventId: import("convex/values").VString<string, "required">;
23
+ sessionId: import("convex/values").VString<string, "required">;
24
+ visitorId: import("convex/values").VString<string, "required">;
25
+ type: import("convex/values").VUnion<"click" | "conversion" | "custom" | "heartbeat" | "outbound" | "pageview", [import("convex/values").VLiteral<"pageview", "required">, import("convex/values").VLiteral<"click", "required">, import("convex/values").VLiteral<"custom", "required">, import("convex/values").VLiteral<"conversion", "required">, import("convex/values").VLiteral<"heartbeat", "required">, import("convex/values").VLiteral<"outbound", "required">], "required", never>;
26
+ name: import("convex/values").VString<string | undefined, "optional">;
27
+ path: import("convex/values").VString<string, "required">;
28
+ referrer: import("convex/values").VString<string | undefined, "optional">;
29
+ timestamp: import("convex/values").VFloat64<number, "required">;
30
+ sequence: import("convex/values").VFloat64<number, "required">;
31
+ target: import("convex/values").VString<string | undefined, "optional">;
32
+ href: import("convex/values").VString<string | undefined, "optional">;
33
+ properties: import("convex/values").VRecord<Record<string, string | number | boolean | null> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean | null, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">, import("convex/values").VNull<null, "required">], "required", never>, "optional", string>;
34
+ revenueCents: import("convex/values").VFloat64<number | undefined, "optional">;
35
+ currency: import("convex/values").VString<string | undefined, "optional">;
36
+ affiliateSlug: import("convex/values").VString<string | undefined, "optional">;
37
+ }, "required", "affiliateSlug" | "currency" | "eventId" | "href" | "name" | "path" | "properties" | "referrer" | "revenueCents" | "sequence" | "sessionId" | "target" | "timestamp" | "type" | "visitorId" | `properties.${string}`>;
38
+ export declare const ingestContextValidator: import("convex/values").VObject<{
39
+ browser?: string | undefined;
40
+ city?: string | undefined;
41
+ country?: string | undefined;
42
+ device?: string | undefined;
43
+ latitude?: number | undefined;
44
+ longitude?: number | undefined;
45
+ os?: string | undefined;
46
+ }, {
47
+ country: import("convex/values").VString<string | undefined, "optional">;
48
+ city: import("convex/values").VString<string | undefined, "optional">;
49
+ latitude: import("convex/values").VFloat64<number | undefined, "optional">;
50
+ longitude: import("convex/values").VFloat64<number | undefined, "optional">;
51
+ browser: import("convex/values").VString<string | undefined, "optional">;
52
+ os: import("convex/values").VString<string | undefined, "optional">;
53
+ device: import("convex/values").VString<string | undefined, "optional">;
54
+ }, "required", "browser" | "city" | "country" | "device" | "latitude" | "longitude" | "os">;
55
+ export declare const siteFieldsValidator: import("convex/values").VObject<{
56
+ cookieless: boolean;
57
+ createdAt: number;
58
+ currency?: string | undefined;
59
+ domains: string[];
60
+ name: string;
61
+ networkId?: string | undefined;
62
+ ownerId: string;
63
+ timezone?: string | undefined;
64
+ updatedAt: number;
65
+ }, {
66
+ ownerId: import("convex/values").VString<string, "required">;
67
+ name: import("convex/values").VString<string, "required">;
68
+ domains: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
69
+ networkId: import("convex/values").VString<string | undefined, "optional">;
70
+ timezone: import("convex/values").VString<string | undefined, "optional">;
71
+ currency: import("convex/values").VString<string | undefined, "optional">;
72
+ cookieless: import("convex/values").VBoolean<boolean, "required">;
73
+ createdAt: import("convex/values").VFloat64<number, "required">;
74
+ updatedAt: import("convex/values").VFloat64<number, "required">;
75
+ }, "required", "cookieless" | "createdAt" | "currency" | "domains" | "name" | "networkId" | "ownerId" | "timezone" | "updatedAt">;
76
+ export declare const sessionFieldsValidator: import("convex/values").VObject<{
77
+ affiliateAttributedAt?: number | undefined;
78
+ affiliateExpiresAt?: number | undefined;
79
+ affiliateId?: import("convex/values").GenericId<"affiliates"> | undefined;
80
+ affiliateSlug?: string | undefined;
81
+ browser: string;
82
+ city?: string | undefined;
83
+ conversionCount: number;
84
+ country?: string | undefined;
85
+ currency?: string | undefined;
86
+ device: string;
87
+ durationMs: number;
88
+ entryPath: string;
89
+ eventCount: number;
90
+ exitPath: string;
91
+ lastSeenAt: number;
92
+ latitude?: number | undefined;
93
+ longitude?: number | undefined;
94
+ os: string;
95
+ pageviewCount: number;
96
+ referrer?: string | undefined;
97
+ revenueCents: number;
98
+ sessionId: string;
99
+ siteId: import("convex/values").GenericId<"sites">;
100
+ source: string;
101
+ startedAt: number;
102
+ utmCampaign?: string | undefined;
103
+ utmMedium?: string | undefined;
104
+ utmSource?: string | undefined;
105
+ visitorId: string;
106
+ }, {
107
+ siteId: import("convex/values").VId<import("convex/values").GenericId<"sites">, "required">;
108
+ sessionId: import("convex/values").VString<string, "required">;
109
+ visitorId: import("convex/values").VString<string, "required">;
110
+ startedAt: import("convex/values").VFloat64<number, "required">;
111
+ lastSeenAt: import("convex/values").VFloat64<number, "required">;
112
+ entryPath: import("convex/values").VString<string, "required">;
113
+ exitPath: import("convex/values").VString<string, "required">;
114
+ referrer: import("convex/values").VString<string | undefined, "optional">;
115
+ source: import("convex/values").VString<string, "required">;
116
+ utmSource: import("convex/values").VString<string | undefined, "optional">;
117
+ utmMedium: import("convex/values").VString<string | undefined, "optional">;
118
+ utmCampaign: import("convex/values").VString<string | undefined, "optional">;
119
+ country: import("convex/values").VString<string | undefined, "optional">;
120
+ city: import("convex/values").VString<string | undefined, "optional">;
121
+ latitude: import("convex/values").VFloat64<number | undefined, "optional">;
122
+ longitude: import("convex/values").VFloat64<number | undefined, "optional">;
123
+ browser: import("convex/values").VString<string, "required">;
124
+ os: import("convex/values").VString<string, "required">;
125
+ device: import("convex/values").VString<string, "required">;
126
+ eventCount: import("convex/values").VFloat64<number, "required">;
127
+ pageviewCount: import("convex/values").VFloat64<number, "required">;
128
+ durationMs: import("convex/values").VFloat64<number, "required">;
129
+ conversionCount: import("convex/values").VFloat64<number, "required">;
130
+ revenueCents: import("convex/values").VFloat64<number, "required">;
131
+ currency: import("convex/values").VString<string | undefined, "optional">;
132
+ affiliateSlug: import("convex/values").VString<string | undefined, "optional">;
133
+ affiliateId: import("convex/values").VId<import("convex/values").GenericId<"affiliates"> | undefined, "optional">;
134
+ affiliateAttributedAt: import("convex/values").VFloat64<number | undefined, "optional">;
135
+ affiliateExpiresAt: import("convex/values").VFloat64<number | undefined, "optional">;
136
+ }, "required", "affiliateAttributedAt" | "affiliateExpiresAt" | "affiliateId" | "affiliateSlug" | "browser" | "city" | "conversionCount" | "country" | "currency" | "device" | "durationMs" | "entryPath" | "eventCount" | "exitPath" | "lastSeenAt" | "latitude" | "longitude" | "os" | "pageviewCount" | "referrer" | "revenueCents" | "sessionId" | "siteId" | "source" | "startedAt" | "utmCampaign" | "utmMedium" | "utmSource" | "visitorId">;
137
+ export declare const eventFieldsValidator: import("convex/values").VObject<{
138
+ affiliateSlug?: string | undefined;
139
+ browser: string;
140
+ city?: string | undefined;
141
+ country?: string | undefined;
142
+ currency?: string | undefined;
143
+ device: string;
144
+ eventId: string;
145
+ href?: string | undefined;
146
+ latitude?: number | undefined;
147
+ longitude?: number | undefined;
148
+ name?: string | undefined;
149
+ os: string;
150
+ path: string;
151
+ properties?: Record<string, string | number | boolean | null> | undefined;
152
+ referrer?: string | undefined;
153
+ revenueCents?: number | undefined;
154
+ sequence: number;
155
+ sessionId: string;
156
+ siteId: import("convex/values").GenericId<"sites">;
157
+ target?: string | undefined;
158
+ timestamp: number;
159
+ type: "click" | "conversion" | "custom" | "heartbeat" | "outbound" | "pageview";
160
+ visitorId: string;
161
+ }, {
162
+ siteId: import("convex/values").VId<import("convex/values").GenericId<"sites">, "required">;
163
+ eventId: import("convex/values").VString<string, "required">;
164
+ sessionId: import("convex/values").VString<string, "required">;
165
+ visitorId: import("convex/values").VString<string, "required">;
166
+ type: import("convex/values").VUnion<"click" | "conversion" | "custom" | "heartbeat" | "outbound" | "pageview", [import("convex/values").VLiteral<"pageview", "required">, import("convex/values").VLiteral<"click", "required">, import("convex/values").VLiteral<"custom", "required">, import("convex/values").VLiteral<"conversion", "required">, import("convex/values").VLiteral<"heartbeat", "required">, import("convex/values").VLiteral<"outbound", "required">], "required", never>;
167
+ name: import("convex/values").VString<string | undefined, "optional">;
168
+ path: import("convex/values").VString<string, "required">;
169
+ referrer: import("convex/values").VString<string | undefined, "optional">;
170
+ timestamp: import("convex/values").VFloat64<number, "required">;
171
+ sequence: import("convex/values").VFloat64<number, "required">;
172
+ target: import("convex/values").VString<string | undefined, "optional">;
173
+ href: import("convex/values").VString<string | undefined, "optional">;
174
+ properties: import("convex/values").VRecord<Record<string, string | number | boolean | null> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean | null, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">, import("convex/values").VNull<null, "required">], "required", never>, "optional", string>;
175
+ revenueCents: import("convex/values").VFloat64<number | undefined, "optional">;
176
+ currency: import("convex/values").VString<string | undefined, "optional">;
177
+ affiliateSlug: import("convex/values").VString<string | undefined, "optional">;
178
+ country: import("convex/values").VString<string | undefined, "optional">;
179
+ city: import("convex/values").VString<string | undefined, "optional">;
180
+ latitude: import("convex/values").VFloat64<number | undefined, "optional">;
181
+ longitude: import("convex/values").VFloat64<number | undefined, "optional">;
182
+ browser: import("convex/values").VString<string, "required">;
183
+ os: import("convex/values").VString<string, "required">;
184
+ device: import("convex/values").VString<string, "required">;
185
+ }, "required", "affiliateSlug" | "browser" | "city" | "country" | "currency" | "device" | "eventId" | "href" | "latitude" | "longitude" | "name" | "os" | "path" | "properties" | "referrer" | "revenueCents" | "sequence" | "sessionId" | "siteId" | "target" | "timestamp" | "type" | "visitorId" | `properties.${string}`>;
186
+ export declare const dimensionTypeValidator: import("convex/values").VUnion<"browser" | "country" | "device" | "event" | "goal" | "page" | "source", [import("convex/values").VLiteral<"source", "required">, import("convex/values").VLiteral<"page", "required">, import("convex/values").VLiteral<"country", "required">, import("convex/values").VLiteral<"device", "required">, import("convex/values").VLiteral<"browser", "required">, import("convex/values").VLiteral<"event", "required">, import("convex/values").VLiteral<"goal", "required">], "required", never>;
187
+ export declare const dimensionSlotValidator: import("convex/values").VObject<{
188
+ count: number;
189
+ revenueCents: number;
190
+ slot: number;
191
+ type: "browser" | "country" | "device" | "event" | "goal" | "page" | "source";
192
+ value: string;
193
+ }, {
194
+ type: import("convex/values").VUnion<"browser" | "country" | "device" | "event" | "goal" | "page" | "source", [import("convex/values").VLiteral<"source", "required">, import("convex/values").VLiteral<"page", "required">, import("convex/values").VLiteral<"country", "required">, import("convex/values").VLiteral<"device", "required">, import("convex/values").VLiteral<"browser", "required">, import("convex/values").VLiteral<"event", "required">, import("convex/values").VLiteral<"goal", "required">], "required", never>;
195
+ slot: import("convex/values").VFloat64<number, "required">;
196
+ value: import("convex/values").VString<string, "required">;
197
+ count: import("convex/values").VFloat64<number, "required">;
198
+ revenueCents: import("convex/values").VFloat64<number, "required">;
199
+ }, "required", "count" | "revenueCents" | "slot" | "type" | "value">;
200
+ export declare const aggregateFieldsValidator: import("convex/values").VObject<{
201
+ bucketStart: number;
202
+ clicks: number;
203
+ conversions: number;
204
+ customEvents: number;
205
+ dimensions: {
206
+ count: number;
207
+ revenueCents: number;
208
+ slot: number;
209
+ type: "browser" | "country" | "device" | "event" | "goal" | "page" | "source";
210
+ value: string;
211
+ }[];
212
+ events: number;
213
+ granularity: "day" | "hour";
214
+ outboundClicks: number;
215
+ pageviews: number;
216
+ revenueCents: number;
217
+ sessions: number;
218
+ shard: number;
219
+ siteId: import("convex/values").GenericId<"sites">;
220
+ visitors: number;
221
+ }, {
222
+ siteId: import("convex/values").VId<import("convex/values").GenericId<"sites">, "required">;
223
+ granularity: import("convex/values").VUnion<"day" | "hour", [import("convex/values").VLiteral<"hour", "required">, import("convex/values").VLiteral<"day", "required">], "required", never>;
224
+ bucketStart: import("convex/values").VFloat64<number, "required">;
225
+ shard: import("convex/values").VFloat64<number, "required">;
226
+ events: import("convex/values").VFloat64<number, "required">;
227
+ pageviews: import("convex/values").VFloat64<number, "required">;
228
+ clicks: import("convex/values").VFloat64<number, "required">;
229
+ customEvents: import("convex/values").VFloat64<number, "required">;
230
+ outboundClicks: import("convex/values").VFloat64<number, "required">;
231
+ sessions: import("convex/values").VFloat64<number, "required">;
232
+ visitors: import("convex/values").VFloat64<number, "required">;
233
+ conversions: import("convex/values").VFloat64<number, "required">;
234
+ revenueCents: import("convex/values").VFloat64<number, "required">;
235
+ dimensions: import("convex/values").VArray<{
236
+ count: number;
237
+ revenueCents: number;
238
+ slot: number;
239
+ type: "browser" | "country" | "device" | "event" | "goal" | "page" | "source";
240
+ value: string;
241
+ }[], import("convex/values").VObject<{
242
+ count: number;
243
+ revenueCents: number;
244
+ slot: number;
245
+ type: "browser" | "country" | "device" | "event" | "goal" | "page" | "source";
246
+ value: string;
247
+ }, {
248
+ type: import("convex/values").VUnion<"browser" | "country" | "device" | "event" | "goal" | "page" | "source", [import("convex/values").VLiteral<"source", "required">, import("convex/values").VLiteral<"page", "required">, import("convex/values").VLiteral<"country", "required">, import("convex/values").VLiteral<"device", "required">, import("convex/values").VLiteral<"browser", "required">, import("convex/values").VLiteral<"event", "required">, import("convex/values").VLiteral<"goal", "required">], "required", never>;
249
+ slot: import("convex/values").VFloat64<number, "required">;
250
+ value: import("convex/values").VString<string, "required">;
251
+ count: import("convex/values").VFloat64<number, "required">;
252
+ revenueCents: import("convex/values").VFloat64<number, "required">;
253
+ }, "required", "count" | "revenueCents" | "slot" | "type" | "value">, "required">;
254
+ }, "required", "bucketStart" | "clicks" | "conversions" | "customEvents" | "dimensions" | "events" | "granularity" | "outboundClicks" | "pageviews" | "revenueCents" | "sessions" | "shard" | "siteId" | "visitors">;
255
+ export declare const goalMatchTypeValidator: import("convex/values").VUnion<"custom" | "pageview", [import("convex/values").VLiteral<"pageview", "required">, import("convex/values").VLiteral<"custom", "required">], "required", never>;
256
+ export declare const goalFieldsValidator: import("convex/values").VObject<{
257
+ active: boolean;
258
+ createdAt: number;
259
+ key: string;
260
+ matchType: "custom" | "pageview";
261
+ matchValue: string;
262
+ name: string;
263
+ siteId: import("convex/values").GenericId<"sites">;
264
+ updatedAt: number;
265
+ valueCents?: number | undefined;
266
+ }, {
267
+ siteId: import("convex/values").VId<import("convex/values").GenericId<"sites">, "required">;
268
+ key: import("convex/values").VString<string, "required">;
269
+ name: import("convex/values").VString<string, "required">;
270
+ matchType: import("convex/values").VUnion<"custom" | "pageview", [import("convex/values").VLiteral<"pageview", "required">, import("convex/values").VLiteral<"custom", "required">], "required", never>;
271
+ matchValue: import("convex/values").VString<string, "required">;
272
+ valueCents: import("convex/values").VFloat64<number | undefined, "optional">;
273
+ active: import("convex/values").VBoolean<boolean, "required">;
274
+ createdAt: import("convex/values").VFloat64<number, "required">;
275
+ updatedAt: import("convex/values").VFloat64<number, "required">;
276
+ }, "required", "active" | "createdAt" | "key" | "matchType" | "matchValue" | "name" | "siteId" | "updatedAt" | "valueCents">;
277
+ export declare const funnelStepValidator: import("convex/values").VObject<{
278
+ name: string;
279
+ type: "custom" | "pageview";
280
+ value: string;
281
+ }, {
282
+ type: import("convex/values").VUnion<"custom" | "pageview", [import("convex/values").VLiteral<"pageview", "required">, import("convex/values").VLiteral<"custom", "required">], "required", never>;
283
+ value: import("convex/values").VString<string, "required">;
284
+ name: import("convex/values").VString<string, "required">;
285
+ }, "required", "name" | "type" | "value">;
286
+ export declare const funnelFieldsValidator: import("convex/values").VObject<{
287
+ active: boolean;
288
+ conversionWindowMs: number;
289
+ createdAt: number;
290
+ key: string;
291
+ name: string;
292
+ siteId: import("convex/values").GenericId<"sites">;
293
+ steps: {
294
+ name: string;
295
+ type: "custom" | "pageview";
296
+ value: string;
297
+ }[];
298
+ updatedAt: number;
299
+ }, {
300
+ siteId: import("convex/values").VId<import("convex/values").GenericId<"sites">, "required">;
301
+ key: import("convex/values").VString<string, "required">;
302
+ name: import("convex/values").VString<string, "required">;
303
+ steps: import("convex/values").VArray<{
304
+ name: string;
305
+ type: "custom" | "pageview";
306
+ value: string;
307
+ }[], import("convex/values").VObject<{
308
+ name: string;
309
+ type: "custom" | "pageview";
310
+ value: string;
311
+ }, {
312
+ type: import("convex/values").VUnion<"custom" | "pageview", [import("convex/values").VLiteral<"pageview", "required">, import("convex/values").VLiteral<"custom", "required">], "required", never>;
313
+ value: import("convex/values").VString<string, "required">;
314
+ name: import("convex/values").VString<string, "required">;
315
+ }, "required", "name" | "type" | "value">, "required">;
316
+ conversionWindowMs: import("convex/values").VFloat64<number, "required">;
317
+ active: import("convex/values").VBoolean<boolean, "required">;
318
+ createdAt: import("convex/values").VFloat64<number, "required">;
319
+ updatedAt: import("convex/values").VFloat64<number, "required">;
320
+ }, "required", "active" | "conversionWindowMs" | "createdAt" | "key" | "name" | "siteId" | "steps" | "updatedAt">;
321
+ export declare const affiliateFieldsValidator: import("convex/values").VObject<{
322
+ active: boolean;
323
+ attributionWindowDays: number;
324
+ commissionBps: number;
325
+ createdAt: number;
326
+ name: string;
327
+ siteId: import("convex/values").GenericId<"sites">;
328
+ slug: string;
329
+ updatedAt: number;
330
+ }, {
331
+ siteId: import("convex/values").VId<import("convex/values").GenericId<"sites">, "required">;
332
+ slug: import("convex/values").VString<string, "required">;
333
+ name: import("convex/values").VString<string, "required">;
334
+ commissionBps: import("convex/values").VFloat64<number, "required">;
335
+ attributionWindowDays: import("convex/values").VFloat64<number, "required">;
336
+ active: import("convex/values").VBoolean<boolean, "required">;
337
+ createdAt: import("convex/values").VFloat64<number, "required">;
338
+ updatedAt: import("convex/values").VFloat64<number, "required">;
339
+ }, "required", "active" | "attributionWindowDays" | "commissionBps" | "createdAt" | "name" | "siteId" | "slug" | "updatedAt">;
340
+ export declare const ingestResultValidator: import("convex/values").VObject<{
341
+ accepted: number;
342
+ duplicates: number;
343
+ rejected: number;
344
+ }, {
345
+ accepted: import("convex/values").VFloat64<number, "required">;
346
+ duplicates: import("convex/values").VFloat64<number, "required">;
347
+ rejected: import("convex/values").VFloat64<number, "required">;
348
+ }, "required", "accepted" | "duplicates" | "rejected">;
349
+ export declare const trustedConversionValidator: import("convex/values").VObject<{
350
+ currency: string;
351
+ eventId: string;
352
+ goalKey?: string | undefined;
353
+ path?: string | undefined;
354
+ properties?: Record<string, string | number | boolean | null> | undefined;
355
+ revenueCents: number;
356
+ sessionId: string;
357
+ siteId: import("convex/values").GenericId<"sites">;
358
+ timestamp: number;
359
+ visitorId: string;
360
+ }, {
361
+ siteId: import("convex/values").VId<import("convex/values").GenericId<"sites">, "required">;
362
+ eventId: import("convex/values").VString<string, "required">;
363
+ sessionId: import("convex/values").VString<string, "required">;
364
+ visitorId: import("convex/values").VString<string, "required">;
365
+ timestamp: import("convex/values").VFloat64<number, "required">;
366
+ revenueCents: import("convex/values").VFloat64<number, "required">;
367
+ currency: import("convex/values").VString<string, "required">;
368
+ path: import("convex/values").VString<string | undefined, "optional">;
369
+ goalKey: import("convex/values").VString<string | undefined, "optional">;
370
+ properties: import("convex/values").VRecord<Record<string, string | number | boolean | null> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VUnion<string | number | boolean | null, [import("convex/values").VString<string, "required">, import("convex/values").VFloat64<number, "required">, import("convex/values").VBoolean<boolean, "required">, import("convex/values").VNull<null, "required">], "required", never>, "optional", string>;
371
+ }, "required", "currency" | "eventId" | "goalKey" | "path" | "properties" | "revenueCents" | "sessionId" | "siteId" | "timestamp" | "visitorId" | `properties.${string}`>;
372
+ export type TrackerEvent = Infer<typeof trackerEventValidator>;
373
+ export type IngestContext = Infer<typeof ingestContextValidator>;
374
+ export type EventProperties = Infer<typeof eventPropertiesValidator>;
375
+ export type FunnelStep = Infer<typeof funnelStepValidator>;
376
+ export type EventType = Infer<typeof eventTypeValidator>;
377
+ //# sourceMappingURL=validators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/component/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,kBAAkB,0dAO9B,CAAC;AAEF,eAAO,MAAM,sBAAsB,0SAKlC,CAAC;AAEF,eAAO,MAAM,wBAAwB,scAGpC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oOAgBhC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;2FAQjC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;iIAU9B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mbA8BjC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6TAwB/B,CAAC;AAEH,eAAO,MAAM,sBAAsB,mgBAQlC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;oEAMjC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oNAenC,CAAC;AAEH,eAAO,MAAM,sBAAsB,8LAGlC,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;4HAU9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;yCAI9B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iHAShC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;6HASnC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;sDAIhC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;yKAWrC,CAAC;AAGH,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC/D,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACjE,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACrE,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAC3D,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,176 @@
1
+ import { v } from "convex/values";
2
+ export const eventTypeValidator = v.union(v.literal("pageview"), v.literal("click"), v.literal("custom"), v.literal("conversion"), v.literal("heartbeat"), v.literal("outbound"));
3
+ export const propertyValueValidator = v.union(v.string(), v.number(), v.boolean(), v.null());
4
+ export const eventPropertiesValidator = v.record(v.string(), propertyValueValidator);
5
+ export const trackerEventValidator = v.object({
6
+ eventId: v.string(),
7
+ sessionId: v.string(),
8
+ visitorId: v.string(),
9
+ type: eventTypeValidator,
10
+ name: v.optional(v.string()),
11
+ path: v.string(),
12
+ referrer: v.optional(v.string()),
13
+ timestamp: v.number(),
14
+ sequence: v.number(),
15
+ target: v.optional(v.string()),
16
+ href: v.optional(v.string()),
17
+ properties: v.optional(eventPropertiesValidator),
18
+ revenueCents: v.optional(v.number()),
19
+ currency: v.optional(v.string()),
20
+ affiliateSlug: v.optional(v.string()),
21
+ });
22
+ export const ingestContextValidator = v.object({
23
+ country: v.optional(v.string()),
24
+ city: v.optional(v.string()),
25
+ latitude: v.optional(v.number()),
26
+ longitude: v.optional(v.number()),
27
+ browser: v.optional(v.string()),
28
+ os: v.optional(v.string()),
29
+ device: v.optional(v.string()),
30
+ });
31
+ export const siteFieldsValidator = v.object({
32
+ ownerId: v.string(),
33
+ name: v.string(),
34
+ domains: v.array(v.string()),
35
+ networkId: v.optional(v.string()),
36
+ timezone: v.optional(v.string()),
37
+ currency: v.optional(v.string()),
38
+ cookieless: v.boolean(),
39
+ createdAt: v.number(),
40
+ updatedAt: v.number(),
41
+ });
42
+ export const sessionFieldsValidator = v.object({
43
+ siteId: v.id("sites"),
44
+ sessionId: v.string(),
45
+ visitorId: v.string(),
46
+ startedAt: v.number(),
47
+ lastSeenAt: v.number(),
48
+ entryPath: v.string(),
49
+ exitPath: v.string(),
50
+ referrer: v.optional(v.string()),
51
+ source: v.string(),
52
+ utmSource: v.optional(v.string()),
53
+ utmMedium: v.optional(v.string()),
54
+ utmCampaign: v.optional(v.string()),
55
+ country: v.optional(v.string()),
56
+ city: v.optional(v.string()),
57
+ latitude: v.optional(v.number()),
58
+ longitude: v.optional(v.number()),
59
+ browser: v.string(),
60
+ os: v.string(),
61
+ device: v.string(),
62
+ eventCount: v.number(),
63
+ pageviewCount: v.number(),
64
+ durationMs: v.number(),
65
+ conversionCount: v.number(),
66
+ revenueCents: v.number(),
67
+ currency: v.optional(v.string()),
68
+ affiliateSlug: v.optional(v.string()),
69
+ affiliateId: v.optional(v.id("affiliates")),
70
+ affiliateAttributedAt: v.optional(v.number()),
71
+ affiliateExpiresAt: v.optional(v.number()),
72
+ });
73
+ export const eventFieldsValidator = v.object({
74
+ siteId: v.id("sites"),
75
+ eventId: v.string(),
76
+ sessionId: v.string(),
77
+ visitorId: v.string(),
78
+ type: eventTypeValidator,
79
+ name: v.optional(v.string()),
80
+ path: v.string(),
81
+ referrer: v.optional(v.string()),
82
+ timestamp: v.number(),
83
+ sequence: v.number(),
84
+ target: v.optional(v.string()),
85
+ href: v.optional(v.string()),
86
+ properties: v.optional(eventPropertiesValidator),
87
+ revenueCents: v.optional(v.number()),
88
+ currency: v.optional(v.string()),
89
+ affiliateSlug: v.optional(v.string()),
90
+ country: v.optional(v.string()),
91
+ city: v.optional(v.string()),
92
+ latitude: v.optional(v.number()),
93
+ longitude: v.optional(v.number()),
94
+ browser: v.string(),
95
+ os: v.string(),
96
+ device: v.string(),
97
+ });
98
+ export const dimensionTypeValidator = v.union(v.literal("source"), v.literal("page"), v.literal("country"), v.literal("device"), v.literal("browser"), v.literal("event"), v.literal("goal"));
99
+ export const dimensionSlotValidator = v.object({
100
+ type: dimensionTypeValidator,
101
+ slot: v.number(),
102
+ value: v.string(),
103
+ count: v.number(),
104
+ revenueCents: v.number(),
105
+ });
106
+ export const aggregateFieldsValidator = v.object({
107
+ siteId: v.id("sites"),
108
+ granularity: v.union(v.literal("hour"), v.literal("day")),
109
+ bucketStart: v.number(),
110
+ shard: v.number(),
111
+ events: v.number(),
112
+ pageviews: v.number(),
113
+ clicks: v.number(),
114
+ customEvents: v.number(),
115
+ outboundClicks: v.number(),
116
+ sessions: v.number(),
117
+ visitors: v.number(),
118
+ conversions: v.number(),
119
+ revenueCents: v.number(),
120
+ dimensions: v.array(dimensionSlotValidator),
121
+ });
122
+ export const goalMatchTypeValidator = v.union(v.literal("pageview"), v.literal("custom"));
123
+ export const goalFieldsValidator = v.object({
124
+ siteId: v.id("sites"),
125
+ key: v.string(),
126
+ name: v.string(),
127
+ matchType: goalMatchTypeValidator,
128
+ matchValue: v.string(),
129
+ valueCents: v.optional(v.number()),
130
+ active: v.boolean(),
131
+ createdAt: v.number(),
132
+ updatedAt: v.number(),
133
+ });
134
+ export const funnelStepValidator = v.object({
135
+ type: v.union(v.literal("pageview"), v.literal("custom")),
136
+ value: v.string(),
137
+ name: v.string(),
138
+ });
139
+ export const funnelFieldsValidator = v.object({
140
+ siteId: v.id("sites"),
141
+ key: v.string(),
142
+ name: v.string(),
143
+ steps: v.array(funnelStepValidator),
144
+ conversionWindowMs: v.number(),
145
+ active: v.boolean(),
146
+ createdAt: v.number(),
147
+ updatedAt: v.number(),
148
+ });
149
+ export const affiliateFieldsValidator = v.object({
150
+ siteId: v.id("sites"),
151
+ slug: v.string(),
152
+ name: v.string(),
153
+ commissionBps: v.number(),
154
+ attributionWindowDays: v.number(),
155
+ active: v.boolean(),
156
+ createdAt: v.number(),
157
+ updatedAt: v.number(),
158
+ });
159
+ export const ingestResultValidator = v.object({
160
+ accepted: v.number(),
161
+ duplicates: v.number(),
162
+ rejected: v.number(),
163
+ });
164
+ export const trustedConversionValidator = v.object({
165
+ siteId: v.id("sites"),
166
+ eventId: v.string(),
167
+ sessionId: v.string(),
168
+ visitorId: v.string(),
169
+ timestamp: v.number(),
170
+ revenueCents: v.number(),
171
+ currency: v.string(),
172
+ path: v.optional(v.string()),
173
+ goalKey: v.optional(v.string()),
174
+ properties: v.optional(eventPropertiesValidator),
175
+ });
176
+ //# sourceMappingURL=validators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/component/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAc,MAAM,eAAe,CAAC;AAE9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CACvC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,EACrB,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAClB,CAA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ty = string | number | boolean | null;
2
+ export type RastroProperties = Record<string, RastroProperty>;
3
+ export interface RastroScriptProps {
4
+ siteId: string;
5
+ src: string;
6
+ endpoint?: string;
7
+ visitorId?: string;
8
+ nonce?: string;
9
+ onLoad?: () => void;
10
+ onError?: () => void;
11
+ }
12
+ export interface RastroContext {
13
+ sessionId: string;
14
+ visitorId: string;
15
+ }
16
+ export interface RastroBrowserApi {
17
+ context: () => RastroContext | null;
18
+ track: (name: string, properties?: RastroProperties) => boolean;
19
+ }
20
+ type RastroCommand = (command: "event" | "context", value?: string, properties?: RastroProperties) => RastroContext | void;
21
+ declare global {
22
+ interface Window {
23
+ rastro?: RastroCommand;
24
+ }
25
+ }
26
+ /** Renders the sub-1KB cookieless tracker with CSP nonce support. */
27
+ export declare function RastroScript({ siteId, src, endpoint, visitorId, nonce, onLoad, onError, }: RastroScriptProps): import("react").DetailedReactHTMLElement<{
28
+ defer: boolean;
29
+ src: string;
30
+ nonce: string | undefined;
31
+ onLoad: (() => void) | undefined;
32
+ onError: (() => void) | undefined;
33
+ "data-site": string;
34
+ "data-endpoint": string | undefined;
35
+ "data-visitor": string | undefined;
36
+ }, HTMLElement>;
37
+ /** Stable browser helpers. `false` means the deferred tracker is not ready yet. */
38
+ export declare function useRastro(): RastroBrowserApi;
39
+ export {};
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAC9D,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAE9D,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CA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