@orq-ai/node 4.15.0-rc.6 → 4.15.0-rc.7

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 (228) hide show
  1. package/README.md +42 -28
  2. package/funcs/auditLogsQuery.d.ts +17 -0
  3. package/funcs/auditLogsQuery.d.ts.map +1 -0
  4. package/funcs/auditLogsQuery.js +115 -0
  5. package/funcs/auditLogsQuery.js.map +1 -0
  6. package/funcs/workspacesGet.d.ts +18 -0
  7. package/funcs/workspacesGet.d.ts.map +1 -0
  8. package/funcs/workspacesGet.js +121 -0
  9. package/funcs/workspacesGet.js.map +1 -0
  10. package/funcs/workspacesList.d.ts +18 -0
  11. package/funcs/workspacesList.d.ts.map +1 -0
  12. package/funcs/workspacesList.js +121 -0
  13. package/funcs/workspacesList.js.map +1 -0
  14. package/funcs/workspacesUpdate.d.ts +18 -0
  15. package/funcs/workspacesUpdate.d.ts.map +1 -0
  16. package/funcs/workspacesUpdate.js +124 -0
  17. package/funcs/workspacesUpdate.js.map +1 -0
  18. package/jsr.json +1 -1
  19. package/lib/config.d.ts +3 -3
  20. package/lib/config.js +3 -3
  21. package/lib/config.js.map +1 -1
  22. package/models/components/auditlog.d.ts +60 -0
  23. package/models/components/auditlog.d.ts.map +1 -0
  24. package/models/components/auditlog.js +83 -0
  25. package/models/components/auditlog.js.map +1 -0
  26. package/models/components/auditlogfilter.d.ts +33 -0
  27. package/models/components/auditlogfilter.d.ts.map +1 -0
  28. package/models/components/auditlogfilter.js +52 -0
  29. package/models/components/auditlogfilter.js.map +1 -0
  30. package/models/components/auditlogfilterquery.d.ts +29 -0
  31. package/models/components/auditlogfilterquery.d.ts.map +1 -0
  32. package/models/components/auditlogfilterquery.js +52 -0
  33. package/models/components/auditlogfilterquery.js.map +1 -0
  34. package/models/components/auditlogpagination.d.ts +28 -0
  35. package/models/components/auditlogpagination.d.ts.map +1 -0
  36. package/models/components/auditlogpagination.js +57 -0
  37. package/models/components/auditlogpagination.js.map +1 -0
  38. package/models/components/auditlogsort.d.ts +23 -0
  39. package/models/components/auditlogsort.d.ts.map +1 -0
  40. package/models/components/{policyprofileidlist.js → auditlogsort.js} +8 -7
  41. package/models/components/auditlogsort.js.map +1 -0
  42. package/models/components/budgetmatch.d.ts +1 -7
  43. package/models/components/budgetmatch.d.ts.map +1 -1
  44. package/models/components/budgetmatch.js.map +1 -1
  45. package/models/components/budgetscope.d.ts +1 -14
  46. package/models/components/budgetscope.d.ts.map +1 -1
  47. package/models/components/budgetscope.js +0 -3
  48. package/models/components/budgetscope.js.map +1 -1
  49. package/models/components/budgetscopekind.d.ts +0 -1
  50. package/models/components/budgetscopekind.d.ts.map +1 -1
  51. package/models/components/budgetscopekind.js +0 -1
  52. package/models/components/budgetscopekind.js.map +1 -1
  53. package/models/components/budgetscoperestresponse.d.ts +1 -13
  54. package/models/components/budgetscoperestresponse.d.ts.map +1 -1
  55. package/models/components/budgetscoperestresponse.js +0 -2
  56. package/models/components/budgetscoperestresponse.js.map +1 -1
  57. package/models/components/getworkspaceresponse.d.ts +11 -0
  58. package/models/components/getworkspaceresponse.d.ts.map +1 -0
  59. package/models/components/{factorybudgetscoperestresponse.js → getworkspaceresponse.js} +8 -7
  60. package/models/components/getworkspaceresponse.js.map +1 -0
  61. package/models/components/index.d.ts +16 -3
  62. package/models/components/index.d.ts.map +1 -1
  63. package/models/components/index.js +16 -3
  64. package/models/components/index.js.map +1 -1
  65. package/models/components/listworkspacesresponse.d.ts +13 -0
  66. package/models/components/listworkspacesresponse.d.ts.map +1 -0
  67. package/models/components/{factorybudgetscope.js → listworkspacesresponse.js} +11 -20
  68. package/models/components/listworkspacesresponse.js.map +1 -0
  69. package/models/components/queryauditlogsrequest.d.ts +31 -0
  70. package/models/components/queryauditlogsrequest.d.ts.map +1 -0
  71. package/models/components/queryauditlogsrequest.js +54 -0
  72. package/models/components/queryauditlogsrequest.js.map +1 -0
  73. package/models/components/queryauditlogsresponse.d.ts +25 -0
  74. package/models/components/queryauditlogsresponse.d.ts.map +1 -0
  75. package/models/components/queryauditlogsresponse.js +60 -0
  76. package/models/components/queryauditlogsresponse.js.map +1 -0
  77. package/models/components/reasoningpart.js +1 -1
  78. package/models/components/updateworkspacerequest.d.ts +29 -0
  79. package/models/components/updateworkspacerequest.d.ts.map +1 -0
  80. package/models/components/updateworkspacerequest.js +69 -0
  81. package/models/components/updateworkspacerequest.js.map +1 -0
  82. package/models/components/updateworkspaceresponse.d.ts +11 -0
  83. package/models/components/updateworkspaceresponse.d.ts.map +1 -0
  84. package/models/components/updateworkspaceresponse.js +51 -0
  85. package/models/components/updateworkspaceresponse.js.map +1 -0
  86. package/models/components/updateworkspacesettingsrequest.d.ts +0 -3
  87. package/models/components/updateworkspacesettingsrequest.d.ts.map +1 -1
  88. package/models/components/updateworkspacesettingsrequest.js +0 -3
  89. package/models/components/updateworkspacesettingsrequest.js.map +1 -1
  90. package/models/components/value.d.ts +13 -0
  91. package/models/components/value.d.ts.map +1 -0
  92. package/models/components/value.js +50 -0
  93. package/models/components/value.js.map +1 -0
  94. package/models/components/workspace.d.ts +33 -0
  95. package/models/components/workspace.d.ts.map +1 -0
  96. package/models/components/workspace.js +88 -0
  97. package/models/components/workspace.js.map +1 -0
  98. package/models/components/workspacecapabilities.d.ts +11 -0
  99. package/models/components/workspacecapabilities.d.ts.map +1 -0
  100. package/models/components/workspacecapabilities.js +51 -0
  101. package/models/components/workspacecapabilities.js.map +1 -0
  102. package/models/components/workspaceorganization.d.ts +11 -0
  103. package/models/components/workspaceorganization.d.ts.map +1 -0
  104. package/models/components/workspaceorganization.js +51 -0
  105. package/models/components/workspaceorganization.js.map +1 -0
  106. package/models/components/workspacesettings.d.ts +0 -1
  107. package/models/components/workspacesettings.d.ts.map +1 -1
  108. package/models/components/workspacesettings.js +0 -2
  109. package/models/components/workspacesettings.js.map +1 -1
  110. package/models/components/workspacesettingsfields.d.ts +39 -0
  111. package/models/components/workspacesettingsfields.d.ts.map +1 -0
  112. package/models/components/workspacesettingsfields.js +99 -0
  113. package/models/components/workspacesettingsfields.js.map +1 -0
  114. package/models/operations/createdataset.js +1 -1
  115. package/models/operations/createdatasetitem.js +5 -5
  116. package/models/operations/createtool.js +4 -4
  117. package/models/operations/getalltools.js +4 -4
  118. package/models/operations/getv2humanevalsets.js +2 -2
  119. package/models/operations/getv2humanevalsetsid.js +2 -2
  120. package/models/operations/index.d.ts +3 -0
  121. package/models/operations/index.d.ts.map +1 -1
  122. package/models/operations/index.js +3 -0
  123. package/models/operations/index.js.map +1 -1
  124. package/models/operations/listdatasetdatapoints.js +5 -5
  125. package/models/operations/listdatasets.js +1 -1
  126. package/models/operations/patchv2humanevalsetsid.js +2 -2
  127. package/models/operations/postv2feedbackevaluation.js +4 -4
  128. package/models/operations/postv2humanevalsets.js +2 -2
  129. package/models/operations/retrievedatapoint.js +5 -5
  130. package/models/operations/retrievedataset.js +1 -1
  131. package/models/operations/retrievetool.js +4 -4
  132. package/models/operations/runagent.js +1 -1
  133. package/models/operations/streamrunagent.js +1 -1
  134. package/models/operations/updatedatapoint.js +5 -5
  135. package/models/operations/updatedataset.js +1 -1
  136. package/models/operations/updatetool.js +4 -4
  137. package/models/operations/workspaceget.d.ts +12 -0
  138. package/models/operations/workspaceget.d.ts.map +1 -0
  139. package/models/operations/workspaceget.js +49 -0
  140. package/models/operations/workspaceget.js.map +1 -0
  141. package/models/operations/workspacelist.d.ts +16 -0
  142. package/models/operations/workspacelist.d.ts.map +1 -0
  143. package/models/operations/workspacelist.js +57 -0
  144. package/models/operations/workspacelist.js.map +1 -0
  145. package/models/operations/workspaceupdate.d.ts +15 -0
  146. package/models/operations/workspaceupdate.d.ts.map +1 -0
  147. package/models/operations/workspaceupdate.js +56 -0
  148. package/models/operations/workspaceupdate.js.map +1 -0
  149. package/package.json +1 -1
  150. package/sdk/auditlogs.d.ts +12 -0
  151. package/sdk/auditlogs.d.ts.map +1 -0
  152. package/sdk/auditlogs.js +22 -0
  153. package/sdk/auditlogs.js.map +1 -0
  154. package/sdk/sdk.d.ts +6 -0
  155. package/sdk/sdk.d.ts.map +1 -1
  156. package/sdk/sdk.js +8 -0
  157. package/sdk/sdk.js.map +1 -1
  158. package/sdk/workspaces.d.ts +27 -0
  159. package/sdk/workspaces.d.ts.map +1 -0
  160. package/sdk/workspaces.js +42 -0
  161. package/sdk/workspaces.js.map +1 -0
  162. package/src/funcs/auditLogsQuery.ts +162 -0
  163. package/src/funcs/workspacesGet.ts +168 -0
  164. package/src/funcs/workspacesList.ts +170 -0
  165. package/src/funcs/workspacesUpdate.ts +171 -0
  166. package/src/lib/config.ts +3 -3
  167. package/src/models/components/auditlog.ts +122 -0
  168. package/src/models/components/auditlogfilter.ts +51 -0
  169. package/src/models/components/auditlogfilterquery.ts +54 -0
  170. package/src/models/components/auditlogpagination.ts +55 -0
  171. package/src/models/components/auditlogsort.ts +39 -0
  172. package/src/models/components/budgetmatch.ts +1 -7
  173. package/src/models/components/budgetscope.ts +1 -21
  174. package/src/models/components/budgetscopekind.ts +0 -1
  175. package/src/models/components/budgetscoperestresponse.ts +1 -17
  176. package/src/models/components/getworkspaceresponse.ts +32 -0
  177. package/src/models/components/index.ts +16 -3
  178. package/src/models/components/listworkspacesresponse.ts +41 -0
  179. package/src/models/components/queryauditlogsrequest.ts +64 -0
  180. package/src/models/components/queryauditlogsresponse.ts +55 -0
  181. package/src/models/components/reasoningpart.ts +1 -1
  182. package/src/models/components/updateworkspacerequest.ts +81 -0
  183. package/src/models/components/updateworkspaceresponse.ts +32 -0
  184. package/src/models/components/updateworkspacesettingsrequest.ts +0 -9
  185. package/src/models/components/value.ts +20 -0
  186. package/src/models/components/workspace.ts +116 -0
  187. package/src/models/components/workspacecapabilities.ts +33 -0
  188. package/src/models/components/workspaceorganization.ts +33 -0
  189. package/src/models/components/workspacesettings.ts +0 -3
  190. package/src/models/components/workspacesettingsfields.ts +135 -0
  191. package/src/models/operations/createdataset.ts +1 -1
  192. package/src/models/operations/createdatasetitem.ts +5 -5
  193. package/src/models/operations/createtool.ts +4 -4
  194. package/src/models/operations/getalltools.ts +4 -4
  195. package/src/models/operations/getv2humanevalsets.ts +2 -2
  196. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  197. package/src/models/operations/index.ts +3 -0
  198. package/src/models/operations/listdatasetdatapoints.ts +5 -5
  199. package/src/models/operations/listdatasets.ts +1 -1
  200. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  201. package/src/models/operations/postv2feedbackevaluation.ts +4 -4
  202. package/src/models/operations/postv2humanevalsets.ts +2 -2
  203. package/src/models/operations/retrievedatapoint.ts +5 -5
  204. package/src/models/operations/retrievedataset.ts +1 -1
  205. package/src/models/operations/retrievetool.ts +4 -4
  206. package/src/models/operations/runagent.ts +1 -1
  207. package/src/models/operations/streamrunagent.ts +1 -1
  208. package/src/models/operations/updatedatapoint.ts +5 -5
  209. package/src/models/operations/updatedataset.ts +1 -1
  210. package/src/models/operations/updatetool.ts +4 -4
  211. package/src/models/operations/workspaceget.ts +31 -0
  212. package/src/models/operations/workspacelist.ts +43 -0
  213. package/src/models/operations/workspaceupdate.ts +40 -0
  214. package/src/sdk/auditlogs.ts +27 -0
  215. package/src/sdk/sdk.ts +12 -0
  216. package/src/sdk/workspaces.ts +64 -0
  217. package/models/components/factorybudgetscope.d.ts +0 -23
  218. package/models/components/factorybudgetscope.d.ts.map +0 -1
  219. package/models/components/factorybudgetscope.js.map +0 -1
  220. package/models/components/factorybudgetscoperestresponse.d.ts +0 -16
  221. package/models/components/factorybudgetscoperestresponse.d.ts.map +0 -1
  222. package/models/components/factorybudgetscoperestresponse.js.map +0 -1
  223. package/models/components/policyprofileidlist.d.ts +0 -12
  224. package/models/components/policyprofileidlist.d.ts.map +0 -1
  225. package/models/components/policyprofileidlist.js.map +0 -1
  226. package/src/models/components/factorybudgetscope.ts +0 -66
  227. package/src/models/components/factorybudgetscoperestresponse.ts +0 -37
  228. package/src/models/components/policyprofileidlist.ts +0 -31
