@orq-ai/node 4.11.7 → 4.11.9

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 (145) hide show
  1. package/jsr.json +1 -1
  2. package/lib/config.d.ts +3 -3
  3. package/lib/config.js +3 -3
  4. package/models/components/evaluatorresponsefunction.js +2 -2
  5. package/models/components/evaluatorresponsehttp.js +2 -2
  6. package/models/components/evaluatorresponsejsonschema.js +2 -2
  7. package/models/components/evaluatorresponsellm.js +2 -2
  8. package/models/components/evaluatorresponsepython.js +2 -2
  9. package/models/components/evaluatorresponseragas.js +2 -2
  10. package/models/components/evaluatorresponsetypescript.js +2 -2
  11. package/models/components/reasoningpart.js +1 -1
  12. package/models/operations/createdataset.js +1 -1
  13. package/models/operations/createdatasetitem.js +4 -4
  14. package/models/operations/createdatasource.js +1 -1
  15. package/models/operations/createtool.js +6 -6
  16. package/models/operations/getalltools.js +6 -6
  17. package/models/operations/getv2humanevalsets.js +2 -2
  18. package/models/operations/getv2humanevalsetsid.js +2 -2
  19. package/models/operations/listdatasetdatapoints.js +4 -4
  20. package/models/operations/listdatasets.js +1 -1
  21. package/models/operations/listdatasources.js +1 -1
  22. package/models/operations/patchv2humanevalsetsid.js +2 -2
  23. package/models/operations/postv2feedbackevaluation.js +3 -3
  24. package/models/operations/postv2humanevalsets.js +2 -2
  25. package/models/operations/retrievedatapoint.js +4 -4
  26. package/models/operations/retrievedataset.js +1 -1
  27. package/models/operations/retrievedatasource.js +1 -1
  28. package/models/operations/retrievetool.js +6 -6
  29. package/models/operations/runagent.js +1 -1
  30. package/models/operations/streamrunagent.js +1 -1
  31. package/models/operations/updatedatapoint.js +4 -4
  32. package/models/operations/updatedataset.js +1 -1
  33. package/models/operations/updatedatasource.js +1 -1
  34. package/models/operations/updatetool.js +7 -7
  35. package/package.json +6 -6
  36. package/packages/orq-rc/src/funcs/notifiersList.ts +2 -0
  37. package/packages/orq-rc/src/funcs/reportingQuery.ts +3 -1
  38. package/packages/orq-rc/src/funcs/telemetryQuery.ts +162 -0
  39. package/packages/orq-rc/src/funcs/tracesAggregate.ts +3 -1
  40. package/packages/orq-rc/src/lib/config.ts +3 -3
  41. package/packages/orq-rc/src/models/components/apikey.ts +6 -0
  42. package/packages/orq-rc/src/models/components/budget.ts +6 -0
  43. package/packages/orq-rc/src/models/components/budgetalert.ts +92 -0
  44. package/packages/orq-rc/src/models/components/budgetalertdimension.ts +22 -0
  45. package/packages/orq-rc/src/models/components/createbudgetrequest.ts +14 -0
  46. package/packages/orq-rc/src/models/components/evaluatorresponsefunction.ts +2 -2
  47. package/packages/orq-rc/src/models/components/evaluatorresponsehttp.ts +2 -2
  48. package/packages/orq-rc/src/models/components/evaluatorresponsejsonschema.ts +2 -2
  49. package/packages/orq-rc/src/models/components/evaluatorresponsellm.ts +2 -2
  50. package/packages/orq-rc/src/models/components/evaluatorresponsepython.ts +2 -2
  51. package/packages/orq-rc/src/models/components/evaluatorresponseragas.ts +2 -2
  52. package/packages/orq-rc/src/models/components/evaluatorresponsetypescript.ts +2 -2
  53. package/packages/orq-rc/src/models/components/identity.ts +6 -0
  54. package/packages/orq-rc/src/models/components/index.ts +6 -0
  55. package/packages/orq-rc/src/models/components/modelsconfig.ts +1 -0
  56. package/packages/orq-rc/src/models/components/querytelemetrymeta.ts +38 -0
  57. package/packages/orq-rc/src/models/components/querytelemetryrequest.ts +85 -0
  58. package/packages/orq-rc/src/models/components/querytelemetryresponse.ts +42 -0
  59. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  60. package/packages/orq-rc/src/models/components/telemetryrow.ts +42 -0
  61. package/packages/orq-rc/src/models/components/thinkingconfigenabledschema.ts +1 -0
  62. package/packages/orq-rc/src/models/components/updatebudgetrequest.ts +21 -0
  63. package/packages/orq-rc/src/models/operations/createagentrequest.ts +4 -0
  64. package/packages/orq-rc/src/models/operations/createchatcompletion.ts +1 -0
  65. package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
  66. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +237 -19
  67. package/packages/orq-rc/src/models/operations/createdatasource.ts +1 -1
  68. package/packages/orq-rc/src/models/operations/createprompt.ts +4 -0
  69. package/packages/orq-rc/src/models/operations/createrouterresponse.ts +19 -26
  70. package/packages/orq-rc/src/models/operations/createtool.ts +6 -6
  71. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +1 -0
  72. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +1 -0
  73. package/packages/orq-rc/src/models/operations/deployments.ts +2 -0
  74. package/packages/orq-rc/src/models/operations/deploymentstream.ts +1 -0
  75. package/packages/orq-rc/src/models/operations/getallprompts.ts +3 -0
  76. package/packages/orq-rc/src/models/operations/getalltools.ts +6 -6
  77. package/packages/orq-rc/src/models/operations/getoneprompt.ts +3 -0
  78. package/packages/orq-rc/src/models/operations/getpromptversion.ts +3 -0
  79. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  80. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  81. package/packages/orq-rc/src/models/operations/listagents.ts +2 -0
  82. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +313 -84
  83. package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
  84. package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
  85. package/packages/orq-rc/src/models/operations/listpromptversions.ts +3 -0
  86. package/packages/orq-rc/src/models/operations/notifierlist.ts +13 -0
  87. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  88. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +119 -11
  89. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  90. package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +2 -0
  91. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +234 -9
  92. package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
  93. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
  94. package/packages/orq-rc/src/models/operations/retrievetool.ts +6 -6
  95. package/packages/orq-rc/src/models/operations/runagent.ts +3 -1
  96. package/packages/orq-rc/src/models/operations/streamrunagent.ts +3 -1
  97. package/packages/orq-rc/src/models/operations/updateagent.ts +4 -0
  98. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +229 -9
  99. package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
  100. package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
  101. package/packages/orq-rc/src/models/operations/updateprompt.ts +4 -0
  102. package/packages/orq-rc/src/models/operations/updatetool.ts +7 -7
  103. package/packages/orq-rc/src/sdk/feedback.ts +6 -0
  104. package/packages/orq-rc/src/sdk/humanreviewsets.ts +4 -1
  105. package/packages/orq-rc/src/sdk/reporting.ts +3 -1
  106. package/packages/orq-rc/src/sdk/sdk.ts +6 -0
  107. package/packages/orq-rc/src/sdk/telemetry.ts +27 -0
  108. package/packages/orq-rc/src/sdk/traces.ts +3 -1
  109. package/sdk/feedback.d.ts +4 -1
  110. package/sdk/feedback.d.ts.map +1 -1
  111. package/sdk/feedback.js +4 -1
  112. package/sdk/feedback.js.map +1 -1
  113. package/src/lib/config.ts +3 -3
  114. package/src/models/components/evaluatorresponsefunction.ts +2 -2
  115. package/src/models/components/evaluatorresponsehttp.ts +2 -2
  116. package/src/models/components/evaluatorresponsejsonschema.ts +2 -2
  117. package/src/models/components/evaluatorresponsellm.ts +2 -2
  118. package/src/models/components/evaluatorresponsepython.ts +2 -2
  119. package/src/models/components/evaluatorresponseragas.ts +2 -2
  120. package/src/models/components/evaluatorresponsetypescript.ts +2 -2
  121. package/src/models/components/reasoningpart.ts +1 -1
  122. package/src/models/operations/createdataset.ts +1 -1
  123. package/src/models/operations/createdatasetitem.ts +4 -4
  124. package/src/models/operations/createdatasource.ts +1 -1
  125. package/src/models/operations/createtool.ts +6 -6
  126. package/src/models/operations/getalltools.ts +6 -6
  127. package/src/models/operations/getv2humanevalsets.ts +2 -2
  128. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  129. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  130. package/src/models/operations/listdatasets.ts +1 -1
  131. package/src/models/operations/listdatasources.ts +1 -1
  132. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  133. package/src/models/operations/postv2feedbackevaluation.ts +3 -3
  134. package/src/models/operations/postv2humanevalsets.ts +2 -2
  135. package/src/models/operations/retrievedatapoint.ts +4 -4
  136. package/src/models/operations/retrievedataset.ts +1 -1
  137. package/src/models/operations/retrievedatasource.ts +1 -1
  138. package/src/models/operations/retrievetool.ts +6 -6
  139. package/src/models/operations/runagent.ts +1 -1
  140. package/src/models/operations/streamrunagent.ts +1 -1
  141. package/src/models/operations/updatedatapoint.ts +4 -4
  142. package/src/models/operations/updatedataset.ts +1 -1
  143. package/src/models/operations/updatedatasource.ts +1 -1
  144. package/src/models/operations/updatetool.ts +7 -7
  145. package/src/sdk/feedback.ts +4 -1
