@orq-ai/node 4.9.11 → 4.9.13

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 (188) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +2 -2
  3. package/lib/config.js +2 -2
  4. package/models/components/reasoningpart.js +1 -1
  5. package/models/operations/createcontact.js +1 -1
  6. package/models/operations/createdataset.js +1 -1
  7. package/models/operations/createdatasetitem.js +4 -4
  8. package/models/operations/createdatasource.js +1 -1
  9. package/models/operations/createeval.js +16 -16
  10. package/models/operations/createidentity.js +1 -1
  11. package/models/operations/createtool.js +6 -6
  12. package/models/operations/getalltools.js +6 -6
  13. package/models/operations/getevals.js +16 -16
  14. package/models/operations/getv2humanevalsets.js +2 -2
  15. package/models/operations/getv2humanevalsetsid.js +2 -2
  16. package/models/operations/listdatasetdatapoints.js +4 -4
  17. package/models/operations/listdatasets.js +1 -1
  18. package/models/operations/listdatasources.js +1 -1
  19. package/models/operations/listidentities.js +1 -1
  20. package/models/operations/patchv2humanevalsetsid.js +2 -2
  21. package/models/operations/postv2feedbackevaluation.js +3 -3
  22. package/models/operations/postv2humanevalsets.js +2 -2
  23. package/models/operations/retrievedatapoint.js +4 -4
  24. package/models/operations/retrievedataset.js +1 -1
  25. package/models/operations/retrievedatasource.js +1 -1
  26. package/models/operations/retrieveidentity.js +1 -1
  27. package/models/operations/retrievetool.js +6 -6
  28. package/models/operations/runagent.js +1 -1
  29. package/models/operations/streamrunagent.js +1 -1
  30. package/models/operations/updatedatapoint.js +4 -4
  31. package/models/operations/updatedataset.js +1 -1
  32. package/models/operations/updatedatasource.js +1 -1
  33. package/models/operations/updateeval.js +16 -16
  34. package/models/operations/updateidentity.js +1 -1
  35. package/models/operations/updatetool.js +7 -7
  36. package/package.json +8 -8
  37. package/packages/orq-rc/src/funcs/{reportingQuery.ts → contactsCreate.ts} +13 -13
  38. package/packages/orq-rc/src/funcs/identitiesCreate.ts +15 -10
  39. package/packages/orq-rc/src/funcs/identitiesDelete.ts +16 -7
  40. package/packages/orq-rc/src/funcs/identitiesList.ts +5 -6
  41. package/packages/orq-rc/src/funcs/identitiesRetrieve.ts +18 -6
  42. package/packages/orq-rc/src/funcs/identitiesUpdate.ts +15 -9
  43. package/packages/orq-rc/src/funcs/projectsCreate.ts +1 -1
  44. package/packages/orq-rc/src/funcs/projectsDelete.ts +0 -3
  45. package/packages/orq-rc/src/funcs/projectsList.ts +1 -1
  46. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +163 -0
  47. package/packages/orq-rc/src/funcs/skillsCreate.ts +1 -1
  48. package/packages/orq-rc/src/funcs/skillsDelete.ts +0 -3
  49. package/packages/orq-rc/src/funcs/skillsGet.ts +1 -1
  50. package/packages/orq-rc/src/funcs/skillsList.ts +1 -1
  51. package/packages/orq-rc/src/funcs/skillsUpdate.ts +1 -1
  52. package/packages/orq-rc/src/lib/config.ts +2 -2
  53. package/packages/orq-rc/src/models/components/createprojectrequest.ts +0 -6
  54. package/packages/orq-rc/src/models/components/createprojectresponse.ts +0 -3
  55. package/packages/orq-rc/src/models/components/createskillrequest.ts +0 -18
  56. package/packages/orq-rc/src/models/components/createskillresponse.ts +0 -3
  57. package/packages/orq-rc/src/models/components/file.ts +3 -0
  58. package/packages/orq-rc/src/models/components/getprojectresponse.ts +0 -3
  59. package/packages/orq-rc/src/models/components/getskillresponse.ts +0 -3
  60. package/packages/orq-rc/src/models/components/index.ts +0 -15
  61. package/packages/orq-rc/src/models/components/invokedeploymentrequest.ts +10 -17
  62. package/packages/orq-rc/src/models/components/listprojectsresponse.ts +0 -12
  63. package/packages/orq-rc/src/models/components/listskillsresponse.ts +0 -12
  64. package/packages/orq-rc/src/models/components/modelref.ts +0 -6
  65. package/packages/orq-rc/src/models/components/project.ts +3 -42
  66. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  67. package/packages/orq-rc/src/models/components/skill.ts +3 -37
  68. package/packages/orq-rc/src/models/components/updateprojectrequest.ts +0 -12
  69. package/packages/orq-rc/src/models/components/updateprojectresponse.ts +0 -3
  70. package/packages/orq-rc/src/models/components/updateskillrequest.ts +0 -21
  71. package/packages/orq-rc/src/models/components/updateskillresponse.ts +0 -3
  72. package/packages/orq-rc/src/models/errors/deleteidentity.ts +62 -0
  73. package/packages/orq-rc/src/models/errors/index.ts +3 -0
  74. package/packages/orq-rc/src/models/errors/retrieveidentity.ts +118 -0
  75. package/packages/orq-rc/src/models/errors/updateidentity.ts +54 -0
  76. package/packages/orq-rc/src/models/operations/createagentrequest.ts +3 -3
  77. package/packages/orq-rc/src/models/operations/createannotation.ts +11 -7
  78. package/packages/orq-rc/src/models/operations/createcontact.ts +156 -0
  79. package/packages/orq-rc/src/models/operations/createdataset.ts +4 -4
  80. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +4 -4
  81. package/packages/orq-rc/src/models/operations/createdatasource.ts +1 -1
  82. package/packages/orq-rc/src/models/operations/createeval.ts +31 -45
  83. package/packages/orq-rc/src/models/operations/createidentity.ts +162 -0
  84. package/packages/orq-rc/src/models/operations/createknowledge.ts +9 -9
  85. package/packages/orq-rc/src/models/operations/creatememorystore.ts +3 -3
  86. package/packages/orq-rc/src/models/operations/createprompt.ts +3 -3
  87. package/packages/orq-rc/src/models/operations/createtool.ts +36 -36
  88. package/packages/orq-rc/src/models/operations/deleteidentity.ts +3 -0
  89. package/packages/orq-rc/src/models/operations/getalltools.ts +21 -21
  90. package/packages/orq-rc/src/models/operations/getevals.ts +16 -22
  91. package/packages/orq-rc/src/models/operations/getoneknowledge.ts +6 -6
  92. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  93. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  94. package/packages/orq-rc/src/models/operations/index.ts +3 -0
  95. package/packages/orq-rc/src/models/operations/invokeeval.ts +80 -83
  96. package/packages/orq-rc/src/models/operations/listagents.ts +3 -3
  97. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +4 -4
  98. package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
  99. package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
  100. package/packages/orq-rc/src/models/operations/listidentities.ts +230 -9
  101. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +6 -6
  102. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  103. package/packages/orq-rc/src/models/operations/postv2agentsa2a.ts +17 -14
  104. package/packages/orq-rc/src/models/operations/postv2feedback.ts +27 -34
  105. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +3 -3
  106. package/packages/orq-rc/src/models/operations/postv2feedbackremove.ts +17 -14
  107. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  108. package/packages/orq-rc/src/models/operations/projectdelete.ts +0 -3
  109. package/packages/orq-rc/src/models/operations/projectget.ts +0 -3
  110. package/packages/orq-rc/src/models/operations/projectlist.ts +0 -15
  111. package/packages/orq-rc/src/models/operations/projectupdate.ts +0 -3
  112. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +108 -0
  113. package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +3 -3
  114. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +4 -4
  115. package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
  116. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
  117. package/packages/orq-rc/src/models/operations/retrieveidentity.ts +138 -3
  118. package/packages/orq-rc/src/models/operations/retrievetool.ts +21 -21
  119. package/packages/orq-rc/src/models/operations/runagent.ts +4 -4
  120. package/packages/orq-rc/src/models/operations/skilldelete.ts +0 -3
  121. package/packages/orq-rc/src/models/operations/skilllist.ts +0 -12
  122. package/packages/orq-rc/src/models/operations/skillupdate.ts +0 -3
  123. package/packages/orq-rc/src/models/operations/streamrunagent.ts +4 -4
  124. package/packages/orq-rc/src/models/operations/updateagent.ts +6 -6
  125. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +4 -4
  126. package/packages/orq-rc/src/models/operations/updatedataset.ts +4 -4
  127. package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
  128. package/packages/orq-rc/src/models/operations/updateeval.ts +23 -30
  129. package/packages/orq-rc/src/models/operations/updateidentity.ts +154 -5
  130. package/packages/orq-rc/src/models/operations/updateknowledge.ts +12 -12
  131. package/packages/orq-rc/src/models/operations/updateprompt.ts +3 -3
  132. package/packages/orq-rc/src/models/operations/updatetool.ts +37 -37
  133. package/packages/orq-rc/src/sdk/contacts.ts +27 -0
  134. package/packages/orq-rc/src/sdk/feedback.ts +8 -8
  135. package/packages/orq-rc/src/sdk/identities.ts +17 -18
  136. package/packages/orq-rc/src/sdk/projects.ts +2 -5
  137. package/packages/orq-rc/src/sdk/remoteconfigs.ts +24 -0
  138. package/packages/orq-rc/src/sdk/sdk.ts +22 -16
  139. package/packages/orq-rc/src/sdk/skills.ts +4 -7
  140. package/src/lib/config.ts +2 -2
  141. package/src/models/components/reasoningpart.ts +1 -1
  142. package/src/models/operations/createcontact.ts +1 -1
  143. package/src/models/operations/createdataset.ts +1 -1
  144. package/src/models/operations/createdatasetitem.ts +4 -4
  145. package/src/models/operations/createdatasource.ts +1 -1
  146. package/src/models/operations/createeval.ts +16 -16
  147. package/src/models/operations/createidentity.ts +1 -1
  148. package/src/models/operations/createtool.ts +6 -6
  149. package/src/models/operations/getalltools.ts +6 -6
  150. package/src/models/operations/getevals.ts +16 -16
  151. package/src/models/operations/getv2humanevalsets.ts +2 -2
  152. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  153. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  154. package/src/models/operations/listdatasets.ts +1 -1
  155. package/src/models/operations/listdatasources.ts +1 -1
  156. package/src/models/operations/listidentities.ts +1 -1
  157. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  158. package/src/models/operations/postv2feedbackevaluation.ts +3 -3
  159. package/src/models/operations/postv2humanevalsets.ts +2 -2
  160. package/src/models/operations/retrievedatapoint.ts +4 -4
  161. package/src/models/operations/retrievedataset.ts +1 -1
  162. package/src/models/operations/retrievedatasource.ts +1 -1
  163. package/src/models/operations/retrieveidentity.ts +1 -1
  164. package/src/models/operations/retrievetool.ts +6 -6
  165. package/src/models/operations/runagent.ts +1 -1
  166. package/src/models/operations/streamrunagent.ts +1 -1
  167. package/src/models/operations/updatedatapoint.ts +4 -4
  168. package/src/models/operations/updatedataset.ts +1 -1
  169. package/src/models/operations/updatedatasource.ts +1 -1
  170. package/src/models/operations/updateeval.ts +16 -16
  171. package/src/models/operations/updateidentity.ts +1 -1
  172. package/src/models/operations/updatetool.ts +7 -7
  173. package/packages/orq-rc/src/models/components/createidentityrequest.ts +0 -76
  174. package/packages/orq-rc/src/models/components/createidentityresponse.ts +0 -32
  175. package/packages/orq-rc/src/models/components/datapoint.ts +0 -60
  176. package/packages/orq-rc/src/models/components/deleteidentityresponse.ts +0 -27
  177. package/packages/orq-rc/src/models/components/filter.ts +0 -137
  178. package/packages/orq-rc/src/models/components/identity.ts +0 -83
  179. package/packages/orq-rc/src/models/components/identitymetrics.ts +0 -45
  180. package/packages/orq-rc/src/models/components/listidentitiesresponse.ts +0 -41
  181. package/packages/orq-rc/src/models/components/queryreportrequest.ts +0 -237
  182. package/packages/orq-rc/src/models/components/queryreportresponse.ts +0 -96
  183. package/packages/orq-rc/src/models/components/responsemeta.ts +0 -103
  184. package/packages/orq-rc/src/models/components/retrieveidentityresponse.ts +0 -32
  185. package/packages/orq-rc/src/models/components/totals.ts +0 -34
  186. package/packages/orq-rc/src/models/components/updateidentityrequest.ts +0 -75
  187. package/packages/orq-rc/src/models/components/updateidentityresponse.ts +0 -32
  188. package/packages/orq-rc/src/sdk/reporting.ts +0 -27
