@orq-ai/node 4.16.10 → 4.16.12

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 (155) hide show
  1. package/funcs/websearchSearch.d.ts +3 -3
  2. package/funcs/websearchSearch.js +3 -3
  3. package/jsr.json +1 -1
  4. package/lib/config.d.ts +2 -2
  5. package/lib/config.js +2 -2
  6. package/models/components/reasoningpart.js +1 -1
  7. package/models/operations/createtool.js +4 -4
  8. package/models/operations/getalltools.js +4 -4
  9. package/models/operations/getv2humanevalsets.js +2 -2
  10. package/models/operations/getv2humanevalsetsid.js +2 -2
  11. package/models/operations/listdeploymentversions.js +1 -1
  12. package/models/operations/patchv2humanevalsetsid.js +2 -2
  13. package/models/operations/postv2feedbackevaluation.js +4 -4
  14. package/models/operations/postv2humanevalsets.js +2 -2
  15. package/models/operations/retrievetool.js +4 -4
  16. package/models/operations/runagent.js +1 -1
  17. package/models/operations/searchweb.d.ts +3 -1
  18. package/models/operations/searchweb.d.ts.map +1 -1
  19. package/models/operations/searchweb.js +2 -0
  20. package/models/operations/searchweb.js.map +1 -1
  21. package/models/operations/streamrunagent.js +1 -1
  22. package/models/operations/updatetool.js +4 -4
  23. package/package.json +1 -1
  24. package/packages/orq-rc/src/funcs/auditLogDestinationsCreate.ts +172 -0
  25. package/packages/orq-rc/src/funcs/auditLogDestinationsDelete.ts +180 -0
  26. package/packages/orq-rc/src/funcs/auditLogDestinationsGet.ts +180 -0
  27. package/packages/orq-rc/src/funcs/auditLogDestinationsList.ts +181 -0
  28. package/packages/orq-rc/src/funcs/auditLogDestinationsListDeliveries.ts +190 -0
  29. package/packages/orq-rc/src/funcs/auditLogDestinationsReplay.ts +183 -0
  30. package/packages/orq-rc/src/funcs/auditLogDestinationsRotateSecret.ts +185 -0
  31. package/packages/orq-rc/src/funcs/auditLogDestinationsTest.ts +180 -0
  32. package/packages/orq-rc/src/funcs/auditLogDestinationsUpdate.ts +183 -0
  33. package/packages/orq-rc/src/funcs/modelsAzureFoundryDeployments.ts +1 -1
  34. package/packages/orq-rc/src/funcs/modelsUpdate.ts +1 -1
  35. package/packages/orq-rc/src/funcs/websearchSearch.ts +3 -3
  36. package/packages/orq-rc/src/lib/config.ts +2 -2
  37. package/packages/orq-rc/src/models/components/alertscope.ts +0 -1
  38. package/packages/orq-rc/src/models/components/alerttelemetrysource.ts +0 -1
  39. package/packages/orq-rc/src/models/components/auditlogdelivery.ts +100 -0
  40. package/packages/orq-rc/src/models/components/auditlogdeliverykind.ts +18 -0
  41. package/packages/orq-rc/src/models/components/auditlogdeliverystatus.ts +24 -0
  42. package/packages/orq-rc/src/models/components/auditlogdestination.ts +83 -0
  43. package/packages/orq-rc/src/models/components/auditlogdestinationstatus.ts +23 -0
  44. package/packages/orq-rc/src/models/components/budgetalertdimension.ts +0 -1
  45. package/packages/orq-rc/src/models/components/budgetperiod.ts +0 -1
  46. package/packages/orq-rc/src/models/components/budgetscopekind.ts +0 -1
  47. package/packages/orq-rc/src/models/components/budgetsortfield.ts +0 -1
  48. package/packages/orq-rc/src/models/components/createauditlogdestinationrequest.ts +53 -0
  49. package/packages/orq-rc/src/models/components/createauditlogdestinationresponse.ts +45 -0
  50. package/packages/orq-rc/src/models/components/createmanagementkeyrequest.ts +2 -3
  51. package/packages/orq-rc/src/models/components/createmcpgatewayrequest.ts +7 -0
  52. package/packages/orq-rc/src/models/components/deleteauditlogdestinationresponse.ts +27 -0
  53. package/packages/orq-rc/src/models/components/domainverificationstatus.ts +0 -1
  54. package/packages/orq-rc/src/models/components/effectiveuserpermissions.ts +31 -0
  55. package/packages/orq-rc/src/models/components/filepurpose.ts +0 -1
  56. package/packages/orq-rc/src/models/components/getauditlogdestinationresponse.ts +35 -0
  57. package/packages/orq-rc/src/models/components/getlogcontextresponse.ts +1 -1
  58. package/packages/orq-rc/src/models/components/getlogresponse.ts +1 -1
  59. package/packages/orq-rc/src/models/components/identitysortfield.ts +0 -1
  60. package/packages/orq-rc/src/models/components/index.ts +21 -0
  61. package/packages/orq-rc/src/models/components/listauditlogdeliveriesresponse.ts +44 -0
  62. package/packages/orq-rc/src/models/components/listauditlogdestinationsresponse.ts +44 -0
  63. package/packages/orq-rc/src/models/components/log.ts +1 -1
  64. package/packages/orq-rc/src/models/components/managementkey.ts +2 -2
  65. package/packages/orq-rc/src/models/components/managementkeystatus.ts +0 -1
  66. package/packages/orq-rc/src/models/components/managementpermissionmode.ts +0 -1
  67. package/packages/orq-rc/src/models/components/mcpauthtype.ts +0 -1
  68. package/packages/orq-rc/src/models/components/mcpconnectiontype.ts +0 -1
  69. package/packages/orq-rc/src/models/components/mcpgateway.ts +6 -0
  70. package/packages/orq-rc/src/models/components/mcpgatewaymode.ts +0 -1
  71. package/packages/orq-rc/src/models/components/mcpgatewayserverlink.ts +15 -0
  72. package/packages/orq-rc/src/models/components/mcpgatewaystatus.ts +0 -1
  73. package/packages/orq-rc/src/models/components/mcpserver.ts +6 -0
  74. package/packages/orq-rc/src/models/components/mcpskill.ts +85 -0
  75. package/packages/orq-rc/src/models/components/mcpskillexposure.ts +72 -0
  76. package/packages/orq-rc/src/models/components/mcpskillfile.ts +47 -0
  77. package/packages/orq-rc/src/models/components/mcpsyncstate.ts +6 -0
  78. package/packages/orq-rc/src/models/components/mcptoolexposuremode.ts +0 -1
  79. package/packages/orq-rc/src/models/components/mcptoolnaming.ts +0 -1
  80. package/packages/orq-rc/src/models/components/modeldocument.ts +3 -0
  81. package/packages/orq-rc/src/models/components/modelfusionpreset.ts +0 -1
  82. package/packages/orq-rc/src/models/components/modelfusionsynthesismode.ts +0 -2
  83. package/packages/orq-rc/src/models/components/monitortelemetrysource.ts +0 -1
  84. package/packages/orq-rc/src/models/components/notifiertype.ts +0 -1
  85. package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
  86. package/packages/orq-rc/src/models/components/replayauditlogdeliveriesrequest.ts +42 -0
  87. package/packages/orq-rc/src/models/components/replayauditlogdeliveriesresponse.ts +41 -0
  88. package/packages/orq-rc/src/models/components/rotateauditlogdestinationsecretresponse.ts +51 -0
  89. package/packages/orq-rc/src/models/components/sessioninterval.ts +0 -1
  90. package/packages/orq-rc/src/models/components/smartrouterprofile.ts +0 -1
  91. package/packages/orq-rc/src/models/components/syncstatus.ts +0 -1
  92. package/packages/orq-rc/src/models/components/telemetryquerymode.ts +0 -1
  93. package/packages/orq-rc/src/models/components/telemetryresultkind.ts +0 -1
  94. package/packages/orq-rc/src/models/components/telemetrysource.ts +0 -1
  95. package/packages/orq-rc/src/models/components/telemetryvaluecardinality.ts +0 -2
  96. package/packages/orq-rc/src/models/components/testauditlogdestinationresponse.ts +35 -0
  97. package/packages/orq-rc/src/models/components/threadkind.ts +0 -1
  98. package/packages/orq-rc/src/models/components/updateauditlogdestinationrequest.ts +60 -0
  99. package/packages/orq-rc/src/models/components/updateauditlogdestinationresponse.ts +35 -0
  100. package/packages/orq-rc/src/models/components/updateidentityrequest.ts +1 -1
  101. package/packages/orq-rc/src/models/components/updatemcpgatewayrequest.ts +14 -0
  102. package/packages/orq-rc/src/models/components/updateworkspacesettingsrequest.ts +2 -4
  103. package/packages/orq-rc/src/models/components/workspacecapabilities.ts +11 -0
  104. package/packages/orq-rc/src/models/operations/auditlogdestinationdelete.ts +38 -0
  105. package/packages/orq-rc/src/models/operations/auditlogdestinationget.ts +38 -0
  106. package/packages/orq-rc/src/models/operations/auditlogdestinationlist.ts +45 -0
  107. package/packages/orq-rc/src/models/operations/auditlogdestinationlistdeliveries.ts +54 -0
  108. package/packages/orq-rc/src/models/operations/auditlogdestinationreplay.ts +45 -0
  109. package/packages/orq-rc/src/models/operations/auditlogdestinationrotatesecret.ts +39 -0
  110. package/packages/orq-rc/src/models/operations/auditlogdestinationtest.ts +38 -0
  111. package/packages/orq-rc/src/models/operations/auditlogdestinationupdate.ts +45 -0
  112. package/packages/orq-rc/src/models/operations/createtool.ts +4 -4
  113. package/packages/orq-rc/src/models/operations/getalltools.ts +4 -4
  114. package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
  115. package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
  116. package/packages/orq-rc/src/models/operations/index.ts +8 -0
  117. package/packages/orq-rc/src/models/operations/listdeploymentversions.ts +1 -1
  118. package/packages/orq-rc/src/models/operations/modelcreate.ts +3 -0
  119. package/packages/orq-rc/src/models/operations/modelcreateawsbedrock.ts +3 -0
  120. package/packages/orq-rc/src/models/operations/modelcreateopenailike.ts +3 -0
  121. package/packages/orq-rc/src/models/operations/modelcreatevertex.ts +3 -0
  122. package/packages/orq-rc/src/models/operations/modelupdate.ts +3 -0
  123. package/packages/orq-rc/src/models/operations/modelupdateawsbedrock.ts +3 -0
  124. package/packages/orq-rc/src/models/operations/modelupdateopenailike.ts +3 -0
  125. package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  126. package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +4 -4
  127. package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
  128. package/packages/orq-rc/src/models/operations/retrievetool.ts +4 -4
  129. package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
  130. package/packages/orq-rc/src/models/operations/searchweb.ts +3 -1
  131. package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
  132. package/packages/orq-rc/src/models/operations/updatetool.ts +4 -4
  133. package/packages/orq-rc/src/sdk/auditlogdestinations.ts +172 -0
  134. package/packages/orq-rc/src/sdk/models.ts +2 -2
  135. package/packages/orq-rc/src/sdk/sdk.ts +8 -0
  136. package/packages/orq-rc/src/sdk/websearch.ts +3 -3
  137. package/sdk/websearch.d.ts +3 -3
  138. package/sdk/websearch.js +3 -3
  139. package/src/funcs/websearchSearch.ts +3 -3
  140. package/src/lib/config.ts +2 -2
  141. package/src/models/components/reasoningpart.ts +1 -1
  142. package/src/models/operations/createtool.ts +4 -4
  143. package/src/models/operations/getalltools.ts +4 -4
  144. package/src/models/operations/getv2humanevalsets.ts +2 -2
  145. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  146. package/src/models/operations/listdeploymentversions.ts +1 -1
  147. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  148. package/src/models/operations/postv2feedbackevaluation.ts +4 -4
  149. package/src/models/operations/postv2humanevalsets.ts +2 -2
  150. package/src/models/operations/retrievetool.ts +4 -4
  151. package/src/models/operations/runagent.ts +1 -1
  152. package/src/models/operations/searchweb.ts +3 -1
  153. package/src/models/operations/streamrunagent.ts +1 -1
  154. package/src/models/operations/updatetool.ts +4 -4
  155. package/src/sdk/websearch.ts +3 -3