@@ -0,0 +1,170 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeFormQuery } 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 * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * List workspaces
31
+ *
32
+ * @remarks
33
+ * Returns workspaces the caller can access. A user session lists every membership. A management key lists only the workspace bound to the key. Project keys are rejected.
34
+ */
35
+ export function workspacesList(
36
+ client: OrqCore,
37
+ request?: operations.WorkspaceListRequest | undefined,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ components.ListWorkspacesResponse,
42
+ | OrqError
43
+ | ResponseValidationError
44
+ | ConnectionError
45
+ | RequestAbortedError
46
+ | RequestTimeoutError
47
+ | InvalidRequestError
48
+ | UnexpectedClientError
49
+ | SDKValidationError
50
+ >
51
+ > {
52
+ return new APIPromise($do(
53
+ client,
54
+ request,
55
+ options,
56
+ ));
57
+ }
58
+
59
+ async function $do(
60
+ client: OrqCore,
61
+ request?: operations.WorkspaceListRequest | undefined,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ components.ListWorkspacesResponse,
67
+ | OrqError
68
+ | ResponseValidationError
69
+ | ConnectionError
70
+ | RequestAbortedError
71
+ | RequestTimeoutError
72
+ | InvalidRequestError
73
+ | UnexpectedClientError
74
+ | SDKValidationError
75
+ >,
76
+ APICall,
77
+ ]
78
+ > {
79
+ const parsed = safeParse(
80
+ request,
81
+ (value) =>
82
+ operations.WorkspaceListRequest$outboundSchema.optional().parse(value),
83
+ "Input validation failed",
84
+ );
85
+ if (!parsed.ok) {
86
+ return [parsed, { status: "invalid" }];
87
+ }
88
+ const payload = parsed.value;
89
+ const body = null;
90
+
91
+ const path = pathToFunc("/v2/workspaces")();
92
+
93
+ const query = encodeFormQuery({
94
+ "ending_before": payload?.ending_before,
95
+ "limit": payload?.limit,
96
+ "starting_after": payload?.starting_after,
97
+ });
98
+
99
+ const headers = new Headers(compactMap({
100
+ Accept: "application/json",
101
+ }));
102
+
103
+ const secConfig = await extractSecurity(client._options.apiKey);
104
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
105
+ const requestSecurity = resolveGlobalSecurity(securityInput);
106
+
107
+ const context = {
108
+ options: client._options,
109
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
110
+ operationID: "WorkspaceList",
111
+ oAuth2Scopes: null,
112
+
113
+ resolvedSecurity: requestSecurity,
114
+
115
+ securitySource: client._options.apiKey,
116
+ retryConfig: options?.retries
117
+ || client._options.retryConfig
118
+ || { strategy: "none" },
119
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
120
+ };
121
+
122
+ const requestRes = client._createRequest(context, {
123
+ security: requestSecurity,
124
+ method: "GET",
125
+ baseURL: options?.serverURL,
126
+ path: path,
127
+ headers: headers,
128
+ query: query,
129
+ body: body,
130
+ userAgent: client._options.userAgent,
131
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
132
+ }, options);
133
+ if (!requestRes.ok) {
134
+ return [requestRes, { status: "invalid" }];
135
+ }
136
+ const req = requestRes.value;
137
+
138
+ const doResult = await client._do(req, {
139
+ context,
140
+ isErrorStatusCode: (statusCode: number) =>
141
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
142
+ retryConfig: context.retryConfig,
143
+ retryCodes: context.retryCodes,
144
+ });
145
+ if (!doResult.ok) {
146
+ return [doResult, { status: "request-error", request: req }];
147
+ }
148
+ const response = doResult.value;
149
+
150
+ const [result] = await M.match<
151
+ components.ListWorkspacesResponse,
152
+ | OrqError
153
+ | ResponseValidationError
154
+ | ConnectionError
155
+ | RequestAbortedError
156
+ | RequestTimeoutError
157
+ | InvalidRequestError
158
+ | UnexpectedClientError
159
+ | SDKValidationError
160
+ >(
161
+ M.json(200, components.ListWorkspacesResponse$inboundSchema),
162
+ M.fail("4XX"),
163
+ M.fail("5XX"),
164
+ )(response, req);
165
+ if (!result.ok) {
166
+ return [result, { status: "complete", request: req, response }];
167
+ }
168
+
169
+ return [result, { status: "complete", request: req, response }];
170
+ }
@@ -0,0 +1,171 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } 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 * as operations from "../models/operations/index.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Update a workspace
31
+ *
32
+ * @remarks
33
+ * Partially updates a workspace. Omit a field to leave it unchanged. Set `archived` to true to archive, false to restore. The workspace key cannot be changed.
34
+ */
35
+ export function workspacesUpdate(
36
+ client: OrqCore,
37
+ request: operations.WorkspaceUpdateRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ components.UpdateWorkspaceResponse,
42
+ | OrqError
43
+ | ResponseValidationError
44
+ | ConnectionError
45
+ | RequestAbortedError
46
+ | RequestTimeoutError
47
+ | InvalidRequestError
48
+ | UnexpectedClientError
49
+ | SDKValidationError
50
+ >
51
+ > {
52
+ return new APIPromise($do(
53
+ client,
54
+ request,
55
+ options,
56
+ ));
57
+ }
58
+
59
+ async function $do(
60
+ client: OrqCore,
61
+ request: operations.WorkspaceUpdateRequest,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ components.UpdateWorkspaceResponse,
67
+ | OrqError
68
+ | ResponseValidationError
69
+ | ConnectionError
70
+ | RequestAbortedError
71
+ | RequestTimeoutError
72
+ | InvalidRequestError
73
+ | UnexpectedClientError
74
+ | SDKValidationError
75
+ >,
76
+ APICall,
77
+ ]
78
+ > {
79
+ const parsed = safeParse(
80
+ request,
81
+ (value) => operations.WorkspaceUpdateRequest$outboundSchema.parse(value),
82
+ "Input validation failed",
83
+ );
84
+ if (!parsed.ok) {
85
+ return [parsed, { status: "invalid" }];
86
+ }
87
+ const payload = parsed.value;
88
+ const body = encodeJSON("body", payload.UpdateWorkspaceRequest, {
89
+ explode: true,
90
+ });
91
+
92
+ const pathParams = {
93
+ key: encodeSimple("key", payload.key, {
94
+ explode: false,
95
+ charEncoding: "percent",
96
+ }),
97
+ };
98
+ const path = pathToFunc("/v2/workspaces/{key}")(pathParams);
99
+
100
+ const headers = new Headers(compactMap({
101
+ "Content-Type": "application/json",
102
+ Accept: "application/json",
103
+ }));
104
+
105
+ const secConfig = await extractSecurity(client._options.apiKey);
106
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
107
+ const requestSecurity = resolveGlobalSecurity(securityInput);
108
+
109
+ const context = {
110
+ options: client._options,
111
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
112
+ operationID: "WorkspaceUpdate",
113
+ oAuth2Scopes: null,
114
+
115
+ resolvedSecurity: requestSecurity,
116
+
117
+ securitySource: client._options.apiKey,
118
+ retryConfig: options?.retries
119
+ || client._options.retryConfig
120
+ || { strategy: "none" },
121
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
122
+ };
123
+
124
+ const requestRes = client._createRequest(context, {
125
+ security: requestSecurity,
126
+ method: "PATCH",
127
+ baseURL: options?.serverURL,
128
+ path: path,
129
+ headers: headers,
130
+ body: body,
131
+ userAgent: client._options.userAgent,
132
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
133
+ }, options);
134
+ if (!requestRes.ok) {
135
+ return [requestRes, { status: "invalid" }];
136
+ }
137
+ const req = requestRes.value;
138
+
139
+ const doResult = await client._do(req, {
140
+ context,
141
+ isErrorStatusCode: (statusCode: number) =>
142
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
143
+ retryConfig: context.retryConfig,
144
+ retryCodes: context.retryCodes,
145
+ });
146
+ if (!doResult.ok) {
147
+ return [doResult, { status: "request-error", request: req }];
148
+ }
149
+ const response = doResult.value;
150
+
151
+ const [result] = await M.match<
152
+ components.UpdateWorkspaceResponse,
153
+ | OrqError
154
+ | ResponseValidationError
155
+ | ConnectionError
156
+ | RequestAbortedError
157
+ | RequestTimeoutError
158
+ | InvalidRequestError
159
+ | UnexpectedClientError
160
+ | SDKValidationError
161
+ >(
162
+ M.json(200, components.UpdateWorkspaceResponse$inboundSchema),
163
+ M.fail("4XX"),
164
+ M.fail("5XX"),
165
+ )(response, req);
166
+ if (!result.ok) {
167
+ return [result, { status: "complete", request: req, response }];
168
+ }
169
+
170
+ return [result, { status: "complete", request: req, response }];
171
+ }
package/src/lib/config.ts CHANGED
@@ -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.15.0-rc.6",
62
- genVersion: "2.932.15",
63
- userAgent: "speakeasy-sdk/typescript 4.15.0-rc.6 2.932.15 2.0 @orq-ai/node",
61
+ sdkVersion: "4.15.0-rc.7",
62
+ genVersion: "2.933.0",
63
+ userAgent: "speakeasy-sdk/typescript 4.15.0-rc.7 2.933.0 2.0 @orq-ai/node",
64
64
  } as const;
