@meetkai/mka1 0.54.44 → 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.
Files changed (223) hide show
  1. package/README.md +315 -303
  2. package/bin/mcp-server.js +3140 -2631
  3. package/bin/mcp-server.js.map +23 -12
  4. package/dist/commonjs/funcs/analyticsEventsSearch.d.ts +21 -0
  5. package/dist/commonjs/funcs/analyticsEventsSearch.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/analyticsEventsSearch.js +140 -0
  7. package/dist/commonjs/funcs/analyticsEventsSearch.js.map +1 -0
  8. package/dist/commonjs/funcs/analyticsVisitorsSearch.d.ts +21 -0
  9. package/dist/commonjs/funcs/analyticsVisitorsSearch.d.ts.map +1 -0
  10. package/dist/commonjs/funcs/analyticsVisitorsSearch.js +140 -0
  11. package/dist/commonjs/funcs/analyticsVisitorsSearch.js.map +1 -0
  12. package/dist/commonjs/funcs/llmModelsListEffectivePrices.d.ts +1 -1
  13. package/dist/commonjs/funcs/llmModelsListEffectivePrices.js +1 -1
  14. package/dist/commonjs/lib/config.d.ts +2 -2
  15. package/dist/commonjs/lib/config.js +2 -2
  16. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  17. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  18. package/dist/commonjs/mcp-server/server.js +5 -1
  19. package/dist/commonjs/mcp-server/server.js.map +1 -1
  20. package/dist/commonjs/mcp-server/tools/analyticsEventsSearch.d.ts +8 -0
  21. package/dist/commonjs/mcp-server/tools/analyticsEventsSearch.d.ts.map +1 -0
  22. package/dist/commonjs/mcp-server/tools/analyticsEventsSearch.js +64 -0
  23. package/dist/commonjs/mcp-server/tools/analyticsEventsSearch.js.map +1 -0
  24. package/dist/commonjs/mcp-server/tools/analyticsVisitorsSearch.d.ts +8 -0
  25. package/dist/commonjs/mcp-server/tools/analyticsVisitorsSearch.d.ts.map +1 -0
  26. package/dist/commonjs/mcp-server/tools/analyticsVisitorsSearch.js +64 -0
  27. package/dist/commonjs/mcp-server/tools/analyticsVisitorsSearch.js.map +1 -0
  28. package/dist/commonjs/mcp-server/tools/llmModelsListEffectivePrices.js +1 -1
  29. package/dist/commonjs/mcp-server/tools/llmModelsListEffectivePrices.js.map +1 -1
  30. package/dist/commonjs/models/components/analyticsevent.d.ts +2 -2
  31. package/dist/commonjs/models/components/analyticseventsearchrequest.d.ts +110 -0
  32. package/dist/commonjs/models/components/analyticseventsearchrequest.d.ts.map +1 -0
  33. package/dist/commonjs/models/components/analyticseventsearchrequest.js +130 -0
  34. package/dist/commonjs/models/components/analyticseventsearchrequest.js.map +1 -0
  35. package/dist/commonjs/models/components/analyticseventsearchresponse.d.ts +26 -0
  36. package/dist/commonjs/models/components/analyticseventsearchresponse.d.ts.map +1 -0
  37. package/dist/commonjs/models/components/analyticseventsearchresponse.js +70 -0
  38. package/dist/commonjs/models/components/analyticseventsearchresponse.js.map +1 -0
  39. package/dist/commonjs/models/components/analyticsvisitor.d.ts +35 -0
  40. package/dist/commonjs/models/components/analyticsvisitor.d.ts.map +1 -0
  41. package/dist/commonjs/models/components/analyticsvisitor.js +79 -0
  42. package/dist/commonjs/models/components/analyticsvisitor.js.map +1 -0
  43. package/dist/commonjs/models/components/analyticsvisitorsearchrequest.d.ts +105 -0
  44. package/dist/commonjs/models/components/analyticsvisitorsearchrequest.d.ts.map +1 -0
  45. package/dist/commonjs/models/components/analyticsvisitorsearchrequest.js +126 -0
  46. package/dist/commonjs/models/components/analyticsvisitorsearchrequest.js.map +1 -0
  47. package/dist/commonjs/models/components/analyticsvisitorsearchresponse.d.ts +26 -0
  48. package/dist/commonjs/models/components/analyticsvisitorsearchresponse.d.ts.map +1 -0
  49. package/dist/commonjs/models/components/analyticsvisitorsearchresponse.js +70 -0
  50. package/dist/commonjs/models/components/analyticsvisitorsearchresponse.js.map +1 -0
  51. package/dist/commonjs/models/components/effectivepricerow.d.ts +3 -0
  52. package/dist/commonjs/models/components/effectivepricerow.d.ts.map +1 -1
  53. package/dist/commonjs/models/components/effectivepricerow.js +11 -0
  54. package/dist/commonjs/models/components/effectivepricerow.js.map +1 -1
  55. package/dist/commonjs/models/components/index.d.ts +5 -0
  56. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  57. package/dist/commonjs/models/components/index.js +5 -0
  58. package/dist/commonjs/models/components/index.js.map +1 -1
  59. package/dist/commonjs/models/operations/analyticseventssearch.d.ts +23 -0
  60. package/dist/commonjs/models/operations/analyticseventssearch.d.ts.map +1 -0
  61. package/dist/commonjs/models/operations/analyticseventssearch.js +70 -0
  62. package/dist/commonjs/models/operations/analyticseventssearch.js.map +1 -0
  63. package/dist/commonjs/models/operations/analyticsvisitorssearch.d.ts +23 -0
  64. package/dist/commonjs/models/operations/analyticsvisitorssearch.d.ts.map +1 -0
  65. package/dist/commonjs/models/operations/analyticsvisitorssearch.js +70 -0
  66. package/dist/commonjs/models/operations/analyticsvisitorssearch.js.map +1 -0
  67. package/dist/commonjs/models/operations/index.d.ts +2 -0
  68. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  69. package/dist/commonjs/models/operations/index.js +2 -0
  70. package/dist/commonjs/models/operations/index.js.map +1 -1
  71. package/dist/commonjs/react-query/analyticsEventsSearch.d.ts +30 -0
  72. package/dist/commonjs/react-query/analyticsEventsSearch.d.ts.map +1 -0
  73. package/dist/commonjs/react-query/analyticsEventsSearch.js +47 -0
  74. package/dist/commonjs/react-query/analyticsEventsSearch.js.map +1 -0
  75. package/dist/commonjs/react-query/analyticsVisitorsSearch.d.ts +30 -0
  76. package/dist/commonjs/react-query/analyticsVisitorsSearch.d.ts.map +1 -0
  77. package/dist/commonjs/react-query/analyticsVisitorsSearch.js +47 -0
  78. package/dist/commonjs/react-query/analyticsVisitorsSearch.js.map +1 -0
  79. package/dist/commonjs/react-query/index.d.ts +2 -0
  80. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  81. package/dist/commonjs/react-query/index.js +2 -0
  82. package/dist/commonjs/react-query/index.js.map +1 -1
  83. package/dist/commonjs/react-query/llmModelsListEffectivePrices.d.ts +2 -2
  84. package/dist/commonjs/react-query/llmModelsListEffectivePrices.js +2 -2
  85. package/dist/commonjs/sdk/analytics.d.ts +6 -0
  86. package/dist/commonjs/sdk/analytics.d.ts.map +1 -1
  87. package/dist/commonjs/sdk/analytics.js +8 -0
  88. package/dist/commonjs/sdk/analytics.js.map +1 -1
  89. package/dist/commonjs/sdk/events.d.ts +13 -0
  90. package/dist/commonjs/sdk/events.d.ts.map +1 -0
  91. package/dist/commonjs/sdk/events.js +22 -0
  92. package/dist/commonjs/sdk/events.js.map +1 -0
  93. package/dist/commonjs/sdk/models.d.ts +1 -1
  94. package/dist/commonjs/sdk/models.js +1 -1
  95. package/dist/commonjs/sdk/visitors.d.ts +13 -0
  96. package/dist/commonjs/sdk/visitors.d.ts.map +1 -0
  97. package/dist/commonjs/sdk/visitors.js +22 -0
  98. package/dist/commonjs/sdk/visitors.js.map +1 -0
  99. package/dist/esm/funcs/analyticsEventsSearch.d.ts +21 -0
  100. package/dist/esm/funcs/analyticsEventsSearch.d.ts.map +1 -0
  101. package/dist/esm/funcs/analyticsEventsSearch.js +104 -0
  102. package/dist/esm/funcs/analyticsEventsSearch.js.map +1 -0
  103. package/dist/esm/funcs/analyticsVisitorsSearch.d.ts +21 -0
  104. package/dist/esm/funcs/analyticsVisitorsSearch.d.ts.map +1 -0
  105. package/dist/esm/funcs/analyticsVisitorsSearch.js +104 -0
  106. package/dist/esm/funcs/analyticsVisitorsSearch.js.map +1 -0
  107. package/dist/esm/funcs/llmModelsListEffectivePrices.d.ts +1 -1
  108. package/dist/esm/funcs/llmModelsListEffectivePrices.js +1 -1
  109. package/dist/esm/lib/config.d.ts +2 -2
  110. package/dist/esm/lib/config.js +2 -2
  111. package/dist/esm/mcp-server/mcp-server.js +1 -1
  112. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  113. package/dist/esm/mcp-server/server.js +5 -1
  114. package/dist/esm/mcp-server/server.js.map +1 -1
  115. package/dist/esm/mcp-server/tools/analyticsEventsSearch.d.ts +8 -0
  116. package/dist/esm/mcp-server/tools/analyticsEventsSearch.d.ts.map +1 -0
  117. package/dist/esm/mcp-server/tools/analyticsEventsSearch.js +28 -0
  118. package/dist/esm/mcp-server/tools/analyticsEventsSearch.js.map +1 -0
  119. package/dist/esm/mcp-server/tools/analyticsVisitorsSearch.d.ts +8 -0
  120. package/dist/esm/mcp-server/tools/analyticsVisitorsSearch.d.ts.map +1 -0
  121. package/dist/esm/mcp-server/tools/analyticsVisitorsSearch.js +28 -0
  122. package/dist/esm/mcp-server/tools/analyticsVisitorsSearch.js.map +1 -0
  123. package/dist/esm/mcp-server/tools/llmModelsListEffectivePrices.js +1 -1
  124. package/dist/esm/mcp-server/tools/llmModelsListEffectivePrices.js.map +1 -1
  125. package/dist/esm/models/components/analyticsevent.d.ts +2 -2
  126. package/dist/esm/models/components/analyticseventsearchrequest.d.ts +110 -0
  127. package/dist/esm/models/components/analyticseventsearchrequest.d.ts.map +1 -0
  128. package/dist/esm/models/components/analyticseventsearchrequest.js +88 -0
  129. package/dist/esm/models/components/analyticseventsearchrequest.js.map +1 -0
  130. package/dist/esm/models/components/analyticseventsearchresponse.d.ts +26 -0
  131. package/dist/esm/models/components/analyticseventsearchresponse.d.ts.map +1 -0
  132. package/dist/esm/models/components/analyticseventsearchresponse.js +32 -0
  133. package/dist/esm/models/components/analyticseventsearchresponse.js.map +1 -0
  134. package/dist/esm/models/components/analyticsvisitor.d.ts +35 -0
  135. package/dist/esm/models/components/analyticsvisitor.d.ts.map +1 -0
  136. package/dist/esm/models/components/analyticsvisitor.js +41 -0
  137. package/dist/esm/models/components/analyticsvisitor.js.map +1 -0
  138. package/dist/esm/models/components/analyticsvisitorsearchrequest.d.ts +105 -0
  139. package/dist/esm/models/components/analyticsvisitorsearchrequest.d.ts.map +1 -0
  140. package/dist/esm/models/components/analyticsvisitorsearchrequest.js +84 -0
  141. package/dist/esm/models/components/analyticsvisitorsearchrequest.js.map +1 -0
  142. package/dist/esm/models/components/analyticsvisitorsearchresponse.d.ts +26 -0
  143. package/dist/esm/models/components/analyticsvisitorsearchresponse.d.ts.map +1 -0
  144. package/dist/esm/models/components/analyticsvisitorsearchresponse.js +32 -0
  145. package/dist/esm/models/components/analyticsvisitorsearchresponse.js.map +1 -0
  146. package/dist/esm/models/components/effectivepricerow.d.ts +3 -0
  147. package/dist/esm/models/components/effectivepricerow.d.ts.map +1 -1
  148. package/dist/esm/models/components/effectivepricerow.js +11 -0
  149. package/dist/esm/models/components/effectivepricerow.js.map +1 -1
  150. package/dist/esm/models/components/index.d.ts +5 -0
  151. package/dist/esm/models/components/index.d.ts.map +1 -1
  152. package/dist/esm/models/components/index.js +5 -0
  153. package/dist/esm/models/components/index.js.map +1 -1
  154. package/dist/esm/models/operations/analyticseventssearch.d.ts +23 -0
  155. package/dist/esm/models/operations/analyticseventssearch.d.ts.map +1 -0
  156. package/dist/esm/models/operations/analyticseventssearch.js +32 -0
  157. package/dist/esm/models/operations/analyticseventssearch.js.map +1 -0
  158. package/dist/esm/models/operations/analyticsvisitorssearch.d.ts +23 -0
  159. package/dist/esm/models/operations/analyticsvisitorssearch.d.ts.map +1 -0
  160. package/dist/esm/models/operations/analyticsvisitorssearch.js +32 -0
  161. package/dist/esm/models/operations/analyticsvisitorssearch.js.map +1 -0
  162. package/dist/esm/models/operations/index.d.ts +2 -0
  163. package/dist/esm/models/operations/index.d.ts.map +1 -1
  164. package/dist/esm/models/operations/index.js +2 -0
  165. package/dist/esm/models/operations/index.js.map +1 -1
  166. package/dist/esm/react-query/analyticsEventsSearch.d.ts +30 -0
  167. package/dist/esm/react-query/analyticsEventsSearch.d.ts.map +1 -0
  168. package/dist/esm/react-query/analyticsEventsSearch.js +42 -0
  169. package/dist/esm/react-query/analyticsEventsSearch.js.map +1 -0
  170. package/dist/esm/react-query/analyticsVisitorsSearch.d.ts +30 -0
  171. package/dist/esm/react-query/analyticsVisitorsSearch.d.ts.map +1 -0
  172. package/dist/esm/react-query/analyticsVisitorsSearch.js +42 -0
  173. package/dist/esm/react-query/analyticsVisitorsSearch.js.map +1 -0
  174. package/dist/esm/react-query/index.d.ts +2 -0
  175. package/dist/esm/react-query/index.d.ts.map +1 -1
  176. package/dist/esm/react-query/index.js +2 -0
  177. package/dist/esm/react-query/index.js.map +1 -1
  178. package/dist/esm/react-query/llmModelsListEffectivePrices.d.ts +2 -2
  179. package/dist/esm/react-query/llmModelsListEffectivePrices.js +2 -2
  180. package/dist/esm/sdk/analytics.d.ts +6 -0
  181. package/dist/esm/sdk/analytics.d.ts.map +1 -1
  182. package/dist/esm/sdk/analytics.js +8 -0
  183. package/dist/esm/sdk/analytics.js.map +1 -1
  184. package/dist/esm/sdk/events.d.ts +13 -0
  185. package/dist/esm/sdk/events.d.ts.map +1 -0
  186. package/dist/esm/sdk/events.js +18 -0
  187. package/dist/esm/sdk/events.js.map +1 -0
  188. package/dist/esm/sdk/models.d.ts +1 -1
  189. package/dist/esm/sdk/models.js +1 -1
  190. package/dist/esm/sdk/visitors.d.ts +13 -0
  191. package/dist/esm/sdk/visitors.d.ts.map +1 -0
  192. package/dist/esm/sdk/visitors.js +18 -0
  193. package/dist/esm/sdk/visitors.js.map +1 -0
  194. package/jsr.json +1 -1
  195. package/package.json +1 -1
  196. package/src/funcs/analyticsEventsSearch.ts +199 -0
  197. package/src/funcs/analyticsVisitorsSearch.ts +199 -0
  198. package/src/funcs/llmModelsListEffectivePrices.ts +1 -1
  199. package/src/lib/config.ts +2 -2
  200. package/src/mcp-server/mcp-server.ts +1 -1
  201. package/src/mcp-server/server.ts +5 -1
  202. package/src/mcp-server/tools/analyticsEventsSearch.ts +37 -0
  203. package/src/mcp-server/tools/analyticsVisitorsSearch.ts +37 -0
  204. package/src/mcp-server/tools/llmModelsListEffectivePrices.ts +1 -1
  205. package/src/models/components/analyticsevent.ts +2 -2
  206. package/src/models/components/analyticseventsearchrequest.ts +249 -0
  207. package/src/models/components/analyticseventsearchresponse.ts +78 -0
  208. package/src/models/components/analyticsvisitor.ts +90 -0
  209. package/src/models/components/analyticsvisitorsearchrequest.ts +241 -0
  210. package/src/models/components/analyticsvisitorsearchresponse.ts +78 -0
  211. package/src/models/components/effectivepricerow.ts +13 -0
  212. package/src/models/components/index.ts +5 -0
  213. package/src/models/operations/analyticseventssearch.ts +72 -0
  214. package/src/models/operations/analyticsvisitorssearch.ts +73 -0
  215. package/src/models/operations/index.ts +2 -0
  216. package/src/react-query/analyticsEventsSearch.ts +112 -0
  217. package/src/react-query/analyticsVisitorsSearch.ts +112 -0
  218. package/src/react-query/index.ts +2 -0
  219. package/src/react-query/llmModelsListEffectivePrices.ts +2 -2
  220. package/src/sdk/analytics.ts +12 -0
  221. package/src/sdk/events.ts +28 -0
  222. package/src/sdk/models.ts +1 -1
  223. package/src/sdk/visitors.ts +28 -0
