@meetkai/mka1 0.54.45 → 0.54.46
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 +315 -303
- package/bin/mcp-server.js +3125 -2627
- package/bin/mcp-server.js.map +20 -9
- package/dist/commonjs/funcs/analyticsEventsSearch.d.ts +21 -0
- package/dist/commonjs/funcs/analyticsEventsSearch.d.ts.map +1 -0
- package/dist/commonjs/funcs/analyticsEventsSearch.js +140 -0
- package/dist/commonjs/funcs/analyticsEventsSearch.js.map +1 -0
- package/dist/commonjs/funcs/analyticsVisitorsSearch.d.ts +21 -0
- package/dist/commonjs/funcs/analyticsVisitorsSearch.d.ts.map +1 -0
- package/dist/commonjs/funcs/analyticsVisitorsSearch.js +140 -0
- package/dist/commonjs/funcs/analyticsVisitorsSearch.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +5 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/analyticsEventsSearch.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/analyticsEventsSearch.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/analyticsEventsSearch.js +64 -0
- package/dist/commonjs/mcp-server/tools/analyticsEventsSearch.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/analyticsVisitorsSearch.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/analyticsVisitorsSearch.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/analyticsVisitorsSearch.js +64 -0
- package/dist/commonjs/mcp-server/tools/analyticsVisitorsSearch.js.map +1 -0
- package/dist/commonjs/models/components/analyticsevent.d.ts +2 -2
- package/dist/commonjs/models/components/analyticseventsearchrequest.d.ts +110 -0
- package/dist/commonjs/models/components/analyticseventsearchrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/analyticseventsearchrequest.js +130 -0
- package/dist/commonjs/models/components/analyticseventsearchrequest.js.map +1 -0
- package/dist/commonjs/models/components/analyticseventsearchresponse.d.ts +26 -0
- package/dist/commonjs/models/components/analyticseventsearchresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/analyticseventsearchresponse.js +70 -0
- package/dist/commonjs/models/components/analyticseventsearchresponse.js.map +1 -0
- package/dist/commonjs/models/components/analyticsvisitor.d.ts +35 -0
- package/dist/commonjs/models/components/analyticsvisitor.d.ts.map +1 -0
- package/dist/commonjs/models/components/analyticsvisitor.js +79 -0
- package/dist/commonjs/models/components/analyticsvisitor.js.map +1 -0
- package/dist/commonjs/models/components/analyticsvisitorsearchrequest.d.ts +105 -0
- package/dist/commonjs/models/components/analyticsvisitorsearchrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/analyticsvisitorsearchrequest.js +126 -0
- package/dist/commonjs/models/components/analyticsvisitorsearchrequest.js.map +1 -0
- package/dist/commonjs/models/components/analyticsvisitorsearchresponse.d.ts +26 -0
- package/dist/commonjs/models/components/analyticsvisitorsearchresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/analyticsvisitorsearchresponse.js +70 -0
- package/dist/commonjs/models/components/analyticsvisitorsearchresponse.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +5 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +5 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/operations/analyticseventssearch.d.ts +23 -0
- package/dist/commonjs/models/operations/analyticseventssearch.d.ts.map +1 -0
- package/dist/commonjs/models/operations/analyticseventssearch.js +70 -0
- package/dist/commonjs/models/operations/analyticseventssearch.js.map +1 -0
- package/dist/commonjs/models/operations/analyticsvisitorssearch.d.ts +23 -0
- package/dist/commonjs/models/operations/analyticsvisitorssearch.d.ts.map +1 -0
- package/dist/commonjs/models/operations/analyticsvisitorssearch.js +70 -0
- package/dist/commonjs/models/operations/analyticsvisitorssearch.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +2 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +2 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/react-query/analyticsEventsSearch.d.ts +30 -0
- package/dist/commonjs/react-query/analyticsEventsSearch.d.ts.map +1 -0
- package/dist/commonjs/react-query/analyticsEventsSearch.js +47 -0
- package/dist/commonjs/react-query/analyticsEventsSearch.js.map +1 -0
- package/dist/commonjs/react-query/analyticsVisitorsSearch.d.ts +30 -0
- package/dist/commonjs/react-query/analyticsVisitorsSearch.d.ts.map +1 -0
- package/dist/commonjs/react-query/analyticsVisitorsSearch.js +47 -0
- package/dist/commonjs/react-query/analyticsVisitorsSearch.js.map +1 -0
- package/dist/commonjs/react-query/index.d.ts +2 -0
- package/dist/commonjs/react-query/index.d.ts.map +1 -1
- package/dist/commonjs/react-query/index.js +2 -0
- package/dist/commonjs/react-query/index.js.map +1 -1
- package/dist/commonjs/sdk/analytics.d.ts +6 -0
- package/dist/commonjs/sdk/analytics.d.ts.map +1 -1
- package/dist/commonjs/sdk/analytics.js +8 -0
- package/dist/commonjs/sdk/analytics.js.map +1 -1
- package/dist/commonjs/sdk/events.d.ts +13 -0
- package/dist/commonjs/sdk/events.d.ts.map +1 -0
- package/dist/commonjs/sdk/events.js +22 -0
- package/dist/commonjs/sdk/events.js.map +1 -0
- package/dist/commonjs/sdk/visitors.d.ts +13 -0
- package/dist/commonjs/sdk/visitors.d.ts.map +1 -0
- package/dist/commonjs/sdk/visitors.js +22 -0
- package/dist/commonjs/sdk/visitors.js.map +1 -0
- package/dist/esm/funcs/analyticsEventsSearch.d.ts +21 -0
- package/dist/esm/funcs/analyticsEventsSearch.d.ts.map +1 -0
- package/dist/esm/funcs/analyticsEventsSearch.js +104 -0
- package/dist/esm/funcs/analyticsEventsSearch.js.map +1 -0
- package/dist/esm/funcs/analyticsVisitorsSearch.d.ts +21 -0
- package/dist/esm/funcs/analyticsVisitorsSearch.d.ts.map +1 -0
- package/dist/esm/funcs/analyticsVisitorsSearch.js +104 -0
- package/dist/esm/funcs/analyticsVisitorsSearch.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +5 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/analyticsEventsSearch.d.ts +8 -0
- package/dist/esm/mcp-server/tools/analyticsEventsSearch.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/analyticsEventsSearch.js +28 -0
- package/dist/esm/mcp-server/tools/analyticsEventsSearch.js.map +1 -0
- package/dist/esm/mcp-server/tools/analyticsVisitorsSearch.d.ts +8 -0
- package/dist/esm/mcp-server/tools/analyticsVisitorsSearch.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/analyticsVisitorsSearch.js +28 -0
- package/dist/esm/mcp-server/tools/analyticsVisitorsSearch.js.map +1 -0
- package/dist/esm/models/components/analyticsevent.d.ts +2 -2
- package/dist/esm/models/components/analyticseventsearchrequest.d.ts +110 -0
- package/dist/esm/models/components/analyticseventsearchrequest.d.ts.map +1 -0
- package/dist/esm/models/components/analyticseventsearchrequest.js +88 -0
- package/dist/esm/models/components/analyticseventsearchrequest.js.map +1 -0
- package/dist/esm/models/components/analyticseventsearchresponse.d.ts +26 -0
- package/dist/esm/models/components/analyticseventsearchresponse.d.ts.map +1 -0
- package/dist/esm/models/components/analyticseventsearchresponse.js +32 -0
- package/dist/esm/models/components/analyticseventsearchresponse.js.map +1 -0
- package/dist/esm/models/components/analyticsvisitor.d.ts +35 -0
- package/dist/esm/models/components/analyticsvisitor.d.ts.map +1 -0
- package/dist/esm/models/components/analyticsvisitor.js +41 -0
- package/dist/esm/models/components/analyticsvisitor.js.map +1 -0
- package/dist/esm/models/components/analyticsvisitorsearchrequest.d.ts +105 -0
- package/dist/esm/models/components/analyticsvisitorsearchrequest.d.ts.map +1 -0
- package/dist/esm/models/components/analyticsvisitorsearchrequest.js +84 -0
- package/dist/esm/models/components/analyticsvisitorsearchrequest.js.map +1 -0
- package/dist/esm/models/components/analyticsvisitorsearchresponse.d.ts +26 -0
- package/dist/esm/models/components/analyticsvisitorsearchresponse.d.ts.map +1 -0
- package/dist/esm/models/components/analyticsvisitorsearchresponse.js +32 -0
- package/dist/esm/models/components/analyticsvisitorsearchresponse.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +5 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +5 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/operations/analyticseventssearch.d.ts +23 -0
- package/dist/esm/models/operations/analyticseventssearch.d.ts.map +1 -0
- package/dist/esm/models/operations/analyticseventssearch.js +32 -0
- package/dist/esm/models/operations/analyticseventssearch.js.map +1 -0
- package/dist/esm/models/operations/analyticsvisitorssearch.d.ts +23 -0
- package/dist/esm/models/operations/analyticsvisitorssearch.d.ts.map +1 -0
- package/dist/esm/models/operations/analyticsvisitorssearch.js +32 -0
- package/dist/esm/models/operations/analyticsvisitorssearch.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +2 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +2 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/react-query/analyticsEventsSearch.d.ts +30 -0
- package/dist/esm/react-query/analyticsEventsSearch.d.ts.map +1 -0
- package/dist/esm/react-query/analyticsEventsSearch.js +42 -0
- package/dist/esm/react-query/analyticsEventsSearch.js.map +1 -0
- package/dist/esm/react-query/analyticsVisitorsSearch.d.ts +30 -0
- package/dist/esm/react-query/analyticsVisitorsSearch.d.ts.map +1 -0
- package/dist/esm/react-query/analyticsVisitorsSearch.js +42 -0
- package/dist/esm/react-query/analyticsVisitorsSearch.js.map +1 -0
- package/dist/esm/react-query/index.d.ts +2 -0
- package/dist/esm/react-query/index.d.ts.map +1 -1
- package/dist/esm/react-query/index.js +2 -0
- package/dist/esm/react-query/index.js.map +1 -1
- package/dist/esm/sdk/analytics.d.ts +6 -0
- package/dist/esm/sdk/analytics.d.ts.map +1 -1
- package/dist/esm/sdk/analytics.js +8 -0
- package/dist/esm/sdk/analytics.js.map +1 -1
- package/dist/esm/sdk/events.d.ts +13 -0
- package/dist/esm/sdk/events.d.ts.map +1 -0
- package/dist/esm/sdk/events.js +18 -0
- package/dist/esm/sdk/events.js.map +1 -0
- package/dist/esm/sdk/visitors.d.ts +13 -0
- package/dist/esm/sdk/visitors.d.ts.map +1 -0
- package/dist/esm/sdk/visitors.js +18 -0
- package/dist/esm/sdk/visitors.js.map +1 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/analyticsEventsSearch.ts +199 -0
- package/src/funcs/analyticsVisitorsSearch.ts +199 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/analyticsEventsSearch.ts +37 -0
- package/src/mcp-server/tools/analyticsVisitorsSearch.ts +37 -0
- package/src/models/components/analyticsevent.ts +2 -2
- package/src/models/components/analyticseventsearchrequest.ts +249 -0
- package/src/models/components/analyticseventsearchresponse.ts +78 -0
- package/src/models/components/analyticsvisitor.ts +90 -0
- package/src/models/components/analyticsvisitorsearchrequest.ts +241 -0
- package/src/models/components/analyticsvisitorsearchresponse.ts +78 -0
- package/src/models/components/index.ts +5 -0
- package/src/models/operations/analyticseventssearch.ts +72 -0
- package/src/models/operations/analyticsvisitorssearch.ts +73 -0
- package/src/models/operations/index.ts +2 -0
- package/src/react-query/analyticsEventsSearch.ts +112 -0
- package/src/react-query/analyticsVisitorsSearch.ts +112 -0
- package/src/react-query/index.ts +2 -0
- package/src/sdk/analytics.ts +12 -0
- package/src/sdk/events.ts +28 -0
- package/src/sdk/visitors.ts +28 -0
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Comparison operator. gt, gte, lt, and lte require a numeric value. exists and not_exists check whether the property is present and do not take a value.
|
|
14
|
+
*/
|
|
15
|
+
export const AnalyticsEventSearchRequestOp = {
|
|
16
|
+
Eq: "eq",
|
|
17
|
+
Neq: "neq",
|
|
18
|
+
Gt: "gt",
|
|
19
|
+
Gte: "gte",
|
|
20
|
+
Lt: "lt",
|
|
21
|
+
Lte: "lte",
|
|
22
|
+
Exists: "exists",
|
|
23
|
+
NotExists: "not_exists",
|
|
24
|
+
} as const;
|
|
25
|
+
/**
|
|
26
|
+
* Comparison operator. gt, gte, lt, and lte require a numeric value. exists and not_exists check whether the property is present and do not take a value.
|
|
27
|
+
*/
|
|
28
|
+
export type AnalyticsEventSearchRequestOp = ClosedEnum<
|
|
29
|
+
typeof AnalyticsEventSearchRequestOp
|
|
30
|
+
>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Value to compare. The number 1 differs from the string '1'. Omit for exists and not_exists.
|
|
34
|
+
*/
|
|
35
|
+
export type AnalyticsEventSearchRequestValue = string | number | boolean;
|
|
36
|
+
|
|
37
|
+
export type AnalyticsEventSearchRequestFilters = {
|
|
38
|
+
/**
|
|
39
|
+
* Event property to filter. Property names are literal keys, not nested paths.
|
|
40
|
+
*/
|
|
41
|
+
property: string;
|
|
42
|
+
/**
|
|
43
|
+
* Comparison operator. gt, gte, lt, and lte require a numeric value. exists and not_exists check whether the property is present and do not take a value.
|
|
44
|
+
*/
|
|
45
|
+
op: AnalyticsEventSearchRequestOp;
|
|
46
|
+
/**
|
|
47
|
+
* Value to compare. The number 1 differs from the string '1'. Omit for exists and not_exists.
|
|
48
|
+
*/
|
|
49
|
+
value?: string | number | boolean | null | undefined;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type AnalyticsEventSearchRequest = {
|
|
53
|
+
/**
|
|
54
|
+
* Start of the time range, inclusive. Use an ISO 8601 timestamp with Z for UTC or an offset such as -07:00. Must be before to.
|
|
55
|
+
*/
|
|
56
|
+
from: Date;
|
|
57
|
+
/**
|
|
58
|
+
* End of the time range, exclusive. Use an ISO 8601 timestamp with Z for UTC or an offset such as -07:00. Must be after from.
|
|
59
|
+
*/
|
|
60
|
+
to: Date;
|
|
61
|
+
/**
|
|
62
|
+
* Only include events with this exact name. Omit to include all event names.
|
|
63
|
+
*/
|
|
64
|
+
eventName?: string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Property filters combined with AND. An event must match every filter.
|
|
67
|
+
*/
|
|
68
|
+
filters?: Array<AnalyticsEventSearchRequestFilters> | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Only include events sent with this exact distinct_id.
|
|
71
|
+
*/
|
|
72
|
+
distinctId?: string | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Maximum number of rows in this page.
|
|
75
|
+
*/
|
|
76
|
+
limit?: number | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Opaque cursor of at most 4096 characters, copied from next_cursor of the previous page. Omit for the first page, which takes the snapshot the whole sequence reads at. Cursors belong to one list and one sort order; a cursor that does not decode, or one from another list, returns 400. A cursor is a position, not a capability: one that decodes only moves the caller within the same project.
|
|
79
|
+
*/
|
|
80
|
+
cursor?: string | undefined;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/** @internal */
|
|
84
|
+
export const AnalyticsEventSearchRequestOp$inboundSchema: z.ZodNativeEnum<
|
|
85
|
+
typeof AnalyticsEventSearchRequestOp
|
|
86
|
+
> = z.nativeEnum(AnalyticsEventSearchRequestOp);
|
|
87
|
+
/** @internal */
|
|
88
|
+
export const AnalyticsEventSearchRequestOp$outboundSchema: z.ZodNativeEnum<
|
|
89
|
+
typeof AnalyticsEventSearchRequestOp
|
|
90
|
+
> = AnalyticsEventSearchRequestOp$inboundSchema;
|
|
91
|
+
|
|
92
|
+
/** @internal */
|
|
93
|
+
export const AnalyticsEventSearchRequestValue$inboundSchema: z.ZodType<
|
|
94
|
+
AnalyticsEventSearchRequestValue,
|
|
95
|
+
z.ZodTypeDef,
|
|
96
|
+
unknown
|
|
97
|
+
> = z.union([z.string(), z.number(), z.boolean()]);
|
|
98
|
+
/** @internal */
|
|
99
|
+
export type AnalyticsEventSearchRequestValue$Outbound =
|
|
100
|
+
| string
|
|
101
|
+
| number
|
|
102
|
+
| boolean;
|
|
103
|
+
|
|
104
|
+
/** @internal */
|
|
105
|
+
export const AnalyticsEventSearchRequestValue$outboundSchema: z.ZodType<
|
|
106
|
+
AnalyticsEventSearchRequestValue$Outbound,
|
|
107
|
+
z.ZodTypeDef,
|
|
108
|
+
AnalyticsEventSearchRequestValue
|
|
109
|
+
> = z.union([z.string(), z.number(), z.boolean()]);
|
|
110
|
+
|
|
111
|
+
export function analyticsEventSearchRequestValueToJSON(
|
|
112
|
+
analyticsEventSearchRequestValue: AnalyticsEventSearchRequestValue,
|
|
113
|
+
): string {
|
|
114
|
+
return JSON.stringify(
|
|
115
|
+
AnalyticsEventSearchRequestValue$outboundSchema.parse(
|
|
116
|
+
analyticsEventSearchRequestValue,
|
|
117
|
+
),
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
export function analyticsEventSearchRequestValueFromJSON(
|
|
121
|
+
jsonString: string,
|
|
122
|
+
): SafeParseResult<AnalyticsEventSearchRequestValue, SDKValidationError> {
|
|
123
|
+
return safeParse(
|
|
124
|
+
jsonString,
|
|
125
|
+
(x) => AnalyticsEventSearchRequestValue$inboundSchema.parse(JSON.parse(x)),
|
|
126
|
+
`Failed to parse 'AnalyticsEventSearchRequestValue' from JSON`,
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** @internal */
|
|
131
|
+
export const AnalyticsEventSearchRequestFilters$inboundSchema: z.ZodType<
|
|
132
|
+
AnalyticsEventSearchRequestFilters,
|
|
133
|
+
z.ZodTypeDef,
|
|
134
|
+
unknown
|
|
135
|
+
> = z.object({
|
|
136
|
+
property: z.string(),
|
|
137
|
+
op: AnalyticsEventSearchRequestOp$inboundSchema,
|
|
138
|
+
value: z.nullable(z.union([z.string(), z.number(), z.boolean()])).optional(),
|
|
139
|
+
});
|
|
140
|
+
/** @internal */
|
|
141
|
+
export type AnalyticsEventSearchRequestFilters$Outbound = {
|
|
142
|
+
property: string;
|
|
143
|
+
op: string;
|
|
144
|
+
value?: string | number | boolean | null | undefined;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
/** @internal */
|
|
148
|
+
export const AnalyticsEventSearchRequestFilters$outboundSchema: z.ZodType<
|
|
149
|
+
AnalyticsEventSearchRequestFilters$Outbound,
|
|
150
|
+
z.ZodTypeDef,
|
|
151
|
+
AnalyticsEventSearchRequestFilters
|
|
152
|
+
> = z.object({
|
|
153
|
+
property: z.string(),
|
|
154
|
+
op: AnalyticsEventSearchRequestOp$outboundSchema,
|
|
155
|
+
value: z.nullable(z.union([z.string(), z.number(), z.boolean()])).optional(),
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
export function analyticsEventSearchRequestFiltersToJSON(
|
|
159
|
+
analyticsEventSearchRequestFilters: AnalyticsEventSearchRequestFilters,
|
|
160
|
+
): string {
|
|
161
|
+
return JSON.stringify(
|
|
162
|
+
AnalyticsEventSearchRequestFilters$outboundSchema.parse(
|
|
163
|
+
analyticsEventSearchRequestFilters,
|
|
164
|
+
),
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
export function analyticsEventSearchRequestFiltersFromJSON(
|
|
168
|
+
jsonString: string,
|
|
169
|
+
): SafeParseResult<AnalyticsEventSearchRequestFilters, SDKValidationError> {
|
|
170
|
+
return safeParse(
|
|
171
|
+
jsonString,
|
|
172
|
+
(x) =>
|
|
173
|
+
AnalyticsEventSearchRequestFilters$inboundSchema.parse(JSON.parse(x)),
|
|
174
|
+
`Failed to parse 'AnalyticsEventSearchRequestFilters' from JSON`,
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** @internal */
|
|
179
|
+
export const AnalyticsEventSearchRequest$inboundSchema: z.ZodType<
|
|
180
|
+
AnalyticsEventSearchRequest,
|
|
181
|
+
z.ZodTypeDef,
|
|
182
|
+
unknown
|
|
183
|
+
> = z.object({
|
|
184
|
+
from: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
185
|
+
to: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
186
|
+
event_name: z.string().optional(),
|
|
187
|
+
filters: z.array(
|
|
188
|
+
z.lazy(() => AnalyticsEventSearchRequestFilters$inboundSchema),
|
|
189
|
+
).optional(),
|
|
190
|
+
distinct_id: z.string().optional(),
|
|
191
|
+
limit: z.number().int().default(50),
|
|
192
|
+
cursor: z.string().optional(),
|
|
193
|
+
}).transform((v) => {
|
|
194
|
+
return remap$(v, {
|
|
195
|
+
"event_name": "eventName",
|
|
196
|
+
"distinct_id": "distinctId",
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
/** @internal */
|
|
200
|
+
export type AnalyticsEventSearchRequest$Outbound = {
|
|
201
|
+
from: string;
|
|
202
|
+
to: string;
|
|
203
|
+
event_name?: string | undefined;
|
|
204
|
+
filters?: Array<AnalyticsEventSearchRequestFilters$Outbound> | undefined;
|
|
205
|
+
distinct_id?: string | undefined;
|
|
206
|
+
limit: number;
|
|
207
|
+
cursor?: string | undefined;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
/** @internal */
|
|
211
|
+
export const AnalyticsEventSearchRequest$outboundSchema: z.ZodType<
|
|
212
|
+
AnalyticsEventSearchRequest$Outbound,
|
|
213
|
+
z.ZodTypeDef,
|
|
214
|
+
AnalyticsEventSearchRequest
|
|
215
|
+
> = z.object({
|
|
216
|
+
from: z.date().transform(v => v.toISOString()),
|
|
217
|
+
to: z.date().transform(v => v.toISOString()),
|
|
218
|
+
eventName: z.string().optional(),
|
|
219
|
+
filters: z.array(
|
|
220
|
+
z.lazy(() => AnalyticsEventSearchRequestFilters$outboundSchema),
|
|
221
|
+
).optional(),
|
|
222
|
+
distinctId: z.string().optional(),
|
|
223
|
+
limit: z.number().int().default(50),
|
|
224
|
+
cursor: z.string().optional(),
|
|
225
|
+
}).transform((v) => {
|
|
226
|
+
return remap$(v, {
|
|
227
|
+
eventName: "event_name",
|
|
228
|
+
distinctId: "distinct_id",
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
export function analyticsEventSearchRequestToJSON(
|
|
233
|
+
analyticsEventSearchRequest: AnalyticsEventSearchRequest,
|
|
234
|
+
): string {
|
|
235
|
+
return JSON.stringify(
|
|
236
|
+
AnalyticsEventSearchRequest$outboundSchema.parse(
|
|
237
|
+
analyticsEventSearchRequest,
|
|
238
|
+
),
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
export function analyticsEventSearchRequestFromJSON(
|
|
242
|
+
jsonString: string,
|
|
243
|
+
): SafeParseResult<AnalyticsEventSearchRequest, SDKValidationError> {
|
|
244
|
+
return safeParse(
|
|
245
|
+
jsonString,
|
|
246
|
+
(x) => AnalyticsEventSearchRequest$inboundSchema.parse(JSON.parse(x)),
|
|
247
|
+
`Failed to parse 'AnalyticsEventSearchRequest' from JSON`,
|
|
248
|
+
);
|
|
249
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
AnalyticsEvent,
|
|
12
|
+
AnalyticsEvent$inboundSchema,
|
|
13
|
+
AnalyticsEvent$Outbound,
|
|
14
|
+
AnalyticsEvent$outboundSchema,
|
|
15
|
+
} from "./analyticsevent.js";
|
|
16
|
+
|
|
17
|
+
export type AnalyticsEventSearchResponse = {
|
|
18
|
+
/**
|
|
19
|
+
* Matching events, newest first. Events with the same timestamp are ordered by event_id, descending.
|
|
20
|
+
*/
|
|
21
|
+
events: Array<AnalyticsEvent>;
|
|
22
|
+
/**
|
|
23
|
+
* Cursor for the next page, or null when there are no more rows. It continues the sequence at the snapshot its first page took.
|
|
24
|
+
*/
|
|
25
|
+
nextCursor: string | null;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const AnalyticsEventSearchResponse$inboundSchema: z.ZodType<
|
|
30
|
+
AnalyticsEventSearchResponse,
|
|
31
|
+
z.ZodTypeDef,
|
|
32
|
+
unknown
|
|
33
|
+
> = z.object({
|
|
34
|
+
events: z.array(AnalyticsEvent$inboundSchema),
|
|
35
|
+
next_cursor: z.nullable(z.string()),
|
|
36
|
+
}).transform((v) => {
|
|
37
|
+
return remap$(v, {
|
|
38
|
+
"next_cursor": "nextCursor",
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
/** @internal */
|
|
42
|
+
export type AnalyticsEventSearchResponse$Outbound = {
|
|
43
|
+
events: Array<AnalyticsEvent$Outbound>;
|
|
44
|
+
next_cursor: string | null;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const AnalyticsEventSearchResponse$outboundSchema: z.ZodType<
|
|
49
|
+
AnalyticsEventSearchResponse$Outbound,
|
|
50
|
+
z.ZodTypeDef,
|
|
51
|
+
AnalyticsEventSearchResponse
|
|
52
|
+
> = z.object({
|
|
53
|
+
events: z.array(AnalyticsEvent$outboundSchema),
|
|
54
|
+
nextCursor: z.nullable(z.string()),
|
|
55
|
+
}).transform((v) => {
|
|
56
|
+
return remap$(v, {
|
|
57
|
+
nextCursor: "next_cursor",
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export function analyticsEventSearchResponseToJSON(
|
|
62
|
+
analyticsEventSearchResponse: AnalyticsEventSearchResponse,
|
|
63
|
+
): string {
|
|
64
|
+
return JSON.stringify(
|
|
65
|
+
AnalyticsEventSearchResponse$outboundSchema.parse(
|
|
66
|
+
analyticsEventSearchResponse,
|
|
67
|
+
),
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
export function analyticsEventSearchResponseFromJSON(
|
|
71
|
+
jsonString: string,
|
|
72
|
+
): SafeParseResult<AnalyticsEventSearchResponse, SDKValidationError> {
|
|
73
|
+
return safeParse(
|
|
74
|
+
jsonString,
|
|
75
|
+
(x) => AnalyticsEventSearchResponse$inboundSchema.parse(JSON.parse(x)),
|
|
76
|
+
`Failed to parse 'AnalyticsEventSearchResponse' from JSON`,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type AnalyticsVisitor = {
|
|
12
|
+
/**
|
|
13
|
+
* The visitor's distinct_id as sent with their events.
|
|
14
|
+
*/
|
|
15
|
+
distinctId: string;
|
|
16
|
+
/**
|
|
17
|
+
* Timestamp of the visitor's earliest matching event in the time range, in UTC with milliseconds.
|
|
18
|
+
*/
|
|
19
|
+
firstSeen: Date;
|
|
20
|
+
/**
|
|
21
|
+
* Timestamp of the visitor's latest matching event in the time range, in UTC with milliseconds.
|
|
22
|
+
*/
|
|
23
|
+
lastSeen: Date;
|
|
24
|
+
/**
|
|
25
|
+
* Number of matching events from this visitor across the whole time range, not only this page.
|
|
26
|
+
*/
|
|
27
|
+
eventCount: number;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const AnalyticsVisitor$inboundSchema: z.ZodType<
|
|
32
|
+
AnalyticsVisitor,
|
|
33
|
+
z.ZodTypeDef,
|
|
34
|
+
unknown
|
|
35
|
+
> = z.object({
|
|
36
|
+
distinct_id: z.string(),
|
|
37
|
+
first_seen: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
38
|
+
last_seen: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
39
|
+
event_count: z.number().int(),
|
|
40
|
+
}).transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
"distinct_id": "distinctId",
|
|
43
|
+
"first_seen": "firstSeen",
|
|
44
|
+
"last_seen": "lastSeen",
|
|
45
|
+
"event_count": "eventCount",
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
/** @internal */
|
|
49
|
+
export type AnalyticsVisitor$Outbound = {
|
|
50
|
+
distinct_id: string;
|
|
51
|
+
first_seen: string;
|
|
52
|
+
last_seen: string;
|
|
53
|
+
event_count: number;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
export const AnalyticsVisitor$outboundSchema: z.ZodType<
|
|
58
|
+
AnalyticsVisitor$Outbound,
|
|
59
|
+
z.ZodTypeDef,
|
|
60
|
+
AnalyticsVisitor
|
|
61
|
+
> = z.object({
|
|
62
|
+
distinctId: z.string(),
|
|
63
|
+
firstSeen: z.date().transform(v => v.toISOString()),
|
|
64
|
+
lastSeen: z.date().transform(v => v.toISOString()),
|
|
65
|
+
eventCount: z.number().int(),
|
|
66
|
+
}).transform((v) => {
|
|
67
|
+
return remap$(v, {
|
|
68
|
+
distinctId: "distinct_id",
|
|
69
|
+
firstSeen: "first_seen",
|
|
70
|
+
lastSeen: "last_seen",
|
|
71
|
+
eventCount: "event_count",
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export function analyticsVisitorToJSON(
|
|
76
|
+
analyticsVisitor: AnalyticsVisitor,
|
|
77
|
+
): string {
|
|
78
|
+
return JSON.stringify(
|
|
79
|
+
AnalyticsVisitor$outboundSchema.parse(analyticsVisitor),
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
export function analyticsVisitorFromJSON(
|
|
83
|
+
jsonString: string,
|
|
84
|
+
): SafeParseResult<AnalyticsVisitor, SDKValidationError> {
|
|
85
|
+
return safeParse(
|
|
86
|
+
jsonString,
|
|
87
|
+
(x) => AnalyticsVisitor$inboundSchema.parse(JSON.parse(x)),
|
|
88
|
+
`Failed to parse 'AnalyticsVisitor' from JSON`,
|
|
89
|
+
);
|
|
90
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Comparison operator. gt, gte, lt, and lte require a numeric value. exists and not_exists check whether the property is present and do not take a value.
|
|
14
|
+
*/
|
|
15
|
+
export const AnalyticsVisitorSearchRequestOp = {
|
|
16
|
+
Eq: "eq",
|
|
17
|
+
Neq: "neq",
|
|
18
|
+
Gt: "gt",
|
|
19
|
+
Gte: "gte",
|
|
20
|
+
Lt: "lt",
|
|
21
|
+
Lte: "lte",
|
|
22
|
+
Exists: "exists",
|
|
23
|
+
NotExists: "not_exists",
|
|
24
|
+
} as const;
|
|
25
|
+
/**
|
|
26
|
+
* Comparison operator. gt, gte, lt, and lte require a numeric value. exists and not_exists check whether the property is present and do not take a value.
|
|
27
|
+
*/
|
|
28
|
+
export type AnalyticsVisitorSearchRequestOp = ClosedEnum<
|
|
29
|
+
typeof AnalyticsVisitorSearchRequestOp
|
|
30
|
+
>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Value to compare. The number 1 differs from the string '1'. Omit for exists and not_exists.
|
|
34
|
+
*/
|
|
35
|
+
export type AnalyticsVisitorSearchRequestValue = string | number | boolean;
|
|
36
|
+
|
|
37
|
+
export type AnalyticsVisitorSearchRequestFilters = {
|
|
38
|
+
/**
|
|
39
|
+
* Event property to filter. Property names are literal keys, not nested paths.
|
|
40
|
+
*/
|
|
41
|
+
property: string;
|
|
42
|
+
/**
|
|
43
|
+
* Comparison operator. gt, gte, lt, and lte require a numeric value. exists and not_exists check whether the property is present and do not take a value.
|
|
44
|
+
*/
|
|
45
|
+
op: AnalyticsVisitorSearchRequestOp;
|
|
46
|
+
/**
|
|
47
|
+
* Value to compare. The number 1 differs from the string '1'. Omit for exists and not_exists.
|
|
48
|
+
*/
|
|
49
|
+
value?: string | number | boolean | null | undefined;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type AnalyticsVisitorSearchRequest = {
|
|
53
|
+
/**
|
|
54
|
+
* Start of the time range, inclusive. Use an ISO 8601 timestamp with Z for UTC or an offset such as -07:00. Must be before to.
|
|
55
|
+
*/
|
|
56
|
+
from: Date;
|
|
57
|
+
/**
|
|
58
|
+
* End of the time range, exclusive. Use an ISO 8601 timestamp with Z for UTC or an offset such as -07:00. Must be after from.
|
|
59
|
+
*/
|
|
60
|
+
to: Date;
|
|
61
|
+
/**
|
|
62
|
+
* Only include events with this exact name. Omit to include all event names.
|
|
63
|
+
*/
|
|
64
|
+
eventName?: string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Property filters combined with AND. An event must match every filter.
|
|
67
|
+
*/
|
|
68
|
+
filters?: Array<AnalyticsVisitorSearchRequestFilters> | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Maximum number of rows in this page.
|
|
71
|
+
*/
|
|
72
|
+
limit?: number | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Opaque cursor of at most 4096 characters, copied from next_cursor of the previous page. Omit for the first page, which takes the snapshot the whole sequence reads at. Cursors belong to one list and one sort order; a cursor that does not decode, or one from another list, returns 400. A cursor is a position, not a capability: one that decodes only moves the caller within the same project.
|
|
75
|
+
*/
|
|
76
|
+
cursor?: string | undefined;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** @internal */
|
|
80
|
+
export const AnalyticsVisitorSearchRequestOp$inboundSchema: z.ZodNativeEnum<
|
|
81
|
+
typeof AnalyticsVisitorSearchRequestOp
|
|
82
|
+
> = z.nativeEnum(AnalyticsVisitorSearchRequestOp);
|
|
83
|
+
/** @internal */
|
|
84
|
+
export const AnalyticsVisitorSearchRequestOp$outboundSchema: z.ZodNativeEnum<
|
|
85
|
+
typeof AnalyticsVisitorSearchRequestOp
|
|
86
|
+
> = AnalyticsVisitorSearchRequestOp$inboundSchema;
|
|
87
|
+
|
|
88
|
+
/** @internal */
|
|
89
|
+
export const AnalyticsVisitorSearchRequestValue$inboundSchema: z.ZodType<
|
|
90
|
+
AnalyticsVisitorSearchRequestValue,
|
|
91
|
+
z.ZodTypeDef,
|
|
92
|
+
unknown
|
|
93
|
+
> = z.union([z.string(), z.number(), z.boolean()]);
|
|
94
|
+
/** @internal */
|
|
95
|
+
export type AnalyticsVisitorSearchRequestValue$Outbound =
|
|
96
|
+
| string
|
|
97
|
+
| number
|
|
98
|
+
| boolean;
|
|
99
|
+
|
|
100
|
+
/** @internal */
|
|
101
|
+
export const AnalyticsVisitorSearchRequestValue$outboundSchema: z.ZodType<
|
|
102
|
+
AnalyticsVisitorSearchRequestValue$Outbound,
|
|
103
|
+
z.ZodTypeDef,
|
|
104
|
+
AnalyticsVisitorSearchRequestValue
|
|
105
|
+
> = z.union([z.string(), z.number(), z.boolean()]);
|
|
106
|
+
|
|
107
|
+
export function analyticsVisitorSearchRequestValueToJSON(
|
|
108
|
+
analyticsVisitorSearchRequestValue: AnalyticsVisitorSearchRequestValue,
|
|
109
|
+
): string {
|
|
110
|
+
return JSON.stringify(
|
|
111
|
+
AnalyticsVisitorSearchRequestValue$outboundSchema.parse(
|
|
112
|
+
analyticsVisitorSearchRequestValue,
|
|
113
|
+
),
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
export function analyticsVisitorSearchRequestValueFromJSON(
|
|
117
|
+
jsonString: string,
|
|
118
|
+
): SafeParseResult<AnalyticsVisitorSearchRequestValue, SDKValidationError> {
|
|
119
|
+
return safeParse(
|
|
120
|
+
jsonString,
|
|
121
|
+
(x) =>
|
|
122
|
+
AnalyticsVisitorSearchRequestValue$inboundSchema.parse(JSON.parse(x)),
|
|
123
|
+
`Failed to parse 'AnalyticsVisitorSearchRequestValue' from JSON`,
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** @internal */
|
|
128
|
+
export const AnalyticsVisitorSearchRequestFilters$inboundSchema: z.ZodType<
|
|
129
|
+
AnalyticsVisitorSearchRequestFilters,
|
|
130
|
+
z.ZodTypeDef,
|
|
131
|
+
unknown
|
|
132
|
+
> = z.object({
|
|
133
|
+
property: z.string(),
|
|
134
|
+
op: AnalyticsVisitorSearchRequestOp$inboundSchema,
|
|
135
|
+
value: z.nullable(z.union([z.string(), z.number(), z.boolean()])).optional(),
|
|
136
|
+
});
|
|
137
|
+
/** @internal */
|
|
138
|
+
export type AnalyticsVisitorSearchRequestFilters$Outbound = {
|
|
139
|
+
property: string;
|
|
140
|
+
op: string;
|
|
141
|
+
value?: string | number | boolean | null | undefined;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/** @internal */
|
|
145
|
+
export const AnalyticsVisitorSearchRequestFilters$outboundSchema: z.ZodType<
|
|
146
|
+
AnalyticsVisitorSearchRequestFilters$Outbound,
|
|
147
|
+
z.ZodTypeDef,
|
|
148
|
+
AnalyticsVisitorSearchRequestFilters
|
|
149
|
+
> = z.object({
|
|
150
|
+
property: z.string(),
|
|
151
|
+
op: AnalyticsVisitorSearchRequestOp$outboundSchema,
|
|
152
|
+
value: z.nullable(z.union([z.string(), z.number(), z.boolean()])).optional(),
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
export function analyticsVisitorSearchRequestFiltersToJSON(
|
|
156
|
+
analyticsVisitorSearchRequestFilters: AnalyticsVisitorSearchRequestFilters,
|
|
157
|
+
): string {
|
|
158
|
+
return JSON.stringify(
|
|
159
|
+
AnalyticsVisitorSearchRequestFilters$outboundSchema.parse(
|
|
160
|
+
analyticsVisitorSearchRequestFilters,
|
|
161
|
+
),
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
export function analyticsVisitorSearchRequestFiltersFromJSON(
|
|
165
|
+
jsonString: string,
|
|
166
|
+
): SafeParseResult<AnalyticsVisitorSearchRequestFilters, SDKValidationError> {
|
|
167
|
+
return safeParse(
|
|
168
|
+
jsonString,
|
|
169
|
+
(x) =>
|
|
170
|
+
AnalyticsVisitorSearchRequestFilters$inboundSchema.parse(JSON.parse(x)),
|
|
171
|
+
`Failed to parse 'AnalyticsVisitorSearchRequestFilters' from JSON`,
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** @internal */
|
|
176
|
+
export const AnalyticsVisitorSearchRequest$inboundSchema: z.ZodType<
|
|
177
|
+
AnalyticsVisitorSearchRequest,
|
|
178
|
+
z.ZodTypeDef,
|
|
179
|
+
unknown
|
|
180
|
+
> = z.object({
|
|
181
|
+
from: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
182
|
+
to: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
183
|
+
event_name: z.string().optional(),
|
|
184
|
+
filters: z.array(
|
|
185
|
+
z.lazy(() => AnalyticsVisitorSearchRequestFilters$inboundSchema),
|
|
186
|
+
).optional(),
|
|
187
|
+
limit: z.number().int().default(50),
|
|
188
|
+
cursor: z.string().optional(),
|
|
189
|
+
}).transform((v) => {
|
|
190
|
+
return remap$(v, {
|
|
191
|
+
"event_name": "eventName",
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
/** @internal */
|
|
195
|
+
export type AnalyticsVisitorSearchRequest$Outbound = {
|
|
196
|
+
from: string;
|
|
197
|
+
to: string;
|
|
198
|
+
event_name?: string | undefined;
|
|
199
|
+
filters?: Array<AnalyticsVisitorSearchRequestFilters$Outbound> | undefined;
|
|
200
|
+
limit: number;
|
|
201
|
+
cursor?: string | undefined;
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/** @internal */
|
|
205
|
+
export const AnalyticsVisitorSearchRequest$outboundSchema: z.ZodType<
|
|
206
|
+
AnalyticsVisitorSearchRequest$Outbound,
|
|
207
|
+
z.ZodTypeDef,
|
|
208
|
+
AnalyticsVisitorSearchRequest
|
|
209
|
+
> = z.object({
|
|
210
|
+
from: z.date().transform(v => v.toISOString()),
|
|
211
|
+
to: z.date().transform(v => v.toISOString()),
|
|
212
|
+
eventName: z.string().optional(),
|
|
213
|
+
filters: z.array(
|
|
214
|
+
z.lazy(() => AnalyticsVisitorSearchRequestFilters$outboundSchema),
|
|
215
|
+
).optional(),
|
|
216
|
+
limit: z.number().int().default(50),
|
|
217
|
+
cursor: z.string().optional(),
|
|
218
|
+
}).transform((v) => {
|
|
219
|
+
return remap$(v, {
|
|
220
|
+
eventName: "event_name",
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
export function analyticsVisitorSearchRequestToJSON(
|
|
225
|
+
analyticsVisitorSearchRequest: AnalyticsVisitorSearchRequest,
|
|
226
|
+
): string {
|
|
227
|
+
return JSON.stringify(
|
|
228
|
+
AnalyticsVisitorSearchRequest$outboundSchema.parse(
|
|
229
|
+
analyticsVisitorSearchRequest,
|
|
230
|
+
),
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
export function analyticsVisitorSearchRequestFromJSON(
|
|
234
|
+
jsonString: string,
|
|
235
|
+
): SafeParseResult<AnalyticsVisitorSearchRequest, SDKValidationError> {
|
|
236
|
+
return safeParse(
|
|
237
|
+
jsonString,
|
|
238
|
+
(x) => AnalyticsVisitorSearchRequest$inboundSchema.parse(JSON.parse(x)),
|
|
239
|
+
`Failed to parse 'AnalyticsVisitorSearchRequest' from JSON`,
|
|
240
|
+
);
|
|
241
|
+
}
|