@@ -0,0 +1,122 @@
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 { Value, Value$inboundSchema } from "./value.js";
11
+
12
+ /**
13
+ * Additional event metadata. The exact shape depends on entity_type and action.
14
+ */
15
+ export type AuditLogMetadata = {};
16
+
17
+ /**
18
+ * An audit log entry for an entity event in the authenticated workspace.
19
+ */
20
+ export type AuditLog = {
21
+ /**
22
+ * Unique identifier for the audit log entry.
23
+ */
24
+ auditLogId: string;
25
+ /**
26
+ * Project associated with the event, when the audited entity belongs to a project.
27
+ */
28
+ projectId?: string | undefined;
29
+ /**
30
+ * Identifier of the entity that changed.
31
+ */
32
+ entityId: string;
33
+ entityType: Value;
34
+ action: Value;
35
+ /**
36
+ * User or system actor that caused the event, when available.
37
+ */
38
+ actorId?: string | undefined;
39
+ /**
40
+ * IP address observed for the actor, when available.
41
+ */
42
+ actorIp?: string | undefined;
43
+ actorType?: Value | undefined;
44
+ /**
45
+ * Human readable actor name captured when the action happened.
46
+ */
47
+ actorDisplay?: string | undefined;
48
+ origin?: Value | undefined;
49
+ /**
50
+ * Correlates the entry with the originating request.
51
+ */
52
+ requestId?: string | undefined;
53
+ /**
54
+ * Time when the audit log entry was created.
55
+ */
56
+ createdAt: Date;
57
+ /**
58
+ * Additional event metadata. The exact shape depends on entity_type and action.
59
+ */
60
+ metadata?: AuditLogMetadata | undefined;
61
+ };
62
+
63
+ /** @internal */
64
+ export const AuditLogMetadata$inboundSchema: z.ZodType<
65
+ AuditLogMetadata,
66
+ z.ZodTypeDef,
67
+ unknown
68
+ > = z.object({});
69
+
70
+ export function auditLogMetadataFromJSON(
71
+ jsonString: string,
72
+ ): SafeParseResult<AuditLogMetadata, SDKValidationError> {
73
+ return safeParse(
74
+ jsonString,
75
+ (x) => AuditLogMetadata$inboundSchema.parse(JSON.parse(x)),
76
+ `Failed to parse 'AuditLogMetadata' from JSON`,
77
+ );
78
+ }
79
+
80
+ /** @internal */
81
+ export const AuditLog$inboundSchema: z.ZodType<
82
+ AuditLog,
83
+ z.ZodTypeDef,
84
+ unknown
85
+ > = z.object({
86
+ audit_log_id: z.string(),
87
+ project_id: z.string().optional(),
88
+ entity_id: z.string(),
89
+ entity_type: Value$inboundSchema,
90
+ action: Value$inboundSchema,
91
+ actor_id: z.string().optional(),
92
+ actor_ip: z.string().optional(),
93
+ actor_type: Value$inboundSchema.optional(),
94
+ actor_display: z.string().optional(),
95
+ origin: Value$inboundSchema.optional(),
96
+ request_id: z.string().optional(),
97
+ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
98
+ metadata: z.lazy(() => AuditLogMetadata$inboundSchema).optional(),
99
+ }).transform((v) => {
100
+ return remap$(v, {
101
+ "audit_log_id": "auditLogId",
102
+ "project_id": "projectId",
103
+ "entity_id": "entityId",
104
+ "entity_type": "entityType",
105
+ "actor_id": "actorId",
106
+ "actor_ip": "actorIp",
107
+ "actor_type": "actorType",
108
+ "actor_display": "actorDisplay",
109
+ "request_id": "requestId",
110
+ "created_at": "createdAt",
111
+ });
112
+ });
113
+
114
+ export function auditLogFromJSON(
115
+ jsonString: string,
116
+ ): SafeParseResult<AuditLog, SDKValidationError> {
117
+ return safeParse(
118
+ jsonString,
119
+ (x) => AuditLog$inboundSchema.parse(JSON.parse(x)),
120
+ `Failed to parse 'AuditLog' from JSON`,
121
+ );
122
+ }
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+
7
+ /**
8
+ * A single advanced filter applied to audit logs.
9
+ */
10
+ export type AuditLogFilter = {
11
+ /**
12
+ * Filter value type, such as string, date, number, boolean, or array.
13
+ */
14
+ type: string;
15
+ /**
16
+ * Audit log field path to filter on. Supported paths include created_at, entity_id, entity_type, action, actor_id, and metadata.display_name.
17
+ */
18
+ path: string;
19
+ /**
20
+ * Filter operator supported by the selected field type.
21
+ */
22
+ operator: string;
23
+ /**
24
+ * Represents a dynamically typed value which can be either null, a number, a string, a boolean, a recursive struct value, or a list of values.
25
+ */
26
+ value?: any | undefined;
27
+ };
28
+
29
+ /** @internal */
30
+ export type AuditLogFilter$Outbound = {
31
+ type: string;
32
+ path: string;
33
+ operator: string;
34
+ value?: any | undefined;
35
+ };
36
+
37
+ /** @internal */
38
+ export const AuditLogFilter$outboundSchema: z.ZodType<
39
+ AuditLogFilter$Outbound,
40
+ z.ZodTypeDef,
41
+ AuditLogFilter
42
+ > = z.object({
43
+ type: z.string(),
44
+ path: z.string(),
45
+ operator: z.string(),
46
+ value: z.any().optional(),
47
+ });
48
+
49
+ export function auditLogFilterToJSON(auditLogFilter: AuditLogFilter): string {
50
+ return JSON.stringify(AuditLogFilter$outboundSchema.parse(auditLogFilter));
51
+ }
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import {
7
+ AuditLogFilter,
8
+ AuditLogFilter$Outbound,
9
+ AuditLogFilter$outboundSchema,
10
+ } from "./auditlogfilter.js";
11
+
12
+ /**
13
+ * Search and advanced filters for querying audit logs.
14
+ */
15
+ export type AuditLogFilterQuery = {
16
+ /**
17
+ * Optional text search applied to supported display fields.
18
+ */
19
+ search?: string | undefined;
20
+ /**
21
+ * Logical operator used to combine filters.
22
+ */
23
+ operator: string;
24
+ /**
25
+ * Advanced filters applied to the query.
26
+ */
27
+ filters: Array<AuditLogFilter>;
28
+ };
29
+
30
+ /** @internal */
31
+ export type AuditLogFilterQuery$Outbound = {
32
+ search?: string | undefined;
33
+ operator: string;
34
+ filters: Array<AuditLogFilter$Outbound>;
35
+ };
36
+
37
+ /** @internal */
38
+ export const AuditLogFilterQuery$outboundSchema: z.ZodType<
39
+ AuditLogFilterQuery$Outbound,
40
+ z.ZodTypeDef,
41
+ AuditLogFilterQuery
42
+ > = z.object({
43
+ search: z.string().optional(),
44
+ operator: z.string(),
45
+ filters: z.array(AuditLogFilter$outboundSchema),
46
+ });
47
+
48
+ export function auditLogFilterQueryToJSON(
49
+ auditLogFilterQuery: AuditLogFilterQuery,
50
+ ): string {
51
+ return JSON.stringify(
52
+ AuditLogFilterQuery$outboundSchema.parse(auditLogFilterQuery),
53
+ );
54
+ }
@@ -0,0 +1,55 @@
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
+ /**
9
+ * Cursor pagination settings for audit log queries.
10
+ */
11
+ export type AuditLogPagination = {
12
+ /**
13
+ * Maximum number of audit logs to return. Defaults to 50 when omitted.
14
+ */
15
+ limit?: number | undefined;
16
+ /**
17
+ * Cursor for the next page. Use the last audit_log_id from the previous page.
18
+ */
19
+ startingAfter?: string | undefined;
20
+ /**
21
+ * Cursor for the previous page. Use the first audit_log_id from the current page.
22
+ */
23
+ endingBefore?: string | undefined;
24
+ };
25
+
26
+ /** @internal */
27
+ export type AuditLogPagination$Outbound = {
28
+ limit?: number | undefined;
29
+ starting_after?: string | undefined;
30
+ ending_before?: string | undefined;
31
+ };
32
+
33
+ /** @internal */
34
+ export const AuditLogPagination$outboundSchema: z.ZodType<
35
+ AuditLogPagination$Outbound,
36
+ z.ZodTypeDef,
37
+ AuditLogPagination
38
+ > = z.object({
39
+ limit: z.number().int().optional(),
40
+ startingAfter: z.string().optional(),
41
+ endingBefore: z.string().optional(),
42
+ }).transform((v) => {
43
+ return remap$(v, {
44
+ startingAfter: "starting_after",
45
+ endingBefore: "ending_before",
46
+ });
47
+ });
48
+
49
+ export function auditLogPaginationToJSON(
50
+ auditLogPagination: AuditLogPagination,
51
+ ): string {
52
+ return JSON.stringify(
53
+ AuditLogPagination$outboundSchema.parse(auditLogPagination),
54
+ );
55
+ }
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+
7
+ /**
8
+ * A sort expression for audit log queries.
9
+ */
10
+ export type AuditLogSort = {
11
+ /**
12
+ * Audit log field to sort by. Supported keys include _id, created_at, entity_type, entity_id, action, and actor_id.
13
+ */
14
+ key: string;
15
+ /**
16
+ * Sort direction. Defaults to desc when omitted or invalid.
17
+ */
18
+ direction?: string | undefined;
19
+ };
20
+
21
+ /** @internal */
22
+ export type AuditLogSort$Outbound = {
23
+ key: string;
24
+ direction?: string | undefined;
25
+ };
26
+
27
+ /** @internal */
28
+ export const AuditLogSort$outboundSchema: z.ZodType<
29
+ AuditLogSort$Outbound,
30
+ z.ZodTypeDef,
31
+ AuditLogSort
32
+ > = z.object({
33
+ key: z.string(),
34
+ direction: z.string().optional(),
35
+ });
36
+
37
+ export function auditLogSortToJSON(auditLogSort: AuditLogSort): string {
38
+ return JSON.stringify(AuditLogSort$outboundSchema.parse(auditLogSort));
39
+ }
@@ -8,13 +8,7 @@ import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
 
10
10
  /**
11
- * BudgetMatch carries the CEL expression that decides whether a budget
12
- *
13
- * @remarks
14
- * applies to a request. Available variables: `model`, `provider`,
15
- * `model_id`, `api_key`, `api_key_labels` (map), `factory`, `identity`,
16
- * `project`, `metadata` (map), `headers` (map, lowercase keys). An empty
17
- * expression always matches. Expressions are syntax-validated at write time.
11
+ * CEL expression that decides whether a budget applies to a request. Available variables: `model`, `provider`, `model_id`, `api_key`, `api_key_labels` (map), `identity`, `project`, `metadata` (map), `headers` (map, lowercase keys). An empty expression always matches. Expressions are syntax-validated at write time.
18
12
  */
19
13
  export type BudgetMatch = {
20
14
  cel?: string | undefined;