@@ -7,6 +7,7 @@ export * from "./activateagentconnector.js";
7
7
  export * from "./addmodelcatalogorgaccess.js";
8
8
  export * from "./addteammember.js";
9
9
  export * from "./analyticscapture.js";
10
+ export * from "./analyticseventssearch.js";
10
11
  export * from "./analyticskeyscreate.js";
11
12
  export * from "./analyticskeyslist.js";
12
13
  export * from "./analyticskeysrevoke.js";
@@ -15,6 +16,7 @@ export * from "./analyticsprojectsget.js";
15
16
  export * from "./analyticsprojectslist.js";
16
17
  export * from "./analyticsprojectsupdate.js";
17
18
  export * from "./analyticsquery.js";
19
+ export * from "./analyticsvisitorssearch.js";
18
20
  export * from "./appendagentevaltrials.js";
19
21
  export * from "./batchgetcompletionfeedback.js";
20
22
  export * from "./batchgetresponsefeedback.js";
@@ -0,0 +1,112 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import {
6
+ MutationKey,
7
+ useMutation,
8
+ UseMutationResult,
9
+ } from "@tanstack/react-query";
10
+ import { SDKCore } from "../core.js";
11
+ import { analyticsEventsSearch } from "../funcs/analyticsEventsSearch.js";
12
+ import { combineSignals } from "../lib/primitives.js";
13
+ import { RequestOptions } from "../lib/sdks.js";
14
+ import * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKError } from "../models/errors/sdkerror.js";
25
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { unwrapAsync } from "../types/fp.js";
28
+ import { useSDKContext } from "./_context.js";
29
+ import { MutationHookOptions } from "./_types.js";
30
+
31
+ export type AnalyticsEventsSearchMutationVariables = {
32
+ request: operations.AnalyticsEventsSearchRequest;
33
+ options?: RequestOptions;
34
+ };
35
+
36
+ export type AnalyticsEventsSearchMutationData =
37
+ components.AnalyticsEventSearchResponse;
38
+
39
+ export type AnalyticsEventsSearchMutationError =
40
+ | errors.AnalyticsError
41
+ | SDKError
42
+ | ResponseValidationError
43
+ | ConnectionError
44
+ | RequestAbortedError
45
+ | RequestTimeoutError
46
+ | InvalidRequestError
47
+ | UnexpectedClientError
48
+ | SDKValidationError;
49
+
50
+ /**
51
+ * Search events in a time range
52
+ *
53
+ * @remarks
54
+ * List individual events in a time range, newest first, with their properties. Optionally filter by event name, event properties, or one visitor's distinct_id. The range includes from and excludes to, and duplicate event IDs are returned once, so a search over a chart bucket's range with the same filters lists exactly the events that bucket counted. A page holds up to 100 events; pass next_cursor as cursor for the following page until it is null. The first page takes a snapshot from ClickHouse's clock before reading its rows and its cursor carries it, so every page of the sequence, the first included, reads only deliveries received at or before that snapshot and ages events out of retention as of it: no event repeats or is skipped, and events received after the snapshot, including a redelivery that revises a listed event, appear only when paging restarts without a cursor. One window blurs that boundary: ClickHouse stamps a receipt at whole seconds when an insert starts and commits its rows when it finishes, so a delivery stamped in or before the snapshot's second that commits after the first page was read is inside the sequence but missing from the first page; it joins from the next page, where an unlisted event it adds or moves ahead of the cursor is skipped and a listed event that a lower-hash redelivery moves behind the cursor repeats at its revised position. A cursor that does not decode, or one from another list, returns 400. A page whose events exceed the response size limit returns 413; request a smaller limit.
55
+ */
56
+ export function useAnalyticsEventsSearchMutation(
57
+ options?: MutationHookOptions<
58
+ AnalyticsEventsSearchMutationData,
59
+ AnalyticsEventsSearchMutationError,
60
+ AnalyticsEventsSearchMutationVariables
61
+ >,
62
+ ): UseMutationResult<
63
+ AnalyticsEventsSearchMutationData,
64
+ AnalyticsEventsSearchMutationError,
65
+ AnalyticsEventsSearchMutationVariables
66
+ > {
67
+ const client = useSDKContext();
68
+ return useMutation({
69
+ ...buildAnalyticsEventsSearchMutation(client, options),
70
+ ...options,
71
+ });
72
+ }
73
+
74
+ export function mutationKeyAnalyticsEventsSearch(): MutationKey {
75
+ return ["@meetkai/mka1", "events", "search"];
76
+ }
77
+
78
+ export function buildAnalyticsEventsSearchMutation(
79
+ client$: SDKCore,
80
+ hookOptions?: RequestOptions,
81
+ ): {
82
+ mutationKey: MutationKey;
83
+ mutationFn: (
84
+ variables: AnalyticsEventsSearchMutationVariables,
85
+ ) => Promise<AnalyticsEventsSearchMutationData>;
86
+ } {
87
+ return {
88
+ mutationKey: mutationKeyAnalyticsEventsSearch(),
89
+ mutationFn: function analyticsEventsSearchMutationFn({
90
+ request,
91
+ options,
92
+ }): Promise<AnalyticsEventsSearchMutationData> {
93
+ const mergedOptions = {
94
+ ...hookOptions,
95
+ ...options,
96
+ fetchOptions: {
97
+ ...hookOptions?.fetchOptions,
98
+ ...options?.fetchOptions,
99
+ signal: combineSignals(
100
+ hookOptions?.fetchOptions?.signal,
101
+ options?.fetchOptions?.signal,
102
+ ),
103
+ },
104
+ };
105
+ return unwrapAsync(analyticsEventsSearch(
106
+ client$,
107
+ request,
108
+ mergedOptions,
109
+ ));
110
+ },
111
+ };
112
+ }
@@ -0,0 +1,112 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import {
6
+ MutationKey,
7
+ useMutation,
8
+ UseMutationResult,
9
+ } from "@tanstack/react-query";
10
+ import { SDKCore } from "../core.js";
11
+ import { analyticsVisitorsSearch } from "../funcs/analyticsVisitorsSearch.js";
12
+ import { combineSignals } from "../lib/primitives.js";
13
+ import { RequestOptions } from "../lib/sdks.js";
14
+ import * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKError } from "../models/errors/sdkerror.js";
25
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { unwrapAsync } from "../types/fp.js";
28
+ import { useSDKContext } from "./_context.js";
29
+ import { MutationHookOptions } from "./_types.js";
30
+
31
+ export type AnalyticsVisitorsSearchMutationVariables = {
32
+ request: operations.AnalyticsVisitorsSearchRequest;
33
+ options?: RequestOptions;
34
+ };
35
+
36
+ export type AnalyticsVisitorsSearchMutationData =
37
+ components.AnalyticsVisitorSearchResponse;
38
+
39
+ export type AnalyticsVisitorsSearchMutationError =
40
+ | errors.AnalyticsError
41
+ | SDKError
42
+ | ResponseValidationError
43
+ | ConnectionError
44
+ | RequestAbortedError
45
+ | RequestTimeoutError
46
+ | InvalidRequestError
47
+ | UnexpectedClientError
48
+ | SDKValidationError;
49
+
50
+ /**
51
+ * Search visitors in a time range
52
+ *
53
+ * @remarks
54
+ * List visitors with matching events in a time range, most recently active first. Each visitor is one distinct_id with the timestamps of its first and last matching event and its event count over the whole range, so for a range that receives no further events the number of visitors across all pages equals the unique_visitors query for the same range and filters. The range includes from and excludes to, and duplicate event IDs are counted once. A page holds up to 100 visitors; pass next_cursor as cursor for the following page until it is null. The first page takes a snapshot from ClickHouse's clock before reading its rows and its cursor carries it, so every page of the sequence, the first included, reads only deliveries received at or before that snapshot and ages events out of retention as of it: a visitor keeps the position, first_seen, last_seen and event_count the sequence started with, no visitor repeats or is skipped, and activity received after the snapshot appears only when paging restarts without a cursor. One window blurs that boundary: ClickHouse stamps a receipt at whole seconds when an insert starts and commits its rows when it finishes, so a delivery stamped in or before the snapshot's second that commits after the first page was read is inside the sequence but missing from the first page; it joins from the next page, where an unlisted visitor it adds or moves ahead of the cursor is skipped and a listed visitor whose winning delivery a lower-hash redelivery moves behind the cursor repeats with revised totals; a listed visitor's totals otherwise stay as listed. A cursor that does not decode, or one from another list, returns 400.
55
+ */
56
+ export function useAnalyticsVisitorsSearchMutation(
57
+ options?: MutationHookOptions<
58
+ AnalyticsVisitorsSearchMutationData,
59
+ AnalyticsVisitorsSearchMutationError,
60
+ AnalyticsVisitorsSearchMutationVariables
61
+ >,
62
+ ): UseMutationResult<
63
+ AnalyticsVisitorsSearchMutationData,
64
+ AnalyticsVisitorsSearchMutationError,
65
+ AnalyticsVisitorsSearchMutationVariables
66
+ > {
67
+ const client = useSDKContext();
68
+ return useMutation({
69
+ ...buildAnalyticsVisitorsSearchMutation(client, options),
70
+ ...options,
71
+ });
72
+ }
73
+
74
+ export function mutationKeyAnalyticsVisitorsSearch(): MutationKey {
75
+ return ["@meetkai/mka1", "visitors", "search"];
76
+ }
77
+
78
+ export function buildAnalyticsVisitorsSearchMutation(
79
+ client$: SDKCore,
80
+ hookOptions?: RequestOptions,
81
+ ): {
82
+ mutationKey: MutationKey;
83
+ mutationFn: (
84
+ variables: AnalyticsVisitorsSearchMutationVariables,
85
+ ) => Promise<AnalyticsVisitorsSearchMutationData>;
86
+ } {
87
+ return {
88
+ mutationKey: mutationKeyAnalyticsVisitorsSearch(),
89
+ mutationFn: function analyticsVisitorsSearchMutationFn({
90
+ request,
91
+ options,
92
+ }): Promise<AnalyticsVisitorsSearchMutationData> {
93
+ const mergedOptions = {
94
+ ...hookOptions,
95
+ ...options,
96
+ fetchOptions: {
97
+ ...hookOptions?.fetchOptions,
98
+ ...options?.fetchOptions,
99
+ signal: combineSignals(
100
+ hookOptions?.fetchOptions?.signal,
101
+ options?.fetchOptions?.signal,
102
+ ),
103
+ },
104
+ };
105
+ return unwrapAsync(analyticsVisitorsSearch(
106
+ client$,
107
+ request,
108
+ mergedOptions,
109
+ ));
110
+ },
111
+ };
112
+ }
@@ -33,6 +33,7 @@ export * from "./agentVersionsGetAgentVersion.js";
33
33
  export * from "./agentVersionsListAgentVersions.js";