@@ -1,237 +0,0 @@
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
- import {
12
- Filter,
13
- Filter$inboundSchema,
14
- Filter$Outbound,
15
- Filter$outboundSchema,
16
- } from "./filter.js";
17
-
18
- /**
19
- * Catalogue metric to query.
20
- */
21
- export const Metric = {
22
- GenaiRequests: "genai.requests",
23
- GenaiTokens: "genai.tokens",
24
- GenaiCost: "genai.cost",
25
- GenaiErrors: "genai.errors",
26
- GenaiLatencyP50: "genai.latency.p50",
27
- GenaiLatencyP95: "genai.latency.p95",
28
- GenaiLatencyP99: "genai.latency.p99",
29
- GenaiEvaluatorRuns: "genai.evaluator.runs",
30
- GenaiEvaluatorPassRate: "genai.evaluator.pass_rate",
31
- GenaiEvaluatorScoreAvg: "genai.evaluator.score.avg",
32
- GenaiGuardrailRuns: "genai.guardrail.runs",
33
- GenaiGuardrailBlockRate: "genai.guardrail.block_rate",
34
- GenaiGuardrailTriggered: "genai.guardrail.triggered",
35
- GenaiUsage: "genai.usage",
36
- } as const;
37
- /**
38
- * Catalogue metric to query.
39
- */
40
- export type Metric = ClosedEnum<typeof Metric>;
41
-
42
- /**
43
- * Requested bucket grain. Use `auto` or omit the field to let the server choose based on the requested range.
44
- */
45
- export const Grain = {
46
- Auto: "auto",
47
- Minute: "minute",
48
- Hour: "hour",
49
- Day: "day",
50
- } as const;
51
- /**
52
- * Requested bucket grain. Use `auto` or omit the field to let the server choose based on the requested range.
53
- */
54
- export type Grain = ClosedEnum<typeof Grain>;
55
-
56
- export const GroupBy = {
57
- Project: "project",
58
- Identity: "identity",
59
- Provider: "provider",
60
- Model: "model",
61
- Product: "product",
62
- ApiKey: "api_key",
63
- StatusCode: "status_code",
64
- HttpStatusCode: "http_status_code",
65
- CredentialType: "credential_type",
66
- Dimension: "dimension",
67
- DimensionType: "dimension_type",
68
- Tag: "tag",
69
- Agent: "agent",
70
- Tool: "tool",
71
- Deployment: "deployment",
72
- Evaluator: "evaluator",
73
- Dataset: "dataset",
74
- Prompt: "prompt",
75
- Policy: "policy",
76
- Conversation: "conversation",
77
- Thread: "thread",
78
- MemoryStore: "memory_store",
79
- Knowledge: "knowledge",
80
- Sheet: "sheet",
81
- GuardrailOrigin: "guardrail_origin",
82
- EvaluatorName: "evaluator_name",
83
- EvaluatorType: "evaluator_type",
84
- EvaluatorVersion: "evaluator_version",
85
- ResultType: "result_type",
86
- EvaluationStage: "evaluation_stage",
87
- GuardrailStage: "guardrail_stage",
88
- EvaluatorStage: "evaluator_stage",
89
- GuardrailAction: "guardrail_action",
90
- ResultLabel: "result_label",
91
- } as const;
92
- export type GroupBy = ClosedEnum<typeof GroupBy>;
93
-
94
- export type QueryReportRequest = {
95
- /**
96
- * Catalogue metric to query.
97
- */
98
- metric: Metric;
99
- /**
100
- * Inclusive lower bound for the report window (RFC 3339, UTC).
101
- */
102
- from: Date;
103
- /**
104
- * Exclusive upper bound for the report window (RFC 3339, UTC).
105
- */
106
- to: Date;
107
- /**
108
- * Requested bucket grain. Use `auto` or omit the field to let the server choose based on the requested range.
109
- */
110
- grain?: Grain | undefined;
111
- /**
112
- * Reporting dimensions to break down by. Valid dimensions depend on the selected metric.
113
- */
114
- groupBy?: Array<GroupBy> | undefined;
115
- /**
116
- * Up to 20 allowlisted predicates combined with AND.
117
- */
118
- filters?: Array<Filter> | undefined;
119
- /**
120
- * Maximum bucket rows returned. Defaults to 1000 and is capped at
121
- *
122
- * @remarks
123
- * 5000.
124
- */
125
- limit?: number | undefined;
126
- /**
127
- * IANA time zone applied to bucket boundaries, for example
128
- *
129
- * @remarks
130
- * `America/New_York`. Response timestamps remain UTC. Empty means UTC.
131
- */
132
- timeZone?: string | undefined;
133
- /**
134
- * When true, include a `totals` block aggregated across the full
135
- *
136
- * @remarks
137
- * report window.
138
- */
139
- includeTotals?: boolean | undefined;
140
- };
141
-
142
- /** @internal */
143
- export const Metric$inboundSchema: z.ZodNativeEnum<typeof Metric> = z
144
- .nativeEnum(Metric);
145
- /** @internal */
146
- export const Metric$outboundSchema: z.ZodNativeEnum<typeof Metric> =
147
- Metric$inboundSchema;
148
-
149
- /** @internal */
150
- export const Grain$inboundSchema: z.ZodNativeEnum<typeof Grain> = z.nativeEnum(
151
- Grain,
152
- );
153
- /** @internal */
154
- export const Grain$outboundSchema: z.ZodNativeEnum<typeof Grain> =
155
- Grain$inboundSchema;
156
-
157
- /** @internal */
158
- export const GroupBy$inboundSchema: z.ZodNativeEnum<typeof GroupBy> = z
159
- .nativeEnum(GroupBy);
160
- /** @internal */
161
- export const GroupBy$outboundSchema: z.ZodNativeEnum<typeof GroupBy> =
162
- GroupBy$inboundSchema;
163
-
164
- /** @internal */
165
- export const QueryReportRequest$inboundSchema: z.ZodType<
166
- QueryReportRequest,
167
- z.ZodTypeDef,
168
- unknown
169
- > = z.object({
170
- metric: Metric$inboundSchema,
171
- from: z.string().datetime({ offset: true }).transform(v => new Date(v)),
172
- to: z.string().datetime({ offset: true }).transform(v => new Date(v)),
173
- grain: Grain$inboundSchema.optional(),
174
- group_by: z.array(GroupBy$inboundSchema).optional(),
175
- filters: z.array(Filter$inboundSchema).optional(),
176
- limit: z.number().int().optional(),
177
- time_zone: z.string().optional(),
178
- include_totals: z.boolean().optional(),
179
- }).transform((v) => {
180
- return remap$(v, {
181
- "group_by": "groupBy",
182
- "time_zone": "timeZone",
183
- "include_totals": "includeTotals",
184
- });
185
- });
186
- /** @internal */
187
- export type QueryReportRequest$Outbound = {
188
- metric: string;
189
- from: string;
190
- to: string;
191
- grain?: string | undefined;
192
- group_by?: Array<string> | undefined;
193
- filters?: Array<Filter$Outbound> | undefined;
194
- limit?: number | undefined;
195
- time_zone?: string | undefined;
196
- include_totals?: boolean | undefined;
197
- };
198
-
199
- /** @internal */
200
- export const QueryReportRequest$outboundSchema: z.ZodType<
201
- QueryReportRequest$Outbound,
202
- z.ZodTypeDef,
203
- QueryReportRequest
204
- > = z.object({
205
- metric: Metric$outboundSchema,
206
- from: z.date().transform(v => v.toISOString()),
207
- to: z.date().transform(v => v.toISOString()),
208
- grain: Grain$outboundSchema.optional(),
209
- groupBy: z.array(GroupBy$outboundSchema).optional(),
210
- filters: z.array(Filter$outboundSchema).optional(),
211
- limit: z.number().int().optional(),
212
- timeZone: z.string().optional(),
213
- includeTotals: z.boolean().optional(),
214
- }).transform((v) => {
215
- return remap$(v, {
216
- groupBy: "group_by",
217
- timeZone: "time_zone",
218
- includeTotals: "include_totals",
219
- });
220
- });
221
-
222
- export function queryReportRequestToJSON(
223
- queryReportRequest: QueryReportRequest,
224
- ): string {
225
- return JSON.stringify(
226
- QueryReportRequest$outboundSchema.parse(queryReportRequest),
227
- );
228
- }
229
- export function queryReportRequestFromJSON(
230
- jsonString: string,
231
- ): SafeParseResult<QueryReportRequest, SDKValidationError> {
232
- return safeParse(
233
- jsonString,
234
- (x) => QueryReportRequest$inboundSchema.parse(JSON.parse(x)),
235
- `Failed to parse 'QueryReportRequest' from JSON`,
236
- );
237
- }
@@ -1,96 +0,0 @@
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
- import { DataPoint, DataPoint$inboundSchema } from "./datapoint.js";
12
- import {
13
- QueryReportRequest,
14
- QueryReportRequest$inboundSchema,
15
- } from "./queryreportrequest.js";
16
- import { ResponseMeta, ResponseMeta$inboundSchema } from "./responsemeta.js";
17
- import { Totals, Totals$inboundSchema } from "./totals.js";
18
-
19
- /**
20
- * Object discriminator for typed SDKs and JSON parsers; always `report`.
21
- */
22
- export const ObjectT = {
23
- Report: "report",
24
- } as const;
25
- /**
26
- * Object discriminator for typed SDKs and JSON parsers; always `report`.
27
- */
28
- export type ObjectT = ClosedEnum<typeof ObjectT>;
29
-
30
- export type QueryReportResponse = {
31
- /**
32
- * Object discriminator for typed SDKs and JSON parsers; always `report`.
33
- */
34
- object?: ObjectT | undefined;
35
- /**
36
- * The request that produced this response, parroted back so caller
37
- *
38
- * @remarks
39
- * code never has to remember its own payload to interpret the result.
40
- */
41
- request?: QueryReportRequest | undefined;
42
- /**
43
- * Time-ordered buckets.
44
- */
45
- data?: Array<DataPoint> | undefined;
46
- /**
47
- * Totals across the whole window. Present only when
48
- *
49
- * @remarks
50
- * `include_totals=true` on the request.
51
- */
52
- totals?: Totals | undefined;
53
- /**
54
- * Pagination contract. Always populated; currently false because the
55
- *
56
- * @remarks
57
- * server caps the response at `limit` instead of issuing cursors.
58
- */
59
- hasMore?: boolean | undefined;
60
- /**
61
- * Diagnostic metadata.
62
- */
63
- meta?: ResponseMeta | undefined;
64
- };
65
-
66
- /** @internal */
67
- export const ObjectT$inboundSchema: z.ZodNativeEnum<typeof ObjectT> = z
68
- .nativeEnum(ObjectT);
69
-
70
- /** @internal */
71
- export const QueryReportResponse$inboundSchema: z.ZodType<
72
- QueryReportResponse,
73
- z.ZodTypeDef,
74
- unknown
75
- > = z.object({
76
- object: ObjectT$inboundSchema.optional(),
77
- request: QueryReportRequest$inboundSchema.optional(),
78
- data: z.array(DataPoint$inboundSchema).optional(),
79
- totals: Totals$inboundSchema.optional(),
80
- has_more: z.boolean().optional(),
81
- meta: ResponseMeta$inboundSchema.optional(),
82
- }).transform((v) => {
83
- return remap$(v, {
84
- "has_more": "hasMore",
85
- });
86
- });
87
-
88
- export function queryReportResponseFromJSON(
89
- jsonString: string,
90
- ): SafeParseResult<QueryReportResponse, SDKValidationError> {
91
- return safeParse(
92
- jsonString,
93
- (x) => QueryReportResponse$inboundSchema.parse(JSON.parse(x)),
94
- `Failed to parse 'QueryReportResponse' from JSON`,
95
- );
96
- }
@@ -1,103 +0,0 @@
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
- * Bucket grain actually applied by the planner.
14
- */
15
- export const EffectiveGrain = {
16
- Minute: "minute",
17
- Hour: "hour",
18
- Day: "day",
19
- } as const;
20
- /**
21
- * Bucket grain actually applied by the planner.
22
- */
23
- export type EffectiveGrain = ClosedEnum<typeof EffectiveGrain>;
24
-
25
- /**
26
- * ISO 4217 currency code for cost fields. Always `USD` today.
27
- */
28
- export const ResponseMetaCurrency = {
29
- Usd: "USD",
30
- } as const;
31
- /**
32
- * ISO 4217 currency code for cost fields. Always `USD` today.
33
- */
34
- export type ResponseMetaCurrency = ClosedEnum<typeof ResponseMetaCurrency>;
35
-
36
- export type ResponseMeta = {
37
- /**
38
- * Bucket grain actually applied by the planner.
39
- */
40
- effectiveGrain?: EffectiveGrain | undefined;
41
- /**
42
- * Number of rows in `data`. Cheap hint for clients that paginate
43
- *
44
- * @remarks
45
- * client-side; mirrors `len(data)`.
46
- */
47
- rowCount?: number | undefined;
48
- /**
49
- * Stable identifier for this query. Forward in support tickets so
50
- *
51
- * @remarks
52
- * server logs can be correlated. Also returned in the
53
- * `X-Request-Id` response header.
54
- */
55
- requestId?: string | undefined;
56
- /**
57
- * ISO 4217 currency code for cost fields. Always `USD` today.
58
- */
59
- currency?: ResponseMetaCurrency | undefined;
60
- /**
61
- * Non-fatal warnings about the response. May contain `totals_unavailable` when totals were requested but failed.
62
- */
63
- warnings?: Array<string> | undefined;
64
- };
65
-
66
- /** @internal */
67
- export const EffectiveGrain$inboundSchema: z.ZodNativeEnum<
68
- typeof EffectiveGrain
69
- > = z.nativeEnum(EffectiveGrain);
70
-
71
- /** @internal */
72
- export const ResponseMetaCurrency$inboundSchema: z.ZodNativeEnum<
73
- typeof ResponseMetaCurrency
74
- > = z.nativeEnum(ResponseMetaCurrency);
75
-
76
- /** @internal */
77
- export const ResponseMeta$inboundSchema: z.ZodType<
78
- ResponseMeta,
79
- z.ZodTypeDef,
80
- unknown
81
- > = z.object({
82
- effective_grain: EffectiveGrain$inboundSchema.optional(),
83
- row_count: z.number().int().optional(),
84
- request_id: z.string().optional(),
85
- currency: ResponseMetaCurrency$inboundSchema.optional(),
86
- warnings: z.array(z.string()).optional(),
87
- }).transform((v) => {
88
- return remap$(v, {
89
- "effective_grain": "effectiveGrain",
90
- "row_count": "rowCount",
91
- "request_id": "requestId",
92
- });
93
- });
94
-
95
- export function responseMetaFromJSON(
96
- jsonString: string,
97
- ): SafeParseResult<ResponseMeta, SDKValidationError> {
98
- return safeParse(
99
- jsonString,
100
- (x) => ResponseMeta$inboundSchema.parse(JSON.parse(x)),
101
- `Failed to parse 'ResponseMeta' from JSON`,
102
- );
103
- }
@@ -1,32 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../../types/fp.js";
8
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
- import { Identity, Identity$inboundSchema } from "./identity.js";
10
-
11
- export type RetrieveIdentityResponse = {
12
- identity?: Identity | undefined;
13
- };
14
-
15
- /** @internal */
16
- export const RetrieveIdentityResponse$inboundSchema: z.ZodType<
17
- RetrieveIdentityResponse,
18
- z.ZodTypeDef,
19
- unknown
20
- > = z.object({
21
- identity: Identity$inboundSchema.optional(),
22
- });
23
-
24
- export function retrieveIdentityResponseFromJSON(
25
- jsonString: string,
26
- ): SafeParseResult<RetrieveIdentityResponse, SDKValidationError> {
27
- return safeParse(
28
- jsonString,
29
- (x) => RetrieveIdentityResponse$inboundSchema.parse(JSON.parse(x)),
30
- `Failed to parse 'RetrieveIdentityResponse' from JSON`,
31
- );
32
- }
@@ -1,34 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../../types/fp.js";
8
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
-
10
- export type Totals = {
11
- /**
12
- * Same shape and rules as `DataPoint.metrics`, aggregated across the
13
- *
14
- * @remarks
15
- * whole window.
16
- */
17
- metrics?: { [k: string]: number } | undefined;
18
- };
19
-
20
- /** @internal */
21
- export const Totals$inboundSchema: z.ZodType<Totals, z.ZodTypeDef, unknown> = z
22
- .object({
23
- metrics: z.record(z.number()).optional(),
24
- });
25
-
26
- export function totalsFromJSON(
27
- jsonString: string,
28
- ): SafeParseResult<Totals, SDKValidationError> {
29
- return safeParse(
30
- jsonString,
31
- (x) => Totals$inboundSchema.parse(JSON.parse(x)),
32
- `Failed to parse 'Totals' from JSON`,
33
- );
34
- }
@@ -1,75 +0,0 @@
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
-
8
- export type UpdateIdentityRequestMetadata = {};
9
-
10
- export type UpdateIdentityRequest = {
11
- id?: string | undefined;
12
- displayName?: string | undefined;
13
- email?: string | undefined;
14
- avatarUrl?: string | undefined;
15
- tags?: Array<string> | undefined;
16
- metadata?: UpdateIdentityRequestMetadata | undefined;
17
- };
18
-
19
- /** @internal */
20
- export type UpdateIdentityRequestMetadata$Outbound = {};
21
-
22
- /** @internal */
23
- export const UpdateIdentityRequestMetadata$outboundSchema: z.ZodType<
24
- UpdateIdentityRequestMetadata$Outbound,
25
- z.ZodTypeDef,
26
- UpdateIdentityRequestMetadata
27
- > = z.object({});
28
-
29
- export function updateIdentityRequestMetadataToJSON(
30
- updateIdentityRequestMetadata: UpdateIdentityRequestMetadata,
31
- ): string {
32
- return JSON.stringify(
33
- UpdateIdentityRequestMetadata$outboundSchema.parse(
34
- updateIdentityRequestMetadata,
35
- ),
36
- );
37
- }
38
-
39
- /** @internal */
40
- export type UpdateIdentityRequest$Outbound = {
41
- id?: string | undefined;
42
- display_name?: string | undefined;
43
- email?: string | undefined;
44
- avatar_url?: string | undefined;
45
- tags?: Array<string> | undefined;
46
- metadata?: UpdateIdentityRequestMetadata$Outbound | undefined;
47
- };
48
-
49
- /** @internal */
50
- export const UpdateIdentityRequest$outboundSchema: z.ZodType<
51
- UpdateIdentityRequest$Outbound,
52
- z.ZodTypeDef,
53
- UpdateIdentityRequest
54
- > = z.object({
55
- id: z.string().optional(),
56
- displayName: z.string().optional(),
57
- email: z.string().optional(),
58
- avatarUrl: z.string().optional(),
59
- tags: z.array(z.string()).optional(),
60
- metadata: z.lazy(() => UpdateIdentityRequestMetadata$outboundSchema)
61
- .optional(),
62
- }).transform((v) => {
63
- return remap$(v, {
64
- displayName: "display_name",
65
- avatarUrl: "avatar_url",
66
- });
67
- });
68
-
69
- export function updateIdentityRequestToJSON(
70
- updateIdentityRequest: UpdateIdentityRequest,
71
- ): string {
72
- return JSON.stringify(
73
- UpdateIdentityRequest$outboundSchema.parse(updateIdentityRequest),
74
- );
75
- }
@@ -1,32 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { safeParse } from "../../lib/schemas.js";
7
- import { Result as SafeParseResult } from "../../types/fp.js";
8
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
- import { Identity, Identity$inboundSchema } from "./identity.js";
10
-
11
- export type UpdateIdentityResponse = {
12
- identity?: Identity | undefined;
13
- };
14
-
15
- /** @internal */
16
- export const UpdateIdentityResponse$inboundSchema: z.ZodType<
17
- UpdateIdentityResponse,
18
- z.ZodTypeDef,
19
- unknown
20
- > = z.object({
21
- identity: Identity$inboundSchema.optional(),
22
- });
23
-
24
- export function updateIdentityResponseFromJSON(
25
- jsonString: string,
26
- ): SafeParseResult<UpdateIdentityResponse, SDKValidationError> {
27
- return safeParse(
28
- jsonString,
29
- (x) => UpdateIdentityResponse$inboundSchema.parse(JSON.parse(x)),
30
- `Failed to parse 'UpdateIdentityResponse' from JSON`,
31
- );
32
- }
@@ -1,27 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { reportingQuery } from "../funcs/reportingQuery.js";
6
- import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
- import * as components from "../models/components/index.js";
8
- import { unwrapAsync } from "../types/fp.js";
9
-
10
- export class Reporting extends ClientSDK {
11
- /**
12
- * Query reporting metrics
13
- *
14
- * @remarks
15
- * Returns time-series analytics for AI usage, cost, latency, evaluator results, and guardrail outcomes. Select a metric and time range, break results down by supported dimensions, apply filters, and optionally include totals for the full range.
16
- */
17
- async query(
18
- request: components.QueryReportRequest,
19
- options?: RequestOptions,
20
- ): Promise<components.QueryReportResponse> {
21
- return unwrapAsync(reportingQuery(
22
- this,
23
- request,
24
- options,
25
- ));
26
- }
27
- }