@orq-ai/node 4.15.11 → 4.15.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/README.md +39 -37
  2. package/funcs/feedbackSubmit.d.ts +17 -0
  3. package/funcs/feedbackSubmit.d.ts.map +1 -0
  4. package/funcs/feedbackSubmit.js +115 -0
  5. package/funcs/feedbackSubmit.js.map +1 -0
  6. package/funcs/routerClassifyCreate.d.ts +1 -1
  7. package/funcs/routerClassifyCreate.js +1 -1
  8. package/jsr.json +1 -1
  9. package/lib/config.d.ts +3 -3
  10. package/lib/config.js +3 -3
  11. package/models/components/classifyanswer.d.ts +1 -1
  12. package/models/components/classifyusage.d.ts +2 -2
  13. package/models/components/index.d.ts +2 -0
  14. package/models/components/index.d.ts.map +1 -1
  15. package/models/components/index.js +2 -0
  16. package/models/components/index.js.map +1 -1
  17. package/models/components/reasoningpart.js +1 -1
  18. package/models/components/submitfeedbackrequest.d.ts +21 -0
  19. package/models/components/submitfeedbackrequest.d.ts.map +1 -0
  20. package/models/components/submitfeedbackrequest.js +57 -0
  21. package/models/components/submitfeedbackrequest.js.map +1 -0
  22. package/models/components/submitfeedbackresponse.d.ts +13 -0
  23. package/models/components/submitfeedbackresponse.d.ts.map +1 -0
  24. package/models/components/submitfeedbackresponse.js +55 -0
  25. package/models/components/submitfeedbackresponse.js.map +1 -0
  26. package/models/operations/createclassify.d.ts +3 -2
  27. package/models/operations/createclassify.d.ts.map +1 -1
  28. package/models/operations/createclassify.js +1 -0
  29. package/models/operations/createclassify.js.map +1 -1
  30. package/models/operations/createdataset.js +1 -1
  31. package/models/operations/createdatasetitem.js +5 -5
  32. package/models/operations/createtool.js +4 -4
  33. package/models/operations/getalltools.js +4 -4
  34. package/models/operations/getv2humanevalsets.js +2 -2
  35. package/models/operations/getv2humanevalsetsid.js +2 -2
  36. package/models/operations/listdatasetdatapoints.js +5 -5
  37. package/models/operations/listdatasets.js +1 -1
  38. package/models/operations/patchv2humanevalsetsid.js +2 -2
  39. package/models/operations/postv2feedbackevaluation.js +4 -4
  40. package/models/operations/postv2humanevalsets.js +2 -2
  41. package/models/operations/retrievedatapoint.js +5 -5
  42. package/models/operations/retrievedataset.js +1 -1
  43. package/models/operations/retrievetool.js +4 -4
  44. package/models/operations/runagent.js +1 -1
  45. package/models/operations/streamrunagent.js +1 -1
  46. package/models/operations/updatedatapoint.js +5 -5
  47. package/models/operations/updatedataset.js +1 -1
  48. package/models/operations/updatetool.js +4 -4
  49. package/package.json +3 -3
  50. package/packages/orq-rc/src/funcs/environmentsCreate.ts +162 -0
  51. package/packages/orq-rc/src/funcs/environmentsDelete.ts +168 -0
  52. package/packages/orq-rc/src/funcs/environmentsGet.ts +168 -0
  53. package/packages/orq-rc/src/funcs/environmentsList.ts +172 -0
  54. package/packages/orq-rc/src/funcs/environmentsUpdate.ts +171 -0
  55. package/packages/orq-rc/src/funcs/responsesCompact.ts +183 -0
  56. package/packages/orq-rc/src/funcs/workspaceSecurityAddIPRange.ts +3 -3
  57. package/packages/orq-rc/src/funcs/workspaceSecurityCreateDomain.ts +1 -1
  58. package/packages/orq-rc/src/funcs/workspaceSecurityDeleteDomain.ts +1 -1
  59. package/packages/orq-rc/src/funcs/workspaceSecurityDeleteIPRange.ts +1 -1
  60. package/packages/orq-rc/src/funcs/workspaceSecurityGetIPAllowlist.ts +3 -1
  61. package/packages/orq-rc/src/funcs/workspaceSecurityListDomains.ts +1 -1
  62. package/packages/orq-rc/src/funcs/workspaceSecurityUpdateIPAllowlist.ts +3 -1
  63. package/packages/orq-rc/src/funcs/workspaceSecurityVerifyDomain.ts +3 -3
  64. package/packages/orq-rc/src/lib/config.ts +3 -3
  65. package/packages/orq-rc/src/models/components/createenvironmentrequest.ts +60 -0
  66. package/packages/orq-rc/src/models/components/createenvironmentresponse.ts +32 -0
  67. package/packages/orq-rc/src/models/components/deleteenvironmentresponse.ts +27 -0
  68. package/packages/orq-rc/src/models/components/environment.ts +78 -0
  69. package/packages/orq-rc/src/models/components/getenvironmentresponse.ts +32 -0
  70. package/packages/orq-rc/src/models/components/index.ts +9 -0
  71. package/packages/orq-rc/src/models/components/listenvironmentsresponse.ts +41 -0
  72. package/packages/orq-rc/src/models/components/publiccompactionitem.ts +79 -0
  73. package/packages/orq-rc/src/models/components/querytelemetryrequest.ts +12 -0
  74. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  75. package/packages/orq-rc/src/models/components/updateenvironmentrequest.ts +53 -0
  76. package/packages/orq-rc/src/models/components/updateenvironmentresponse.ts +32 -0
  77. package/packages/orq-rc/src/models/errors/compactresponse.ts +155 -0
  78. package/packages/orq-rc/src/models/errors/index.ts +1 -0
  79. package/packages/orq-rc/src/models/operations/compactresponse.ts +244 -0
  80. package/packages/orq-rc/src/models/operations/createannotation.ts +32 -19
  81. package/packages/orq-rc/src/models/operations/createembedding.ts +11 -7
  82. package/packages/orq-rc/src/models/operations/createrouterresponse.ts +18 -12
  83. package/packages/orq-rc/src/models/operations/createtool.ts +4 -4
  84. package/packages/orq-rc/src/models/operations/deleteannotation.ts +3 -4
  85. package/packages/orq-rc/src/models/operations/environmentdelete.ts +36 -0
  86. package/packages/orq-rc/src/models/operations/environmentget.ts +36 -0
  87. package/packages/orq-rc/src/models/operations/environmentlist.ts +50 -0
  88. package/packages/orq-rc/src/models/operations/environmentupdate.ts +41 -0
  89. package/packages/orq-rc/src/models/operations/getalltools.ts +4 -4
  90. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  91. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  92. package/packages/orq-rc/src/models/operations/index.ts +5 -0
  93. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  94. package/packages/orq-rc/src/models/operations/postv2feedback.ts +14 -18
  95. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +4 -4
  96. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  97. package/packages/orq-rc/src/models/operations/retrievetool.ts +4 -4
  98. package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
  99. package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
  100. package/packages/orq-rc/src/models/operations/updatetool.ts +4 -4
  101. package/packages/orq-rc/src/sdk/environments.ts +100 -0
  102. package/packages/orq-rc/src/sdk/responses.ts +18 -0
  103. package/packages/orq-rc/src/sdk/sdk.ts +16 -10
  104. package/sdk/classify.d.ts +1 -1
  105. package/sdk/classify.js +1 -1
  106. package/sdk/feedback.d.ts +8 -0
  107. package/sdk/feedback.d.ts.map +1 -1
  108. package/sdk/feedback.js +10 -0
  109. package/sdk/feedback.js.map +1 -1
  110. package/src/funcs/feedbackSubmit.ts +162 -0
  111. package/src/funcs/routerClassifyCreate.ts +1 -1
  112. package/src/lib/config.ts +3 -3
  113. package/src/models/components/classifyanswer.ts +1 -1
  114. package/src/models/components/classifyusage.ts +2 -2
  115. package/src/models/components/index.ts +2 -0
  116. package/src/models/components/reasoningpart.ts +1 -1
  117. package/src/models/components/submitfeedbackrequest.ts +48 -0
  118. package/src/models/components/submitfeedbackresponse.ts +39 -0
  119. package/src/models/operations/createclassify.ts +4 -2
  120. package/src/models/operations/createdataset.ts +1 -1
  121. package/src/models/operations/createdatasetitem.ts +5 -5
  122. package/src/models/operations/createtool.ts +4 -4
  123. package/src/models/operations/getalltools.ts +4 -4
  124. package/src/models/operations/getv2humanevalsets.ts +2 -2
  125. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  126. package/src/models/operations/listdatasetdatapoints.ts +5 -5
  127. package/src/models/operations/listdatasets.ts +1 -1
  128. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  129. package/src/models/operations/postv2feedbackevaluation.ts +4 -4
  130. package/src/models/operations/postv2humanevalsets.ts +2 -2
  131. package/src/models/operations/retrievedatapoint.ts +5 -5
  132. package/src/models/operations/retrievedataset.ts +1 -1
  133. package/src/models/operations/retrievetool.ts +4 -4
  134. package/src/models/operations/runagent.ts +1 -1
  135. package/src/models/operations/streamrunagent.ts +1 -1
  136. package/src/models/operations/updatedatapoint.ts +5 -5
  137. package/src/models/operations/updatedataset.ts +1 -1
  138. package/src/models/operations/updatetool.ts +4 -4
  139. package/src/sdk/classify.ts +1 -1
  140. package/src/sdk/feedback.ts +19 -0