@@ -95,7 +95,7 @@ exports.UpdateDatasetResponseBody$inboundSchema = z.object({
95
95
  updated_by_id: z.nullable(z.string()).optional(),
96
96
  created: z.string().datetime({ offset: true }).transform(v => new Date(v))
97
97
  .optional(),
98
- updated: z.string().datetime({ offset: true }).default("2026-07-10T06:22:08.083Z").transform(v => new Date(v)),
98
+ updated: z.string().datetime({ offset: true }).default("2026-07-16T11:44:16.687Z").transform(v => new Date(v)),
99
99
  }).transform((v) => {
100
100
  return (0, primitives_js_1.remap)(v, {
101
101
  "_id": "id",
@@ -80,7 +80,7 @@ function updateDatasourceRequestToJSON(updateDatasourceRequest) {
80
80
  exports.UpdateDatasourceStatus$inboundSchema = z.nativeEnum(exports.UpdateDatasourceStatus);
81
81
  /** @internal */
82
82
  exports.UpdateDatasourceResponseBody$inboundSchema = z.object({
83
- _id: z.string().default("01KX5B25PHCSY9Z6GNAVJMAXZE"),
83
+ _id: z.string().default("01KXNBWH8CAG0GBMDM0X6RJJX4"),
84
84
  display_name: z.string(),
85
85
  description: z.nullable(z.string()).optional(),
86
86
  status: exports.UpdateDatasourceStatus$inboundSchema,
@@ -371,7 +371,7 @@ function updateToolRequestBodyToolsSchemaToJSON(updateToolRequestBodyToolsSchema
371
371
  }
372
372
  /** @internal */
373
373
  exports.RequestBodyTools$outboundSchema = z.object({
374
- id: z.string().default("01KX5B25HDNEE2V9KV9GAAJ4A4"),
374
+ id: z.string().default("01KXNBWH4MBQ2EH5M0NA38CKT7"),
375
375
  name: z.string(),
376
376
  description: z.string().optional(),
377
377
  schema: z.lazy(() => exports.UpdateToolRequestBodyToolsSchema$outboundSchema),
@@ -666,7 +666,7 @@ function updateToolResponseBodyCodeToolFromJSON(jsonString) {
666
666
  }
667
667
  /** @internal */
668
668
  exports.UpdateToolResponseBodyCodeExecutionTool$inboundSchema = z.object({
669
- _id: z.string().default("tool_01KX5B25H2WXSJYAE5NV8FSEYJ"),
669
+ _id: z.string().default("tool_01KXNBWH4A805EJSBMBF3AA2G9"),
670
670
  path: z.string(),
671
671
  key: z.string(),
672
672
  display_name: z.string().optional(),
@@ -719,7 +719,7 @@ function updateToolResponseBodyToolsSchemaFromJSON(jsonString) {
719
719
  }
720
720
  /** @internal */
721
721
  exports.UpdateToolResponseBodyTools$inboundSchema = z.object({
722
- id: z.string().default("01KX5B25H1G2TW22S4K0CTVH3Z"),
722
+ id: z.string().default("01KXNBWH49AZCSCKRY6GV206K8"),
723
723
  name: z.string(),
724
724
  description: z.string().optional(),
725
725
  schema: z.lazy(() => exports.UpdateToolResponseBodyToolsSchema$inboundSchema),
@@ -749,7 +749,7 @@ function updateToolResponseBodyMcpFromJSON(jsonString) {
749
749
  }
750
750
  /** @internal */
751
751
  exports.UpdateToolResponseBodyMCPTool$inboundSchema = z.object({
752
- _id: z.string().default("tool_01KX5B25GZFFNZ5JZZQTY2SGZ7"),
752
+ _id: z.string().default("tool_01KXNBWH47R16NCJEM0TSGVJ7M"),
753
753
  path: z.string(),
754
754
  key: z.string(),
755
755
  display_name: z.string().optional(),
@@ -836,7 +836,7 @@ function updateToolResponseBodyHttpFromJSON(jsonString) {
836
836
  }
837
837
  /** @internal */
838
838
  exports.UpdateToolResponseBodyHTTPTool$inboundSchema = z.object({
839
- _id: z.string().default("tool_01KX5B25GW77K56N7YAYQRHFB9"),
839
+ _id: z.string().default("tool_01KXNBWH437ZHD6WBV4MCYC8TB"),
840
840
  path: z.string(),
841
841
  key: z.string(),
842
842
  display_name: z.string().optional(),
@@ -886,7 +886,7 @@ function updateToolResponseBodyJsonSchemaFromJSON(jsonString) {
886
886
  }
887
887
  /** @internal */
888
888
  exports.UpdateToolResponseBodyJSONSchemaTool$inboundSchema = z.object({
889
- _id: z.string().default("tool_01KX5B25GS2JX1GMFQPJ6301J2"),
889
+ _id: z.string().default("tool_01KXNBWH41VG87S789554E4Q39"),
890
890
  path: z.string(),
891
891
  key: z.string(),
892
892
  display_name: z.string().optional(),
@@ -940,7 +940,7 @@ function updateToolResponseBodyFunctionFromJSON(jsonString) {
940
940
  }
941
941
  /** @internal */
942
942
  exports.UpdateToolResponseBodyFunctionTool$inboundSchema = z.object({
943
- _id: z.string().default("tool_01KX5B25GR1J0G0YWVE6EFEN6D"),
943
+ _id: z.string().default("tool_01KXNBWH3Z1R2M0R4KJWEFQSZZ"),
944
944
  path: z.string(),
945
945
  key: z.string(),
946
946
  display_name: z.string().optional(),
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@orq-ai/node",
3
- "version": "4.11.7",
3
+ "version": "4.11.9",
4
4
  "author": "Orq",
5
5
  "exports": {
6
- ".": {
7
- "import": "./index.js",
8
- "require": "./index.js",
9
- "types": "./index.d.ts"
10
- },
11
6
  "./*": "./*",
12
7
  "./langchain": {
13
8
  "import": "./langchain/index.mjs",
14
9
  "require": "./langchain/index.js",
15
10
  "types": "./langchain/index.d.mts"
11
+ },
12
+ ".": {
13
+ "import": "./index.js",
14
+ "require": "./index.js",
15
+ "types": "./index.d.ts"
16
16
  }
17
17
  },
18
18
  "main": "./index.js",
@@ -94,7 +94,9 @@ async function $do(
94
94
  "ending_before": payload?.ending_before,
95
95
  "limit": payload?.limit,
96
96
  "project_id": payload?.project_id,
97
+ "search": payload?.search,
97
98
  "starting_after": payload?.starting_after,
99
+ "type": payload?.type,
98
100
  });
99
101
 
100
102
  const headers = new Headers(compactMap({
@@ -29,7 +29,9 @@ import { Result } from "../types/fp.js";
29
29
  * Query reporting metrics
30
30
  *
31
31
  * @remarks
32
- * 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.
32
+ * Deprecated: use TelemetryService.Query (POST /v2/telemetry/query) instead. 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.
33
+ *
34
+ * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
33
35
  */
34
36
  export function reportingQuery(
35
37
  client: OrqCore,
@@ -0,0 +1,162 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeJSON } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.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 { OrqError } from "../models/errors/orqerror.js";
23
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
24
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
25
+ import { APICall, APIPromise } from "../types/async.js";
26
+ import { Result } from "../types/fp.js";
27
+
28
+ /**
29
+ * Query telemetry
30
+ *
31
+ * @remarks
32
+ * Unified query envelope for traces, metrics, and logs. Selects a source, a compute list, and a time range, with optional grain, group-by, and filters; returns a time series or a single aggregate row per group.
33
+ */
34
+ export function telemetryQuery(
35
+ client: OrqCore,
36
+ request: components.QueryTelemetryRequest,
37
+ options?: RequestOptions,
38
+ ): APIPromise<
39
+ Result<
40
+ components.QueryTelemetryResponse,
41
+ | OrqError
42
+ | ResponseValidationError
43
+ | ConnectionError
44
+ | RequestAbortedError
45
+ | RequestTimeoutError
46
+ | InvalidRequestError
47
+ | UnexpectedClientError
48
+ | SDKValidationError
49
+ >
50
+ > {
51
+ return new APIPromise($do(
52
+ client,
53
+ request,
54
+ options,
55
+ ));
56
+ }
57
+
58
+ async function $do(
59
+ client: OrqCore,
60
+ request: components.QueryTelemetryRequest,
61
+ options?: RequestOptions,
62
+ ): Promise<
63
+ [
64
+ Result<
65
+ components.QueryTelemetryResponse,
66
+ | OrqError
67
+ | ResponseValidationError
68
+ | ConnectionError
69
+ | RequestAbortedError
70
+ | RequestTimeoutError
71
+ | InvalidRequestError
72
+ | UnexpectedClientError
73
+ | SDKValidationError
74
+ >,
75
+ APICall,
76
+ ]
77
+ > {
78
+ const parsed = safeParse(
79
+ request,
80
+ (value) => components.QueryTelemetryRequest$outboundSchema.parse(value),
81
+ "Input validation failed",
82
+ );
83
+ if (!parsed.ok) {
84
+ return [parsed, { status: "invalid" }];
85
+ }
86
+ const payload = parsed.value;
87
+ const body = encodeJSON("body", payload, { explode: true });
88
+
89
+ const path = pathToFunc("/v2/telemetry/query")();
90
+
91
+ const headers = new Headers(compactMap({
92
+ "Content-Type": "application/json",
93
+ Accept: "application/json",
94
+ }));
95
+
96
+ const secConfig = await extractSecurity(client._options.apiKey);
97
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
98
+ const requestSecurity = resolveGlobalSecurity(securityInput);
99
+
100
+ const context = {
101
+ options: client._options,
102
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
103
+ operationID: "TelemetryQuery",
104
+ oAuth2Scopes: null,
105
+
106
+ resolvedSecurity: requestSecurity,
107
+
108
+ securitySource: client._options.apiKey,
109
+ retryConfig: options?.retries
110
+ || client._options.retryConfig
111
+ || { strategy: "none" },
112
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
113
+ };
114
+
115
+ const requestRes = client._createRequest(context, {
116
+ security: requestSecurity,
117
+ method: "POST",
118
+ baseURL: options?.serverURL,
119
+ path: path,
120
+ headers: headers,
121
+ body: body,
122
+ userAgent: client._options.userAgent,
123
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
124
+ }, options);
125
+ if (!requestRes.ok) {
126
+ return [requestRes, { status: "invalid" }];
127
+ }
128
+ const req = requestRes.value;
129
+
130
+ const doResult = await client._do(req, {
131
+ context,
132
+ isErrorStatusCode: (statusCode: number) =>
133
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
134
+ retryConfig: context.retryConfig,
135
+ retryCodes: context.retryCodes,
136
+ });
137
+ if (!doResult.ok) {
138
+ return [doResult, { status: "request-error", request: req }];
139
+ }
140
+ const response = doResult.value;
141
+
142
+ const [result] = await M.match<
143
+ components.QueryTelemetryResponse,
144
+ | OrqError
145
+ | ResponseValidationError
146
+ | ConnectionError
147
+ | RequestAbortedError
148
+ | RequestTimeoutError
149
+ | InvalidRequestError
150
+ | UnexpectedClientError
151
+ | SDKValidationError
152
+ >(
153
+ M.json(200, components.QueryTelemetryResponse$inboundSchema),
154
+ M.fail("4XX"),
155
+ M.fail("5XX"),
156
+ )(response, req);
157
+ if (!result.ok) {
158
+ return [result, { status: "complete", request: req, response }];
159
+ }
160
+
161
+ return [result, { status: "complete", request: req, response }];
162
+ }
@@ -29,7 +29,9 @@ import { Result } from "../types/fp.js";
29
29
  * Aggregate traces
30
30
  *
31
31
  * @remarks
32
- * Aggregate trace metrics using the structured trace filter contract.
32
+ * Deprecated: use TelemetryService.Query (POST /v2/telemetry/query, source=TRACES, grain=none) instead. Aggregate trace metrics using the structured trace filter contract.
33
+ *
34
+ * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
33
35
  */
34
36
  export function tracesAggregate(
35
37
  client: OrqCore,
@@ -58,7 +58,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
58
58
  export const SDK_METADATA = {
59
59
  language: "typescript",
60
60
  openapiDocVersion: "2.0",
61
- sdkVersion: "4.12.0-rc.12",
62
- genVersion: "2.916.4",
63
- userAgent: "speakeasy-sdk/typescript 4.12.0-rc.12 2.916.4 2.0 @orq-ai/node",
61
+ sdkVersion: "4.12.0-rc.34",
62
+ genVersion: "2.918.3",
63
+ userAgent: "speakeasy-sdk/typescript 4.12.0-rc.34 2.918.3 2.0 @orq-ai/node",
64
64
  } as const;
@@ -9,6 +9,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
10
  import { ApiKeyOwner, ApiKeyOwner$inboundSchema } from "./apikeyowner.js";
11
11
  import { ApiKeyStatus, ApiKeyStatus$inboundSchema } from "./apikeystatus.js";
12
+ import { BudgetAlert, BudgetAlert$inboundSchema } from "./budgetalert.js";
12
13
  import { BudgetLimits, BudgetLimits$inboundSchema } from "./budgetlimits.js";
13
14
  import { BudgetMatch, BudgetMatch$inboundSchema } from "./budgetmatch.js";
14
15
  import { BudgetScope, BudgetScope$inboundSchema } from "./budgetscope.js";
@@ -84,6 +85,10 @@ export type ApiKeyBudget = {
84
85
  * has not been spent against in the current period.
85
86
  */
86
87
  usage?: BudgetUsage | undefined;
88
+ /**
89
+ * Threshold notifications. Absent when the budget has none.
90
+ */
91
+ alerts?: Array<BudgetAlert> | undefined;
87
92
  };
88
93
 
89
94
  /**
@@ -210,6 +215,7 @@ export const ApiKeyBudget$inboundSchema: z.ZodType<
210
215
  updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
211
216
  .optional(),
212
217
  usage: BudgetUsage$inboundSchema.optional(),
218
+ alerts: z.array(BudgetAlert$inboundSchema).optional(),
213
219
  }).transform((v) => {
214
220
  return remap$(v, {
215
221
  "budget_id": "budgetId",
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import { BudgetAlert, BudgetAlert$inboundSchema } from "./budgetalert.js";
10
11
  import { BudgetLimits, BudgetLimits$inboundSchema } from "./budgetlimits.js";
11
12
  import { BudgetMatch, BudgetMatch$inboundSchema } from "./budgetmatch.js";
12
13
  import { BudgetScope, BudgetScope$inboundSchema } from "./budgetscope.js";
@@ -71,6 +72,10 @@ export type Budget = {
71
72
  * has not been spent against in the current period.
72
73
  */
73
74
  usage?: BudgetUsage | undefined;
75
+ /**
76
+ * Threshold notifications. Absent when the budget has none.
77
+ */
78
+ alerts?: Array<BudgetAlert> | undefined;
74
79
  };
75
80
 
76
81
  /** @internal */
@@ -92,6 +97,7 @@ export const Budget$inboundSchema: z.ZodType<Budget, z.ZodTypeDef, unknown> = z
92
97
  new Date(v)
93
98
  ).optional(),
94
99
  usage: BudgetUsage$inboundSchema.optional(),
100
+ alerts: z.array(BudgetAlert$inboundSchema).optional(),
95
101
  }).transform((v) => {
96
102
  return remap$(v, {
97
103
  "budget_id": "budgetId",
@@ -0,0 +1,92 @@
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
+ BudgetAlertDimension,
12
+ BudgetAlertDimension$inboundSchema,
13
+ BudgetAlertDimension$outboundSchema,
14
+ } from "./budgetalertdimension.js";
15
+
16
+ /**
17
+ * Notifies every listed notifier once current-period consumption on
18
+ *
19
+ * @remarks
20
+ * `dimension` reaches `threshold_percent` of the matching limit. Each alert
21
+ * fires at most once per period, re-arming on rollover or a limit change.
22
+ * The dimension must have a limit set, or the write is rejected.
23
+ */
24
+ export type BudgetAlert = {
25
+ /**
26
+ * Assigned by ORQ. Supply an existing id to edit that alert in place.
27
+ */
28
+ id?: string | undefined;
29
+ /**
30
+ * Percentage of the dimension's limit at which the alert fires, 1–100.
31
+ */
32
+ thresholdPercent: number;
33
+ /**
34
+ * Must be workspace-scoped; project-scoped notifiers are rejected.
35
+ */
36
+ notifierIds: Array<string>;
37
+ dimension?: BudgetAlertDimension | undefined;
38
+ };
39
+
40
+ /** @internal */
41
+ export const BudgetAlert$inboundSchema: z.ZodType<
42
+ BudgetAlert,
43
+ z.ZodTypeDef,
44
+ unknown
45
+ > = z.object({
46
+ id: z.string().optional(),
47
+ threshold_percent: z.number().int(),
48
+ notifier_ids: z.array(z.string()),
49
+ dimension: BudgetAlertDimension$inboundSchema.optional(),
50
+ }).transform((v) => {
51
+ return remap$(v, {
52
+ "threshold_percent": "thresholdPercent",
53
+ "notifier_ids": "notifierIds",
54
+ });
55
+ });
56
+ /** @internal */
57
+ export type BudgetAlert$Outbound = {
58
+ id?: string | undefined;
59
+ threshold_percent: number;
60
+ notifier_ids: Array<string>;
61
+ dimension?: string | undefined;
62
+ };
63
+
64
+ /** @internal */
65
+ export const BudgetAlert$outboundSchema: z.ZodType<
66
+ BudgetAlert$Outbound,
67
+ z.ZodTypeDef,
68
+ BudgetAlert
69
+ > = z.object({
70
+ id: z.string().optional(),
71
+ thresholdPercent: z.number().int(),
72
+ notifierIds: z.array(z.string()),
73
+ dimension: BudgetAlertDimension$outboundSchema.optional(),
74
+ }).transform((v) => {
75
+ return remap$(v, {
76
+ thresholdPercent: "threshold_percent",
77
+ notifierIds: "notifier_ids",
78
+ });
79
+ });
80
+
81
+ export function budgetAlertToJSON(budgetAlert: BudgetAlert): string {
82
+ return JSON.stringify(BudgetAlert$outboundSchema.parse(budgetAlert));
83
+ }
84
+ export function budgetAlertFromJSON(
85
+ jsonString: string,
86
+ ): SafeParseResult<BudgetAlert, SDKValidationError> {
87
+ return safeParse(
88
+ jsonString,
89
+ (x) => BudgetAlert$inboundSchema.parse(JSON.parse(x)),
90
+ `Failed to parse 'BudgetAlert' from JSON`,
91
+ );
92
+ }
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ export const BudgetAlertDimension = {
9
+ BudgetAlertDimensionUnspecified: "BUDGET_ALERT_DIMENSION_UNSPECIFIED",
10
+ BudgetAlertDimensionCost: "BUDGET_ALERT_DIMENSION_COST",
11
+ BudgetAlertDimensionTokens: "BUDGET_ALERT_DIMENSION_TOKENS",
12
+ } as const;
13
+ export type BudgetAlertDimension = ClosedEnum<typeof BudgetAlertDimension>;
14
+
15
+ /** @internal */
16
+ export const BudgetAlertDimension$inboundSchema: z.ZodNativeEnum<
17
+ typeof BudgetAlertDimension
18
+ > = z.nativeEnum(BudgetAlertDimension);
19
+ /** @internal */
20
+ export const BudgetAlertDimension$outboundSchema: z.ZodNativeEnum<
21
+ typeof BudgetAlertDimension
22
+ > = BudgetAlertDimension$inboundSchema;
@@ -4,6 +4,11 @@
4
4
 
5
5
  import * as z from "zod/v3";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
+ import {
8
+ BudgetAlert,
9
+ BudgetAlert$Outbound,
10
+ BudgetAlert$outboundSchema,
11
+ } from "./budgetalert.js";
7
12
  import {
8
13
  BudgetLimits,
9
14
  BudgetLimits$Outbound,
@@ -68,6 +73,13 @@ export type CreateBudgetRequest = {
68
73
  * the value MUST be in the future; the handler rejects past values.
69
74
  */
70
75
  expiresAt?: Date | undefined;
76
+ /**
77
+ * Optional threshold notifications. Ids are assigned by the server, so
78
+ *
79
+ * @remarks
80
+ * `alerts[].id` must be omitted here; supplying one is rejected.
81
+ */
82
+ alerts?: Array<BudgetAlert> | undefined;
71
83
  };
72
84
 
73
85
  /** @internal */
@@ -78,6 +90,7 @@ export type CreateBudgetRequest$Outbound = {
78
90
  rate_limit?: RateLimit$Outbound | undefined;
79
91
  is_active?: boolean | undefined;
80
92
  expires_at?: string | undefined;
93
+ alerts?: Array<BudgetAlert$Outbound> | undefined;
81
94
  };
82
95
 
83
96
  /** @internal */
@@ -92,6 +105,7 @@ export const CreateBudgetRequest$outboundSchema: z.ZodType<
92
105
  rateLimit: RateLimit$outboundSchema.optional(),
93
106
  isActive: z.boolean().optional(),
94
107
  expiresAt: z.date().transform(v => v.toISOString()).optional(),
108
+ alerts: z.array(BudgetAlert$outboundSchema).optional(),
95
109
  }).transform((v) => {
96
110
  return remap$(v, {
97
111
  rateLimit: "rate_limit",
@@ -856,8 +856,8 @@ export const EvaluatorResponseFunction$inboundSchema: z.ZodType<
856
856
  > = z.object({
857
857
  _id: z.string(),
858
858
  description: z.string(),
859
- created: z.string().default("2026-07-10T05:18:09.327Z"),
860
- updated: z.string().default("2026-07-10T05:18:09.327Z"),
859
+ created: z.string().default("2026-07-16T11:02:25.452Z"),
860
+ updated: z.string().default("2026-07-16T11:02:25.452Z"),
861
861
  updated_by_id: z.nullable(z.string()).optional(),
862
862
  guardrail_config: z.any().optional(),
863
863
  type: z.literal("function_eval"),
@@ -42,8 +42,8 @@ export const EvaluatorResponseHttp$inboundSchema: z.ZodType<
42
42
  > = z.object({
43
43
  _id: z.string(),
44
44
  description: z.string(),
45
- created: z.string().default("2026-07-10T05:18:09.327Z"),
46
- updated: z.string().default("2026-07-10T05:18:09.327Z"),
45
+ created: z.string().default("2026-07-16T11:02:25.452Z"),
46
+ updated: z.string().default("2026-07-16T11:02:25.452Z"),
47
47
  updated_by_id: z.nullable(z.string()).optional(),
48
48
  guardrail_config: z.any().optional(),
49
49
  type: z.literal("http_eval"),
@@ -28,8 +28,8 @@ export const EvaluatorResponseJsonSchema$inboundSchema: z.ZodType<
28
28
  > = z.object({
29
29
  _id: z.string(),
30
30
  description: z.string(),
31
- created: z.string().default("2026-07-10T05:18:09.327Z"),
32
- updated: z.string().default("2026-07-10T05:18:09.327Z"),
31
+ created: z.string().default("2026-07-16T11:02:25.452Z"),
32
+ updated: z.string().default("2026-07-16T11:02:25.452Z"),
33
33
  updated_by_id: z.nullable(z.string()).optional(),
34
34
  guardrail_config: z.any().optional(),
35
35
  type: z.literal("json_schema"),
@@ -267,8 +267,8 @@ export const EvaluatorResponseLlm$inboundSchema: z.ZodType<
267
267
  > = z.object({
268
268
  _id: z.string(),
269
269
  description: z.string(),
270
- created: z.string().default("2026-07-10T05:18:09.327Z"),
271
- updated: z.string().default("2026-07-10T05:18:09.327Z"),
270
+ created: z.string().default("2026-07-16T11:02:25.452Z"),
271
+ updated: z.string().default("2026-07-16T11:02:25.452Z"),
272
272
  updated_by_id: z.nullable(z.string()).optional(),
273
273
  guardrail_config: z.any().optional(),
274
274
  type: z.literal("llm_eval"),
@@ -28,8 +28,8 @@ export const EvaluatorResponsePython$inboundSchema: z.ZodType<
28
28
  > = z.object({
29
29
  _id: z.string(),
30
30
  description: z.string(),
31
- created: z.string().default("2026-07-10T05:18:09.327Z"),
32
- updated: z.string().default("2026-07-10T05:18:09.327Z"),
31
+ created: z.string().default("2026-07-16T11:02:25.452Z"),
32
+ updated: z.string().default("2026-07-16T11:02:25.452Z"),
33
33
  updated_by_id: z.nullable(z.string()).optional(),
34
34
  guardrail_config: z.any().optional(),
35
35
  code: z.string(),
@@ -50,8 +50,8 @@ export const EvaluatorResponseRagas$inboundSchema: z.ZodType<
50
50
  > = z.object({
51
51
  _id: z.string(),
52
52
  description: z.string(),
53
- created: z.string().default("2026-07-10T05:18:09.327Z"),
54
- updated: z.string().default("2026-07-10T05:18:09.327Z"),
53
+ created: z.string().default("2026-07-16T11:02:25.452Z"),
54
+ updated: z.string().default("2026-07-16T11:02:25.452Z"),
55
55
  updated_by_id: z.nullable(z.string()).optional(),
56
56
  guardrail_config: z.any().optional(),
57
57
  type: z.literal("ragas"),
@@ -28,8 +28,8 @@ export const EvaluatorResponseTypescript$inboundSchema: z.ZodType<
28
28
  > = z.object({
29
29
  _id: z.string(),
30
30
  description: z.string(),
31
- created: z.string().default("2026-07-10T05:18:09.327Z"),
32
- updated: z.string().default("2026-07-10T05:18:09.327Z"),
31
+ created: z.string().default("2026-07-16T11:02:25.452Z"),
32
+ updated: z.string().default("2026-07-16T11:02:25.452Z"),
33
33
  updated_by_id: z.nullable(z.string()).optional(),
34
34
  guardrail_config: z.any().optional(),
35
35
  code: z.string(),
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import { BudgetAlert, BudgetAlert$inboundSchema } from "./budgetalert.js";
10
11
  import { BudgetLimits, BudgetLimits$inboundSchema } from "./budgetlimits.js";
11
12
  import { BudgetMatch, BudgetMatch$inboundSchema } from "./budgetmatch.js";
12
13
  import { BudgetScope, BudgetScope$inboundSchema } from "./budgetscope.js";
@@ -82,6 +83,10 @@ export type IdentityBudget = {
82
83
  * has not been spent against in the current period.
83
84
  */
84
85
  usage?: BudgetUsage | undefined;
86
+ /**
87
+ * Threshold notifications. Absent when the budget has none.
88
+ */
89
+ alerts?: Array<BudgetAlert> | undefined;
85
90
  };
86
91
 
87
92
  export type Identity = {
@@ -186,6 +191,7 @@ export const IdentityBudget$inboundSchema: z.ZodType<
186
191
  updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
187
192
  .optional(),
188
193
  usage: BudgetUsage$inboundSchema.optional(),
194
+ alerts: z.array(BudgetAlert$inboundSchema).optional(),
189
195
  }).transform((v) => {
190
196
  return remap$(v, {
191
197
  "budget_id": "budgetId",