@orq-ai/node 4.10.0-rc.30 → 4.10.0-rc.31

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 (270) hide show
  1. package/README.md +53 -38
  2. package/funcs/apiKeysCreate.d.ts +17 -0
  3. package/funcs/apiKeysCreate.d.ts.map +1 -0
  4. package/funcs/apiKeysCreate.js +115 -0
  5. package/funcs/apiKeysCreate.js.map +1 -0
  6. package/funcs/apiKeysDelete.d.ts +18 -0
  7. package/funcs/apiKeysDelete.d.ts.map +1 -0
  8. package/funcs/apiKeysDelete.js +121 -0
  9. package/funcs/apiKeysDelete.js.map +1 -0
  10. package/funcs/apiKeysGet.d.ts +18 -0
  11. package/funcs/apiKeysGet.d.ts.map +1 -0
  12. package/funcs/apiKeysGet.js +121 -0
  13. package/funcs/apiKeysGet.js.map +1 -0
  14. package/funcs/apiKeysList.d.ts +18 -0
  15. package/funcs/apiKeysList.d.ts.map +1 -0
  16. package/funcs/apiKeysList.js +126 -0
  17. package/funcs/apiKeysList.js.map +1 -0
  18. package/funcs/apiKeysListCapabilities.d.ts +17 -0
  19. package/funcs/apiKeysListCapabilities.d.ts.map +1 -0
  20. package/funcs/apiKeysListCapabilities.js +105 -0
  21. package/funcs/apiKeysListCapabilities.js.map +1 -0
  22. package/funcs/apiKeysUpdate.d.ts +18 -0
  23. package/funcs/apiKeysUpdate.d.ts.map +1 -0
  24. package/funcs/apiKeysUpdate.js +124 -0
  25. package/funcs/apiKeysUpdate.js.map +1 -0
  26. package/funcs/filesList.js +1 -0
  27. package/funcs/filesList.js.map +1 -1
  28. package/jsr.json +1 -1
  29. package/lib/config.d.ts +2 -2
  30. package/lib/config.js +2 -2
  31. package/models/components/allprojects.d.ts +13 -0
  32. package/models/components/allprojects.d.ts.map +1 -0
  33. package/models/components/allprojects.js +54 -0
  34. package/models/components/allprojects.js.map +1 -0
  35. package/models/components/apikey.d.ts +117 -0
  36. package/models/components/apikey.d.ts.map +1 -0
  37. package/models/components/apikey.js +87 -0
  38. package/models/components/apikey.js.map +1 -0
  39. package/models/components/apikeyowner.d.ts +31 -0
  40. package/models/components/apikeyowner.d.ts.map +1 -0
  41. package/models/components/apikeyowner.js +71 -0
  42. package/models/components/apikeyowner.js.map +1 -0
  43. package/models/components/apikeystatus.d.ts +14 -0
  44. package/models/components/apikeystatus.d.ts.map +1 -0
  45. package/models/components/apikeystatus.js +51 -0
  46. package/models/components/apikeystatus.js.map +1 -0
  47. package/models/components/createapikeyrequest.d.ts +53 -0
  48. package/models/components/createapikeyrequest.d.ts.map +1 -0
  49. package/models/components/createapikeyrequest.js +64 -0
  50. package/models/components/createapikeyrequest.js.map +1 -0
  51. package/models/components/createapikeyresponse.d.ts +22 -0
  52. package/models/components/createapikeyresponse.d.ts.map +1 -0
  53. package/models/components/createapikeyresponse.js +57 -0
  54. package/models/components/createapikeyresponse.js.map +1 -0
  55. package/models/components/createfilerequest.d.ts +8 -2
  56. package/models/components/createfilerequest.d.ts.map +1 -1
  57. package/models/components/createfilerequest.js +4 -1
  58. package/models/components/createfilerequest.js.map +1 -1
  59. package/models/components/deleteapikeyresponse.d.ts +8 -0
  60. package/models/components/deleteapikeyresponse.d.ts.map +1 -0
  61. package/models/components/deleteapikeyresponse.js +48 -0
  62. package/models/components/deleteapikeyresponse.js.map +1 -0
  63. package/models/components/domain.d.ts +53 -0
  64. package/models/components/domain.d.ts.map +1 -0
  65. package/models/components/domain.js +64 -0
  66. package/models/components/domain.js.map +1 -0
  67. package/models/components/domaingroup.d.ts +12 -0
  68. package/models/components/domaingroup.d.ts.map +1 -0
  69. package/models/components/domaingroup.js +50 -0
  70. package/models/components/domaingroup.js.map +1 -0
  71. package/models/components/file.d.ts +6 -1
  72. package/models/components/file.d.ts.map +1 -1
  73. package/models/components/file.js +4 -1
  74. package/models/components/file.js.map +1 -1
  75. package/models/components/filepurpose.d.ts +14 -0
  76. package/models/components/filepurpose.d.ts.map +1 -0
  77. package/models/components/filepurpose.js +52 -0
  78. package/models/components/filepurpose.js.map +1 -0
  79. package/models/components/getapikeyresponse.d.ts +14 -0
  80. package/models/components/getapikeyresponse.d.ts.map +1 -0
  81. package/models/components/getapikeyresponse.js +56 -0
  82. package/models/components/getapikeyresponse.js.map +1 -0
  83. package/models/components/index.d.ts +23 -0
  84. package/models/components/index.d.ts.map +1 -1
  85. package/models/components/index.js +23 -0
  86. package/models/components/index.js.map +1 -1
  87. package/models/components/legacytokenfamily.d.ts +12 -0
  88. package/models/components/legacytokenfamily.d.ts.map +1 -0
  89. package/models/components/legacytokenfamily.js +49 -0
  90. package/models/components/legacytokenfamily.js.map +1 -0
  91. package/models/components/listapikeysresponse.d.ts +28 -0
  92. package/models/components/listapikeysresponse.d.ts.map +1 -0
  93. package/models/components/listapikeysresponse.js +58 -0
  94. package/models/components/listapikeysresponse.js.map +1 -0
  95. package/models/components/listcapabilitiesresponse.d.ts +18 -0
  96. package/models/components/listcapabilitiesresponse.d.ts.map +1 -0
  97. package/models/components/listcapabilitiesresponse.js +51 -0
  98. package/models/components/listcapabilitiesresponse.js.map +1 -0
  99. package/models/components/ownertype.d.ts +11 -0
  100. package/models/components/ownertype.d.ts.map +1 -0
  101. package/models/components/ownertype.js +49 -0
  102. package/models/components/ownertype.js.map +1 -0
  103. package/models/components/permissionmode.d.ts +14 -0
  104. package/models/components/permissionmode.d.ts.map +1 -0
  105. package/models/components/permissionmode.js +51 -0
  106. package/models/components/permissionmode.js.map +1 -0
  107. package/models/components/projectscope.d.ts +28 -0
  108. package/models/components/projectscope.d.ts.map +1 -0
  109. package/models/components/projectscope.js +62 -0
  110. package/models/components/projectscope.js.map +1 -0
  111. package/models/components/reasoningpart.js +1 -1
  112. package/models/components/scopemode.d.ts +11 -0
  113. package/models/components/scopemode.d.ts.map +1 -0
  114. package/models/components/scopemode.js +49 -0
  115. package/models/components/scopemode.js.map +1 -0
  116. package/models/components/serviceaccountowner.d.ts +13 -0
  117. package/models/components/serviceaccountowner.d.ts.map +1 -0
  118. package/models/components/serviceaccountowner.js +54 -0
  119. package/models/components/serviceaccountowner.js.map +1 -0
  120. package/models/components/singleproject.d.ts +17 -0
  121. package/models/components/singleproject.d.ts.map +1 -0
  122. package/models/components/singleproject.js +67 -0
  123. package/models/components/singleproject.js.map +1 -0
  124. package/models/components/updateapikeyrequest.d.ts +61 -0
  125. package/models/components/updateapikeyrequest.d.ts.map +1 -0
  126. package/models/components/updateapikeyrequest.js +68 -0
  127. package/models/components/updateapikeyrequest.js.map +1 -0
  128. package/models/components/updateapikeyresponse.d.ts +14 -0
  129. package/models/components/updateapikeyresponse.d.ts.map +1 -0
  130. package/models/components/updateapikeyresponse.js +56 -0
  131. package/models/components/updateapikeyresponse.js.map +1 -0
  132. package/models/components/userowner.d.ts +17 -0
  133. package/models/components/userowner.d.ts.map +1 -0
  134. package/models/components/userowner.js +67 -0
  135. package/models/components/userowner.js.map +1 -0
  136. package/models/operations/apikeydelete.d.ts +15 -0
  137. package/models/operations/apikeydelete.d.ts.map +1 -0
  138. package/models/operations/apikeydelete.js +54 -0
  139. package/models/operations/apikeydelete.js.map +1 -0
  140. package/models/operations/apikeyget.d.ts +15 -0
  141. package/models/operations/apikeyget.d.ts.map +1 -0
  142. package/models/operations/apikeyget.js +54 -0
  143. package/models/operations/apikeyget.js.map +1 -0
  144. package/models/operations/apikeylist.d.ts +72 -0
  145. package/models/operations/apikeylist.d.ts.map +1 -0
  146. package/models/operations/apikeylist.js +66 -0
  147. package/models/operations/apikeylist.js.map +1 -0
  148. package/models/operations/apikeyupdate.d.ts +18 -0
  149. package/models/operations/apikeyupdate.d.ts.map +1 -0
  150. package/models/operations/apikeyupdate.js +57 -0
  151. package/models/operations/apikeyupdate.js.map +1 -0
  152. package/models/operations/createdataset.js +1 -1
  153. package/models/operations/createdatasetitem.js +4 -4
  154. package/models/operations/createdatasource.js +1 -1
  155. package/models/operations/createeval.d.ts +15 -15
  156. package/models/operations/createeval.d.ts.map +1 -1
  157. package/models/operations/createeval.js +55 -55
  158. package/models/operations/createeval.js.map +1 -1
  159. package/models/operations/createtool.js +6 -6
  160. package/models/operations/filelist.d.ts +2 -0
  161. package/models/operations/filelist.d.ts.map +1 -1
  162. package/models/operations/filelist.js +2 -0
  163. package/models/operations/filelist.js.map +1 -1
  164. package/models/operations/getalltools.js +6 -6
  165. package/models/operations/getevals.js +40 -40
  166. package/models/operations/getevals.js.map +1 -1
  167. package/models/operations/getv2humanevalsets.js +2 -2
  168. package/models/operations/getv2humanevalsetsid.js +2 -2
  169. package/models/operations/index.d.ts +4 -0
  170. package/models/operations/index.d.ts.map +1 -1
  171. package/models/operations/index.js +4 -0
  172. package/models/operations/index.js.map +1 -1
  173. package/models/operations/listdatasetdatapoints.js +4 -4
  174. package/models/operations/listdatasets.js +1 -1
  175. package/models/operations/listdatasources.js +1 -1
  176. package/models/operations/patchv2humanevalsetsid.js +2 -2
  177. package/models/operations/postv2feedbackevaluation.js +3 -3
  178. package/models/operations/postv2humanevalsets.js +2 -2
  179. package/models/operations/retrievedatapoint.js +4 -4
  180. package/models/operations/retrievedataset.js +1 -1
  181. package/models/operations/retrievedatasource.js +1 -1
  182. package/models/operations/retrievetool.js +6 -6
  183. package/models/operations/runagent.js +1 -1
  184. package/models/operations/streamrunagent.js +1 -1
  185. package/models/operations/updatedatapoint.js +4 -4
  186. package/models/operations/updatedataset.js +1 -1
  187. package/models/operations/updatedatasource.js +1 -1
  188. package/models/operations/updateeval.d.ts +3 -3
  189. package/models/operations/updateeval.d.ts.map +1 -1
  190. package/models/operations/updateeval.js +43 -43
  191. package/models/operations/updateeval.js.map +1 -1
  192. package/models/operations/updatetool.js +7 -7
  193. package/package.json +7 -7
  194. package/sdk/apikeys.d.ts +48 -0
  195. package/sdk/apikeys.d.ts.map +1 -0
  196. package/sdk/apikeys.js +72 -0
  197. package/sdk/apikeys.js.map +1 -0
  198. package/sdk/sdk.d.ts +3 -0
  199. package/sdk/sdk.d.ts.map +1 -1
  200. package/sdk/sdk.js +4 -0
  201. package/sdk/sdk.js.map +1 -1
  202. package/src/funcs/apiKeysCreate.ts +162 -0
  203. package/src/funcs/apiKeysDelete.ts +168 -0
  204. package/src/funcs/apiKeysGet.ts +168 -0
  205. package/src/funcs/apiKeysList.ts +175 -0
  206. package/src/funcs/apiKeysListCapabilities.ts +144 -0
  207. package/src/funcs/apiKeysUpdate.ts +171 -0
  208. package/src/funcs/filesList.ts +1 -0
  209. package/src/lib/config.ts +2 -2
  210. package/src/models/components/allprojects.ts +39 -0
  211. package/src/models/components/apikey.ts +178 -0
  212. package/src/models/components/apikeyowner.ts +82 -0
  213. package/src/models/components/apikeystatus.ts +21 -0
  214. package/src/models/components/createapikeyrequest.ts +91 -0
  215. package/src/models/components/createapikeyresponse.ts +49 -0
  216. package/src/models/components/createfilerequest.ts +11 -3
  217. package/src/models/components/deleteapikeyresponse.ts +27 -0
  218. package/src/models/components/domain.ts +82 -0
  219. package/src/models/components/domaingroup.ts +18 -0
  220. package/src/models/components/file.ts +9 -2
  221. package/src/models/components/filepurpose.ts +21 -0
  222. package/src/models/components/getapikeyresponse.ts +40 -0
  223. package/src/models/components/index.ts +23 -0
  224. package/src/models/components/legacytokenfamily.ts +19 -0
  225. package/src/models/components/listapikeysresponse.ts +56 -0
  226. package/src/models/components/listcapabilitiesresponse.ts +39 -0
  227. package/src/models/components/ownertype.ts +17 -0
  228. package/src/models/components/permissionmode.ts +23 -0
  229. package/src/models/components/projectscope.ts +70 -0
  230. package/src/models/components/reasoningpart.ts +1 -1
  231. package/src/models/components/scopemode.ts +17 -0
  232. package/src/models/components/serviceaccountowner.ts +43 -0
  233. package/src/models/components/singleproject.ts +56 -0
  234. package/src/models/components/updateapikeyrequest.ts +99 -0
  235. package/src/models/components/updateapikeyresponse.ts +40 -0
  236. package/src/models/components/userowner.ts +56 -0
  237. package/src/models/operations/apikeydelete.ts +39 -0
  238. package/src/models/operations/apikeyget.ts +39 -0
  239. package/src/models/operations/apikeylist.ts +107 -0
  240. package/src/models/operations/apikeyupdate.ts +44 -0
  241. package/src/models/operations/createdataset.ts +1 -1
  242. package/src/models/operations/createdatasetitem.ts +4 -4
  243. package/src/models/operations/createdatasource.ts +1 -1
  244. package/src/models/operations/createeval.ts +70 -70
  245. package/src/models/operations/createtool.ts +6 -6
  246. package/src/models/operations/filelist.ts +4 -0
  247. package/src/models/operations/getalltools.ts +6 -6
  248. package/src/models/operations/getevals.ts +40 -40
  249. package/src/models/operations/getv2humanevalsets.ts +2 -2
  250. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  251. package/src/models/operations/index.ts +4 -0
  252. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  253. package/src/models/operations/listdatasets.ts +1 -1
  254. package/src/models/operations/listdatasources.ts +1 -1
  255. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  256. package/src/models/operations/postv2feedbackevaluation.ts +3 -3
  257. package/src/models/operations/postv2humanevalsets.ts +2 -2
  258. package/src/models/operations/retrievedatapoint.ts +4 -4
  259. package/src/models/operations/retrievedataset.ts +1 -1
  260. package/src/models/operations/retrievedatasource.ts +1 -1
  261. package/src/models/operations/retrievetool.ts +6 -6
  262. package/src/models/operations/runagent.ts +1 -1
  263. package/src/models/operations/streamrunagent.ts +1 -1
  264. package/src/models/operations/updatedatapoint.ts +4 -4
  265. package/src/models/operations/updatedataset.ts +1 -1
  266. package/src/models/operations/updatedatasource.ts +1 -1
  267. package/src/models/operations/updateeval.ts +46 -46
  268. package/src/models/operations/updatetool.ts +7 -7
  269. package/src/sdk/apikeys.ts +116 -0
  270. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,168 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { 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
+ * Retrieve an API key
31
+ *
32
+ * @remarks
33
+ * Retrieves the metadata for an existing API key by its unique identifier. The raw secret is never returned — only `token_prefix`, `permission_mode`, `project_scope`, and lifecycle fields.
34
+ */
35
+ export function apiKeysGet(
36
+ client: OrqCore,
37
+ request: operations.ApiKeyGetRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ components.GetApiKeyResponse,
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.ApiKeyGetRequest,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ components.GetApiKeyResponse,
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.ApiKeyGetRequest$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 = null;
89
+
90
+ const pathParams = {
91
+ api_key_id: encodeSimple("api_key_id", payload.api_key_id, {
92
+ explode: false,
93
+ charEncoding: "percent",
94
+ }),
95
+ };
96
+ const path = pathToFunc("/v2/api-keys/{api_key_id}")(pathParams);
97
+
98
+ const headers = new Headers(compactMap({
99
+ Accept: "application/json",
100
+ }));
101
+
102
+ const secConfig = await extractSecurity(client._options.apiKey);
103
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
104
+ const requestSecurity = resolveGlobalSecurity(securityInput);
105
+
106
+ const context = {
107
+ options: client._options,
108
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
109
+ operationID: "ApiKeyGet",
110
+ oAuth2Scopes: null,
111
+
112
+ resolvedSecurity: requestSecurity,
113
+
114
+ securitySource: client._options.apiKey,
115
+ retryConfig: options?.retries
116
+ || client._options.retryConfig
117
+ || { strategy: "none" },
118
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
119
+ };
120
+
121
+ const requestRes = client._createRequest(context, {
122
+ security: requestSecurity,
123
+ method: "GET",
124
+ baseURL: options?.serverURL,
125
+ path: path,
126
+ headers: headers,
127
+ body: body,
128
+ userAgent: client._options.userAgent,
129
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
130
+ }, options);
131
+ if (!requestRes.ok) {
132
+ return [requestRes, { status: "invalid" }];
133
+ }
134
+ const req = requestRes.value;
135
+
136
+ const doResult = await client._do(req, {
137
+ context,
138
+ isErrorStatusCode: (statusCode: number) =>
139
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
140
+ retryConfig: context.retryConfig,
141
+ retryCodes: context.retryCodes,
142
+ });
143
+ if (!doResult.ok) {
144
+ return [doResult, { status: "request-error", request: req }];
145
+ }
146
+ const response = doResult.value;
147
+
148
+ const [result] = await M.match<
149
+ components.GetApiKeyResponse,
150
+ | OrqError
151
+ | ResponseValidationError
152
+ | ConnectionError
153
+ | RequestAbortedError
154
+ | RequestTimeoutError
155
+ | InvalidRequestError
156
+ | UnexpectedClientError
157
+ | SDKValidationError
158
+ >(
159
+ M.json(200, components.GetApiKeyResponse$inboundSchema),
160
+ M.fail("4XX"),
161
+ M.fail("5XX"),
162
+ )(response, req);
163
+ if (!result.ok) {
164
+ return [result, { status: "complete", request: req, response }];
165
+ }
166
+
167
+ return [result, { status: "complete", request: req, response }];
168
+ }
@@ -0,0 +1,175 @@
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 API keys
31
+ *
32
+ * @remarks
33
+ * Returns API keys visible to the current workspace, ordered by creation time with the newest key first. The `api_key` and `token_hash` fields are never returned by this endpoint; only `token_prefix` is included.
34
+ */
35
+ export function apiKeysList(
36
+ client: OrqCore,
37
+ request?: operations.ApiKeyListRequest | undefined,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ components.ListApiKeysResponse,
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.ApiKeyListRequest | undefined,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ components.ListApiKeysResponse,
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.ApiKeyListRequest$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/api-keys")();
92
+
93
+ const query = encodeFormQuery({
94
+ "ending_before": payload?.ending_before,
95
+ "limit": payload?.limit,
96
+ "owner_type": payload?.owner_type,
97
+ "permission_mode": payload?.permission_mode,
98
+ "project_id": payload?.project_id,
99
+ "search": payload?.search,
100
+ "starting_after": payload?.starting_after,
101
+ "status": payload?.status,
102
+ });
103
+
104
+ const headers = new Headers(compactMap({
105
+ Accept: "application/json",
106
+ }));
107
+
108
+ const secConfig = await extractSecurity(client._options.apiKey);
109
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
110
+ const requestSecurity = resolveGlobalSecurity(securityInput);
111
+
112
+ const context = {
113
+ options: client._options,
114
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
115
+ operationID: "ApiKeyList",
116
+ oAuth2Scopes: null,
117
+
118
+ resolvedSecurity: requestSecurity,
119
+
120
+ securitySource: client._options.apiKey,
121
+ retryConfig: options?.retries
122
+ || client._options.retryConfig
123
+ || { strategy: "none" },
124
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
125
+ };
126
+
127
+ const requestRes = client._createRequest(context, {
128
+ security: requestSecurity,
129
+ method: "GET",
130
+ baseURL: options?.serverURL,
131
+ path: path,
132
+ headers: headers,
133
+ query: query,
134
+ body: body,
135
+ userAgent: client._options.userAgent,
136
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
137
+ }, options);
138
+ if (!requestRes.ok) {
139
+ return [requestRes, { status: "invalid" }];
140
+ }
141
+ const req = requestRes.value;
142
+
143
+ const doResult = await client._do(req, {
144
+ context,
145
+ isErrorStatusCode: (statusCode: number) =>
146
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
147
+ retryConfig: context.retryConfig,
148
+ retryCodes: context.retryCodes,
149
+ });
150
+ if (!doResult.ok) {
151
+ return [doResult, { status: "request-error", request: req }];
152
+ }
153
+ const response = doResult.value;
154
+
155
+ const [result] = await M.match<
156
+ components.ListApiKeysResponse,
157
+ | OrqError
158
+ | ResponseValidationError
159
+ | ConnectionError
160
+ | RequestAbortedError
161
+ | RequestTimeoutError
162
+ | InvalidRequestError
163
+ | UnexpectedClientError
164
+ | SDKValidationError
165
+ >(
166
+ M.json(200, components.ListApiKeysResponse$inboundSchema),
167
+ M.fail("4XX"),
168
+ M.fail("5XX"),
169
+ )(response, req);
170
+ if (!result.ok) {
171
+ return [result, { status: "complete", request: req, response }];
172
+ }
173
+
174
+ return [result, { status: "complete", request: req, response }];
175
+ }
@@ -0,0 +1,144 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { OrqCore } from "../core.js";
6
+ import { matchStatusCode } from "../lib/http.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import * as components from "../models/components/index.js";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import { OrqError } from "../models/errors/orqerror.js";
21
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
22
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
+ import { APICall, APIPromise } from "../types/async.js";
24
+ import { Result } from "../types/fp.js";
25
+
26
+ /**
27
+ * List capability catalog
28
+ *
29
+ * @remarks
30
+ * Returns the capability catalog: the set of permission domains that can be granted to an API key. Each entry includes the domain id, display name, group, allowed project scopes, and the read / write verb sets resolved at authorize() time. Drives the permissions UI in the dashboard.
31
+ */
32
+ export function apiKeysListCapabilities(
33
+ client: OrqCore,
34
+ options?: RequestOptions,
35
+ ): APIPromise<
36
+ Result<
37
+ components.ListCapabilitiesResponse,
38
+ | OrqError
39
+ | ResponseValidationError
40
+ | ConnectionError
41
+ | RequestAbortedError
42
+ | RequestTimeoutError
43
+ | InvalidRequestError
44
+ | UnexpectedClientError
45
+ | SDKValidationError
46
+ >
47
+ > {
48
+ return new APIPromise($do(
49
+ client,
50
+ options,
51
+ ));
52
+ }
53
+
54
+ async function $do(
55
+ client: OrqCore,
56
+ options?: RequestOptions,
57
+ ): Promise<
58
+ [
59
+ Result<
60
+ components.ListCapabilitiesResponse,
61
+ | OrqError
62
+ | ResponseValidationError
63
+ | ConnectionError
64
+ | RequestAbortedError
65
+ | RequestTimeoutError
66
+ | InvalidRequestError
67
+ | UnexpectedClientError
68
+ | SDKValidationError
69
+ >,
70
+ APICall,
71
+ ]
72
+ > {
73
+ const path = pathToFunc("/v2/api-keys/capabilities")();
74
+
75
+ const headers = new Headers(compactMap({
76
+ Accept: "application/json",
77
+ }));
78
+
79
+ const secConfig = await extractSecurity(client._options.apiKey);
80
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
81
+ const requestSecurity = resolveGlobalSecurity(securityInput);
82
+
83
+ const context = {
84
+ options: client._options,
85
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
86
+ operationID: "ApiKeyListCapabilities",
87
+ oAuth2Scopes: null,
88
+
89
+ resolvedSecurity: requestSecurity,
90
+
91
+ securitySource: client._options.apiKey,
92
+ retryConfig: options?.retries
93
+ || client._options.retryConfig
94
+ || { strategy: "none" },
95
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
96
+ };
97
+
98
+ const requestRes = client._createRequest(context, {
99
+ security: requestSecurity,
100
+ method: "GET",
101
+ baseURL: options?.serverURL,
102
+ path: path,
103
+ headers: headers,
104
+ userAgent: client._options.userAgent,
105
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
106
+ }, options);
107
+ if (!requestRes.ok) {
108
+ return [requestRes, { status: "invalid" }];
109
+ }
110
+ const req = requestRes.value;
111
+
112
+ const doResult = await client._do(req, {
113
+ context,
114
+ isErrorStatusCode: (statusCode: number) =>
115
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
116
+ retryConfig: context.retryConfig,
117
+ retryCodes: context.retryCodes,
118
+ });
119
+ if (!doResult.ok) {
120
+ return [doResult, { status: "request-error", request: req }];
121
+ }
122
+ const response = doResult.value;
123
+
124
+ const [result] = await M.match<
125
+ components.ListCapabilitiesResponse,
126
+ | OrqError
127
+ | ResponseValidationError
128
+ | ConnectionError
129
+ | RequestAbortedError
130
+ | RequestTimeoutError
131
+ | InvalidRequestError
132
+ | UnexpectedClientError
133
+ | SDKValidationError
134
+ >(
135
+ M.json(200, components.ListCapabilitiesResponse$inboundSchema),
136
+ M.fail("4XX"),
137
+ M.fail("5XX"),
138
+ )(response, req);
139
+ if (!result.ok) {
140
+ return [result, { status: "complete", request: req, response }];
141
+ }
142
+
143
+ return [result, { status: "complete", request: req, response }];
144
+ }
@@ -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 an API key
31
+ *
32
+ * @remarks
33
+ * Updates mutable fields of an API key: display name, status (active / disabled / revoked), permission mode and access map, project scope, and constraints (budget / rate limit / expiry). Omitted fields keep their current values.
34
+ */
35
+ export function apiKeysUpdate(
36
+ client: OrqCore,
37
+ request: operations.ApiKeyUpdateRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ components.UpdateApiKeyResponse,
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.ApiKeyUpdateRequest,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ components.UpdateApiKeyResponse,
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.ApiKeyUpdateRequest$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.UpdateApiKeyRequest, {
89
+ explode: true,
90
+ });
91
+
92
+ const pathParams = {
93
+ api_key_id: encodeSimple("api_key_id", payload.api_key_id, {
94
+ explode: false,
95
+ charEncoding: "percent",
96
+ }),
97
+ };
98
+ const path = pathToFunc("/v2/api-keys/{api_key_id}")(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: "ApiKeyUpdate",
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.UpdateApiKeyResponse,
153
+ | OrqError
154
+ | ResponseValidationError
155
+ | ConnectionError
156
+ | RequestAbortedError
157
+ | RequestTimeoutError
158
+ | InvalidRequestError
159
+ | UnexpectedClientError
160
+ | SDKValidationError
161
+ >(
162
+ M.json(200, components.UpdateApiKeyResponse$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
+ }
@@ -93,6 +93,7 @@ async function $do(
93
93
  const query = encodeFormQuery({
94
94
  "ending_before": payload?.ending_before,
95
95
  "limit": payload?.limit,
96
+ "project_id": payload?.project_id,
96
97
  "starting_after": payload?.starting_after,
97
98
  });
98
99
 
package/src/lib/config.ts CHANGED
@@ -68,7 +68,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
68
68
  export const SDK_METADATA = {
69
69
  language: "typescript",
70
70
  openapiDocVersion: "2.0",
71
- sdkVersion: "4.10.0-rc.30",
71
+ sdkVersion: "4.10.0-rc.31",
72
72
  genVersion: "2.885.1",
73
- userAgent: "speakeasy-sdk/typescript 4.10.0-rc.30 2.885.1 2.0 @orq-ai/node",
73
+ userAgent: "speakeasy-sdk/typescript 4.10.0-rc.31 2.885.1 2.0 @orq-ai/node",
74
74
  } as const;