@iann29/rastro 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -9
- package/agent/integration.md +48 -19
- package/agent/manifest.json +13 -7
- package/agent/manifest.schema.json +18 -8
- package/dist/client/federation.d.ts +18 -8
- package/dist/client/federation.d.ts.map +1 -1
- package/dist/client/federation.js +7 -1
- package/dist/client/federation.js.map +1 -1
- package/dist/client/identity.d.ts +11 -0
- package/dist/client/identity.d.ts.map +1 -0
- package/dist/client/identity.js +123 -0
- package/dist/client/identity.js.map +1 -0
- package/dist/client/index.d.ts +257 -7
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +110 -4
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/api.d.ts +2 -0
- package/dist/component/_generated/api.d.ts.map +1 -1
- package/dist/component/_generated/api.js.map +1 -1
- package/dist/component/_generated/component.d.ts +92 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/ingest.d.ts.map +1 -1
- package/dist/component/ingest.js +37 -24
- package/dist/component/ingest.js.map +1 -1
- package/dist/component/people.d.ts +79 -0
- package/dist/component/people.d.ts.map +1 -0
- package/dist/component/people.js +249 -0
- package/dist/component/people.js.map +1 -0
- package/dist/component/reports.d.ts +13 -4
- package/dist/component/reports.d.ts.map +1 -1
- package/dist/component/reports.js +25 -10
- package/dist/component/reports.js.map +1 -1
- package/dist/component/sanitize.d.ts +3 -1
- package/dist/component/sanitize.d.ts.map +1 -1
- package/dist/component/sanitize.js +30 -1
- package/dist/component/sanitize.js.map +1 -1
- package/dist/component/schema.d.ts +42 -1
- package/dist/component/schema.js +30 -1
- package/dist/component/schema.js.map +1 -1
- package/dist/component/sites.d.ts +4 -0
- package/dist/component/sites.d.ts.map +1 -1
- package/dist/component/sites.js +13 -2
- package/dist/component/sites.js.map +1 -1
- package/dist/component/validators.d.ts +53 -1
- package/dist/component/validators.d.ts.map +1 -1
- package/dist/component/validators.js +28 -0
- package/dist/component/validators.js.map +1 -1
- package/dist/component/visitors.d.ts +38 -2
- package/dist/component/visitors.d.ts.map +1 -1
- package/dist/component/visitors.js +162 -42
- package/dist/component/visitors.js.map +1 -1
- package/dist/react/index.d.ts +9 -5
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +36 -5
- package/dist/react/index.js.map +1 -1
- package/dist/tracker/generated.d.ts +6 -6
- package/dist/tracker/generated.d.ts.map +1 -1
- package/dist/tracker/generated.js +6 -6
- package/dist/tracker/generated.js.map +1 -1
- package/dist/tracker/tracker.d.ts +2 -1
- package/dist/tracker/tracker.d.ts.map +1 -1
- package/dist/tracker/tracker.js +41 -2
- package/dist/tracker/tracker.js.map +1 -1
- package/dist/tracker.min.js +1 -1
- package/docs/federation.md +24 -0
- package/docs/identity.md +307 -0
- package/docs/upgrading.md +85 -20
- package/llms.txt +6 -2
- package/package.json +5 -3
- package/src/component/_generated/api.ts +2 -0
- package/src/component/_generated/component.ts +104 -0
- package/src/component/ingest.ts +54 -30
- package/src/component/people.ts +321 -0
- package/src/component/reports.ts +34 -9
- package/src/component/sanitize.ts +46 -1
- package/src/component/schema.ts +35 -0
- package/src/component/sites.ts +14 -1
- package/src/component/validators.ts +50 -0
- package/src/component/visitors.ts +232 -55
- package/src/tracker/generated.ts +6 -6
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type GenericActionCtx, type GenericDataModel } from "convex/server";
|
|
2
|
+
import type { IdentifyVisitorInput } from "./index.js";
|
|
3
|
+
import type { VisitorProfile } from "../component/validators.js";
|
|
4
|
+
/** Fits provider identifiers (including issuer URLs and Unicode) into a tracker ID. */
|
|
5
|
+
export declare function visitorIdForUser(userId: string): Promise<string>;
|
|
6
|
+
type ActionCtx = GenericActionCtx<GenericDataModel>;
|
|
7
|
+
export type IdentityHttpAuthorizer = (ctx: ActionCtx, request: Request, siteId: string) => void | Promise<void>;
|
|
8
|
+
/** Server-to-server transport. The host must authenticate AND authorize the site. */
|
|
9
|
+
export declare function identityHttpAction(identify: (ctx: ActionCtx, input: IdentifyVisitorInput) => Promise<VisitorProfile>, authorize: IdentityHttpAuthorizer): import("convex/server").PublicHttpAction;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/client/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,uFAAuF;AACvF,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQtE;AAED,KAAK,SAAS,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;AACpD,MAAM,MAAM,sBAAsB,GAAG,CACnC,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,KACX,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B,qFAAqF;AACrF,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,CACR,GAAG,EAAE,SAAS,EACd,KAAK,EAAE,oBAAoB,KACxB,OAAO,CAAC,cAAc,CAAC,EAC5B,SAAS,EAAE,sBAAsB,4CAqIlC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { httpActionGeneric, } from "convex/server";
|
|
2
|
+
import { ConvexError } from "convex/values";
|
|
3
|
+
/** Fits provider identifiers (including issuer URLs and Unicode) into a tracker ID. */
|
|
4
|
+
export async function visitorIdForUser(userId) {
|
|
5
|
+
if (!userId.trim() || userId.length > 2048)
|
|
6
|
+
throw new Error("userId must contain 1–2048 characters");
|
|
7
|
+
const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(userId));
|
|
8
|
+
return `user_${Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("")}`;
|
|
9
|
+
}
|
|
10
|
+
/** Server-to-server transport. The host must authenticate AND authorize the site. */
|
|
11
|
+
export function identityHttpAction(identify, authorize) {
|
|
12
|
+
const json = (value, status) => Response.json(value, {
|
|
13
|
+
status,
|
|
14
|
+
headers: { "Cache-Control": "no-store" },
|
|
15
|
+
});
|
|
16
|
+
return httpActionGeneric(async (ctx, request) => {
|
|
17
|
+
if (request.method !== "POST")
|
|
18
|
+
return json({ error: "METHOD_NOT_ALLOWED" }, 405);
|
|
19
|
+
let input;
|
|
20
|
+
try {
|
|
21
|
+
if (request.headers
|
|
22
|
+
.get("content-type")
|
|
23
|
+
?.toLowerCase()
|
|
24
|
+
.split(";")[0]
|
|
25
|
+
.trim() !== "application/json") {
|
|
26
|
+
return json({ error: "JSON_REQUIRED" }, 415);
|
|
27
|
+
}
|
|
28
|
+
const reader = request.body?.getReader();
|
|
29
|
+
if (!reader)
|
|
30
|
+
return json({ error: "INVALID_BODY" }, 400);
|
|
31
|
+
const chunks = [];
|
|
32
|
+
let size = 0;
|
|
33
|
+
try {
|
|
34
|
+
while (true) {
|
|
35
|
+
const { done, value } = await reader.read();
|
|
36
|
+
if (done)
|
|
37
|
+
break;
|
|
38
|
+
size += value.byteLength;
|
|
39
|
+
if (size > 8192) {
|
|
40
|
+
await reader.cancel();
|
|
41
|
+
return json({ error: "BODY_TOO_LARGE" }, 413);
|
|
42
|
+
}
|
|
43
|
+
chunks.push(value);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
reader.releaseLock();
|
|
48
|
+
}
|
|
49
|
+
const bytes = new Uint8Array(size);
|
|
50
|
+
let offset = 0;
|
|
51
|
+
for (const chunk of chunks) {
|
|
52
|
+
bytes.set(chunk, offset);
|
|
53
|
+
offset += chunk.byteLength;
|
|
54
|
+
}
|
|
55
|
+
const body = JSON.parse(new TextDecoder().decode(bytes));
|
|
56
|
+
if (!body || typeof body !== "object" || Array.isArray(body))
|
|
57
|
+
throw new Error("body");
|
|
58
|
+
const fields = body;
|
|
59
|
+
if (Object.keys(fields).some((key) => ![
|
|
60
|
+
"siteId",
|
|
61
|
+
"visitorId",
|
|
62
|
+
"previousVisitorId",
|
|
63
|
+
"name",
|
|
64
|
+
"email",
|
|
65
|
+
"attributes",
|
|
66
|
+
].includes(key)))
|
|
67
|
+
throw new Error("fields");
|
|
68
|
+
if (typeof fields.siteId !== "string" ||
|
|
69
|
+
typeof fields.visitorId !== "string")
|
|
70
|
+
throw new Error("identity");
|
|
71
|
+
if (fields.previousVisitorId !== undefined &&
|
|
72
|
+
typeof fields.previousVisitorId !== "string")
|
|
73
|
+
throw new Error("previousVisitorId");
|
|
74
|
+
for (const key of ["name", "email"]) {
|
|
75
|
+
if (fields[key] !== undefined &&
|
|
76
|
+
fields[key] !== null &&
|
|
77
|
+
typeof fields[key] !== "string")
|
|
78
|
+
throw new Error(key);
|
|
79
|
+
}
|
|
80
|
+
if (fields.attributes !== undefined) {
|
|
81
|
+
if (!fields.attributes ||
|
|
82
|
+
typeof fields.attributes !== "object" ||
|
|
83
|
+
Array.isArray(fields.attributes))
|
|
84
|
+
throw new Error("attributes");
|
|
85
|
+
if (Object.values(fields.attributes).some((value) => value !== null &&
|
|
86
|
+
!["string", "number", "boolean"].includes(typeof value)))
|
|
87
|
+
throw new Error("attribute value");
|
|
88
|
+
}
|
|
89
|
+
input = fields;
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
return json({ error: "INVALID_BODY" }, 400);
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
await authorize(ctx, request, input.siteId);
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
return json({ error: "FORBIDDEN" }, 403);
|
|
99
|
+
}
|
|
100
|
+
try {
|
|
101
|
+
return json(await identify(ctx, input), 200);
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
if (error instanceof ConvexError &&
|
|
105
|
+
error.data &&
|
|
106
|
+
typeof error.data === "object") {
|
|
107
|
+
const code = error.data.code;
|
|
108
|
+
const status = code === "CONFLICT"
|
|
109
|
+
? 409
|
|
110
|
+
: code === "NOT_FOUND"
|
|
111
|
+
? 404
|
|
112
|
+
: code === "LIMIT_EXCEEDED"
|
|
113
|
+
? 429
|
|
114
|
+
: code === "INVALID_ARGUMENT"
|
|
115
|
+
? 400
|
|
116
|
+
: 500;
|
|
117
|
+
return json({ error: status === 500 ? "IDENTIFY_FAILED" : code }, status);
|
|
118
|
+
}
|
|
119
|
+
return json({ error: "IDENTIFY_FAILED" }, 500);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/client/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAGlB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5C,uFAAuF;AACvF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,MAAc;IACnD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,MAAM,CAAC,MAAM,GAAG,IAAI;QACxC,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CACvC,SAAS,EACT,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CACjC,CAAC;IACF,OAAO,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE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,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,GAAG,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,MAAM,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;QAC/C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IACE,KAAK,YAAY,WAAW;gBAC5B,KAAK,CAAC,IAAI;gBACV,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAC9B,CAAC;gBACD,MAAM,IAAI,GAAI,KAAK,CAAC,IAA0B,CAAC,IAAI,CAAC;gBACpD,MAAM,MAAM,GACV,IAAI,KAAK,UAAU;oBACjB,CAAC,CAAC,GAAG;oBACL,CAAC,CAAC,IAAI,KAAK,WAAW;wBACpB,CAAC,CAAC,GAAG;wBACL,CAAC,CAAC,IAAI,KAAK,gBAAgB;4BACzB,CAAC,CAAC,GAAG;4BACL,CAAC,CAAC,IAAI,KAAK,kBAAkB;gCAC3B,CAAC,CAAC,GAAG;gCACL,CAAC,CAAC,GAAG,CAAC;gBAChB,OAAO,IAAI,CACT,EAAE,KAAK,EAAE,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,EAAE,EACpD,MAAM,CACP,CAAC;YACJ,CAAC;YACD,OAAO,IAAI,CAAC,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,GAAG,CAAC,CAAC;QACjD,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import type { FunctionArgs, FunctionReturnType, GenericActionCtx, GenericDataModel, GenericMutationCtx, GenericQueryCtx } from "convex/server";
|
|
2
2
|
import { type Infer } from "convex/values";
|
|
3
|
+
import { type IdentityHttpAuthorizer } from "./identity.js";
|
|
4
|
+
export { visitorIdForUser } from "./identity.js";
|
|
5
|
+
export type { IdentityHttpAuthorizer } from "./identity.js";
|
|
3
6
|
import type { ComponentApi } from "../component/_generated/component.js";
|
|
4
|
-
import { eventPropertiesValidator, eventTypeValidator, funnelStepValidator, goalMatchTypeValidator, ingestContextValidator, ingestResultValidator, trackerEventValidator, vitalMetricValidator } from "../component/validators.js";
|
|
7
|
+
import { eventPropertiesValidator, eventTypeValidator, funnelStepValidator, goalMatchTypeValidator, ingestContextValidator, ingestResultValidator, trackerEventValidator, vitalMetricValidator, visitorProfileValidator } from "../component/validators.js";
|
|
5
8
|
import { type FederatedAnalyticsAuthorizerOptions, type FederatedAnalyticsConnectionStatus, type FederatedSiteSummary } from "./federation.js";
|
|
6
|
-
export { eventPropertiesValidator, eventTypeValidator, funnelStepValidator, goalMatchTypeValidator, ingestContextValidator, ingestResultValidator, trackerEventValidator, vitalMetricValidator, };
|
|
7
|
-
export type { Channel, EventProperties, EventType, Evidence, FunnelStep, IngestContext, TrackerEvent, } from "../component/validators.js";
|
|
9
|
+
export { eventPropertiesValidator, eventTypeValidator, funnelStepValidator, goalMatchTypeValidator, ingestContextValidator, ingestResultValidator, trackerEventValidator, vitalMetricValidator, visitorProfileValidator, };
|
|
10
|
+
export type { Channel, EventProperties, EventType, Evidence, FunnelStep, IngestContext, TrackerEvent, VisitorProfile, PersonAttributes, PersonFilter, } from "../component/validators.js";
|
|
8
11
|
export { channelForPlatform, platformDimensionValue, platformForSource, splitPlatformDimension, } from "../component/origin.js";
|
|
9
12
|
export { VITAL_METRICS, VITAL_THRESHOLDS } from "../component/vitals.js";
|
|
10
|
-
export { normalizeRoute } from "../component/sanitize.js";
|
|
13
|
+
export { normalizeRoute, validateRoutePatterns, } from "../component/sanitize.js";
|
|
11
14
|
export { localDayStart, nextLocalDayStart, previousLocalDayStart, } from "../component/localTime.js";
|
|
12
15
|
export { HEAT_HOT_SCORE, HEAT_WARM_SCORE, visitorHeat } from "./heat.js";
|
|
13
16
|
export type { HeatInput, HeatLevel, HeatSignal, VisitorHeat } from "./heat.js";
|
|
@@ -15,6 +18,8 @@ export type { VitalMetric } from "../component/vitals.js";
|
|
|
15
18
|
export { effectiveFederatedPermissions, federatedPermissionSatisfies, isPublicFederatedAccess, FEDERATED_ANALYTICS_CLAIMS, FEDERATED_ANALYTICS_CONFIGURE_FUNCTIONS, FEDERATED_ANALYTICS_CONFIGURE_PERMISSION, FEDERATED_ANALYTICS_CONNECTOR_MANIFEST, FEDERATED_ANALYTICS_ERROR_CODES, FEDERATED_ANALYTICS_PERMISSIONS, FEDERATED_ANALYTICS_PUBLIC_FUNCTIONS, FEDERATED_ANALYTICS_PUBLIC_PERMISSION, FEDERATED_ANALYTICS_READ_PERMISSION, FEDERATED_ANALYTICS_REQUIRED_CAPABILITIES, FEDERATED_ANALYTICS_REQUIRED_FUNCTIONS, federatedAnalyticsPermissionValidator, } from "./federation.js";
|
|
16
19
|
export type { FederatedAnalyticsCapability, FederatedAnalyticsAuthorizerOptions, FederatedAnalyticsConnection, FederatedAnalyticsConnectionStatus, FederatedAnalyticsErrorCode, FederatedAnalyticsIdentity, FederatedAnalyticsManifest, FederatedAnalyticsPermission, FederatedSiteSummary, ResolveFederatedAnalyticsConnection, } from "./federation.js";
|
|
17
20
|
export type CreateSiteInput = FunctionArgs<ComponentApi["sites"]["create"]>;
|
|
21
|
+
export type ListPeopleInput = FunctionArgs<ComponentApi["people"]["list"]>;
|
|
22
|
+
export type Person = FunctionReturnType<ComponentApi["people"]["list"]>["page"][number];
|
|
18
23
|
export type CreateSiteOutput = FunctionReturnType<ComponentApi["sites"]["create"]>;
|
|
19
24
|
export type UpdateSiteInput = FunctionArgs<ComponentApi["sites"]["update"]>;
|
|
20
25
|
export type UpdateSiteOutput = FunctionReturnType<ComponentApi["sites"]["update"]>;
|
|
@@ -27,6 +32,8 @@ export type TrackConversionInput = Omit<FunctionArgs<ComponentApi["ingest"]["tra
|
|
|
27
32
|
export type TrackConversionOutput = FunctionReturnType<ComponentApi["ingest"]["trackConversion"]>;
|
|
28
33
|
export type LinkVisitorInput = FunctionArgs<ComponentApi["visitors"]["link"]>;
|
|
29
34
|
export type LinkVisitorOutput = FunctionReturnType<ComponentApi["visitors"]["link"]>;
|
|
35
|
+
export type IdentifyVisitorInput = FunctionArgs<ComponentApi["visitors"]["identify"]>;
|
|
36
|
+
export type GetVisitorProfileInput = FunctionArgs<ComponentApi["visitors"]["getProfile"]>;
|
|
30
37
|
export type OverviewInput = FunctionArgs<ComponentApi["reports"]["overview"]>;
|
|
31
38
|
export type Overview = Infer<typeof hostOverviewValidator>;
|
|
32
39
|
export type LiveVisitorsInput = FunctionArgs<ComponentApi["reports"]["liveVisitors"]>;
|
|
@@ -137,6 +144,7 @@ export declare class Rastro {
|
|
|
137
144
|
name: string;
|
|
138
145
|
networkId?: string;
|
|
139
146
|
ownerId: string;
|
|
147
|
+
routePatterns?: Array<string>;
|
|
140
148
|
timezone?: string;
|
|
141
149
|
updatedAt: number;
|
|
142
150
|
} | null>;
|
|
@@ -155,6 +163,7 @@ export declare class Rastro {
|
|
|
155
163
|
name: string;
|
|
156
164
|
networkId?: string;
|
|
157
165
|
ownerId: string;
|
|
166
|
+
routePatterns?: Array<string>;
|
|
158
167
|
timezone?: string;
|
|
159
168
|
updatedAt: number;
|
|
160
169
|
}[]>;
|
|
@@ -172,6 +181,61 @@ export declare class Rastro {
|
|
|
172
181
|
aliasCount: number;
|
|
173
182
|
linked: boolean;
|
|
174
183
|
}>;
|
|
184
|
+
/** The caller resolves the user with its own auth; no provider is required. */
|
|
185
|
+
identifyVisitor(ctx: MutationCtx | ActionCtx, args: IdentifyVisitorInput): Promise<{
|
|
186
|
+
attributes?: Record<string, string | number | boolean>;
|
|
187
|
+
email?: string;
|
|
188
|
+
identifiedAt: number;
|
|
189
|
+
name?: string;
|
|
190
|
+
updatedAt: number;
|
|
191
|
+
visitorId: string;
|
|
192
|
+
}>;
|
|
193
|
+
/** End-user entrypoint: the browser supplies only its pre-login visitor ID. */
|
|
194
|
+
identifyVisitorMutation<DataModel extends GenericDataModel>(options: {
|
|
195
|
+
resolveUser: (ctx: GenericMutationCtx<DataModel>) => Promise<Omit<IdentifyVisitorInput, "previousVisitorId"> | null>;
|
|
196
|
+
}): import("convex/server").RegisteredMutation<"public", {
|
|
197
|
+
previousVisitorId?: string | undefined;
|
|
198
|
+
}, Promise<{
|
|
199
|
+
attributes?: Record<string, string | number | boolean>;
|
|
200
|
+
email?: string;
|
|
201
|
+
identifiedAt: number;
|
|
202
|
+
name?: string;
|
|
203
|
+
updatedAt: number;
|
|
204
|
+
visitorId: string;
|
|
205
|
+
}>>;
|
|
206
|
+
/** Mount on the host's router with its own server credential/site authorization. */
|
|
207
|
+
identifyVisitorHttpAction(options: {
|
|
208
|
+
authorize: IdentityHttpAuthorizer;
|
|
209
|
+
}): import("convex/server").PublicHttpAction;
|
|
210
|
+
getVisitorProfile(ctx: QueryCtx | MutationCtx | ActionCtx, args: GetVisitorProfileInput): Promise<{
|
|
211
|
+
attributes?: Record<string, string | number | boolean>;
|
|
212
|
+
email?: string;
|
|
213
|
+
identifiedAt: number;
|
|
214
|
+
name?: string;
|
|
215
|
+
updatedAt: number;
|
|
216
|
+
visitorId: string;
|
|
217
|
+
} | null>;
|
|
218
|
+
listPeople(ctx: QueryCtx | MutationCtx | ActionCtx, args: ListPeopleInput): Promise<{
|
|
219
|
+
continueCursor: string;
|
|
220
|
+
isDone: boolean;
|
|
221
|
+
page: Array<{
|
|
222
|
+
_creationTime: number;
|
|
223
|
+
_id: string;
|
|
224
|
+
attributes?: Record<string, string | number | boolean>;
|
|
225
|
+
email?: string;
|
|
226
|
+
identifiedAt: number;
|
|
227
|
+
name?: string;
|
|
228
|
+
siteId: string;
|
|
229
|
+
updatedAt: number;
|
|
230
|
+
visitorId: string;
|
|
231
|
+
}>;
|
|
232
|
+
}>;
|
|
233
|
+
backfillVisitorProfiles(ctx: MutationCtx | ActionCtx, args: {
|
|
234
|
+
siteId: string;
|
|
235
|
+
}): Promise<{
|
|
236
|
+
isDone: boolean;
|
|
237
|
+
updated: number;
|
|
238
|
+
}>;
|
|
175
239
|
overview(ctx: QueryCtx | MutationCtx | ActionCtx, args: OverviewInput): Promise<{
|
|
176
240
|
currency: string;
|
|
177
241
|
from: number;
|
|
@@ -342,6 +406,14 @@ export declare class Rastro {
|
|
|
342
406
|
pageviewCount: number;
|
|
343
407
|
path: string;
|
|
344
408
|
previousPath?: string;
|
|
409
|
+
profile?: {
|
|
410
|
+
attributes?: Record<string, string | number | boolean>;
|
|
411
|
+
email?: string;
|
|
412
|
+
identifiedAt: number;
|
|
413
|
+
name?: string;
|
|
414
|
+
updatedAt: number;
|
|
415
|
+
visitorId: string;
|
|
416
|
+
};
|
|
345
417
|
returning?: boolean;
|
|
346
418
|
sessionId: string;
|
|
347
419
|
siteId: string;
|
|
@@ -379,6 +451,14 @@ export declare class Rastro {
|
|
|
379
451
|
os: string;
|
|
380
452
|
pageviewCount: number;
|
|
381
453
|
platform?: string;
|
|
454
|
+
profile?: {
|
|
455
|
+
attributes?: Record<string, string | number | boolean>;
|
|
456
|
+
email?: string;
|
|
457
|
+
identifiedAt: number;
|
|
458
|
+
name?: string;
|
|
459
|
+
updatedAt: number;
|
|
460
|
+
visitorId: string;
|
|
461
|
+
};
|
|
382
462
|
referrer?: string;
|
|
383
463
|
revenueCents: number;
|
|
384
464
|
sessionId: string;
|
|
@@ -427,6 +507,14 @@ export declare class Rastro {
|
|
|
427
507
|
os: string;
|
|
428
508
|
pageviewCount: number;
|
|
429
509
|
platform?: string;
|
|
510
|
+
profile?: {
|
|
511
|
+
attributes?: Record<string, string | number | boolean>;
|
|
512
|
+
email?: string;
|
|
513
|
+
identifiedAt: number;
|
|
514
|
+
name?: string;
|
|
515
|
+
updatedAt: number;
|
|
516
|
+
visitorId: string;
|
|
517
|
+
};
|
|
430
518
|
referrer?: string;
|
|
431
519
|
revenueCents: number;
|
|
432
520
|
sessionId: string;
|
|
@@ -717,6 +805,7 @@ export declare class Rastro {
|
|
|
717
805
|
exact: boolean;
|
|
718
806
|
};
|
|
719
807
|
};
|
|
808
|
+
routePatterns?: Record<string, Array<string>>;
|
|
720
809
|
routes: Array<{
|
|
721
810
|
bounces: number;
|
|
722
811
|
daily: Array<{
|
|
@@ -862,7 +951,7 @@ export declare class Rastro {
|
|
|
862
951
|
hasMore: boolean;
|
|
863
952
|
}>;
|
|
864
953
|
}
|
|
865
|
-
export type AnalyticsOperation = "site.create" | "site.update" | "site.get" | "site.list" | "ingest" | "conversion.track" | "visitor.link" | "report.overview" | "report.live" | "report.sessions" | "report.sessionJourney" | "report.conversions" | "report.visitorJourney" | "report.goals" | "report.funnels" | "report.affiliates" | "report.vitals" | "report.siteMap" | "goal.upsert" | "goal.list" | "goal.remove" | "funnel.upsert" | "funnel.list" | "funnel.remove" | "affiliate.upsert" | "affiliate.list" | "affiliate.remove" | "trackedLink.create" | "trackedLink.update" | "trackedLink.delete" | "trackedLink.list" | "retention.cleanup" | "retention.policy" | "retention.status" | "coverage.read";
|
|
954
|
+
export type AnalyticsOperation = "site.create" | "site.update" | "site.get" | "site.list" | "ingest" | "conversion.track" | "visitor.link" | "visitor.identify" | "visitor.profile" | "visitor.list" | "visitor.index" | "report.overview" | "report.live" | "report.sessions" | "report.sessionJourney" | "report.conversions" | "report.visitorJourney" | "report.goals" | "report.funnels" | "report.affiliates" | "report.vitals" | "report.siteMap" | "goal.upsert" | "goal.list" | "goal.remove" | "funnel.upsert" | "funnel.list" | "funnel.remove" | "affiliate.upsert" | "affiliate.list" | "affiliate.remove" | "trackedLink.create" | "trackedLink.update" | "trackedLink.delete" | "trackedLink.list" | "retention.cleanup" | "retention.policy" | "retention.status" | "coverage.read";
|
|
866
955
|
export type AnalyticsAuthorizationRequest = {
|
|
867
956
|
operation: AnalyticsOperation;
|
|
868
957
|
siteIds: string[];
|
|
@@ -2060,6 +2149,7 @@ declare const hostSiteMapValidator: import("convex/values").VObject<{
|
|
|
2060
2149
|
exact: boolean;
|
|
2061
2150
|
};
|
|
2062
2151
|
};
|
|
2152
|
+
routePatterns?: Record<string, string[]> | undefined;
|
|
2063
2153
|
routes: {
|
|
2064
2154
|
bounces: number;
|
|
2065
2155
|
daily: {
|
|
@@ -2091,6 +2181,7 @@ declare const hostSiteMapValidator: import("convex/values").VObject<{
|
|
|
2091
2181
|
to: number;
|
|
2092
2182
|
} | null;
|
|
2093
2183
|
}, {
|
|
2184
|
+
routePatterns: import("convex/values").VRecord<Record<string, string[]> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, "optional", string>;
|
|
2094
2185
|
from: import("convex/values").VFloat64<number, "required">;
|
|
2095
2186
|
to: import("convex/values").VFloat64<number, "required">;
|
|
2096
2187
|
window: import("convex/values").VUnion<{
|
|
@@ -2242,7 +2333,7 @@ declare const hostSiteMapValidator: import("convex/values").VObject<{
|
|
|
2242
2333
|
rows: import("convex/values").VFloat64<number, "required">;
|
|
2243
2334
|
}, "required", "routesPerDay" | "rows" | "transitionSlots">;
|
|
2244
2335
|
}, "required", "basis" | "coverage" | "coverage.availableFrom" | "coverage.availableThrough" | "coverage.generation" | "coverage.retainedBefore" | "coverage.state" | "limits" | "limits.routesPerDay" | "limits.rows" | "limits.transitionSlots" | "range" | "range.boundary" | "range.from" | "range.timezone" | "range.to" | "visitors" | "visitors.basis" | "visitors.exact">;
|
|
2245
|
-
}, "required", "from" | "metadata" | "metadata.basis" | "metadata.coverage" | "metadata.coverage.availableFrom" | "metadata.coverage.availableThrough" | "metadata.coverage.generation" | "metadata.coverage.retainedBefore" | "metadata.coverage.state" | "metadata.limits" | "metadata.limits.routesPerDay" | "metadata.limits.rows" | "metadata.limits.transitionSlots" | "metadata.range" | "metadata.range.boundary" | "metadata.range.from" | "metadata.range.timezone" | "metadata.range.to" | "metadata.visitors" | "metadata.visitors.basis" | "metadata.visitors.exact" | "routes" | "to" | "transitions" | "truncated" | "truncated.routes" | "truncated.transitions" | "window" | "window.from" | "window.to"
|
|
2336
|
+
}, "required", "from" | "metadata" | "metadata.basis" | "metadata.coverage" | "metadata.coverage.availableFrom" | "metadata.coverage.availableThrough" | "metadata.coverage.generation" | "metadata.coverage.retainedBefore" | "metadata.coverage.state" | "metadata.limits" | "metadata.limits.routesPerDay" | "metadata.limits.rows" | "metadata.limits.transitionSlots" | "metadata.range" | "metadata.range.boundary" | "metadata.range.from" | "metadata.range.timezone" | "metadata.range.to" | "metadata.visitors" | "metadata.visitors.basis" | "metadata.visitors.exact" | "routePatterns" | "routes" | "to" | "transitions" | "truncated" | "truncated.routes" | "truncated.transitions" | "window" | "window.from" | "window.to" | `routePatterns.${string}`>;
|
|
2246
2337
|
export declare function exposeAnalyticsApi(component: ComponentApi, options: {
|
|
2247
2338
|
authorize: AnalyticsAuthorizer;
|
|
2248
2339
|
}): {
|
|
@@ -2253,6 +2344,7 @@ export declare function exposeAnalyticsApi(component: ComponentApi, options: {
|
|
|
2253
2344
|
name: string;
|
|
2254
2345
|
networkId?: string | undefined;
|
|
2255
2346
|
ownerId: string;
|
|
2347
|
+
routePatterns?: string[] | undefined;
|
|
2256
2348
|
timezone?: string | undefined;
|
|
2257
2349
|
}, Promise<string>>;
|
|
2258
2350
|
updateSite: import("convex/server").RegisteredMutation<"public", {
|
|
@@ -2261,6 +2353,7 @@ export declare function exposeAnalyticsApi(component: ComponentApi, options: {
|
|
|
2261
2353
|
domains?: string[] | undefined;
|
|
2262
2354
|
name?: string | undefined;
|
|
2263
2355
|
networkId?: string | null | undefined;
|
|
2356
|
+
routePatterns?: string[] | undefined;
|
|
2264
2357
|
siteId: string;
|
|
2265
2358
|
timezone?: string | null | undefined;
|
|
2266
2359
|
}, Promise<null>>;
|
|
@@ -2276,6 +2369,7 @@ export declare function exposeAnalyticsApi(component: ComponentApi, options: {
|
|
|
2276
2369
|
name: string;
|
|
2277
2370
|
networkId?: string;
|
|
2278
2371
|
ownerId: string;
|
|
2372
|
+
routePatterns?: Array<string>;
|
|
2279
2373
|
timezone?: string;
|
|
2280
2374
|
updatedAt: number;
|
|
2281
2375
|
} | null>>;
|
|
@@ -2292,6 +2386,7 @@ export declare function exposeAnalyticsApi(component: ComponentApi, options: {
|
|
|
2292
2386
|
name: string;
|
|
2293
2387
|
networkId?: string;
|
|
2294
2388
|
ownerId: string;
|
|
2389
|
+
routePatterns?: Array<string>;
|
|
2295
2390
|
timezone?: string;
|
|
2296
2391
|
updatedAt: number;
|
|
2297
2392
|
}[]>>;
|
|
@@ -2357,6 +2452,67 @@ export declare function exposeAnalyticsApi(component: ComponentApi, options: {
|
|
|
2357
2452
|
aliasCount: number;
|
|
2358
2453
|
linked: boolean;
|
|
2359
2454
|
}>>;
|
|
2455
|
+
identifyVisitor: import("convex/server").RegisteredMutation<"public", {
|
|
2456
|
+
attributes?: Record<string, string | number | boolean | null> | undefined;
|
|
2457
|
+
email?: string | null | undefined;
|
|
2458
|
+
name?: string | null | undefined;
|
|
2459
|
+
previousVisitorId?: string | undefined;
|
|
2460
|
+
siteId: string;
|
|
2461
|
+
visitorId: string;
|
|
2462
|
+
}, Promise<{
|
|
2463
|
+
attributes?: Record<string, string | number | boolean>;
|
|
2464
|
+
email?: string;
|
|
2465
|
+
identifiedAt: number;
|
|
2466
|
+
name?: string;
|
|
2467
|
+
updatedAt: number;
|
|
2468
|
+
visitorId: string;
|
|
2469
|
+
}>>;
|
|
2470
|
+
getVisitorProfile: import("convex/server").RegisteredQuery<"public", {
|
|
2471
|
+
siteId: string;
|
|
2472
|
+
visitorId: string;
|
|
2473
|
+
}, Promise<{
|
|
2474
|
+
attributes?: Record<string, string | number | boolean>;
|
|
2475
|
+
email?: string;
|
|
2476
|
+
identifiedAt: number;
|
|
2477
|
+
name?: string;
|
|
2478
|
+
updatedAt: number;
|
|
2479
|
+
visitorId: string;
|
|
2480
|
+
} | null>>;
|
|
2481
|
+
listPeople: import("convex/server").RegisteredQuery<"public", {
|
|
2482
|
+
filter?: {
|
|
2483
|
+
field: "email" | "name" | "visitorId";
|
|
2484
|
+
prefix: string;
|
|
2485
|
+
} | {
|
|
2486
|
+
field: "attribute";
|
|
2487
|
+
key: string;
|
|
2488
|
+
value: string | number | boolean;
|
|
2489
|
+
} | undefined;
|
|
2490
|
+
paginationOpts: {
|
|
2491
|
+
cursor: string | null;
|
|
2492
|
+
numItems: number;
|
|
2493
|
+
};
|
|
2494
|
+
siteId: string;
|
|
2495
|
+
}, Promise<{
|
|
2496
|
+
continueCursor: string;
|
|
2497
|
+
isDone: boolean;
|
|
2498
|
+
page: Array<{
|
|
2499
|
+
_creationTime: number;
|
|
2500
|
+
_id: string;
|
|
2501
|
+
attributes?: Record<string, string | number | boolean>;
|
|
2502
|
+
email?: string;
|
|
2503
|
+
identifiedAt: number;
|
|
2504
|
+
name?: string;
|
|
2505
|
+
siteId: string;
|
|
2506
|
+
updatedAt: number;
|
|
2507
|
+
visitorId: string;
|
|
2508
|
+
}>;
|
|
2509
|
+
}>>;
|
|
2510
|
+
backfillVisitorProfiles: import("convex/server").RegisteredMutation<"public", {
|
|
2511
|
+
siteId: string;
|
|
2512
|
+
}, Promise<{
|
|
2513
|
+
isDone: boolean;
|
|
2514
|
+
updated: number;
|
|
2515
|
+
}>>;
|
|
2360
2516
|
overview: import("convex/server").RegisteredQuery<"public", {
|
|
2361
2517
|
from: number;
|
|
2362
2518
|
interval?: "day" | "hour" | undefined;
|
|
@@ -2536,6 +2692,14 @@ export declare function exposeAnalyticsApi(component: ComponentApi, options: {
|
|
|
2536
2692
|
pageviewCount: number;
|
|
2537
2693
|
path: string;
|
|
2538
2694
|
previousPath?: string;
|
|
2695
|
+
profile?: {
|
|
2696
|
+
attributes?: Record<string, string | number | boolean>;
|
|
2697
|
+
email?: string;
|
|
2698
|
+
identifiedAt: number;
|
|
2699
|
+
name?: string;
|
|
2700
|
+
updatedAt: number;
|
|
2701
|
+
visitorId: string;
|
|
2702
|
+
};
|
|
2539
2703
|
returning?: boolean;
|
|
2540
2704
|
sessionId: string;
|
|
2541
2705
|
siteId: string;
|
|
@@ -2573,6 +2737,14 @@ export declare function exposeAnalyticsApi(component: ComponentApi, options: {
|
|
|
2573
2737
|
os: string;
|
|
2574
2738
|
pageviewCount: number;
|
|
2575
2739
|
platform?: string;
|
|
2740
|
+
profile?: {
|
|
2741
|
+
attributes?: Record<string, string | number | boolean>;
|
|
2742
|
+
email?: string;
|
|
2743
|
+
identifiedAt: number;
|
|
2744
|
+
name?: string;
|
|
2745
|
+
updatedAt: number;
|
|
2746
|
+
visitorId: string;
|
|
2747
|
+
};
|
|
2576
2748
|
referrer?: string;
|
|
2577
2749
|
revenueCents: number;
|
|
2578
2750
|
sessionId: string;
|
|
@@ -2633,6 +2805,14 @@ export declare function exposeAnalyticsApi(component: ComponentApi, options: {
|
|
|
2633
2805
|
os: string;
|
|
2634
2806
|
pageviewCount: number;
|
|
2635
2807
|
platform?: string;
|
|
2808
|
+
profile?: {
|
|
2809
|
+
attributes?: Record<string, string | number | boolean>;
|
|
2810
|
+
email?: string;
|
|
2811
|
+
identifiedAt: number;
|
|
2812
|
+
name?: string;
|
|
2813
|
+
updatedAt: number;
|
|
2814
|
+
visitorId: string;
|
|
2815
|
+
};
|
|
2636
2816
|
referrer?: string;
|
|
2637
2817
|
revenueCents: number;
|
|
2638
2818
|
sessionId: string;
|
|
@@ -2974,6 +3154,7 @@ export declare function exposeAnalyticsApi(component: ComponentApi, options: {
|
|
|
2974
3154
|
exact: boolean;
|
|
2975
3155
|
};
|
|
2976
3156
|
};
|
|
3157
|
+
routePatterns?: Record<string, Array<string>>;
|
|
2977
3158
|
routes: Array<{
|
|
2978
3159
|
bounces: number;
|
|
2979
3160
|
daily: Array<{
|
|
@@ -3262,6 +3443,8 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
|
|
|
3262
3443
|
setRetentionPolicy: "setRetentionPolicy";
|
|
3263
3444
|
disableRetentionPolicy: "disableRetentionPolicy";
|
|
3264
3445
|
getSession: "getSession";
|
|
3446
|
+
getVisitorProfile: "getVisitorProfile";
|
|
3447
|
+
listPeople: "listPeople";
|
|
3265
3448
|
revenueSummary: "revenueSummary";
|
|
3266
3449
|
vitalsReport: "vitalsReport";
|
|
3267
3450
|
siteMap: "siteMap";
|
|
@@ -3271,7 +3454,7 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
|
|
|
3271
3454
|
deleteTrackedLink: "deleteTrackedLink";
|
|
3272
3455
|
transferConnection?: "transferConnection" | undefined;
|
|
3273
3456
|
};
|
|
3274
|
-
capabilities: ("affiliates" | "configure" | "conversions" | "dataCoverage" | "funnels" | "goals" | "liveVisitors" | "localDays" | "overview" | "revenueSummary" | "sessionDetails" | "sessionJourney" | "sessions" | "siteMap" | "siteSummaries" | "trackedLinks" | "transfer" | "visitorJourney" | "vitals")[];
|
|
3457
|
+
capabilities: ("affiliates" | "configure" | "conversions" | "dataCoverage" | "funnels" | "goals" | "liveVisitors" | "localDays" | "overview" | "people" | "revenueSummary" | "sessionDetails" | "sessionJourney" | "sessions" | "siteMap" | "siteSummaries" | "trackedLinks" | "transfer" | "visitorJourney" | "visitorProfiles" | "vitals")[];
|
|
3275
3458
|
limits: {
|
|
3276
3459
|
maxSitesPerRequest: 10;
|
|
3277
3460
|
maxSitesPerConnection: 10;
|
|
@@ -3462,6 +3645,14 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
|
|
|
3462
3645
|
pageviewCount: number;
|
|
3463
3646
|
path: string;
|
|
3464
3647
|
previousPath?: string;
|
|
3648
|
+
profile?: {
|
|
3649
|
+
attributes?: Record<string, string | number | boolean>;
|
|
3650
|
+
email?: string;
|
|
3651
|
+
identifiedAt: number;
|
|
3652
|
+
name?: string;
|
|
3653
|
+
updatedAt: number;
|
|
3654
|
+
visitorId: string;
|
|
3655
|
+
};
|
|
3465
3656
|
returning?: boolean;
|
|
3466
3657
|
sessionId: string;
|
|
3467
3658
|
siteId: string;
|
|
@@ -3499,6 +3690,14 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
|
|
|
3499
3690
|
os: string;
|
|
3500
3691
|
pageviewCount: number;
|
|
3501
3692
|
platform?: string;
|
|
3693
|
+
profile?: {
|
|
3694
|
+
attributes?: Record<string, string | number | boolean>;
|
|
3695
|
+
email?: string;
|
|
3696
|
+
identifiedAt: number;
|
|
3697
|
+
name?: string;
|
|
3698
|
+
updatedAt: number;
|
|
3699
|
+
visitorId: string;
|
|
3700
|
+
};
|
|
3502
3701
|
referrer?: string;
|
|
3503
3702
|
revenueCents: number;
|
|
3504
3703
|
sessionId: string;
|
|
@@ -3559,6 +3758,14 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
|
|
|
3559
3758
|
os: string;
|
|
3560
3759
|
pageviewCount: number;
|
|
3561
3760
|
platform?: string;
|
|
3761
|
+
profile?: {
|
|
3762
|
+
attributes?: Record<string, string | number | boolean>;
|
|
3763
|
+
email?: string;
|
|
3764
|
+
identifiedAt: number;
|
|
3765
|
+
name?: string;
|
|
3766
|
+
updatedAt: number;
|
|
3767
|
+
visitorId: string;
|
|
3768
|
+
};
|
|
3562
3769
|
referrer?: string;
|
|
3563
3770
|
revenueCents: number;
|
|
3564
3771
|
sessionId: string;
|
|
@@ -3690,6 +3897,46 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
|
|
|
3690
3897
|
type: "pageview" | "click" | "custom" | "conversion" | "heartbeat" | "leave" | "outbound" | "vital";
|
|
3691
3898
|
visitorId: string;
|
|
3692
3899
|
}[]>>;
|
|
3900
|
+
getVisitorProfile: import("convex/server").RegisteredQuery<"public", {
|
|
3901
|
+
siteId: string;
|
|
3902
|
+
visitorId: string;
|
|
3903
|
+
}, Promise<{
|
|
3904
|
+
attributes?: Record<string, string | number | boolean>;
|
|
3905
|
+
email?: string;
|
|
3906
|
+
identifiedAt: number;
|
|
3907
|
+
name?: string;
|
|
3908
|
+
updatedAt: number;
|
|
3909
|
+
visitorId: string;
|
|
3910
|
+
} | null>>;
|
|
3911
|
+
listPeople: import("convex/server").RegisteredQuery<"public", {
|
|
3912
|
+
filter?: {
|
|
3913
|
+
field: "email" | "name" | "visitorId";
|
|
3914
|
+
prefix: string;
|
|
3915
|
+
} | {
|
|
3916
|
+
field: "attribute";
|
|
3917
|
+
key: string;
|
|
3918
|
+
value: string | number | boolean;
|
|
3919
|
+
} | undefined;
|
|
3920
|
+
paginationOpts: {
|
|
3921
|
+
cursor: string | null;
|
|
3922
|
+
numItems: number;
|
|
3923
|
+
};
|
|
3924
|
+
siteId: string;
|
|
3925
|
+
}, Promise<{
|
|
3926
|
+
continueCursor: string;
|
|
3927
|
+
isDone: boolean;
|
|
3928
|
+
page: Array<{
|
|
3929
|
+
_creationTime: number;
|
|
3930
|
+
_id: string;
|
|
3931
|
+
attributes?: Record<string, string | number | boolean>;
|
|
3932
|
+
email?: string;
|
|
3933
|
+
identifiedAt: number;
|
|
3934
|
+
name?: string;
|
|
3935
|
+
siteId: string;
|
|
3936
|
+
updatedAt: number;
|
|
3937
|
+
visitorId: string;
|
|
3938
|
+
}>;
|
|
3939
|
+
}>>;
|
|
3693
3940
|
goalsReport: import("convex/server").RegisteredQuery<"public", {
|
|
3694
3941
|
from: number;
|
|
3695
3942
|
siteId: string;
|
|
@@ -3900,6 +4147,7 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
|
|
|
3900
4147
|
exact: boolean;
|
|
3901
4148
|
};
|
|
3902
4149
|
};
|
|
4150
|
+
routePatterns?: Record<string, Array<string>>;
|
|
3903
4151
|
routes: Array<{
|
|
3904
4152
|
bounces: number;
|
|
3905
4153
|
daily: Array<{
|
|
@@ -3959,10 +4207,12 @@ export declare function exposeFederatedAnalyticsApi(component: ComponentApi, opt
|
|
|
3959
4207
|
timezone: string | null;
|
|
3960
4208
|
currency: string;
|
|
3961
4209
|
cookieless: boolean;
|
|
4210
|
+
routePatterns: string[];
|
|
3962
4211
|
}>>;
|
|
3963
4212
|
updateSite: import("convex/server").RegisteredMutation<"public", {
|
|
3964
4213
|
domains?: string[] | undefined;
|
|
3965
4214
|
name?: string | undefined;
|
|
4215
|
+
routePatterns?: string[] | undefined;
|
|
3966
4216
|
siteId: string;
|
|
3967
4217
|
timezone?: string | null | undefined;
|
|
3968
4218
|
}, Promise<null>>;
|