34
34
  export * from "./agentVersionsRollbackAgentVersion.js";
35
35
  export * from "./analyticsCapture.js";
36
+ export * from "./analyticsEventsSearch.js";
36
37
  export * from "./analyticsKeysCreate.js";
37
38
  export * from "./analyticsKeysList.js";
38
39
  export * from "./analyticsKeysRevoke.js";
@@ -42,6 +43,7 @@ export * from "./analyticsProjectsGet.js";
42
43
  export * from "./analyticsProjectsList.js";
43
44
  export * from "./analyticsProjectsUpdate.js";
44
45
  export * from "./analyticsQuery.js";
46
+ export * from "./analyticsVisitorsSearch.js";
45
47
  export * from "./authApiKeyGetJwtFromKey.js";
46
48
  export * from "./authApiKeysCreate.js";
47
49
  export * from "./authApiKeysExchangeToken.js";
@@ -54,7 +54,7 @@ export type LlmModelsListEffectivePricesQueryError =
54
54
  * List effective prices for the caller's models
55
55
  *
56
56
  * @remarks
57
- * For every active model, returns its registry-aware price: an org row, a cluster default for cluster lineage, or unpriced ($0).
57
+ * For every active model, returns its registry-aware price: an org row, a cluster default for cluster lineage, or unpriced ($0). Also lists the `auto` routing alias, priced at the per-metric maximum across every model it can be billed as (`resolves_to`): a judge policy's active candidates, or the direct/YAML target plus any reroute target it can fall through to.
58
58
  */
