@orq-ai/node 4.8.1 → 4.8.3
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/FUNCTIONS.md +2 -2
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/models/components/reasoningpart.js +1 -1
- package/models/operations/createcontact.js +1 -1
- 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/createidentity.js +1 -1
- 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/listdatasetdatapoints.js +4 -4
- package/models/operations/listdatasets.js +1 -1
- package/models/operations/listdatasources.js +1 -1
- package/models/operations/listidentities.js +1 -1
- package/models/operations/patchv2humanevalsetsid.js +2 -2
- package/models/operations/policyupdate.d.ts +5 -0
- package/models/operations/policyupdate.d.ts.map +1 -1
- package/models/operations/policyupdate.js +2 -0
- package/models/operations/policyupdate.js.map +1 -1
- 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/retrieveidentity.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/updateidentity.js +1 -1
- package/models/operations/updatetool.js +7 -7
- package/package.json +6 -6
- package/packages/orq-rc/src/funcs/filesCreate.ts +13 -48
- package/packages/orq-rc/src/funcs/filesDelete.ts +8 -8
- package/packages/orq-rc/src/funcs/filesGet.ts +6 -5
- package/packages/orq-rc/src/funcs/filesGetContent.ts +9 -9
- package/packages/orq-rc/src/funcs/filesList.ts +6 -5
- package/packages/orq-rc/src/funcs/filesUpdate.ts +8 -7
- package/packages/orq-rc/src/funcs/skillsCreate.ts +162 -0
- package/packages/orq-rc/src/funcs/skillsDelete.ts +165 -0
- package/packages/orq-rc/src/funcs/skillsGet.ts +168 -0
- package/packages/orq-rc/src/funcs/skillsList.ts +170 -0
- package/packages/orq-rc/src/funcs/skillsUpdate.ts +171 -0
- package/packages/orq-rc/src/lib/config.ts +3 -3
- package/packages/orq-rc/src/models/components/createfilerequest.ts +45 -0
- package/packages/orq-rc/src/models/components/createfileresponse.ts +32 -0
- package/packages/orq-rc/src/models/components/createskillrequest.ts +55 -0
- package/packages/orq-rc/src/models/components/createskillresponse.ts +32 -0
- package/packages/orq-rc/src/models/components/deletefileresponse.ts +27 -0
- package/packages/orq-rc/src/models/components/deleteskillresponse.ts +27 -0
- package/packages/orq-rc/src/models/components/file.ts +48 -0
- package/packages/orq-rc/src/models/components/filepart.ts +21 -16
- package/packages/orq-rc/src/models/components/getfilecontentresponse.ts +36 -0
- package/packages/orq-rc/src/models/components/getfileresponse.ts +32 -0
- package/packages/orq-rc/src/models/components/getskillresponse.ts +32 -0
- package/packages/orq-rc/src/models/components/index.ts +17 -1
- package/packages/orq-rc/src/models/components/listfilesresponse.ts +41 -0
- package/packages/orq-rc/src/models/components/listskillsresponse.ts +41 -0
- package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
- package/packages/orq-rc/src/models/components/skill.ts +77 -0
- package/packages/orq-rc/src/models/components/updatefilerequest.ts +40 -0
- package/packages/orq-rc/src/models/components/updatefileresponse.ts +32 -0
- package/packages/orq-rc/src/models/components/updateskillrequest.ts +55 -0
- package/packages/orq-rc/src/models/components/updateskillresponse.ts +32 -0
- package/packages/orq-rc/src/models/operations/createagentrequest.ts +11 -0
- package/packages/orq-rc/src/models/operations/createcontact.ts +1 -1
- package/packages/orq-rc/src/models/operations/createdataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/createdatasetitem.ts +4 -4
- package/packages/orq-rc/src/models/operations/createdatasource.ts +1 -1
- package/packages/orq-rc/src/models/operations/createeval.ts +16 -16
- package/packages/orq-rc/src/models/operations/createidentity.ts +1 -1
- package/packages/orq-rc/src/models/operations/createtool.ts +6 -6
- package/packages/orq-rc/src/models/operations/filecontent.ts +0 -3
- package/packages/orq-rc/src/models/operations/filedelete.ts +0 -3
- package/packages/orq-rc/src/models/operations/fileget.ts +0 -48
- package/packages/orq-rc/src/models/operations/filelist.ts +2 -46
- package/packages/orq-rc/src/models/operations/fileupdate.ts +5 -82
- package/packages/orq-rc/src/models/operations/getalltools.ts +6 -6
- package/packages/orq-rc/src/models/operations/getevals.ts +16 -16
- package/packages/orq-rc/src/models/operations/getv2humanevalsets.ts +2 -2
- package/packages/orq-rc/src/models/operations/getv2humanevalsetsid.ts +2 -2
- package/packages/orq-rc/src/models/operations/index.ts +4 -1
- package/packages/orq-rc/src/models/operations/invokeeval.ts +5 -2
- package/packages/orq-rc/src/models/operations/listagents.ts +5 -0
- package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +4 -4
- package/packages/orq-rc/src/models/operations/listdatasets.ts +1 -1
- package/packages/orq-rc/src/models/operations/listdatasources.ts +1 -1
- package/packages/orq-rc/src/models/operations/listidentities.ts +1 -1
- package/packages/orq-rc/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/packages/orq-rc/src/models/operations/postv2feedbackevaluation.ts +3 -3
- package/packages/orq-rc/src/models/operations/postv2humanevalsets.ts +2 -2
- package/packages/orq-rc/src/models/operations/retrieveagentrequest.ts +5 -0
- package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +4 -4
- package/packages/orq-rc/src/models/operations/retrievedataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrievedatasource.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrieveidentity.ts +1 -1
- package/packages/orq-rc/src/models/operations/retrievetool.ts +6 -6
- package/packages/orq-rc/src/models/operations/runagent.ts +1 -1
- package/packages/orq-rc/src/models/operations/skilldelete.ts +36 -0
- package/packages/orq-rc/src/models/operations/skillget.ts +40 -0
- package/packages/orq-rc/src/models/operations/skilllist.ts +49 -0
- package/packages/orq-rc/src/models/operations/skillupdate.ts +41 -0
- package/packages/orq-rc/src/models/operations/streamrunagent.ts +1 -1
- package/packages/orq-rc/src/models/operations/updateagent.ts +20 -31
- package/packages/orq-rc/src/models/operations/updatedatapoint.ts +4 -4
- package/packages/orq-rc/src/models/operations/updatedataset.ts +1 -1
- package/packages/orq-rc/src/models/operations/updatedatasource.ts +1 -1
- package/packages/orq-rc/src/models/operations/updateeval.ts +16 -16
- package/packages/orq-rc/src/models/operations/updateidentity.ts +1 -1
- package/packages/orq-rc/src/models/operations/updatetool.ts +7 -7
- package/packages/orq-rc/src/sdk/files.ts +22 -21
- package/packages/orq-rc/src/sdk/sdk.ts +11 -5
- package/packages/orq-rc/src/sdk/skills.ts +97 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/reasoningpart.ts +1 -1
- package/src/models/operations/createcontact.ts +1 -1
- 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/createidentity.ts +1 -1
- 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/listdatasetdatapoints.ts +4 -4
- package/src/models/operations/listdatasets.ts +1 -1
- package/src/models/operations/listdatasources.ts +1 -1
- package/src/models/operations/listidentities.ts +1 -1
- package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
- package/src/models/operations/policyupdate.ts +7 -0
- 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/retrieveidentity.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/updateidentity.ts +1 -1
- package/src/models/operations/updatetool.ts +7 -7
- package/packages/orq-rc/src/models/components/filedocument.ts +0 -48
- package/packages/orq-rc/src/models/operations/fileupload.ts +0 -135
|
@@ -11,6 +11,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
11
11
|
import { RequestOptions } from "../lib/sdks.js";
|
|
12
12
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
13
|
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
14
15
|
import {
|
|
15
16
|
ConnectionError,
|
|
16
17
|
InvalidRequestError,
|
|
@@ -37,7 +38,7 @@ export function filesGet(
|
|
|
37
38
|
options?: RequestOptions,
|
|
38
39
|
): APIPromise<
|
|
39
40
|
Result<
|
|
40
|
-
|
|
41
|
+
components.GetFileResponse,
|
|
41
42
|
| OrqError
|
|
42
43
|
| ResponseValidationError
|
|
43
44
|
| ConnectionError
|
|
@@ -62,7 +63,7 @@ async function $do(
|
|
|
62
63
|
): Promise<
|
|
63
64
|
[
|
|
64
65
|
Result<
|
|
65
|
-
|
|
66
|
+
components.GetFileResponse,
|
|
66
67
|
| OrqError
|
|
67
68
|
| ResponseValidationError
|
|
68
69
|
| ConnectionError
|
|
@@ -145,7 +146,7 @@ async function $do(
|
|
|
145
146
|
const response = doResult.value;
|
|
146
147
|
|
|
147
148
|
const [result] = await M.match<
|
|
148
|
-
|
|
149
|
+
components.GetFileResponse,
|
|
149
150
|
| OrqError
|
|
150
151
|
| ResponseValidationError
|
|
151
152
|
| ConnectionError
|
|
@@ -155,8 +156,8 @@ async function $do(
|
|
|
155
156
|
| UnexpectedClientError
|
|
156
157
|
| SDKValidationError
|
|
157
158
|
>(
|
|
158
|
-
M.json(200,
|
|
159
|
-
M.fail(
|
|
159
|
+
M.json(200, components.GetFileResponse$inboundSchema),
|
|
160
|
+
M.fail("4XX"),
|
|
160
161
|
M.fail("5XX"),
|
|
161
162
|
)(response, req);
|
|
162
163
|
if (!result.ok) {
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
5
|
import { OrqCore } from "../core.js";
|
|
7
6
|
import { encodeSimple } from "../lib/encodings.js";
|
|
8
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
@@ -12,6 +11,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
12
11
|
import { RequestOptions } from "../lib/sdks.js";
|
|
13
12
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
13
|
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
15
|
import {
|
|
16
16
|
ConnectionError,
|
|
17
17
|
InvalidRequestError,
|
|
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
30
30
|
* Download file content
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
*
|
|
33
|
+
* Returns a presigned URL for downloading the file content by file ID.
|
|
34
34
|
*/
|
|
35
35
|
export function filesGetContent(
|
|
36
36
|
client: OrqCore,
|
|
@@ -38,7 +38,7 @@ export function filesGetContent(
|
|
|
38
38
|
options?: RequestOptions,
|
|
39
39
|
): APIPromise<
|
|
40
40
|
Result<
|
|
41
|
-
|
|
41
|
+
components.GetFileContentResponse,
|
|
42
42
|
| OrqError
|
|
43
43
|
| ResponseValidationError
|
|
44
44
|
| ConnectionError
|
|
@@ -63,7 +63,7 @@ async function $do(
|
|
|
63
63
|
): Promise<
|
|
64
64
|
[
|
|
65
65
|
Result<
|
|
66
|
-
|
|
66
|
+
components.GetFileContentResponse,
|
|
67
67
|
| OrqError
|
|
68
68
|
| ResponseValidationError
|
|
69
69
|
| ConnectionError
|
|
@@ -96,7 +96,7 @@ async function $do(
|
|
|
96
96
|
const path = pathToFunc("/v2/files/{file_id_or_path}/content")(pathParams);
|
|
97
97
|
|
|
98
98
|
const headers = new Headers(compactMap({
|
|
99
|
-
Accept: "
|
|
99
|
+
Accept: "application/json",
|
|
100
100
|
}));
|
|
101
101
|
|
|
102
102
|
const secConfig = await extractSecurity(client._options.apiKey);
|
|
@@ -146,7 +146,7 @@ async function $do(
|
|
|
146
146
|
const response = doResult.value;
|
|
147
147
|
|
|
148
148
|
const [result] = await M.match<
|
|
149
|
-
|
|
149
|
+
components.GetFileContentResponse,
|
|
150
150
|
| OrqError
|
|
151
151
|
| ResponseValidationError
|
|
152
152
|
| ConnectionError
|
|
@@ -156,9 +156,9 @@ async function $do(
|
|
|
156
156
|
| UnexpectedClientError
|
|
157
157
|
| SDKValidationError
|
|
158
158
|
>(
|
|
159
|
-
M.
|
|
160
|
-
M.fail(
|
|
161
|
-
M.fail(
|
|
159
|
+
M.json(200, components.GetFileContentResponse$inboundSchema),
|
|
160
|
+
M.fail("4XX"),
|
|
161
|
+
M.fail("5XX"),
|
|
162
162
|
)(response, req);
|
|
163
163
|
if (!result.ok) {
|
|
164
164
|
return [result, { status: "complete", request: req, response }];
|
|
@@ -11,6 +11,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
11
11
|
import { RequestOptions } from "../lib/sdks.js";
|
|
12
12
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
13
|
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
14
15
|
import {
|
|
15
16
|
ConnectionError,
|
|
16
17
|
InvalidRequestError,
|
|
@@ -37,7 +38,7 @@ export function filesList(
|
|
|
37
38
|
options?: RequestOptions,
|
|
38
39
|
): APIPromise<
|
|
39
40
|
Result<
|
|
40
|
-
|
|
41
|
+
components.ListFilesResponse,
|
|
41
42
|
| OrqError
|
|
42
43
|
| ResponseValidationError
|
|
43
44
|
| ConnectionError
|
|
@@ -62,7 +63,7 @@ async function $do(
|
|
|
62
63
|
): Promise<
|
|
63
64
|
[
|
|
64
65
|
Result<
|
|
65
|
-
|
|
66
|
+
components.ListFilesResponse,
|
|
66
67
|
| OrqError
|
|
67
68
|
| ResponseValidationError
|
|
68
69
|
| ConnectionError
|
|
@@ -93,7 +94,7 @@ async function $do(
|
|
|
93
94
|
"ending_before": payload?.ending_before,
|
|
94
95
|
"limit": payload?.limit,
|
|
95
96
|
"starting_after": payload?.starting_after,
|
|
96
|
-
}
|
|
97
|
+
});
|
|
97
98
|
|
|
98
99
|
const headers = new Headers(compactMap({
|
|
99
100
|
Accept: "application/json",
|
|
@@ -147,7 +148,7 @@ async function $do(
|
|
|
147
148
|
const response = doResult.value;
|
|
148
149
|
|
|
149
150
|
const [result] = await M.match<
|
|
150
|
-
|
|
151
|
+
components.ListFilesResponse,
|
|
151
152
|
| OrqError
|
|
152
153
|
| ResponseValidationError
|
|
153
154
|
| ConnectionError
|
|
@@ -157,7 +158,7 @@ async function $do(
|
|
|
157
158
|
| UnexpectedClientError
|
|
158
159
|
| SDKValidationError
|
|
159
160
|
>(
|
|
160
|
-
M.json(200,
|
|
161
|
+
M.json(200, components.ListFilesResponse$inboundSchema),
|
|
161
162
|
M.fail("4XX"),
|
|
162
163
|
M.fail("5XX"),
|
|
163
164
|
)(response, req);
|
|
@@ -11,6 +11,7 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
11
11
|
import { RequestOptions } from "../lib/sdks.js";
|
|
12
12
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
13
|
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
14
15
|
import {
|
|
15
16
|
ConnectionError,
|
|
16
17
|
InvalidRequestError,
|
|
@@ -26,7 +27,7 @@ import { APICall, APIPromise } from "../types/async.js";
|
|
|
26
27
|
import { Result } from "../types/fp.js";
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
|
-
* Update file
|
|
30
|
+
* Update a file
|
|
30
31
|
*
|
|
31
32
|
* @remarks
|
|
32
33
|
* Updates the metadata of an existing file object.
|
|
@@ -37,7 +38,7 @@ export function filesUpdate(
|
|
|
37
38
|
options?: RequestOptions,
|
|
38
39
|
): APIPromise<
|
|
39
40
|
Result<
|
|
40
|
-
|
|
41
|
+
components.UpdateFileResponse,
|
|
41
42
|
| OrqError
|
|
42
43
|
| ResponseValidationError
|
|
43
44
|
| ConnectionError
|
|
@@ -62,7 +63,7 @@ async function $do(
|
|
|
62
63
|
): Promise<
|
|
63
64
|
[
|
|
64
65
|
Result<
|
|
65
|
-
|
|
66
|
+
components.UpdateFileResponse,
|
|
66
67
|
| OrqError
|
|
67
68
|
| ResponseValidationError
|
|
68
69
|
| ConnectionError
|
|
@@ -84,7 +85,7 @@ async function $do(
|
|
|
84
85
|
return [parsed, { status: "invalid" }];
|
|
85
86
|
}
|
|
86
87
|
const payload = parsed.value;
|
|
87
|
-
const body = encodeJSON("body", payload.
|
|
88
|
+
const body = encodeJSON("body", payload.UpdateFileRequest, { explode: true });
|
|
88
89
|
|
|
89
90
|
const pathParams = {
|
|
90
91
|
file_id: encodeSimple("file_id", payload.file_id, {
|
|
@@ -146,7 +147,7 @@ async function $do(
|
|
|
146
147
|
const response = doResult.value;
|
|
147
148
|
|
|
148
149
|
const [result] = await M.match<
|
|
149
|
-
|
|
150
|
+
components.UpdateFileResponse,
|
|
150
151
|
| OrqError
|
|
151
152
|
| ResponseValidationError
|
|
152
153
|
| ConnectionError
|
|
@@ -156,8 +157,8 @@ async function $do(
|
|
|
156
157
|
| UnexpectedClientError
|
|
157
158
|
| SDKValidationError
|
|
158
159
|
>(
|
|
159
|
-
M.json(200,
|
|
160
|
-
M.fail(
|
|
160
|
+
M.json(200, components.UpdateFileResponse$inboundSchema),
|
|
161
|
+
M.fail("4XX"),
|
|
161
162
|
M.fail("5XX"),
|
|
162
163
|
)(response, req);
|
|
163
164
|
if (!result.ok) {
|
|
@@ -0,0 +1,162 @@
|
|
|
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 { OrqError } from "../models/errors/orqerror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Create a new skill
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Skills are modular instructions you can use to codify processes and conventions
|
|
33
|
+
*/
|
|
34
|
+
export function skillsCreate(
|
|
35
|
+
client: OrqCore,
|
|
36
|
+
request: components.CreateSkillRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
components.CreateSkillResponse,
|
|
41
|
+
| OrqError
|
|
42
|
+
| ResponseValidationError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
| RequestAbortedError
|
|
45
|
+
| RequestTimeoutError
|
|
46
|
+
| InvalidRequestError
|
|
47
|
+
| UnexpectedClientError
|
|
48
|
+
| SDKValidationError
|
|
49
|
+
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client,
|
|
53
|
+
request,
|
|
54
|
+
options,
|
|
55
|
+
));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function $do(
|
|
59
|
+
client: OrqCore,
|
|
60
|
+
request: components.CreateSkillRequest,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): Promise<
|
|
63
|
+
[
|
|
64
|
+
Result<
|
|
65
|
+
components.CreateSkillResponse,
|
|
66
|
+
| OrqError
|
|
67
|
+
| ResponseValidationError
|
|
68
|
+
| ConnectionError
|
|
69
|
+
| RequestAbortedError
|
|
70
|
+
| RequestTimeoutError
|
|
71
|
+
| InvalidRequestError
|
|
72
|
+
| UnexpectedClientError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
>,
|
|
75
|
+
APICall,
|
|
76
|
+
]
|
|
77
|
+
> {
|
|
78
|
+
const parsed = safeParse(
|
|
79
|
+
request,
|
|
80
|
+
(value) => components.CreateSkillRequest$outboundSchema.parse(value),
|
|
81
|
+
"Input validation failed",
|
|
82
|
+
);
|
|
83
|
+
if (!parsed.ok) {
|
|
84
|
+
return [parsed, { status: "invalid" }];
|
|
85
|
+
}
|
|
86
|
+
const payload = parsed.value;
|
|
87
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
88
|
+
|
|
89
|
+
const path = pathToFunc("/v2/skills")();
|
|
90
|
+
|
|
91
|
+
const headers = new Headers(compactMap({
|
|
92
|
+
"Content-Type": "application/json",
|
|
93
|
+
Accept: "application/json",
|
|
94
|
+
}));
|
|
95
|
+
|
|
96
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
97
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
98
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
99
|
+
|
|
100
|
+
const context = {
|
|
101
|
+
options: client._options,
|
|
102
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
103
|
+
operationID: "SkillCreate",
|
|
104
|
+
oAuth2Scopes: null,
|
|
105
|
+
|
|
106
|
+
resolvedSecurity: requestSecurity,
|
|
107
|
+
|
|
108
|
+
securitySource: client._options.apiKey,
|
|
109
|
+
retryConfig: options?.retries
|
|
110
|
+
|| client._options.retryConfig
|
|
111
|
+
|| { strategy: "none" },
|
|
112
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const requestRes = client._createRequest(context, {
|
|
116
|
+
security: requestSecurity,
|
|
117
|
+
method: "POST",
|
|
118
|
+
baseURL: options?.serverURL,
|
|
119
|
+
path: path,
|
|
120
|
+
headers: headers,
|
|
121
|
+
body: body,
|
|
122
|
+
userAgent: client._options.userAgent,
|
|
123
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
124
|
+
}, options);
|
|
125
|
+
if (!requestRes.ok) {
|
|
126
|
+
return [requestRes, { status: "invalid" }];
|
|
127
|
+
}
|
|
128
|
+
const req = requestRes.value;
|
|
129
|
+
|
|
130
|
+
const doResult = await client._do(req, {
|
|
131
|
+
context,
|
|
132
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
133
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
134
|
+
retryConfig: context.retryConfig,
|
|
135
|
+
retryCodes: context.retryCodes,
|
|
136
|
+
});
|
|
137
|
+
if (!doResult.ok) {
|
|
138
|
+
return [doResult, { status: "request-error", request: req }];
|
|
139
|
+
}
|
|
140
|
+
const response = doResult.value;
|
|
141
|
+
|
|
142
|
+
const [result] = await M.match<
|
|
143
|
+
components.CreateSkillResponse,
|
|
144
|
+
| OrqError
|
|
145
|
+
| ResponseValidationError
|
|
146
|
+
| ConnectionError
|
|
147
|
+
| RequestAbortedError
|
|
148
|
+
| RequestTimeoutError
|
|
149
|
+
| InvalidRequestError
|
|
150
|
+
| UnexpectedClientError
|
|
151
|
+
| SDKValidationError
|
|
152
|
+
>(
|
|
153
|
+
M.json(200, components.CreateSkillResponse$inboundSchema),
|
|
154
|
+
M.fail("4XX"),
|
|
155
|
+
M.fail("5XX"),
|
|
156
|
+
)(response, req);
|
|
157
|
+
if (!result.ok) {
|
|
158
|
+
return [result, { status: "complete", request: req, response }];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return [result, { status: "complete", request: req, response }];
|
|
162
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
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
|
+
* Delete a skill
|
|
31
|
+
*/
|
|
32
|
+
export function skillsDelete(
|
|
33
|
+
client: OrqCore,
|
|
34
|
+
request: operations.SkillDeleteRequest,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): APIPromise<
|
|
37
|
+
Result<
|
|
38
|
+
components.DeleteSkillResponse,
|
|
39
|
+
| OrqError
|
|
40
|
+
| ResponseValidationError
|
|
41
|
+
| ConnectionError
|
|
42
|
+
| RequestAbortedError
|
|
43
|
+
| RequestTimeoutError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| UnexpectedClientError
|
|
46
|
+
| SDKValidationError
|
|
47
|
+
>
|
|
48
|
+
> {
|
|
49
|
+
return new APIPromise($do(
|
|
50
|
+
client,
|
|
51
|
+
request,
|
|
52
|
+
options,
|
|
53
|
+
));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function $do(
|
|
57
|
+
client: OrqCore,
|
|
58
|
+
request: operations.SkillDeleteRequest,
|
|
59
|
+
options?: RequestOptions,
|
|
60
|
+
): Promise<
|
|
61
|
+
[
|
|
62
|
+
Result<
|
|
63
|
+
components.DeleteSkillResponse,
|
|
64
|
+
| OrqError
|
|
65
|
+
| ResponseValidationError
|
|
66
|
+
| ConnectionError
|
|
67
|
+
| RequestAbortedError
|
|
68
|
+
| RequestTimeoutError
|
|
69
|
+
| InvalidRequestError
|
|
70
|
+
| UnexpectedClientError
|
|
71
|
+
| SDKValidationError
|
|
72
|
+
>,
|
|
73
|
+
APICall,
|
|
74
|
+
]
|
|
75
|
+
> {
|
|
76
|
+
const parsed = safeParse(
|
|
77
|
+
request,
|
|
78
|
+
(value) => operations.SkillDeleteRequest$outboundSchema.parse(value),
|
|
79
|
+
"Input validation failed",
|
|
80
|
+
);
|
|
81
|
+
if (!parsed.ok) {
|
|
82
|
+
return [parsed, { status: "invalid" }];
|
|
83
|
+
}
|
|
84
|
+
const payload = parsed.value;
|
|
85
|
+
const body = null;
|
|
86
|
+
|
|
87
|
+
const pathParams = {
|
|
88
|
+
skill_id: encodeSimple("skill_id", payload.skill_id, {
|
|
89
|
+
explode: false,
|
|
90
|
+
charEncoding: "percent",
|
|
91
|
+
}),
|
|
92
|
+
};
|
|
93
|
+
const path = pathToFunc("/v2/skills/{skill_id}")(pathParams);
|
|
94
|
+
|
|
95
|
+
const headers = new Headers(compactMap({
|
|
96
|
+
Accept: "application/json",
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
100
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
101
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
102
|
+
|
|
103
|
+
const context = {
|
|
104
|
+
options: client._options,
|
|
105
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
106
|
+
operationID: "SkillDelete",
|
|
107
|
+
oAuth2Scopes: null,
|
|
108
|
+
|
|
109
|
+
resolvedSecurity: requestSecurity,
|
|
110
|
+
|
|
111
|
+
securitySource: client._options.apiKey,
|
|
112
|
+
retryConfig: options?.retries
|
|
113
|
+
|| client._options.retryConfig
|
|
114
|
+
|| { strategy: "none" },
|
|
115
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const requestRes = client._createRequest(context, {
|
|
119
|
+
security: requestSecurity,
|
|
120
|
+
method: "DELETE",
|
|
121
|
+
baseURL: options?.serverURL,
|
|
122
|
+
path: path,
|
|
123
|
+
headers: headers,
|
|
124
|
+
body: body,
|
|
125
|
+
userAgent: client._options.userAgent,
|
|
126
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
127
|
+
}, options);
|
|
128
|
+
if (!requestRes.ok) {
|
|
129
|
+
return [requestRes, { status: "invalid" }];
|
|
130
|
+
}
|
|
131
|
+
const req = requestRes.value;
|
|
132
|
+
|
|
133
|
+
const doResult = await client._do(req, {
|
|
134
|
+
context,
|
|
135
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
136
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
137
|
+
retryConfig: context.retryConfig,
|
|
138
|
+
retryCodes: context.retryCodes,
|
|
139
|
+
});
|
|
140
|
+
if (!doResult.ok) {
|
|
141
|
+
return [doResult, { status: "request-error", request: req }];
|
|
142
|
+
}
|
|
143
|
+
const response = doResult.value;
|
|
144
|
+
|
|
145
|
+
const [result] = await M.match<
|
|
146
|
+
components.DeleteSkillResponse,
|
|
147
|
+
| OrqError
|
|
148
|
+
| ResponseValidationError
|
|
149
|
+
| ConnectionError
|
|
150
|
+
| RequestAbortedError
|
|
151
|
+
| RequestTimeoutError
|
|
152
|
+
| InvalidRequestError
|
|
153
|
+
| UnexpectedClientError
|
|
154
|
+
| SDKValidationError
|
|
155
|
+
>(
|
|
156
|
+
M.json(200, components.DeleteSkillResponse$inboundSchema),
|
|
157
|
+
M.fail("4XX"),
|
|
158
|
+
M.fail("5XX"),
|
|
159
|
+
)(response, req);
|
|
160
|
+
if (!result.ok) {
|
|
161
|
+
return [result, { status: "complete", request: req, response }];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return [result, { status: "complete", request: req, response }];
|
|
165
|
+
}
|