@orq-ai/node 4.11.0-rc.51 → 4.11.0-rc.52
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.
- package/README.md +51 -36
- package/funcs/managementKeysCreate.d.ts +17 -0
- package/funcs/managementKeysCreate.d.ts.map +1 -0
- package/funcs/managementKeysCreate.js +115 -0
- package/funcs/managementKeysCreate.js.map +1 -0
- package/funcs/managementKeysDelete.d.ts +18 -0
- package/funcs/managementKeysDelete.d.ts.map +1 -0
- package/funcs/managementKeysDelete.js +118 -0
- package/funcs/managementKeysDelete.js.map +1 -0
- package/funcs/managementKeysGet.d.ts +18 -0
- package/funcs/managementKeysGet.d.ts.map +1 -0
- package/funcs/managementKeysGet.js +118 -0
- package/funcs/managementKeysGet.js.map +1 -0
- package/funcs/managementKeysList.d.ts +18 -0
- package/funcs/managementKeysList.d.ts.map +1 -0
- package/funcs/managementKeysList.js +124 -0
- package/funcs/managementKeysList.js.map +1 -0
- package/funcs/managementKeysListCapabilities.d.ts +17 -0
- package/funcs/managementKeysListCapabilities.d.ts.map +1 -0
- package/funcs/managementKeysListCapabilities.js +105 -0
- package/funcs/managementKeysListCapabilities.js.map +1 -0
- package/funcs/managementKeysUpdate.d.ts +18 -0
- package/funcs/managementKeysUpdate.d.ts.map +1 -0
- package/funcs/managementKeysUpdate.js +121 -0
- package/funcs/managementKeysUpdate.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/createmanagementkeyrequest.d.ts +42 -0
- package/models/components/createmanagementkeyrequest.d.ts.map +1 -0
- package/models/components/createmanagementkeyrequest.js +59 -0
- package/models/components/createmanagementkeyrequest.js.map +1 -0
- package/models/components/createmanagementkeyresponse.d.ts +21 -0
- package/models/components/createmanagementkeyresponse.d.ts.map +1 -0
- package/models/components/createmanagementkeyresponse.js +57 -0
- package/models/components/createmanagementkeyresponse.js.map +1 -0
- package/models/components/deletemanagementkeyresponse.d.ts +8 -0
- package/models/components/deletemanagementkeyresponse.d.ts.map +1 -0
- package/models/components/deletemanagementkeyresponse.js +48 -0
- package/models/components/deletemanagementkeyresponse.js.map +1 -0
- package/models/components/domain.d.ts +5 -12
- package/models/components/domain.d.ts.map +1 -1
- package/models/components/domain.js +0 -2
- package/models/components/domain.js.map +1 -1
- package/models/components/getmanagementkeyresponse.d.ts +14 -0
- package/models/components/getmanagementkeyresponse.d.ts.map +1 -0
- package/models/components/getmanagementkeyresponse.js +56 -0
- package/models/components/getmanagementkeyresponse.js.map +1 -0
- package/models/components/index.d.ts +11 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +11 -0
- package/models/components/index.js.map +1 -1
- package/models/components/listmanagementcapabilitiesresponse.d.ts +14 -0
- package/models/components/listmanagementcapabilitiesresponse.d.ts.map +1 -0
- package/models/components/listmanagementcapabilitiesresponse.js +51 -0
- package/models/components/listmanagementcapabilitiesresponse.js.map +1 -0
- package/models/components/listmanagementkeysresponse.d.ts +28 -0
- package/models/components/listmanagementkeysresponse.d.ts.map +1 -0
- package/models/components/listmanagementkeysresponse.js +58 -0
- package/models/components/listmanagementkeysresponse.js.map +1 -0
- package/models/components/managementkey.d.ts +80 -0
- package/models/components/managementkey.d.ts.map +1 -0
- package/models/components/managementkey.js +77 -0
- package/models/components/managementkey.js.map +1 -0
- package/models/components/managementkeystatus.d.ts +14 -0
- package/models/components/managementkeystatus.d.ts.map +1 -0
- package/models/components/managementkeystatus.js +51 -0
- package/models/components/managementkeystatus.js.map +1 -0
- package/models/components/managementpermissionmode.d.ts +14 -0
- package/models/components/managementpermissionmode.d.ts.map +1 -0
- package/models/components/managementpermissionmode.js +51 -0
- package/models/components/managementpermissionmode.js.map +1 -0
- package/models/components/reasoningpart.js +1 -1
- package/models/components/updatemanagementkeyrequest.d.ts +47 -0
- package/models/components/updatemanagementkeyrequest.d.ts.map +1 -0
- package/models/components/updatemanagementkeyrequest.js +63 -0
- package/models/components/updatemanagementkeyrequest.js.map +1 -0
- package/models/components/updatemanagementkeyresponse.d.ts +14 -0
- package/models/components/updatemanagementkeyresponse.d.ts.map +1 -0
- package/models/components/updatemanagementkeyresponse.js +56 -0
- package/models/components/updatemanagementkeyresponse.js.map +1 -0
- package/models/operations/createdataset.js +1 -1
- package/models/operations/createdatasetitem.js +4 -4
- package/models/operations/createdatasource.js +1 -1
- package/models/operations/createeval.js +16 -16
- package/models/operations/createtool.js +6 -6
- package/models/operations/getalltools.js +6 -6
- package/models/operations/getevals.js +16 -16
- package/models/operations/getv2humanevalsets.js +2 -2
- package/models/operations/getv2humanevalsetsid.js +2 -2
- package/models/operations/index.d.ts +4 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +4 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listdatasetdatapoints.js +4 -4
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/listdatasources.js +1 -1
- package/models/operations/managementkeydelete.d.ts +15 -0
- package/models/operations/managementkeydelete.d.ts.map +1 -0
- package/models/operations/managementkeydelete.js +54 -0
- package/models/operations/managementkeydelete.js.map +1 -0
- package/models/operations/managementkeyget.d.ts +15 -0
- package/models/operations/managementkeyget.d.ts.map +1 -0
- package/models/operations/managementkeyget.js +54 -0
- package/models/operations/managementkeyget.js.map +1 -0
- package/models/operations/managementkeylist.d.ts +53 -0
- package/models/operations/managementkeylist.d.ts.map +1 -0
- package/models/operations/managementkeylist.js +63 -0
- package/models/operations/managementkeylist.js.map +1 -0
- package/models/operations/managementkeyupdate.d.ts +18 -0
- package/models/operations/managementkeyupdate.d.ts.map +1 -0
- package/models/operations/managementkeyupdate.js +57 -0
- package/models/operations/managementkeyupdate.js.map +1 -0
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/postv2feedbackevaluation.js +3 -3
- package/models/operations/postv2humanevalsets.js +2 -2
- package/models/operations/retrievedatapoint.js +4 -4
- package/models/operations/retrievedataset.js +1 -1
- package/models/operations/retrievedatasource.js +1 -1
- package/models/operations/retrievetool.js +6 -6
- package/models/operations/runagent.js +1 -1
- package/models/operations/streamrunagent.js +1 -1
- package/models/operations/updatedatapoint.js +4 -4
- package/models/operations/updatedataset.js +1 -1
- package/models/operations/updatedatasource.js +1 -1
- package/models/operations/updateeval.js +16 -16
- package/models/operations/updatetool.js +7 -7
- package/package.json +8 -8
- package/sdk/feedback.d.ts +4 -1
- package/sdk/feedback.d.ts.map +1 -1
- package/sdk/feedback.js +4 -1
- package/sdk/feedback.js.map +1 -1
- package/sdk/managementkeys.d.ts +48 -0
- package/sdk/managementkeys.d.ts.map +1 -0
- package/sdk/managementkeys.js +72 -0
- package/sdk/managementkeys.js.map +1 -0
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/managementKeysCreate.ts +163 -0
- package/src/funcs/managementKeysDelete.ts +172 -0
- package/src/funcs/managementKeysGet.ts +171 -0
- package/src/funcs/managementKeysList.ts +175 -0
- package/src/funcs/managementKeysListCapabilities.ts +144 -0
- package/src/funcs/managementKeysUpdate.ts +175 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/createmanagementkeyrequest.ts +69 -0
- package/src/models/components/createmanagementkeyresponse.ts +48 -0
- package/src/models/components/deletemanagementkeyresponse.ts +27 -0
- package/src/models/components/domain.ts +5 -14
- package/src/models/components/getmanagementkeyresponse.ts +40 -0
- package/src/models/components/index.ts +11 -0
- package/src/models/components/listmanagementcapabilitiesresponse.ts +36 -0
- package/src/models/components/listmanagementkeysresponse.ts +56 -0
- package/src/models/components/managementkey.ts +132 -0
- package/src/models/components/managementkeystatus.ts +23 -0
- package/src/models/components/managementpermissionmode.ts +25 -0
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/components/updatemanagementkeyrequest.ts +80 -0
- package/src/models/components/updatemanagementkeyresponse.ts +40 -0
- package/src/models/operations/createdataset.ts +1 -1
- package/src/models/operations/createdatasetitem.ts +4 -4
- package/src/models/operations/createdatasource.ts +1 -1
- package/src/models/operations/createeval.ts +16 -16
- package/src/models/operations/createtool.ts +6 -6
- package/src/models/operations/getalltools.ts +6 -6
- package/src/models/operations/getevals.ts +16 -16
- package/src/models/operations/getv2humanevalsets.ts +2 -2
- package/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/src/models/operations/index.ts +4 -0
- package/src/models/operations/listdatasetdatapoints.ts +4 -4
- package/src/models/operations/listdatasets.ts +1 -1
- package/src/models/operations/listdatasources.ts +1 -1
- package/src/models/operations/managementkeydelete.ts +39 -0
- package/src/models/operations/managementkeyget.ts +39 -0
- package/src/models/operations/managementkeylist.ts +85 -0
- package/src/models/operations/managementkeyupdate.ts +45 -0
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/postv2feedbackevaluation.ts +3 -3
- package/src/models/operations/postv2humanevalsets.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +4 -4
- package/src/models/operations/retrievedataset.ts +1 -1
- package/src/models/operations/retrievedatasource.ts +1 -1
- package/src/models/operations/retrievetool.ts +6 -6
- package/src/models/operations/runagent.ts +1 -1
- package/src/models/operations/streamrunagent.ts +1 -1
- package/src/models/operations/updatedatapoint.ts +4 -4
- package/src/models/operations/updatedataset.ts +1 -1
- package/src/models/operations/updatedatasource.ts +1 -1
- package/src/models/operations/updateeval.ts +16 -16
- package/src/models/operations/updatetool.ts +7 -7
- package/src/sdk/feedback.ts +4 -1
- package/src/sdk/managementkeys.ts +116 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -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 { 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 a management key
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Retrieves the metadata for an existing management key by its unique identifier. The raw secret is never returned — only `token_prefix`, `permission_mode`, and lifecycle fields.
|
|
34
|
+
*/
|
|
35
|
+
export function managementKeysGet(
|
|
36
|
+
client: OrqCore,
|
|
37
|
+
request: operations.ManagementKeyGetRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
components.GetManagementKeyResponse,
|
|
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.ManagementKeyGetRequest,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
components.GetManagementKeyResponse,
|
|
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.ManagementKeyGetRequest$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
|
+
management_key_id: encodeSimple(
|
|
92
|
+
"management_key_id",
|
|
93
|
+
payload.management_key_id,
|
|
94
|
+
{ explode: false, charEncoding: "percent" },
|
|
95
|
+
),
|
|
96
|
+
};
|
|
97
|
+
const path = pathToFunc("/v2/management-keys/{management_key_id}")(
|
|
98
|
+
pathParams,
|
|
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: "ManagementKeyGet",
|
|
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
|
+
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.GetManagementKeyResponse,
|
|
153
|
+
| OrqError
|
|
154
|
+
| ResponseValidationError
|
|
155
|
+
| ConnectionError
|
|
156
|
+
| RequestAbortedError
|
|
157
|
+
| RequestTimeoutError
|
|
158
|
+
| InvalidRequestError
|
|
159
|
+
| UnexpectedClientError
|
|
160
|
+
| SDKValidationError
|
|
161
|
+
>(
|
|
162
|
+
M.json(200, components.GetManagementKeyResponse$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,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 management keys
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Returns management keys in 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 managementKeysList(
|
|
36
|
+
client: OrqCore,
|
|
37
|
+
request?: operations.ManagementKeyListRequest | undefined,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
components.ListManagementKeysResponse,
|
|
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.ManagementKeyListRequest | undefined,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
components.ListManagementKeysResponse,
|
|
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.ManagementKeyListRequest$outboundSchema.optional().parse(
|
|
83
|
+
value,
|
|
84
|
+
),
|
|
85
|
+
"Input validation failed",
|
|
86
|
+
);
|
|
87
|
+
if (!parsed.ok) {
|
|
88
|
+
return [parsed, { status: "invalid" }];
|
|
89
|
+
}
|
|
90
|
+
const payload = parsed.value;
|
|
91
|
+
const body = null;
|
|
92
|
+
|
|
93
|
+
const path = pathToFunc("/v2/management-keys")();
|
|
94
|
+
|
|
95
|
+
const query = encodeFormQuery({
|
|
96
|
+
"ending_before": payload?.ending_before,
|
|
97
|
+
"limit": payload?.limit,
|
|
98
|
+
"permission_mode": payload?.permission_mode,
|
|
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: "ManagementKeyList",
|
|
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.ListManagementKeysResponse,
|
|
157
|
+
| OrqError
|
|
158
|
+
| ResponseValidationError
|
|
159
|
+
| ConnectionError
|
|
160
|
+
| RequestAbortedError
|
|
161
|
+
| RequestTimeoutError
|
|
162
|
+
| InvalidRequestError
|
|
163
|
+
| UnexpectedClientError
|
|
164
|
+
| SDKValidationError
|
|
165
|
+
>(
|
|
166
|
+
M.json(200, components.ListManagementKeysResponse$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 management capability catalog
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Returns the management capability catalog: the set of workspace-admin permission domains that can be granted to a management key. Each entry includes the domain id, display name, group, and the read / write verb support. Drives the permissions UI in the dashboard.
|
|
31
|
+
*/
|
|
32
|
+
export function managementKeysListCapabilities(
|
|
33
|
+
client: OrqCore,
|
|
34
|
+
options?: RequestOptions,
|
|
35
|
+
): APIPromise<
|
|
36
|
+
Result<
|
|
37
|
+
components.ListManagementCapabilitiesResponse,
|
|
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.ListManagementCapabilitiesResponse,
|
|
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/management-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: "ManagementKeyListCapabilities",
|
|
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.ListManagementCapabilitiesResponse,
|
|
126
|
+
| OrqError
|
|
127
|
+
| ResponseValidationError
|
|
128
|
+
| ConnectionError
|
|
129
|
+
| RequestAbortedError
|
|
130
|
+
| RequestTimeoutError
|
|
131
|
+
| InvalidRequestError
|
|
132
|
+
| UnexpectedClientError
|
|
133
|
+
| SDKValidationError
|
|
134
|
+
>(
|
|
135
|
+
M.json(200, components.ListManagementCapabilitiesResponse$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,175 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Update a management key
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Updates mutable fields of a management key: display name, status (active / disabled / revoked), permission mode and access map, and expiry. Omitted fields keep their current values.
|
|
34
|
+
*/
|
|
35
|
+
export function managementKeysUpdate(
|
|
36
|
+
client: OrqCore,
|
|
37
|
+
request: operations.ManagementKeyUpdateRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
components.UpdateManagementKeyResponse,
|
|
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.ManagementKeyUpdateRequest,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
components.UpdateManagementKeyResponse,
|
|
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.ManagementKeyUpdateRequest$outboundSchema.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 = encodeJSON("body", payload.UpdateManagementKeyRequest, {
|
|
90
|
+
explode: true,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const pathParams = {
|
|
94
|
+
management_key_id: encodeSimple(
|
|
95
|
+
"management_key_id",
|
|
96
|
+
payload.management_key_id,
|
|
97
|
+
{ explode: false, charEncoding: "percent" },
|
|
98
|
+
),
|
|
99
|
+
};
|
|
100
|
+
const path = pathToFunc("/v2/management-keys/{management_key_id}")(
|
|
101
|
+
pathParams,
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
const headers = new Headers(compactMap({
|
|
105
|
+
"Content-Type": "application/json",
|
|
106
|
+
Accept: "application/json",
|
|
107
|
+
}));
|
|
108
|
+
|
|
109
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
110
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
111
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
112
|
+
|
|
113
|
+
const context = {
|
|
114
|
+
options: client._options,
|
|
115
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
116
|
+
operationID: "ManagementKeyUpdate",
|
|
117
|
+
oAuth2Scopes: null,
|
|
118
|
+
|
|
119
|
+
resolvedSecurity: requestSecurity,
|
|
120
|
+
|
|
121
|
+
securitySource: client._options.apiKey,
|
|
122
|
+
retryConfig: options?.retries
|
|
123
|
+
|| client._options.retryConfig
|
|
124
|
+
|| { strategy: "none" },
|
|
125
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const requestRes = client._createRequest(context, {
|
|
129
|
+
security: requestSecurity,
|
|
130
|
+
method: "PATCH",
|
|
131
|
+
baseURL: options?.serverURL,
|
|
132
|
+
path: path,
|
|
133
|
+
headers: headers,
|
|
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.UpdateManagementKeyResponse,
|
|
157
|
+
| OrqError
|
|
158
|
+
| ResponseValidationError
|
|
159
|
+
| ConnectionError
|
|
160
|
+
| RequestAbortedError
|
|
161
|
+
| RequestTimeoutError
|
|
162
|
+
| InvalidRequestError
|
|
163
|
+
| UnexpectedClientError
|
|
164
|
+
| SDKValidationError
|
|
165
|
+
>(
|
|
166
|
+
M.json(200, components.UpdateManagementKeyResponse$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
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -58,7 +58,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
58
58
|
export const SDK_METADATA = {
|
|
59
59
|
language: "typescript",
|
|
60
60
|
openapiDocVersion: "2.0",
|
|
61
|
-
sdkVersion: "4.11.0-rc.
|
|
62
|
-
genVersion: "2.
|
|
63
|
-
userAgent: "speakeasy-sdk/typescript 4.11.0-rc.
|
|
61
|
+
sdkVersion: "4.11.0-rc.52",
|
|
62
|
+
genVersion: "2.913.3",
|
|
63
|
+
userAgent: "speakeasy-sdk/typescript 4.11.0-rc.52 2.913.3 2.0 @orq-ai/node",
|
|
64
64
|
} as const;
|