@orq-ai/node 4.8.8 → 4.8.9
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/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- 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/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 +3 -3
- package/packages/orq-rc/src/funcs/projectsCreate.ts +162 -0
- package/packages/orq-rc/src/funcs/projectsDelete.ts +165 -0
- package/packages/orq-rc/src/funcs/projectsGet.ts +168 -0
- package/packages/orq-rc/src/funcs/projectsList.ts +170 -0
- package/packages/orq-rc/src/funcs/projectsUpdate.ts +171 -0
- package/packages/orq-rc/src/lib/config.ts +2 -2
- package/packages/orq-rc/src/models/components/createprojectrequest.ts +34 -0
- package/packages/orq-rc/src/models/components/createprojectresponse.ts +32 -0
- package/packages/orq-rc/src/models/components/deleteprojectresponse.ts +27 -0
- package/packages/orq-rc/src/models/components/getprojectresponse.ts +32 -0
- package/packages/orq-rc/src/models/components/index.ts +8 -0
- package/packages/orq-rc/src/models/components/listprojectsresponse.ts +41 -0
- package/packages/orq-rc/src/models/components/project.ts +64 -0
- package/packages/orq-rc/src/models/components/publicschedule.ts +0 -3
- package/packages/orq-rc/src/models/components/reasoningpart.ts +1 -1
- package/packages/orq-rc/src/models/components/updateprojectrequest.ts +42 -0
- package/packages/orq-rc/src/models/components/updateprojectresponse.ts +32 -0
- package/packages/orq-rc/src/models/operations/createagentschedule.ts +0 -3
- 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/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 -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/projectdelete.ts +36 -0
- package/packages/orq-rc/src/models/operations/projectget.ts +36 -0
- package/packages/orq-rc/src/models/operations/projectlist.ts +43 -0
- package/packages/orq-rc/src/models/operations/projectupdate.ts +41 -0
- package/packages/orq-rc/src/models/operations/retrieveagentschedule.ts +0 -3
- 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/streamrunagent.ts +1 -1
- package/packages/orq-rc/src/models/operations/updateagentschedule.ts +0 -3
- 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/projects.ts +97 -0
- package/packages/orq-rc/src/sdk/sdk.ts +6 -0
- package/src/lib/config.ts +2 -2
- 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/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
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Retrieve a project
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Retrieves the details of an existing project by its unique project ID.
|
|
34
|
+
*/
|
|
35
|
+
export function projectsGet(
|
|
36
|
+
client: OrqCore,
|
|
37
|
+
request: operations.ProjectGetRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
components.GetProjectResponse,
|
|
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.ProjectGetRequest,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
components.GetProjectResponse,
|
|
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.ProjectGetRequest$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
|
+
project_id: encodeSimple("project_id", payload.project_id, {
|
|
92
|
+
explode: false,
|
|
93
|
+
charEncoding: "percent",
|
|
94
|
+
}),
|
|
95
|
+
};
|
|
96
|
+
const path = pathToFunc("/v2/projects/{project_id}")(pathParams);
|
|
97
|
+
|
|
98
|
+
const headers = new Headers(compactMap({
|
|
99
|
+
Accept: "application/json",
|
|
100
|
+
}));
|
|
101
|
+
|
|
102
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
103
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
104
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
105
|
+
|
|
106
|
+
const context = {
|
|
107
|
+
options: client._options,
|
|
108
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
109
|
+
operationID: "ProjectGet",
|
|
110
|
+
oAuth2Scopes: null,
|
|
111
|
+
|
|
112
|
+
resolvedSecurity: requestSecurity,
|
|
113
|
+
|
|
114
|
+
securitySource: client._options.apiKey,
|
|
115
|
+
retryConfig: options?.retries
|
|
116
|
+
|| client._options.retryConfig
|
|
117
|
+
|| { strategy: "none" },
|
|
118
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const requestRes = client._createRequest(context, {
|
|
122
|
+
security: requestSecurity,
|
|
123
|
+
method: "GET",
|
|
124
|
+
baseURL: options?.serverURL,
|
|
125
|
+
path: path,
|
|
126
|
+
headers: headers,
|
|
127
|
+
body: body,
|
|
128
|
+
userAgent: client._options.userAgent,
|
|
129
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
130
|
+
}, options);
|
|
131
|
+
if (!requestRes.ok) {
|
|
132
|
+
return [requestRes, { status: "invalid" }];
|
|
133
|
+
}
|
|
134
|
+
const req = requestRes.value;
|
|
135
|
+
|
|
136
|
+
const doResult = await client._do(req, {
|
|
137
|
+
context,
|
|
138
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
139
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
140
|
+
retryConfig: context.retryConfig,
|
|
141
|
+
retryCodes: context.retryCodes,
|
|
142
|
+
});
|
|
143
|
+
if (!doResult.ok) {
|
|
144
|
+
return [doResult, { status: "request-error", request: req }];
|
|
145
|
+
}
|
|
146
|
+
const response = doResult.value;
|
|
147
|
+
|
|
148
|
+
const [result] = await M.match<
|
|
149
|
+
components.GetProjectResponse,
|
|
150
|
+
| OrqError
|
|
151
|
+
| ResponseValidationError
|
|
152
|
+
| ConnectionError
|
|
153
|
+
| RequestAbortedError
|
|
154
|
+
| RequestTimeoutError
|
|
155
|
+
| InvalidRequestError
|
|
156
|
+
| UnexpectedClientError
|
|
157
|
+
| SDKValidationError
|
|
158
|
+
>(
|
|
159
|
+
M.json(200, components.GetProjectResponse$inboundSchema),
|
|
160
|
+
M.fail("4XX"),
|
|
161
|
+
M.fail("5XX"),
|
|
162
|
+
)(response, req);
|
|
163
|
+
if (!result.ok) {
|
|
164
|
+
return [result, { status: "complete", request: req, response }];
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return [result, { status: "complete", request: req, response }];
|
|
168
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
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 all projects
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Returns a list of projects. Projects are sorted by creation date, with the most recently created projects appearing first.
|
|
34
|
+
*/
|
|
35
|
+
export function projectsList(
|
|
36
|
+
client: OrqCore,
|
|
37
|
+
request?: operations.ProjectListRequest | undefined,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
components.ListProjectsResponse,
|
|
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.ProjectListRequest | undefined,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
components.ListProjectsResponse,
|
|
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.ProjectListRequest$outboundSchema.optional().parse(value),
|
|
83
|
+
"Input validation failed",
|
|
84
|
+
);
|
|
85
|
+
if (!parsed.ok) {
|
|
86
|
+
return [parsed, { status: "invalid" }];
|
|
87
|
+
}
|
|
88
|
+
const payload = parsed.value;
|
|
89
|
+
const body = null;
|
|
90
|
+
|
|
91
|
+
const path = pathToFunc("/v2/projects")();
|
|
92
|
+
|
|
93
|
+
const query = encodeFormQuery({
|
|
94
|
+
"ending_before": payload?.ending_before,
|
|
95
|
+
"limit": payload?.limit,
|
|
96
|
+
"starting_after": payload?.starting_after,
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const headers = new Headers(compactMap({
|
|
100
|
+
Accept: "application/json",
|
|
101
|
+
}));
|
|
102
|
+
|
|
103
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
104
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
105
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
106
|
+
|
|
107
|
+
const context = {
|
|
108
|
+
options: client._options,
|
|
109
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
110
|
+
operationID: "ProjectList",
|
|
111
|
+
oAuth2Scopes: null,
|
|
112
|
+
|
|
113
|
+
resolvedSecurity: requestSecurity,
|
|
114
|
+
|
|
115
|
+
securitySource: client._options.apiKey,
|
|
116
|
+
retryConfig: options?.retries
|
|
117
|
+
|| client._options.retryConfig
|
|
118
|
+
|| { strategy: "none" },
|
|
119
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const requestRes = client._createRequest(context, {
|
|
123
|
+
security: requestSecurity,
|
|
124
|
+
method: "GET",
|
|
125
|
+
baseURL: options?.serverURL,
|
|
126
|
+
path: path,
|
|
127
|
+
headers: headers,
|
|
128
|
+
query: query,
|
|
129
|
+
body: body,
|
|
130
|
+
userAgent: client._options.userAgent,
|
|
131
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
132
|
+
}, options);
|
|
133
|
+
if (!requestRes.ok) {
|
|
134
|
+
return [requestRes, { status: "invalid" }];
|
|
135
|
+
}
|
|
136
|
+
const req = requestRes.value;
|
|
137
|
+
|
|
138
|
+
const doResult = await client._do(req, {
|
|
139
|
+
context,
|
|
140
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
141
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
142
|
+
retryConfig: context.retryConfig,
|
|
143
|
+
retryCodes: context.retryCodes,
|
|
144
|
+
});
|
|
145
|
+
if (!doResult.ok) {
|
|
146
|
+
return [doResult, { status: "request-error", request: req }];
|
|
147
|
+
}
|
|
148
|
+
const response = doResult.value;
|
|
149
|
+
|
|
150
|
+
const [result] = await M.match<
|
|
151
|
+
components.ListProjectsResponse,
|
|
152
|
+
| OrqError
|
|
153
|
+
| ResponseValidationError
|
|
154
|
+
| ConnectionError
|
|
155
|
+
| RequestAbortedError
|
|
156
|
+
| RequestTimeoutError
|
|
157
|
+
| InvalidRequestError
|
|
158
|
+
| UnexpectedClientError
|
|
159
|
+
| SDKValidationError
|
|
160
|
+
>(
|
|
161
|
+
M.json(200, components.ListProjectsResponse$inboundSchema),
|
|
162
|
+
M.fail("4XX"),
|
|
163
|
+
M.fail("5XX"),
|
|
164
|
+
)(response, req);
|
|
165
|
+
if (!result.ok) {
|
|
166
|
+
return [result, { status: "complete", request: req, response }];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return [result, { status: "complete", request: req, response }];
|
|
170
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { OrqCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import { OrqError } from "../models/errors/orqerror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Update a project
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Updates the specified project by setting the values of the parameters passed.
|
|
34
|
+
*/
|
|
35
|
+
export function projectsUpdate(
|
|
36
|
+
client: OrqCore,
|
|
37
|
+
request: operations.ProjectUpdateRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
components.UpdateProjectResponse,
|
|
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.ProjectUpdateRequest,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
components.UpdateProjectResponse,
|
|
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.ProjectUpdateRequest$outboundSchema.parse(value),
|
|
82
|
+
"Input validation failed",
|
|
83
|
+
);
|
|
84
|
+
if (!parsed.ok) {
|
|
85
|
+
return [parsed, { status: "invalid" }];
|
|
86
|
+
}
|
|
87
|
+
const payload = parsed.value;
|
|
88
|
+
const body = encodeJSON("body", payload.UpdateProjectRequest, {
|
|
89
|
+
explode: true,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const pathParams = {
|
|
93
|
+
project_id: encodeSimple("project_id", payload.project_id, {
|
|
94
|
+
explode: false,
|
|
95
|
+
charEncoding: "percent",
|
|
96
|
+
}),
|
|
97
|
+
};
|
|
98
|
+
const path = pathToFunc("/v2/projects/{project_id}")(pathParams);
|
|
99
|
+
|
|
100
|
+
const headers = new Headers(compactMap({
|
|
101
|
+
"Content-Type": "application/json",
|
|
102
|
+
Accept: "application/json",
|
|
103
|
+
}));
|
|
104
|
+
|
|
105
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
106
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
107
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
108
|
+
|
|
109
|
+
const context = {
|
|
110
|
+
options: client._options,
|
|
111
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
112
|
+
operationID: "ProjectUpdate",
|
|
113
|
+
oAuth2Scopes: null,
|
|
114
|
+
|
|
115
|
+
resolvedSecurity: requestSecurity,
|
|
116
|
+
|
|
117
|
+
securitySource: client._options.apiKey,
|
|
118
|
+
retryConfig: options?.retries
|
|
119
|
+
|| client._options.retryConfig
|
|
120
|
+
|| { strategy: "none" },
|
|
121
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const requestRes = client._createRequest(context, {
|
|
125
|
+
security: requestSecurity,
|
|
126
|
+
method: "PATCH",
|
|
127
|
+
baseURL: options?.serverURL,
|
|
128
|
+
path: path,
|
|
129
|
+
headers: headers,
|
|
130
|
+
body: body,
|
|
131
|
+
userAgent: client._options.userAgent,
|
|
132
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 600000,
|
|
133
|
+
}, options);
|
|
134
|
+
if (!requestRes.ok) {
|
|
135
|
+
return [requestRes, { status: "invalid" }];
|
|
136
|
+
}
|
|
137
|
+
const req = requestRes.value;
|
|
138
|
+
|
|
139
|
+
const doResult = await client._do(req, {
|
|
140
|
+
context,
|
|
141
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
142
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
143
|
+
retryConfig: context.retryConfig,
|
|
144
|
+
retryCodes: context.retryCodes,
|
|
145
|
+
});
|
|
146
|
+
if (!doResult.ok) {
|
|
147
|
+
return [doResult, { status: "request-error", request: req }];
|
|
148
|
+
}
|
|
149
|
+
const response = doResult.value;
|
|
150
|
+
|
|
151
|
+
const [result] = await M.match<
|
|
152
|
+
components.UpdateProjectResponse,
|
|
153
|
+
| OrqError
|
|
154
|
+
| ResponseValidationError
|
|
155
|
+
| ConnectionError
|
|
156
|
+
| RequestAbortedError
|
|
157
|
+
| RequestTimeoutError
|
|
158
|
+
| InvalidRequestError
|
|
159
|
+
| UnexpectedClientError
|
|
160
|
+
| SDKValidationError
|
|
161
|
+
>(
|
|
162
|
+
M.json(200, components.UpdateProjectResponse$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
|
+
}
|
|
@@ -68,7 +68,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
68
68
|
export const SDK_METADATA = {
|
|
69
69
|
language: "typescript",
|
|
70
70
|
openapiDocVersion: "2.0",
|
|
71
|
-
sdkVersion: "4.9.0-rc.
|
|
71
|
+
sdkVersion: "4.9.0-rc.24",
|
|
72
72
|
genVersion: "2.881.17",
|
|
73
|
-
userAgent: "speakeasy-sdk/typescript 4.9.0-rc.
|
|
73
|
+
userAgent: "speakeasy-sdk/typescript 4.9.0-rc.24 2.881.17 2.0 @orq-ai/node",
|
|
74
74
|
} as const;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
|
|
7
|
+
export type CreateProjectRequest = {
|
|
8
|
+
name?: string | undefined;
|
|
9
|
+
teams?: Array<string> | undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/** @internal */
|
|
13
|
+
export type CreateProjectRequest$Outbound = {
|
|
14
|
+
name?: string | undefined;
|
|
15
|
+
teams?: Array<string> | undefined;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const CreateProjectRequest$outboundSchema: z.ZodType<
|
|
20
|
+
CreateProjectRequest$Outbound,
|
|
21
|
+
z.ZodTypeDef,
|
|
22
|
+
CreateProjectRequest
|
|
23
|
+
> = z.object({
|
|
24
|
+
name: z.string().optional(),
|
|
25
|
+
teams: z.array(z.string()).optional(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export function createProjectRequestToJSON(
|
|
29
|
+
createProjectRequest: CreateProjectRequest,
|
|
30
|
+
): string {
|
|
31
|
+
return JSON.stringify(
|
|
32
|
+
CreateProjectRequest$outboundSchema.parse(createProjectRequest),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import { Project, Project$inboundSchema } from "./project.js";
|
|
10
|
+
|
|
11
|
+
export type CreateProjectResponse = {
|
|
12
|
+
project?: Project | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const CreateProjectResponse$inboundSchema: z.ZodType<
|
|
17
|
+
CreateProjectResponse,
|
|
18
|
+
z.ZodTypeDef,
|
|
19
|
+
unknown
|
|
20
|
+
> = z.object({
|
|
21
|
+
project: Project$inboundSchema.optional(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export function createProjectResponseFromJSON(
|
|
25
|
+
jsonString: string,
|
|
26
|
+
): SafeParseResult<CreateProjectResponse, SDKValidationError> {
|
|
27
|
+
return safeParse(
|
|
28
|
+
jsonString,
|
|
29
|
+
(x) => CreateProjectResponse$inboundSchema.parse(JSON.parse(x)),
|
|
30
|
+
`Failed to parse 'CreateProjectResponse' from JSON`,
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type DeleteProjectResponse = {};
|
|
11
|
+
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const DeleteProjectResponse$inboundSchema: z.ZodType<
|
|
14
|
+
DeleteProjectResponse,
|
|
15
|
+
z.ZodTypeDef,
|
|
16
|
+
unknown
|
|
17
|
+
> = z.object({});
|
|
18
|
+
|
|
19
|
+
export function deleteProjectResponseFromJSON(
|
|
20
|
+
jsonString: string,
|
|
21
|
+
): SafeParseResult<DeleteProjectResponse, SDKValidationError> {
|
|
22
|
+
return safeParse(
|
|
23
|
+
jsonString,
|
|
24
|
+
(x) => DeleteProjectResponse$inboundSchema.parse(JSON.parse(x)),
|
|
25
|
+
`Failed to parse 'DeleteProjectResponse' from JSON`,
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import { Project, Project$inboundSchema } from "./project.js";
|
|
10
|
+
|
|
11
|
+
export type GetProjectResponse = {
|
|
12
|
+
project?: Project | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const GetProjectResponse$inboundSchema: z.ZodType<
|
|
17
|
+
GetProjectResponse,
|
|
18
|
+
z.ZodTypeDef,
|
|
19
|
+
unknown
|
|
20
|
+
> = z.object({
|
|
21
|
+
project: Project$inboundSchema.optional(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export function getProjectResponseFromJSON(
|
|
25
|
+
jsonString: string,
|
|
26
|
+
): SafeParseResult<GetProjectResponse, SDKValidationError> {
|
|
27
|
+
return safeParse(
|
|
28
|
+
jsonString,
|
|
29
|
+
(x) => GetProjectResponse$inboundSchema.parse(JSON.parse(x)),
|
|
30
|
+
`Failed to parse 'GetProjectResponse' from JSON`,
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -18,10 +18,13 @@ export * from "./conversationparam.js";
|
|
|
18
18
|
export * from "./createagentresponse.js";
|
|
19
19
|
export * from "./createfilerequest.js";
|
|
20
20
|
export * from "./createfileresponse.js";
|
|
21
|
+
export * from "./createprojectrequest.js";
|
|
22
|
+
export * from "./createprojectresponse.js";
|
|
21
23
|
export * from "./createskillrequest.js";
|
|
22
24
|
export * from "./createskillresponse.js";
|
|
23
25
|
export * from "./datapart.js";
|
|
24
26
|
export * from "./deletefileresponse.js";
|
|
27
|
+
export * from "./deleteprojectresponse.js";
|
|
25
28
|
export * from "./deleteskillresponse.js";
|
|
26
29
|
export * from "./errorpart.js";
|
|
27
30
|
export * from "./errorstreamingevent.js";
|
|
@@ -39,6 +42,7 @@ export * from "./filepart.js";
|
|
|
39
42
|
export * from "./getagentresponse.js";
|
|
40
43
|
export * from "./getfilecontentresponse.js";
|
|
41
44
|
export * from "./getfileresponse.js";
|
|
45
|
+
export * from "./getprojectresponse.js";
|
|
42
46
|
export * from "./getskillresponse.js";
|
|
43
47
|
export * from "./guardrailref.js";
|
|
44
48
|
export * from "./guardrailrule.js";
|
|
@@ -48,6 +52,7 @@ export * from "./inputtokensdetails.js";
|
|
|
48
52
|
export * from "./invokedeploymentrequest.js";
|
|
49
53
|
export * from "./limits.js";
|
|
50
54
|
export * from "./listfilesresponse.js";
|
|
55
|
+
export * from "./listprojectsresponse.js";
|
|
51
56
|
export * from "./listskillsresponse.js";
|
|
52
57
|
export * from "./memoryparam.js";
|
|
53
58
|
export * from "./modelref.js";
|
|
@@ -58,6 +63,7 @@ export * from "./partdeltaevent.js";
|
|
|
58
63
|
export * from "./partdoneevent.js";
|
|
59
64
|
export * from "./policy.js";
|
|
60
65
|
export * from "./policyretryconfig.js";
|
|
66
|
+
export * from "./project.js";
|
|
61
67
|
export * from "./publiccontact.js";
|
|
62
68
|
export * from "./publicidentity.js";
|
|
63
69
|
export * from "./publicschedule.js";
|
|
@@ -105,5 +111,7 @@ export * from "./toolreviewrequestedevent.js";
|
|
|
105
111
|
export * from "./toolstartedevent.js";
|
|
106
112
|
export * from "./updatefilerequest.js";
|
|
107
113
|
export * from "./updatefileresponse.js";
|
|
114
|
+
export * from "./updateprojectrequest.js";
|
|
115
|
+
export * from "./updateprojectresponse.js";
|
|
108
116
|
export * from "./updateskillrequest.js";
|
|
109
117
|
export * from "./updateskillresponse.js";
|