@@ -0,0 +1,172 @@
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 environments
31
+ *
32
+ * @remarks
33
+ * Returns environments visible to the caller. When project_id is set, the result contains project-owned environments plus workspace environments shared with that project. When project_id is omitted, the result contains workspace-owned environments.
34
+ */
35
+ export function environmentsList(
36
+ client: OrqCore,
37
+ request?: operations.EnvironmentListRequest | undefined,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ components.ListEnvironmentsResponse,
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.EnvironmentListRequest | undefined,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ components.ListEnvironmentsResponse,
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.EnvironmentListRequest$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("/v3/environments")();
92
+
93
+ const query = encodeFormQuery({
94
+ "ending_before": payload?.ending_before,
95
+ "limit": payload?.limit,
96
+ "project_id": payload?.project_id,
97
+ "search": payload?.search,
98
+ "starting_after": payload?.starting_after,
99
+ });
100
+
101
+ const headers = new Headers(compactMap({
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: "EnvironmentList",
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: "GET",
127
+ baseURL: options?.serverURL,
128
+ path: path,
129
+ headers: headers,
130
+ query: query,
131
+ body: body,
132
+ userAgent: client._options.userAgent,
133
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
134
+ }, options);
135
+ if (!requestRes.ok) {
136
+ return [requestRes, { status: "invalid" }];
137
+ }
138
+ const req = requestRes.value;
139
+
140
+ const doResult = await client._do(req, {
141
+ context,
142
+ isErrorStatusCode: (statusCode: number) =>
143
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
144
+ retryConfig: context.retryConfig,
145
+ retryCodes: context.retryCodes,
146
+ });
147
+ if (!doResult.ok) {
148
+ return [doResult, { status: "request-error", request: req }];
149
+ }
150
+ const response = doResult.value;
151
+
152
+ const [result] = await M.match<
153
+ components.ListEnvironmentsResponse,
154
+ | OrqError
155
+ | ResponseValidationError
156
+ | ConnectionError
157
+ | RequestAbortedError
158
+ | RequestTimeoutError
159
+ | InvalidRequestError
160
+ | UnexpectedClientError
161
+ | SDKValidationError
162
+ >(
163
+ M.json(200, components.ListEnvironmentsResponse$inboundSchema),
164
+ M.fail("4XX"),
165
+ M.fail("5XX"),
166
+ )(response, req);
167
+ if (!result.ok) {
168
+ return [result, { status: "complete", request: req, response }];
169
+ }
170
+
171
+ return [result, { status: "complete", request: req, response }];
172
+ }
@@ -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 environment
31
+ *
32
+ * @remarks
33
+ * Updates environment metadata. Scope is immutable; sharing may only be updated on workspace-owned environments.
34
+ */
35
+ export function environmentsUpdate(
36
+ client: OrqCore,
37
+ request: operations.EnvironmentUpdateRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ components.UpdateEnvironmentResponse,
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.EnvironmentUpdateRequest,
62
+ options?: RequestOptions,
63
+ ): Promise<
64
+ [
65
+ Result<
66
+ components.UpdateEnvironmentResponse,
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.EnvironmentUpdateRequest$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.UpdateEnvironmentRequest, {
89
+ explode: true,
90
+ });
91
+
92
+ const pathParams = {
93
+ environment_id: encodeSimple("environment_id", payload.environment_id, {
94
+ explode: false,
95
+ charEncoding: "percent",
96
+ }),
97
+ };
98
+ const path = pathToFunc("/v3/environments/{environment_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: "EnvironmentUpdate",
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.UpdateEnvironmentResponse,
153
+ | OrqError
154
+ | ResponseValidationError
155
+ | ConnectionError
156
+ | RequestAbortedError
157
+ | RequestTimeoutError
158
+ | InvalidRequestError
159
+ | UnexpectedClientError
160
+ | SDKValidationError
161
+ >(
162
+ M.json(200, components.UpdateEnvironmentResponse$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
+ }
@@ -0,0 +1,183 @@
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 {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.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
+ * Compact response
31
+ *
32
+ * @remarks
33
+ * Compacts a conversation by summarizing older items to free up context window space. Returns a compaction item containing the generated summary.
34
+ */
35
+ export function responsesCompact(
36
+ client: OrqCore,
37
+ request: operations.CompactResponseRequestBody,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ operations.CompactResponseResponseBody,
42
+ | errors.CompactResponseResponseBody
43
+ | errors.CompactResponseResponsesResponseBody
44
+ | errors.CompactResponseResponsesResponseResponseBody
45
+ | OrqError
46
+ | ResponseValidationError
47
+ | ConnectionError
48
+ | RequestAbortedError
49
+ | RequestTimeoutError
50
+ | InvalidRequestError
51
+ | UnexpectedClientError
52
+ | SDKValidationError
53
+ >
54
+ > {
55
+ return new APIPromise($do(
56
+ client,
57
+ request,
58
+ options,
59
+ ));
60
+ }
61
+
62
+ async function $do(
63
+ client: OrqCore,
64
+ request: operations.CompactResponseRequestBody,
65
+ options?: RequestOptions,
66
+ ): Promise<
67
+ [
68
+ Result<
69
+ operations.CompactResponseResponseBody,
70
+ | errors.CompactResponseResponseBody
71
+ | errors.CompactResponseResponsesResponseBody
72
+ | errors.CompactResponseResponsesResponseResponseBody
73
+ | OrqError
74
+ | ResponseValidationError
75
+ | ConnectionError
76
+ | RequestAbortedError
77
+ | RequestTimeoutError
78
+ | InvalidRequestError
79
+ | UnexpectedClientError
80
+ | SDKValidationError
81
+ >,
82
+ APICall,
83
+ ]
84
+ > {
85
+ const parsed = safeParse(
86
+ request,
87
+ (value) =>
88
+ operations.CompactResponseRequestBody$outboundSchema.parse(value),
89
+ "Input validation failed",
90
+ );
91
+ if (!parsed.ok) {
92
+ return [parsed, { status: "invalid" }];
93
+ }
94
+ const payload = parsed.value;
95
+ const body = encodeJSON("body", payload, { explode: true });
96
+
97
+ const path = pathToFunc("/v1/responses/compact")();
98
+
99
+ const headers = new Headers(compactMap({
100
+ "Content-Type": "application/json",
101
+ Accept: "application/json",
102
+ }));
103
+
104
+ const secConfig = await extractSecurity(client._options.apiKey);
105
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
106
+ const requestSecurity = resolveGlobalSecurity(securityInput);
107
+
108
+ const context = {
109
+ options: client._options,
110
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
111
+ operationID: "compact-response",
112
+ oAuth2Scopes: null,
113
+
114
+ resolvedSecurity: requestSecurity,
115
+
116
+ securitySource: client._options.apiKey,
117
+ retryConfig: options?.retries
118
+ || client._options.retryConfig
119
+ || { strategy: "none" },
120
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
121
+ };
122
+
123
+ const requestRes = client._createRequest(context, {
124
+ security: requestSecurity,
125
+ method: "POST",
126
+ baseURL: options?.serverURL,
127
+ path: path,
128
+ headers: headers,
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 responseFields = {
151
+ HttpMeta: { Response: response, Request: req },
152
+ };
153
+
154
+ const [result] = await M.match<
155
+ operations.CompactResponseResponseBody,
156
+ | errors.CompactResponseResponseBody
157
+ | errors.CompactResponseResponsesResponseBody
158
+ | errors.CompactResponseResponsesResponseResponseBody
159
+ | OrqError
160
+ | ResponseValidationError
161
+ | ConnectionError
162
+ | RequestAbortedError
163
+ | RequestTimeoutError
164
+ | InvalidRequestError
165
+ | UnexpectedClientError
166
+ | SDKValidationError
167
+ >(
168
+ M.json(200, operations.CompactResponseResponseBody$inboundSchema),
169
+ M.jsonErr(400, errors.CompactResponseResponseBody$inboundSchema),
170
+ M.jsonErr(401, errors.CompactResponseResponsesResponseBody$inboundSchema),
171
+ M.jsonErr(
172
+ 502,
173
+ errors.CompactResponseResponsesResponseResponseBody$inboundSchema,
174
+ ),
175
+ M.fail("4XX"),
176
+ M.fail("5XX"),
177
+ )(response, req, { extraFields: responseFields });
178
+ if (!result.ok) {
179
+ return [result, { status: "complete", request: req, response }];
180
+ }
181
+
182
+ return [result, { status: "complete", request: req, response }];
183
+ }
@@ -94,9 +94,9 @@ async function $do(
94
94
  charEncoding: "percent",
95
95
  }),
96
96
  };
97
- const path = pathToFunc("/v2/{workspace_key}/ip-allowlist/entries")(
98
- pathParams,
99
- );
97
+ const path = pathToFunc(
98
+ "/v2/workspaces/{workspace_key}/ip-allowlist/entries",
99
+ )(pathParams);
100
100
 
101
101
  const headers = new Headers(compactMap({
102
102
  "Content-Type": "application/json",
@@ -98,7 +98,7 @@ async function $do(
98
98
  charEncoding: "percent",
99
99
  }),
100
100
  };
101
- const path = pathToFunc("/v2/{workspace_key}/domains")(pathParams);
101
+ const path = pathToFunc("/v2/workspaces/{workspace_key}/domains")(pathParams);
102
102
 
103
103
  const headers = new Headers(compactMap({
104
104
  "Content-Type": "application/json",
@@ -100,7 +100,7 @@ async function $do(
100
100
  charEncoding: "percent",
101
101
  }),
102
102
  };
103
- const path = pathToFunc("/v2/{workspace_key}/domains/{domain_id}")(
103
+ const path = pathToFunc("/v2/workspaces/{workspace_key}/domains/{domain_id}")(
104
104
  pathParams,
105
105
  );
106
106
 
@@ -101,7 +101,7 @@ async function $do(
101
101
  }),
102
102
  };
103
103
  const path = pathToFunc(
104
- "/v2/{workspace_key}/ip-allowlist/entries/{range_id}",
104
+ "/v2/workspaces/{workspace_key}/ip-allowlist/entries/{range_id}",
105
105
  )(pathParams);
106
106
 
107
107
  const headers = new Headers(compactMap({
@@ -96,7 +96,9 @@ async function $do(
96
96
  charEncoding: "percent",
97
97
  }),
98
98
  };
99
- const path = pathToFunc("/v2/{workspace_key}/ip-allowlist")(pathParams);
99
+ const path = pathToFunc("/v2/workspaces/{workspace_key}/ip-allowlist")(
100
+ pathParams,
101
+ );
100
102
 
101
103
  const headers = new Headers(compactMap({
102
104
  Accept: "application/json",
@@ -96,7 +96,7 @@ async function $do(
96
96
  charEncoding: "percent",
97
97
  }),
98
98
  };
99
- const path = pathToFunc("/v2/{workspace_key}/domains")(pathParams);
99
+ const path = pathToFunc("/v2/workspaces/{workspace_key}/domains")(pathParams);
100
100
 
101
101
  const headers = new Headers(compactMap({
102
102
  Accept: "application/json",
@@ -98,7 +98,9 @@ async function $do(
98
98
  charEncoding: "percent",
99
99
  }),
100
100
  };
101
- const path = pathToFunc("/v2/{workspace_key}/ip-allowlist")(pathParams);
101
+ const path = pathToFunc("/v2/workspaces/{workspace_key}/ip-allowlist")(
102
+ pathParams,
103
+ );
102
104
 
103
105
  const headers = new Headers(compactMap({
104
106
  "Content-Type": "application/json",
@@ -100,9 +100,9 @@ async function $do(
100
100
  charEncoding: "percent",
101
101
  }),
102
102
  };
103
- const path = pathToFunc("/v2/{workspace_key}/domains/{domain_id}/verify")(
104
- pathParams,
105
- );
103
+ const path = pathToFunc(
104
+ "/v2/workspaces/{workspace_key}/domains/{domain_id}/verify",
105
+ )(pathParams);
106
106
 
107
107
  const headers = new Headers(compactMap({
108
108
  Accept: "application/json",
@@ -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.16.0-rc.14",
62
- genVersion: "2.938.0",
63
- userAgent: "speakeasy-sdk/typescript 4.16.0-rc.14 2.938.0 2.0 @orq-ai/node",
61
+ sdkVersion: "4.16.0-rc.20",
62
+ genVersion: "2.941.0",
63
+ userAgent: "speakeasy-sdk/typescript 4.16.0-rc.20 2.941.0 2.0 @orq-ai/node",
64
64
  } as const;
@@ -0,0 +1,60 @@
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 {
8
+ Sharing,
9
+ Sharing$Outbound,
10
+ Sharing$outboundSchema,
11
+ } from "./sharing.js";
12
+
13
+ export type CreateEnvironmentRequest = {
14
+ slug: string;
15
+ displayName: string;
16
+ description?: string | undefined;
17
+ projectId?: string | undefined;
18
+ /**
19
+ * Sharing controls which projects in the workspace may use this entity and
20
+ *
21
+ * @remarks
22
+ * what they may do with it.
23
+ */
24
+ sharing?: Sharing | undefined;
25
+ };
26
+
27
+ /** @internal */
28
+ export type CreateEnvironmentRequest$Outbound = {
29
+ slug: string;
30
+ display_name: string;
31
+ description?: string | undefined;
32
+ project_id?: string | undefined;
33
+ sharing?: Sharing$Outbound | undefined;
34
+ };
35
+
36
+ /** @internal */
37
+ export const CreateEnvironmentRequest$outboundSchema: z.ZodType<
38
+ CreateEnvironmentRequest$Outbound,
39
+ z.ZodTypeDef,
40
+ CreateEnvironmentRequest
41
+ > = z.object({
42
+ slug: z.string(),
43
+ displayName: z.string(),
44
+ description: z.string().optional(),
45
+ projectId: z.string().optional(),
46
+ sharing: Sharing$outboundSchema.optional(),
47
+ }).transform((v) => {
48
+ return remap$(v, {
49
+ displayName: "display_name",
50
+ projectId: "project_id",
51
+ });
52
+ });
53
+
54
+ export function createEnvironmentRequestToJSON(
55
+ createEnvironmentRequest: CreateEnvironmentRequest,
56
+ ): string {
57
+ return JSON.stringify(
58
+ CreateEnvironmentRequest$outboundSchema.parse(createEnvironmentRequest),
59
+ );
60
+ }