@@ -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 { encodeJSON } from "../lib/encodings.js";
7
+ import { matchStatusCode } from "../lib/http.js";
8
+ import * as M from "../lib/matchers.js";
9
+ import { compactMap } from "../lib/primitives.js";
10
+ import { safeParse } from "../lib/schemas.js";
11
+ import { RequestOptions } from "../lib/sdks.js";
12
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
13
+ import { pathToFunc } from "../lib/url.js";
14
+ import * as components from "../models/components/index.js";
15
+ import {
16
+ ConnectionError,
17
+ InvalidRequestError,
18
+ RequestAbortedError,
19
+ RequestTimeoutError,
20
+ UnexpectedClientError,
21
+ } from "../models/errors/httpclienterrors.js";
22
+ import * as errors from "../models/errors/index.js";
23
+ import { OrqError } from "../models/errors/orqerror.js";
24
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
+ import { APICall, APIPromise } from "../types/async.js";
27
+ import { Result } from "../types/fp.js";
28
+
29
+ /**
30
+ * Create an audit log destination
31
+ *
32
+ * @remarks
33
+ * Creates a signed webhook destination that receives every audit log event recorded in the workspace from this point on. The signing secret is returned once in this response and never again.
34
+ */
35
+ export function auditLogDestinationsCreate(
36
+ client: OrqCore,
37
+ request: components.CreateAuditLogDestinationRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ components.CreateAuditLogDestinationResponse,
42
+ | errors.ErrorResponse
43
+ | OrqError
44
+ | ResponseValidationError
45
+ | ConnectionError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | InvalidRequestError
49
+ | UnexpectedClientError
50
+ | SDKValidationError
51
+ >
52
+ > {
53
+ return new APIPromise($do(
54
+ client,
55
+ request,
56
+ options,
57
+ ));
58
+ }
59
+
60
+ async function $do(
61
+ client: OrqCore,
62
+ request: components.CreateAuditLogDestinationRequest,
63
+ options?: RequestOptions,
64
+ ): Promise<
65
+ [
66
+ Result<
67
+ components.CreateAuditLogDestinationResponse,
68
+ | errors.ErrorResponse
69
+ | OrqError
70
+ | ResponseValidationError
71
+ | ConnectionError
72
+ | RequestAbortedError
73
+ | RequestTimeoutError
74
+ | InvalidRequestError
75
+ | UnexpectedClientError
76
+ | SDKValidationError
77
+ >,
78
+ APICall,
79
+ ]
80
+ > {
81
+ const parsed = safeParse(
82
+ request,
83
+ (value) =>
84
+ components.CreateAuditLogDestinationRequest$outboundSchema.parse(value),
85
+ "Input validation failed",
86
+ );
87
+ if (!parsed.ok) {
88
+ return [parsed, { status: "invalid" }];
89
+ }
90
+ const payload = parsed.value;
91
+ const body = encodeJSON("body", payload, { explode: true });
92
+
93
+ const path = pathToFunc("/v3/audit-log-destinations")();
94
+
95
+ const headers = new Headers(compactMap({
96
+ "Content-Type": "application/json",
97
+ Accept: "application/json",
98
+ }));
99
+
100
+ const secConfig = await extractSecurity(client._options.apiKey);
101
+ const securityInput = secConfig == null ? {} : { apiKey: secConfig };
102
+ const requestSecurity = resolveGlobalSecurity(securityInput);
103
+
104
+ const context = {
105
+ options: client._options,
106
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
107
+ operationID: "AuditLogDestinationCreate",
108
+ oAuth2Scopes: null,
109
+
110
+ resolvedSecurity: requestSecurity,
111
+
112
+ securitySource: client._options.apiKey,
113
+ retryConfig: options?.retries
114
+ || client._options.retryConfig
115
+ || { strategy: "none" },
116
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
117
+ };
118
+
119
+ const requestRes = client._createRequest(context, {
120
+ security: requestSecurity,
121
+ method: "POST",
122
+ baseURL: options?.serverURL,
123
+ path: path,
124
+ headers: headers,
125
+ body: body,
126
+ userAgent: client._options.userAgent,
127
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
128
+ }, options);
129
+ if (!requestRes.ok) {
130
+ return [requestRes, { status: "invalid" }];
131
+ }
132
+ const req = requestRes.value;
133
+
134
+ const doResult = await client._do(req, {
135
+ context,
136
+ isErrorStatusCode: (statusCode: number) =>
137
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
138
+ retryConfig: context.retryConfig,
139
+ retryCodes: context.retryCodes,
140
+ });
141
+ if (!doResult.ok) {
142
+ return [doResult, { status: "request-error", request: req }];
143
+ }
144
+ const response = doResult.value;
145
+
146
+ const responseFields = {
147
+ HttpMeta: { Response: response, Request: req },
148
+ };
149
+
150
+ const [result] = await M.match<
151
+ components.CreateAuditLogDestinationResponse,
152
+ | errors.ErrorResponse
153
+ | OrqError
154
+ | ResponseValidationError
155
+ | ConnectionError
156
+ | RequestAbortedError
157
+ | RequestTimeoutError
158
+ | InvalidRequestError
159
+ | UnexpectedClientError
160
+ | SDKValidationError
161
+ >(
162
+ M.json(200, components.CreateAuditLogDestinationResponse$inboundSchema),
163
+ M.jsonErr(401, errors.ErrorResponse$inboundSchema),
164
+ M.fail("4XX"),
165
+ M.fail("5XX"),
166
+ )(response, req, { extraFields: responseFields });
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,180 @@
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 * as errors from "../models/errors/index.js";
23
+ import { OrqError } from "../models/errors/orqerror.js";
24
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * Delete an audit log destination
32
+ *
33
+ * @remarks
34
+ * Deletes a destination and cancels its pending deliveries.
35
+ */
36
+ export function auditLogDestinationsDelete(
37
+ client: OrqCore,
38
+ request: operations.AuditLogDestinationDeleteRequest,
39
+ options?: RequestOptions,
40
+ ): APIPromise<
41
+ Result<
42
+ components.DeleteAuditLogDestinationResponse,
43
+ | errors.ErrorResponse
44
+ | OrqError
45
+ | ResponseValidationError
46
+ | ConnectionError
47
+ | RequestAbortedError
48
+ | RequestTimeoutError
49
+ | InvalidRequestError
50
+ | UnexpectedClientError
51
+ | SDKValidationError
52
+ >
53
+ > {
54
+ return new APIPromise($do(
55
+ client,
56
+ request,
57
+ options,
58
+ ));
59
+ }
60
+
61
+ async function $do(
62
+ client: OrqCore,
63
+ request: operations.AuditLogDestinationDeleteRequest,
64
+ options?: RequestOptions,
65
+ ): Promise<
66
+ [
67
+ Result<
68
+ components.DeleteAuditLogDestinationResponse,
69
+ | errors.ErrorResponse
70
+ | OrqError
71
+ | ResponseValidationError
72
+ | ConnectionError
73
+ | RequestAbortedError
74
+ | RequestTimeoutError
75
+ | InvalidRequestError
76
+ | UnexpectedClientError
77
+ | SDKValidationError
78
+ >,
79
+ APICall,
80
+ ]
81
+ > {
82
+ const parsed = safeParse(
83
+ request,
84
+ (value) =>
85
+ operations.AuditLogDestinationDeleteRequest$outboundSchema.parse(value),
86
+ "Input validation failed",
87
+ );
88
+ if (!parsed.ok) {
89
+ return [parsed, { status: "invalid" }];
90
+ }
91
+ const payload = parsed.value;
92
+ const body = null;
93
+
94
+ const pathParams = {
95
+ destination_id: encodeSimple("destination_id", payload.destination_id, {
96
+ explode: false,
97
+ charEncoding: "percent",
98
+ }),
99
+ };
100
+ const path = pathToFunc("/v3/audit-log-destinations/{destination_id}")(
101
+ pathParams,
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: "AuditLogDestinationDelete",
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: "DELETE",
130
+ baseURL: options?.serverURL,
131
+ path: path,
132
+ headers: headers,
133
+ body: body,
134
+ userAgent: client._options.userAgent,
135
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
136
+ }, options);
137
+ if (!requestRes.ok) {
138
+ return [requestRes, { status: "invalid" }];
139
+ }
140
+ const req = requestRes.value;
141
+
142
+ const doResult = await client._do(req, {
143
+ context,
144
+ isErrorStatusCode: (statusCode: number) =>
145
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
146
+ retryConfig: context.retryConfig,
147
+ retryCodes: context.retryCodes,
148
+ });
149
+ if (!doResult.ok) {
150
+ return [doResult, { status: "request-error", request: req }];
151
+ }
152
+ const response = doResult.value;
153
+
154
+ const responseFields = {
155
+ HttpMeta: { Response: response, Request: req },
156
+ };
157
+
158
+ const [result] = await M.match<
159
+ components.DeleteAuditLogDestinationResponse,
160
+ | errors.ErrorResponse
161
+ | OrqError
162
+ | ResponseValidationError
163
+ | ConnectionError
164
+ | RequestAbortedError
165
+ | RequestTimeoutError
166
+ | InvalidRequestError
167
+ | UnexpectedClientError
168
+ | SDKValidationError
169
+ >(
170
+ M.json(200, components.DeleteAuditLogDestinationResponse$inboundSchema),
171
+ M.jsonErr(401, errors.ErrorResponse$inboundSchema),
172
+ M.fail("4XX"),
173
+ M.fail("5XX"),
174
+ )(response, req, { extraFields: responseFields });
175
+ if (!result.ok) {
176
+ return [result, { status: "complete", request: req, response }];
177
+ }
178
+
179
+ return [result, { status: "complete", request: req, response }];
180
+ }
@@ -0,0 +1,180 @@
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 * as errors from "../models/errors/index.js";
23
+ import { OrqError } from "../models/errors/orqerror.js";
24
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * Retrieve an audit log destination
32
+ *
33
+ * @remarks
34
+ * Retrieves an audit log destination by ID. The signing secret is never returned.
35
+ */
36
+ export function auditLogDestinationsGet(
37
+ client: OrqCore,
38
+ request: operations.AuditLogDestinationGetRequest,
39
+ options?: RequestOptions,
40
+ ): APIPromise<
41
+ Result<
42
+ components.GetAuditLogDestinationResponse,
43
+ | errors.ErrorResponse
44
+ | OrqError
45
+ | ResponseValidationError
46
+ | ConnectionError
47
+ | RequestAbortedError
48
+ | RequestTimeoutError
49
+ | InvalidRequestError
50
+ | UnexpectedClientError
51
+ | SDKValidationError
52
+ >
53
+ > {
54
+ return new APIPromise($do(
55
+ client,
56
+ request,
57
+ options,
58
+ ));
59
+ }
60
+
61
+ async function $do(
62
+ client: OrqCore,
63
+ request: operations.AuditLogDestinationGetRequest,
64
+ options?: RequestOptions,
65
+ ): Promise<
66
+ [
67
+ Result<
68
+ components.GetAuditLogDestinationResponse,
69
+ | errors.ErrorResponse
70
+ | OrqError
71
+ | ResponseValidationError
72
+ | ConnectionError
73
+ | RequestAbortedError
74
+ | RequestTimeoutError
75
+ | InvalidRequestError
76
+ | UnexpectedClientError
77
+ | SDKValidationError
78
+ >,
79
+ APICall,
80
+ ]
81
+ > {
82
+ const parsed = safeParse(
83
+ request,
84
+ (value) =>
85
+ operations.AuditLogDestinationGetRequest$outboundSchema.parse(value),
86
+ "Input validation failed",
87
+ );
88
+ if (!parsed.ok) {
89
+ return [parsed, { status: "invalid" }];
90
+ }
91
+ const payload = parsed.value;
92
+ const body = null;
93
+
94
+ const pathParams = {
95
+ destination_id: encodeSimple("destination_id", payload.destination_id, {
96
+ explode: false,
97
+ charEncoding: "percent",
98
+ }),
99
+ };
100
+ const path = pathToFunc("/v3/audit-log-destinations/{destination_id}")(
101
+ pathParams,
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: "AuditLogDestinationGet",
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
+ body: body,
134
+ userAgent: client._options.userAgent,
135
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
136
+ }, options);
137
+ if (!requestRes.ok) {
138
+ return [requestRes, { status: "invalid" }];
139
+ }
140
+ const req = requestRes.value;
141
+
142
+ const doResult = await client._do(req, {
143
+ context,
144
+ isErrorStatusCode: (statusCode: number) =>
145
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
146
+ retryConfig: context.retryConfig,
147
+ retryCodes: context.retryCodes,
148
+ });
149
+ if (!doResult.ok) {
150
+ return [doResult, { status: "request-error", request: req }];
151
+ }
152
+ const response = doResult.value;
153
+
154
+ const responseFields = {
155
+ HttpMeta: { Response: response, Request: req },
156
+ };
157
+
158
+ const [result] = await M.match<
159
+ components.GetAuditLogDestinationResponse,
160
+ | errors.ErrorResponse
161
+ | OrqError
162
+ | ResponseValidationError
163
+ | ConnectionError
164
+ | RequestAbortedError
165
+ | RequestTimeoutError
166
+ | InvalidRequestError
167
+ | UnexpectedClientError
168
+ | SDKValidationError
169
+ >(
170
+ M.json(200, components.GetAuditLogDestinationResponse$inboundSchema),
171
+ M.jsonErr(401, errors.ErrorResponse$inboundSchema),
172
+ M.fail("4XX"),
173
+ M.fail("5XX"),
174
+ )(response, req, { extraFields: responseFields });
175
+ if (!result.ok) {
176
+ return [result, { status: "complete", request: req, response }];
177
+ }
178
+
179
+ return [result, { status: "complete", request: req, response }];
180
+ }
@@ -0,0 +1,181 @@
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 * as errors from "../models/errors/index.js";
23
+ import { OrqError } from "../models/errors/orqerror.js";
24
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
25
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+
30
+ /**
31
+ * List audit log destinations
32
+ *
33
+ * @remarks
34
+ * Returns the audit log destinations of the workspace, newest first, with cursor pagination.
35
+ */
36
+ export function auditLogDestinationsList(
37
+ client: OrqCore,
38
+ request?: operations.AuditLogDestinationListRequest | undefined,
39
+ options?: RequestOptions,
40
+ ): APIPromise<
41
+ Result<
42
+ components.ListAuditLogDestinationsResponse,
43
+ | errors.ErrorResponse
44
+ | OrqError
45
+ | ResponseValidationError
46
+ | ConnectionError
47
+ | RequestAbortedError
48
+ | RequestTimeoutError
49
+ | InvalidRequestError
50
+ | UnexpectedClientError
51
+ | SDKValidationError
52
+ >
53
+ > {
54
+ return new APIPromise($do(
55
+ client,
56
+ request,
57
+ options,
58
+ ));
59
+ }
60
+
61
+ async function $do(
62
+ client: OrqCore,
63
+ request?: operations.AuditLogDestinationListRequest | undefined,
64
+ options?: RequestOptions,
65
+ ): Promise<
66
+ [
67
+ Result<
68
+ components.ListAuditLogDestinationsResponse,
69
+ | errors.ErrorResponse
70
+ | OrqError
71
+ | ResponseValidationError
72
+ | ConnectionError
73
+ | RequestAbortedError
74
+ | RequestTimeoutError
75
+ | InvalidRequestError
76
+ | UnexpectedClientError
77
+ | SDKValidationError
78
+ >,
79
+ APICall,
80
+ ]
81
+ > {
82
+ const parsed = safeParse(
83
+ request,
84
+ (value) =>
85
+ operations.AuditLogDestinationListRequest$outboundSchema.optional().parse(
86
+ value,
87
+ ),
88
+ "Input validation failed",
89
+ );
90
+ if (!parsed.ok) {
91
+ return [parsed, { status: "invalid" }];
92
+ }
93
+ const payload = parsed.value;
94
+ const body = null;
95
+
96
+ const path = pathToFunc("/v3/audit-log-destinations")();
97
+
98
+ const query = encodeFormQuery({
99
+ "ending_before": payload?.ending_before,
100
+ "limit": payload?.limit,
101
+ "starting_after": payload?.starting_after,
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: "AuditLogDestinationList",
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 responseFields = {
156
+ HttpMeta: { Response: response, Request: req },
157
+ };
158
+
159
+ const [result] = await M.match<
160
+ components.ListAuditLogDestinationsResponse,
161
+ | errors.ErrorResponse
162
+ | OrqError
163
+ | ResponseValidationError
164
+ | ConnectionError
165
+ | RequestAbortedError
166
+ | RequestTimeoutError
167
+ | InvalidRequestError
168
+ | UnexpectedClientError
169
+ | SDKValidationError
170
+ >(
171
+ M.json(200, components.ListAuditLogDestinationsResponse$inboundSchema),
172
+ M.jsonErr(401, errors.ErrorResponse$inboundSchema),
173
+ M.fail("4XX"),
174
+ M.fail("5XX"),
175
+ )(response, req, { extraFields: responseFields });
176
+ if (!result.ok) {
177
+ return [result, { status: "complete", request: req, response }];
178
+ }
179
+
180
+ return [result, { status: "complete", request: req, response }];
181
+ }