59
59
  export function useLlmModelsListEffectivePrices(
60
60
  request: operations.ListEffectivePricesRequest,
@@ -81,7 +81,7 @@ export function useLlmModelsListEffectivePrices(
81
81
  * List effective prices for the caller's models
82
82
  *
83
83
  * @remarks
84
- * For every active model, returns its registry-aware price: an org row, a cluster default for cluster lineage, or unpriced ($0).
84
+ * For every active model, returns its registry-aware price: an org row, a cluster default for cluster lineage, or unpriced ($0). Also lists the `auto` routing alias, priced at the per-metric maximum across every model it can be billed as (`resolves_to`): a judge policy's active candidates, or the direct/YAML target plus any reroute target it can fall through to.
85
85
  */
86
86
  export function useLlmModelsListEffectivePricesSuspense(
87
87
  request: operations.ListEffectivePricesRequest,
@@ -8,8 +8,10 @@ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
8
8
  import * as components from "../models/components/index.js";
9
9
  import * as operations from "../models/operations/index.js";
10
10
  import { unwrapAsync } from "../types/fp.js";
11
+ import { Events } from "./events.js";
11
12
  import { Keys } from "./keys.js";
12
13
  import { Projects } from "./projects.js";
14
+ import { Visitors } from "./visitors.js";
13
15
 
14
16
  export class Analytics extends ClientSDK {
15
17
  private _projects?: Projects;
@@ -22,6 +24,16 @@ export class Analytics extends ClientSDK {
22
24
  return (this._keys ??= new Keys(this._options));
23
25
  }
24
26
 
27
+ private _events?: Events;
28
+ get events(): Events {
29
+ return (this._events ??= new Events(this._options));
30
+ }
31
+
32
+ private _visitors?: Visitors;
33
+ get visitors(): Visitors {
34
+ return (this._visitors ??= new Visitors(this._options));
35
+ }
36
+
25
37
  /**
26
38
  * Durably accept a batch of events
27
39
  *
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { analyticsEventsSearch } from "../funcs/analyticsEventsSearch.js";
6
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
+ import * as components from "../models/components/index.js";
8
+ import * as operations from "../models/operations/index.js";
9
+ import { unwrapAsync } from "../types/fp.js";
10
+
11
+ export class Events extends ClientSDK {
12
+ /**
13
+ * Search events in a time range
14
+ *
15
+ * @remarks
16
+ * List individual events in a time range, newest first, with their properties. Optionally filter by event name, event properties, or one visitor's distinct_id. The range includes from and excludes to, and duplicate event IDs are returned once, so a search over a chart bucket's range with the same filters lists exactly the events that bucket counted. A page holds up to 100 events; pass next_cursor as cursor for the following page until it is null. The first page takes a snapshot from ClickHouse's clock before reading its rows and its cursor carries it, so every page of the sequence, the first included, reads only deliveries received at or before that snapshot and ages events out of retention as of it: no event repeats or is skipped, and events received after the snapshot, including a redelivery that revises a listed event, appear only when paging restarts without a cursor. One window blurs that boundary: ClickHouse stamps a receipt at whole seconds when an insert starts and commits its rows when it finishes, so a delivery stamped in or before the snapshot's second that commits after the first page was read is inside the sequence but missing from the first page; it joins from the next page, where an unlisted event it adds or moves ahead of the cursor is skipped and a listed event that a lower-hash redelivery moves behind the cursor repeats at its revised position. A cursor that does not decode, or one from another list, returns 400. A page whose events exceed the response size limit returns 413; request a smaller limit.
17
+ */
18
+ async search(
19
+ request: operations.AnalyticsEventsSearchRequest,
20
+ options?: RequestOptions,
21
+ ): Promise<components.AnalyticsEventSearchResponse> {
22
+ return unwrapAsync(analyticsEventsSearch(
23
+ this,
24
+ request,
25
+ options,
26
+ ));
27
+ }
28
+ }
package/src/sdk/models.ts CHANGED
@@ -455,7 +455,7 @@ export class Models extends ClientSDK {
455
455
  * List effective prices for the caller's models
456
456
  *
457
457
  * @remarks
458
- * For every active model, returns its registry-aware price: an org row, a cluster default for cluster lineage, or unpriced ($0).
458
+ * For every active model, returns its registry-aware price: an org row, a cluster default for cluster lineage, or unpriced ($0). Also lists the `auto` routing alias, priced at the per-metric maximum across every model it can be billed as (`resolves_to`): a judge policy's active candidates, or the direct/YAML target plus any reroute target it can fall through to.
459
459
  */
460
460
  async listEffectivePrices(
461
461
  request: operations.ListEffectivePricesRequest,
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { analyticsVisitorsSearch } from "../funcs/analyticsVisitorsSearch.js";
6
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
+ import * as components from "../models/components/index.js";
8
+ import * as operations from "../models/operations/index.js";
9
+ import { unwrapAsync } from "../types/fp.js";
10
+
11
+ export class Visitors extends ClientSDK {
12
+ /**
13
+ * Search visitors in a time range
14
+ *
15
+ * @remarks
16
+ * List visitors with matching events in a time range, most recently active first. Each visitor is one distinct_id with the timestamps of its first and last matching event and its event count over the whole range, so for a range that receives no further events the number of visitors across all pages equals the unique_visitors query for the same range and filters. The range includes from and excludes to, and duplicate event IDs are counted once. A page holds up to 100 visitors; pass next_cursor as cursor for the following page until it is null. The first page takes a snapshot from ClickHouse's clock before reading its rows and its cursor carries it, so every page of the sequence, the first included, reads only deliveries received at or before that snapshot and ages events out of retention as of it: a visitor keeps the position, first_seen, last_seen and event_count the sequence started with, no visitor repeats or is skipped, and activity received after the snapshot appears only when paging restarts without a cursor. One window blurs that boundary: ClickHouse stamps a receipt at whole seconds when an insert starts and commits its rows when it finishes, so a delivery stamped in or before the snapshot's second that commits after the first page was read is inside the sequence but missing from the first page; it joins from the next page, where an unlisted visitor it adds or moves ahead of the cursor is skipped and a listed visitor whose winning delivery a lower-hash redelivery moves behind the cursor repeats with revised totals; a listed visitor's totals otherwise stay as listed. A cursor that does not decode, or one from another list, returns 400.
17
+ */
18
+ async search(
19
+ request: operations.AnalyticsVisitorsSearchRequest,
20
+ options?: RequestOptions,
21
+ ): Promise<components.AnalyticsVisitorSearchResponse> {
22
+ return unwrapAsync(analyticsVisitorsSearch(
23
+ this,
24
+ request,
25
+ options,
26
+ ));
27
+ }
28
+ }