@openrouter/sdk 1.2.53 → 1.2.55
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/esm/funcs/containersDownloadContainerFileContent.d.ts +18 -0
- package/esm/funcs/containersDownloadContainerFileContent.js +107 -0
- package/esm/funcs/containersGetContainerFile.d.ts +19 -0
- package/esm/funcs/containersGetContainerFile.js +107 -0
- package/esm/funcs/containersListContainerFiles.d.ts +19 -0
- package/esm/funcs/containersListContainerFiles.js +108 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/additionaltoolsitem.d.ts +10 -4
- package/esm/models/additionaltoolsitem.js +8 -0
- package/esm/models/containerfile.d.ts +53 -0
- package/esm/models/containerfile.js +40 -0
- package/esm/models/containerfilelistresponse.d.ts +25 -0
- package/esm/models/containerfilelistresponse.js +31 -0
- package/esm/models/index.d.ts +4 -0
- package/esm/models/index.js +4 -0
- package/esm/models/messagesrequest.d.ts +5 -4
- package/esm/models/messagesrequest.js +3 -0
- package/esm/models/openresponsesresult.d.ts +4 -0
- package/esm/models/openresponsesresult.js +5 -0
- package/esm/models/operations/downloadcontainerfilecontent.d.ts +63 -0
- package/esm/models/operations/downloadcontainerfilecontent.js +24 -0
- package/esm/models/operations/getcontainerfile.d.ts +63 -0
- package/esm/models/operations/getcontainerfile.js +24 -0
- package/esm/models/operations/index.d.ts +3 -0
- package/esm/models/operations/index.js +3 -0
- package/esm/models/operations/listcontainerfiles.d.ts +68 -0
- package/esm/models/operations/listcontainerfiles.js +24 -0
- package/esm/models/responsesrequest.d.ts +14 -0
- package/esm/models/responsesrequest.js +8 -0
- package/esm/models/toolsearchservertool.d.ts +28 -0
- package/esm/models/toolsearchservertool.js +20 -0
- package/esm/models/toolsearchservertoolconfig.d.ts +18 -0
- package/esm/models/toolsearchservertoolconfig.js +18 -0
- package/esm/sdk/containers.d.ts +27 -0
- package/esm/sdk/containers.js +39 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +4 -0
- package/jsr.json +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OpenRouterCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
5
|
+
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as operations from "../models/operations/index.js";
|
|
9
|
+
import { APIPromise } from "../types/async.js";
|
|
10
|
+
import { Result } from "../types/fp.js";
|
|
11
|
+
/**
|
|
12
|
+
* Download container file content
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Streams the raw bytes of a file under a sandbox session prefix.
|
|
16
|
+
*/
|
|
17
|
+
export declare function containersDownloadContainerFileContent(client: OpenRouterCore, request: operations.DownloadContainerFileContentRequest, options?: RequestOptions): APIPromise<Result<ReadableStream<Uint8Array>, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.ServiceUnavailableResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
|
+
//# sourceMappingURL=containersDownloadContainerFileContent.d.ts.map
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 5c9b66d827d2
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
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 { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import * as errors from "../models/errors/index.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { APIPromise } from "../types/async.js";
|
|
16
|
+
/**
|
|
17
|
+
* Download container file content
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Streams the raw bytes of a file under a sandbox session prefix.
|
|
21
|
+
*/
|
|
22
|
+
export function containersDownloadContainerFileContent(client, request, options) {
|
|
23
|
+
return new APIPromise($do(client, request, options));
|
|
24
|
+
}
|
|
25
|
+
async function $do(client, request, options) {
|
|
26
|
+
const parsed = safeParse(request, (value) => operations.DownloadContainerFileContentRequest$outboundSchema.parse(value), "Input validation failed");
|
|
27
|
+
if (!parsed.ok) {
|
|
28
|
+
return [parsed, { status: "invalid" }];
|
|
29
|
+
}
|
|
30
|
+
const payload = parsed.value;
|
|
31
|
+
const body = null;
|
|
32
|
+
const pathParams = {
|
|
33
|
+
file_id: encodeSimple("file_id", payload.file_id, {
|
|
34
|
+
explode: false,
|
|
35
|
+
charEncoding: "percent",
|
|
36
|
+
}),
|
|
37
|
+
session_id: encodeSimple("session_id", payload.session_id, {
|
|
38
|
+
explode: false,
|
|
39
|
+
charEncoding: "percent",
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
42
|
+
const path = pathToFunc("/containers/{session_id}/files/{file_id}/content")(pathParams);
|
|
43
|
+
const headers = new Headers(compactMap({
|
|
44
|
+
Accept: "application/octet-stream",
|
|
45
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
46
|
+
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
47
|
+
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
48
|
+
}));
|
|
49
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
50
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
51
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
52
|
+
const context = {
|
|
53
|
+
options: client._options,
|
|
54
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
55
|
+
operationID: "downloadContainerFileContent",
|
|
56
|
+
oAuth2Scopes: null,
|
|
57
|
+
resolvedSecurity: requestSecurity,
|
|
58
|
+
securitySource: client._options.apiKey,
|
|
59
|
+
retryConfig: options?.retries
|
|
60
|
+
|| client._options.retryConfig
|
|
61
|
+
|| {
|
|
62
|
+
strategy: "backoff",
|
|
63
|
+
backoff: {
|
|
64
|
+
initialInterval: 500,
|
|
65
|
+
maxInterval: 60000,
|
|
66
|
+
exponent: 1.5,
|
|
67
|
+
maxElapsedTime: 3600000,
|
|
68
|
+
},
|
|
69
|
+
retryConnectionErrors: true,
|
|
70
|
+
}
|
|
71
|
+
|| { strategy: "none" },
|
|
72
|
+
retryCodes: options?.retryCodes || ["5XX"],
|
|
73
|
+
};
|
|
74
|
+
const requestRes = client._createRequest(context, {
|
|
75
|
+
security: requestSecurity,
|
|
76
|
+
method: "GET",
|
|
77
|
+
baseURL: options?.serverURL,
|
|
78
|
+
path: path,
|
|
79
|
+
headers: headers,
|
|
80
|
+
body: body,
|
|
81
|
+
userAgent: client._options.userAgent,
|
|
82
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
83
|
+
}, options);
|
|
84
|
+
if (!requestRes.ok) {
|
|
85
|
+
return [requestRes, { status: "invalid" }];
|
|
86
|
+
}
|
|
87
|
+
const req = requestRes.value;
|
|
88
|
+
const doResult = await client._do(req, {
|
|
89
|
+
context,
|
|
90
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
91
|
+
retryConfig: context.retryConfig,
|
|
92
|
+
retryCodes: context.retryCodes,
|
|
93
|
+
});
|
|
94
|
+
if (!doResult.ok) {
|
|
95
|
+
return [doResult, { status: "request-error", request: req }];
|
|
96
|
+
}
|
|
97
|
+
const response = doResult.value;
|
|
98
|
+
const responseFields = {
|
|
99
|
+
HttpMeta: { Response: response, Request: req },
|
|
100
|
+
};
|
|
101
|
+
const [result] = await M.match(M.stream(200, z.custom(x => x instanceof ReadableStream)), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(503, errors.ServiceUnavailableResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
102
|
+
if (!result.ok) {
|
|
103
|
+
return [result, { status: "complete", request: req, response }];
|
|
104
|
+
}
|
|
105
|
+
return [result, { status: "complete", request: req, response }];
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=containersDownloadContainerFileContent.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OpenRouterCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
5
|
+
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as models from "../models/index.js";
|
|
9
|
+
import * as operations from "../models/operations/index.js";
|
|
10
|
+
import { APIPromise } from "../types/async.js";
|
|
11
|
+
import { Result } from "../types/fp.js";
|
|
12
|
+
/**
|
|
13
|
+
* Retrieve a container file
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Returns the metadata of a single file under a sandbox session prefix.
|
|
17
|
+
*/
|
|
18
|
+
export declare function containersGetContainerFile(client: OpenRouterCore, request: operations.GetContainerFileRequest, options?: RequestOptions): APIPromise<Result<models.ContainerFile, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.ServiceUnavailableResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
|
+
//# sourceMappingURL=containersGetContainerFile.d.ts.map
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 9450910db6e6
|
|
4
|
+
*/
|
|
5
|
+
import { encodeSimple } from "../lib/encodings.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 { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as models from "../models/index.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { APIPromise } from "../types/async.js";
|
|
16
|
+
/**
|
|
17
|
+
* Retrieve a container file
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Returns the metadata of a single file under a sandbox session prefix.
|
|
21
|
+
*/
|
|
22
|
+
export function containersGetContainerFile(client, request, options) {
|
|
23
|
+
return new APIPromise($do(client, request, options));
|
|
24
|
+
}
|
|
25
|
+
async function $do(client, request, options) {
|
|
26
|
+
const parsed = safeParse(request, (value) => operations.GetContainerFileRequest$outboundSchema.parse(value), "Input validation failed");
|
|
27
|
+
if (!parsed.ok) {
|
|
28
|
+
return [parsed, { status: "invalid" }];
|
|
29
|
+
}
|
|
30
|
+
const payload = parsed.value;
|
|
31
|
+
const body = null;
|
|
32
|
+
const pathParams = {
|
|
33
|
+
file_id: encodeSimple("file_id", payload.file_id, {
|
|
34
|
+
explode: false,
|
|
35
|
+
charEncoding: "percent",
|
|
36
|
+
}),
|
|
37
|
+
session_id: encodeSimple("session_id", payload.session_id, {
|
|
38
|
+
explode: false,
|
|
39
|
+
charEncoding: "percent",
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
42
|
+
const path = pathToFunc("/containers/{session_id}/files/{file_id}")(pathParams);
|
|
43
|
+
const headers = new Headers(compactMap({
|
|
44
|
+
Accept: "application/json",
|
|
45
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
46
|
+
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
47
|
+
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
48
|
+
}));
|
|
49
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
50
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
51
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
52
|
+
const context = {
|
|
53
|
+
options: client._options,
|
|
54
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
55
|
+
operationID: "getContainerFile",
|
|
56
|
+
oAuth2Scopes: null,
|
|
57
|
+
resolvedSecurity: requestSecurity,
|
|
58
|
+
securitySource: client._options.apiKey,
|
|
59
|
+
retryConfig: options?.retries
|
|
60
|
+
|| client._options.retryConfig
|
|
61
|
+
|| {
|
|
62
|
+
strategy: "backoff",
|
|
63
|
+
backoff: {
|
|
64
|
+
initialInterval: 500,
|
|
65
|
+
maxInterval: 60000,
|
|
66
|
+
exponent: 1.5,
|
|
67
|
+
maxElapsedTime: 3600000,
|
|
68
|
+
},
|
|
69
|
+
retryConnectionErrors: true,
|
|
70
|
+
}
|
|
71
|
+
|| { strategy: "none" },
|
|
72
|
+
retryCodes: options?.retryCodes || ["5XX"],
|
|
73
|
+
};
|
|
74
|
+
const requestRes = client._createRequest(context, {
|
|
75
|
+
security: requestSecurity,
|
|
76
|
+
method: "GET",
|
|
77
|
+
baseURL: options?.serverURL,
|
|
78
|
+
path: path,
|
|
79
|
+
headers: headers,
|
|
80
|
+
body: body,
|
|
81
|
+
userAgent: client._options.userAgent,
|
|
82
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
83
|
+
}, options);
|
|
84
|
+
if (!requestRes.ok) {
|
|
85
|
+
return [requestRes, { status: "invalid" }];
|
|
86
|
+
}
|
|
87
|
+
const req = requestRes.value;
|
|
88
|
+
const doResult = await client._do(req, {
|
|
89
|
+
context,
|
|
90
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
91
|
+
retryConfig: context.retryConfig,
|
|
92
|
+
retryCodes: context.retryCodes,
|
|
93
|
+
});
|
|
94
|
+
if (!doResult.ok) {
|
|
95
|
+
return [doResult, { status: "request-error", request: req }];
|
|
96
|
+
}
|
|
97
|
+
const response = doResult.value;
|
|
98
|
+
const responseFields = {
|
|
99
|
+
HttpMeta: { Response: response, Request: req },
|
|
100
|
+
};
|
|
101
|
+
const [result] = await M.match(M.json(200, models.ContainerFile$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors.NotFoundResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(503, errors.ServiceUnavailableResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
102
|
+
if (!result.ok) {
|
|
103
|
+
return [result, { status: "complete", request: req, response }];
|
|
104
|
+
}
|
|
105
|
+
return [result, { status: "complete", request: req, response }];
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=containersGetContainerFile.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OpenRouterCore } from "../core.js";
|
|
2
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
+
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
+
import * as errors from "../models/errors/index.js";
|
|
5
|
+
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
+
import * as models from "../models/index.js";
|
|
9
|
+
import * as operations from "../models/operations/index.js";
|
|
10
|
+
import { APIPromise } from "../types/async.js";
|
|
11
|
+
import { Result } from "../types/fp.js";
|
|
12
|
+
/**
|
|
13
|
+
* List container files
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Lists the files under a sandbox session prefix, in lexicographic path order. A restarted session is a separate container with its own session id. Paginate with `limit` and `after` (pass the previous page’s `last_id`); `has_more: true` always means the next page is fetchable that way.
|
|
17
|
+
*/
|
|
18
|
+
export declare function containersListContainerFiles(client: OpenRouterCore, request: operations.ListContainerFilesRequest, options?: RequestOptions): APIPromise<Result<models.ContainerFileListResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.ServiceUnavailableResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
|
+
//# sourceMappingURL=containersListContainerFiles.d.ts.map
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: a5b09a82f065
|
|
4
|
+
*/
|
|
5
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.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 { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as errors from "../models/errors/index.js";
|
|
13
|
+
import * as models from "../models/index.js";
|
|
14
|
+
import * as operations from "../models/operations/index.js";
|
|
15
|
+
import { APIPromise } from "../types/async.js";
|
|
16
|
+
/**
|
|
17
|
+
* List container files
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Lists the files under a sandbox session prefix, in lexicographic path order. A restarted session is a separate container with its own session id. Paginate with `limit` and `after` (pass the previous page’s `last_id`); `has_more: true` always means the next page is fetchable that way.
|
|
21
|
+
*/
|
|
22
|
+
export function containersListContainerFiles(client, request, options) {
|
|
23
|
+
return new APIPromise($do(client, request, options));
|
|
24
|
+
}
|
|
25
|
+
async function $do(client, request, options) {
|
|
26
|
+
const parsed = safeParse(request, (value) => operations.ListContainerFilesRequest$outboundSchema.parse(value), "Input validation failed");
|
|
27
|
+
if (!parsed.ok) {
|
|
28
|
+
return [parsed, { status: "invalid" }];
|
|
29
|
+
}
|
|
30
|
+
const payload = parsed.value;
|
|
31
|
+
const body = null;
|
|
32
|
+
const pathParams = {
|
|
33
|
+
session_id: encodeSimple("session_id", payload.session_id, {
|
|
34
|
+
explode: false,
|
|
35
|
+
charEncoding: "percent",
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
38
|
+
const path = pathToFunc("/containers/{session_id}/files")(pathParams);
|
|
39
|
+
const query = encodeFormQuery({
|
|
40
|
+
"after": payload.after,
|
|
41
|
+
"limit": payload.limit,
|
|
42
|
+
});
|
|
43
|
+
const headers = new Headers(compactMap({
|
|
44
|
+
Accept: "application/json",
|
|
45
|
+
"HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
|
|
46
|
+
"X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
|
|
47
|
+
"X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
|
|
48
|
+
}));
|
|
49
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
50
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
51
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
52
|
+
const context = {
|
|
53
|
+
options: client._options,
|
|
54
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
55
|
+
operationID: "listContainerFiles",
|
|
56
|
+
oAuth2Scopes: null,
|
|
57
|
+
resolvedSecurity: requestSecurity,
|
|
58
|
+
securitySource: client._options.apiKey,
|
|
59
|
+
retryConfig: options?.retries
|
|
60
|
+
|| client._options.retryConfig
|
|
61
|
+
|| {
|
|
62
|
+
strategy: "backoff",
|
|
63
|
+
backoff: {
|
|
64
|
+
initialInterval: 500,
|
|
65
|
+
maxInterval: 60000,
|
|
66
|
+
exponent: 1.5,
|
|
67
|
+
maxElapsedTime: 3600000,
|
|
68
|
+
},
|
|
69
|
+
retryConnectionErrors: true,
|
|
70
|
+
}
|
|
71
|
+
|| { strategy: "none" },
|
|
72
|
+
retryCodes: options?.retryCodes || ["5XX"],
|
|
73
|
+
};
|
|
74
|
+
const requestRes = client._createRequest(context, {
|
|
75
|
+
security: requestSecurity,
|
|
76
|
+
method: "GET",
|
|
77
|
+
baseURL: options?.serverURL,
|
|
78
|
+
path: path,
|
|
79
|
+
headers: headers,
|
|
80
|
+
query: query,
|
|
81
|
+
body: body,
|
|
82
|
+
userAgent: client._options.userAgent,
|
|
83
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
84
|
+
}, options);
|
|
85
|
+
if (!requestRes.ok) {
|
|
86
|
+
return [requestRes, { status: "invalid" }];
|
|
87
|
+
}
|
|
88
|
+
const req = requestRes.value;
|
|
89
|
+
const doResult = await client._do(req, {
|
|
90
|
+
context,
|
|
91
|
+
isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
|
|
92
|
+
retryConfig: context.retryConfig,
|
|
93
|
+
retryCodes: context.retryCodes,
|
|
94
|
+
});
|
|
95
|
+
if (!doResult.ok) {
|
|
96
|
+
return [doResult, { status: "request-error", request: req }];
|
|
97
|
+
}
|
|
98
|
+
const response = doResult.value;
|
|
99
|
+
const responseFields = {
|
|
100
|
+
HttpMeta: { Response: response, Request: req },
|
|
101
|
+
};
|
|
102
|
+
const [result] = await M.match(M.json(200, models.ContainerFileListResponse$inboundSchema), M.jsonErr(400, errors.BadRequestResponseError$inboundSchema), M.jsonErr(401, errors.UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors.ForbiddenResponseError$inboundSchema), M.jsonErr(429, errors.TooManyRequestsResponseError$inboundSchema), M.jsonErr(500, errors.InternalServerResponseError$inboundSchema), M.jsonErr(503, errors.ServiceUnavailableResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
103
|
+
if (!result.ok) {
|
|
104
|
+
return [result, { status: "complete", request: req, response }];
|
|
105
|
+
}
|
|
106
|
+
return [result, { status: "complete", request: req, response }];
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=containersListContainerFiles.js.map
|
package/esm/lib/config.d.ts
CHANGED
|
@@ -50,8 +50,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
50
50
|
export declare const SDK_METADATA: {
|
|
51
51
|
readonly language: "typescript";
|
|
52
52
|
readonly openapiDocVersion: "1.0.0";
|
|
53
|
-
readonly sdkVersion: "1.2.
|
|
53
|
+
readonly sdkVersion: "1.2.55";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.55 2.914.0 1.0.0 @openrouter/sdk";
|
|
56
56
|
};
|
|
57
57
|
//# sourceMappingURL=config.d.ts.map
|
package/esm/lib/config.js
CHANGED
|
@@ -29,8 +29,8 @@ export function serverURLFromOptions(options) {
|
|
|
29
29
|
export const SDK_METADATA = {
|
|
30
30
|
language: "typescript",
|
|
31
31
|
openapiDocVersion: "1.0.0",
|
|
32
|
-
sdkVersion: "1.2.
|
|
32
|
+
sdkVersion: "1.2.55",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.55 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -23,6 +23,7 @@ import { SearchModelsServerToolOpenRouter, SearchModelsServerToolOpenRouter$Outb
|
|
|
23
23
|
import { ShellServerTool, ShellServerTool$Outbound } from "./shellservertool.js";
|
|
24
24
|
import { ShellServerToolOpenRouter, ShellServerToolOpenRouter$Outbound } from "./shellservertoolopenrouter.js";
|
|
25
25
|
import { SubagentServerToolOpenRouter, SubagentServerToolOpenRouter$Outbound } from "./subagentservertoolopenrouter.js";
|
|
26
|
+
import { ToolSearchServerTool, ToolSearchServerTool$Outbound } from "./toolsearchservertool.js";
|
|
26
27
|
import { WebFetchServerTool, WebFetchServerTool$Outbound } from "./webfetchservertool.js";
|
|
27
28
|
import { WebSearchServerTool, WebSearchServerTool$Outbound } from "./websearchservertool.js";
|
|
28
29
|
import { WebSearchServerToolOpenRouter, WebSearchServerToolOpenRouter$Outbound } from "./websearchservertoolopenrouter.js";
|
|
@@ -58,8 +59,12 @@ export type AdditionalToolsItemToolFunction = {
|
|
|
58
59
|
} | null;
|
|
59
60
|
strict?: boolean | null | undefined;
|
|
60
61
|
type: AdditionalToolsItemTypeFunction;
|
|
62
|
+
/**
|
|
63
|
+
* Withhold this tool from the model until `openrouter:tool_search` finds it. Requires the tool search server tool; at least one tool must remain non-deferred.
|
|
64
|
+
*/
|
|
65
|
+
deferLoading?: boolean | undefined;
|
|
61
66
|
};
|
|
62
|
-
export type AdditionalToolsItemToolUnion = ComputerUseServerTool | NamespaceTool | AdditionalToolsItemToolFunction | FileSearchServerTool | CodeInterpreterServerTool | McpServerTool | CustomTool | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | AdvisorServerToolOpenRouter | SubagentServerToolOpenRouter | DatetimeServerTool | FilesServerTool | FusionServerToolOpenRouter | ImageGenerationServerToolOpenRouter | SearchModelsServerToolOpenRouter | WebFetchServerTool | WebSearchServerToolOpenRouter | ApplyPatchServerToolOpenRouter | BashServerTool | ShellServerToolOpenRouter | AdditionalToolsItemTool;
|
|
67
|
+
export type AdditionalToolsItemToolUnion = ComputerUseServerTool | NamespaceTool | AdditionalToolsItemToolFunction | FileSearchServerTool | CodeInterpreterServerTool | McpServerTool | CustomTool | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | AdvisorServerToolOpenRouter | SubagentServerToolOpenRouter | DatetimeServerTool | FilesServerTool | FusionServerToolOpenRouter | ImageGenerationServerToolOpenRouter | SearchModelsServerToolOpenRouter | WebFetchServerTool | WebSearchServerToolOpenRouter | ApplyPatchServerToolOpenRouter | BashServerTool | ShellServerToolOpenRouter | ToolSearchServerTool | AdditionalToolsItemTool;
|
|
63
68
|
export declare const TypeAdditionalTools: {
|
|
64
69
|
readonly AdditionalTools: "additional_tools";
|
|
65
70
|
};
|
|
@@ -70,7 +75,7 @@ export type TypeAdditionalTools = ClosedEnum<typeof TypeAdditionalTools>;
|
|
|
70
75
|
export type AdditionalToolsItem = {
|
|
71
76
|
id?: string | null | undefined;
|
|
72
77
|
role: AdditionalToolsItemRole;
|
|
73
|
-
tools: Array<ComputerUseServerTool | NamespaceTool | AdditionalToolsItemToolFunction | FileSearchServerTool | CodeInterpreterServerTool | McpServerTool | CustomTool | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | AdvisorServerToolOpenRouter | SubagentServerToolOpenRouter | DatetimeServerTool | FilesServerTool | FusionServerToolOpenRouter | ImageGenerationServerToolOpenRouter | SearchModelsServerToolOpenRouter | WebFetchServerTool | WebSearchServerToolOpenRouter | ApplyPatchServerToolOpenRouter | BashServerTool | ShellServerToolOpenRouter | AdditionalToolsItemTool>;
|
|
78
|
+
tools: Array<ComputerUseServerTool | NamespaceTool | AdditionalToolsItemToolFunction | FileSearchServerTool | CodeInterpreterServerTool | McpServerTool | CustomTool | PreviewWebSearchServerTool | Preview20250311WebSearchServerTool | LegacyWebSearchServerTool | WebSearchServerTool | ImageGenerationServerTool | CodexLocalShellTool | ShellServerTool | ApplyPatchServerTool | AdvisorServerToolOpenRouter | SubagentServerToolOpenRouter | DatetimeServerTool | FilesServerTool | FusionServerToolOpenRouter | ImageGenerationServerToolOpenRouter | SearchModelsServerToolOpenRouter | WebFetchServerTool | WebSearchServerToolOpenRouter | ApplyPatchServerToolOpenRouter | BashServerTool | ShellServerToolOpenRouter | ToolSearchServerTool | AdditionalToolsItemTool>;
|
|
74
79
|
type: TypeAdditionalTools;
|
|
75
80
|
};
|
|
76
81
|
/** @internal */
|
|
@@ -94,12 +99,13 @@ export type AdditionalToolsItemToolFunction$Outbound = {
|
|
|
94
99
|
} | null;
|
|
95
100
|
strict?: boolean | null | undefined;
|
|
96
101
|
type: string;
|
|
102
|
+
defer_loading?: boolean | undefined;
|
|
97
103
|
};
|
|
98
104
|
/** @internal */
|
|
99
105
|
export declare const AdditionalToolsItemToolFunction$outboundSchema: z.ZodType<AdditionalToolsItemToolFunction$Outbound, AdditionalToolsItemToolFunction>;
|
|
100
106
|
export declare function additionalToolsItemToolFunctionToJSON(additionalToolsItemToolFunction: AdditionalToolsItemToolFunction): string;
|
|
101
107
|
/** @internal */
|
|
102
|
-
export type AdditionalToolsItemToolUnion$Outbound = ComputerUseServerTool$Outbound | NamespaceTool$Outbound | AdditionalToolsItemToolFunction$Outbound | FileSearchServerTool$Outbound | CodeInterpreterServerTool$Outbound | McpServerTool$Outbound | CustomTool$Outbound | PreviewWebSearchServerTool$Outbound | Preview20250311WebSearchServerTool$Outbound | LegacyWebSearchServerTool$Outbound | WebSearchServerTool$Outbound | ImageGenerationServerTool$Outbound | CodexLocalShellTool$Outbound | ShellServerTool$Outbound | ApplyPatchServerTool$Outbound | AdvisorServerToolOpenRouter$Outbound | SubagentServerToolOpenRouter$Outbound | DatetimeServerTool$Outbound | FilesServerTool$Outbound | FusionServerToolOpenRouter$Outbound | ImageGenerationServerToolOpenRouter$Outbound | SearchModelsServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | WebSearchServerToolOpenRouter$Outbound | ApplyPatchServerToolOpenRouter$Outbound | BashServerTool$Outbound | ShellServerToolOpenRouter$Outbound | AdditionalToolsItemTool$Outbound;
|
|
108
|
+
export type AdditionalToolsItemToolUnion$Outbound = ComputerUseServerTool$Outbound | NamespaceTool$Outbound | AdditionalToolsItemToolFunction$Outbound | FileSearchServerTool$Outbound | CodeInterpreterServerTool$Outbound | McpServerTool$Outbound | CustomTool$Outbound | PreviewWebSearchServerTool$Outbound | Preview20250311WebSearchServerTool$Outbound | LegacyWebSearchServerTool$Outbound | WebSearchServerTool$Outbound | ImageGenerationServerTool$Outbound | CodexLocalShellTool$Outbound | ShellServerTool$Outbound | ApplyPatchServerTool$Outbound | AdvisorServerToolOpenRouter$Outbound | SubagentServerToolOpenRouter$Outbound | DatetimeServerTool$Outbound | FilesServerTool$Outbound | FusionServerToolOpenRouter$Outbound | ImageGenerationServerToolOpenRouter$Outbound | SearchModelsServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | WebSearchServerToolOpenRouter$Outbound | ApplyPatchServerToolOpenRouter$Outbound | BashServerTool$Outbound | ShellServerToolOpenRouter$Outbound | ToolSearchServerTool$Outbound | AdditionalToolsItemTool$Outbound;
|
|
103
109
|
/** @internal */
|
|
104
110
|
export declare const AdditionalToolsItemToolUnion$outboundSchema: z.ZodType<AdditionalToolsItemToolUnion$Outbound, AdditionalToolsItemToolUnion>;
|
|
105
111
|
export declare function additionalToolsItemToolUnionToJSON(additionalToolsItemToolUnion: AdditionalToolsItemToolUnion): string;
|
|
@@ -109,7 +115,7 @@ export declare const TypeAdditionalTools$outboundSchema: z.ZodEnum<typeof TypeAd
|
|
|
109
115
|
export type AdditionalToolsItem$Outbound = {
|
|
110
116
|
id?: string | null | undefined;
|
|
111
117
|
role: string;
|
|
112
|
-
tools: Array<ComputerUseServerTool$Outbound | NamespaceTool$Outbound | AdditionalToolsItemToolFunction$Outbound | FileSearchServerTool$Outbound | CodeInterpreterServerTool$Outbound | McpServerTool$Outbound | CustomTool$Outbound | PreviewWebSearchServerTool$Outbound | Preview20250311WebSearchServerTool$Outbound | LegacyWebSearchServerTool$Outbound | WebSearchServerTool$Outbound | ImageGenerationServerTool$Outbound | CodexLocalShellTool$Outbound | ShellServerTool$Outbound | ApplyPatchServerTool$Outbound | AdvisorServerToolOpenRouter$Outbound | SubagentServerToolOpenRouter$Outbound | DatetimeServerTool$Outbound | FilesServerTool$Outbound | FusionServerToolOpenRouter$Outbound | ImageGenerationServerToolOpenRouter$Outbound | SearchModelsServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | WebSearchServerToolOpenRouter$Outbound | ApplyPatchServerToolOpenRouter$Outbound | BashServerTool$Outbound | ShellServerToolOpenRouter$Outbound | AdditionalToolsItemTool$Outbound>;
|
|
118
|
+
tools: Array<ComputerUseServerTool$Outbound | NamespaceTool$Outbound | AdditionalToolsItemToolFunction$Outbound | FileSearchServerTool$Outbound | CodeInterpreterServerTool$Outbound | McpServerTool$Outbound | CustomTool$Outbound | PreviewWebSearchServerTool$Outbound | Preview20250311WebSearchServerTool$Outbound | LegacyWebSearchServerTool$Outbound | WebSearchServerTool$Outbound | ImageGenerationServerTool$Outbound | CodexLocalShellTool$Outbound | ShellServerTool$Outbound | ApplyPatchServerTool$Outbound | AdvisorServerToolOpenRouter$Outbound | SubagentServerToolOpenRouter$Outbound | DatetimeServerTool$Outbound | FilesServerTool$Outbound | FusionServerToolOpenRouter$Outbound | ImageGenerationServerToolOpenRouter$Outbound | SearchModelsServerToolOpenRouter$Outbound | WebFetchServerTool$Outbound | WebSearchServerToolOpenRouter$Outbound | ApplyPatchServerToolOpenRouter$Outbound | BashServerTool$Outbound | ShellServerToolOpenRouter$Outbound | ToolSearchServerTool$Outbound | AdditionalToolsItemTool$Outbound>;
|
|
113
119
|
type: string;
|
|
114
120
|
};
|
|
115
121
|
/** @internal */
|
|
@@ -28,6 +28,7 @@ import { SearchModelsServerToolOpenRouter$outboundSchema, } from "./searchmodels
|
|
|
28
28
|
import { ShellServerTool$outboundSchema, } from "./shellservertool.js";
|
|
29
29
|
import { ShellServerToolOpenRouter$outboundSchema, } from "./shellservertoolopenrouter.js";
|
|
30
30
|
import { SubagentServerToolOpenRouter$outboundSchema, } from "./subagentservertoolopenrouter.js";
|
|
31
|
+
import { ToolSearchServerTool$outboundSchema, } from "./toolsearchservertool.js";
|
|
31
32
|
import { WebFetchServerTool$outboundSchema, } from "./webfetchservertool.js";
|
|
32
33
|
import { WebSearchServerTool$outboundSchema, } from "./websearchservertool.js";
|
|
33
34
|
import { WebSearchServerToolOpenRouter$outboundSchema, } from "./websearchservertoolopenrouter.js";
|
|
@@ -73,6 +74,11 @@ export const AdditionalToolsItemToolFunction$outboundSchema = z.object({
|
|
|
73
74
|
parameters: z.nullable(z.record(z.string(), z.any())),
|
|
74
75
|
strict: z.nullable(z.boolean()).optional(),
|
|
75
76
|
type: AdditionalToolsItemTypeFunction$outboundSchema,
|
|
77
|
+
deferLoading: z.boolean().optional(),
|
|
78
|
+
}).transform((v) => {
|
|
79
|
+
return remap$(v, {
|
|
80
|
+
deferLoading: "defer_loading",
|
|
81
|
+
});
|
|
76
82
|
});
|
|
77
83
|
export function additionalToolsItemToolFunctionToJSON(additionalToolsItemToolFunction) {
|
|
78
84
|
return JSON.stringify(AdditionalToolsItemToolFunction$outboundSchema.parse(additionalToolsItemToolFunction));
|
|
@@ -106,6 +112,7 @@ export const AdditionalToolsItemToolUnion$outboundSchema = z.union([
|
|
|
106
112
|
ApplyPatchServerToolOpenRouter$outboundSchema,
|
|
107
113
|
BashServerTool$outboundSchema,
|
|
108
114
|
ShellServerToolOpenRouter$outboundSchema,
|
|
115
|
+
ToolSearchServerTool$outboundSchema,
|
|
109
116
|
z.lazy(() => AdditionalToolsItemTool$outboundSchema),
|
|
110
117
|
]);
|
|
111
118
|
export function additionalToolsItemToolUnionToJSON(additionalToolsItemToolUnion) {
|
|
@@ -145,6 +152,7 @@ export const AdditionalToolsItem$outboundSchema = z.object({
|
|
|
145
152
|
ApplyPatchServerToolOpenRouter$outboundSchema,
|
|
146
153
|
BashServerTool$outboundSchema,
|
|
147
154
|
ShellServerToolOpenRouter$outboundSchema,
|
|
155
|
+
ToolSearchServerTool$outboundSchema,
|
|
148
156
|
z.lazy(() => AdditionalToolsItemTool$outboundSchema),
|
|
149
157
|
])),
|
|
150
158
|
type: TypeAdditionalTools$outboundSchema,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const ContainerFileObject: {
|
|
6
|
+
readonly ContainerFile: "container.file";
|
|
7
|
+
};
|
|
8
|
+
export type ContainerFileObject = ClosedEnum<typeof ContainerFileObject>;
|
|
9
|
+
/**
|
|
10
|
+
* Container files are always produced by the assistant sandbox.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ContainerFileSource: {
|
|
13
|
+
readonly Assistant: "assistant";
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Container files are always produced by the assistant sandbox.
|
|
17
|
+
*/
|
|
18
|
+
export type ContainerFileSource = ClosedEnum<typeof ContainerFileSource>;
|
|
19
|
+
export type ContainerFile = {
|
|
20
|
+
/**
|
|
21
|
+
* File size in bytes.
|
|
22
|
+
*/
|
|
23
|
+
bytes: number;
|
|
24
|
+
/**
|
|
25
|
+
* The container the file belongs to — echoes the `session_id` path parameter (OpenAI field name).
|
|
26
|
+
*/
|
|
27
|
+
containerId: string;
|
|
28
|
+
/**
|
|
29
|
+
* Unix timestamp (seconds) when the file was last synced.
|
|
30
|
+
*/
|
|
31
|
+
createdAt: number;
|
|
32
|
+
/**
|
|
33
|
+
* Container file id: `cfile_` + base64url of the file path.
|
|
34
|
+
*/
|
|
35
|
+
id: string;
|
|
36
|
+
object: ContainerFileObject;
|
|
37
|
+
/**
|
|
38
|
+
* Session-relative file path inside the container.
|
|
39
|
+
*/
|
|
40
|
+
path: string;
|
|
41
|
+
/**
|
|
42
|
+
* Container files are always produced by the assistant sandbox.
|
|
43
|
+
*/
|
|
44
|
+
source: ContainerFileSource;
|
|
45
|
+
};
|
|
46
|
+
/** @internal */
|
|
47
|
+
export declare const ContainerFileObject$inboundSchema: z.ZodEnum<typeof ContainerFileObject>;
|
|
48
|
+
/** @internal */
|
|
49
|
+
export declare const ContainerFileSource$inboundSchema: z.ZodEnum<typeof ContainerFileSource>;
|
|
50
|
+
/** @internal */
|
|
51
|
+
export declare const ContainerFile$inboundSchema: z.ZodType<ContainerFile, unknown>;
|
|
52
|
+
export declare function containerFileFromJSON(jsonString: string): SafeParseResult<ContainerFile, SDKValidationError>;
|
|
53
|
+
//# sourceMappingURL=containerfile.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: ece4a8ddc017
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
export const ContainerFileObject = {
|
|
9
|
+
ContainerFile: "container.file",
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Container files are always produced by the assistant sandbox.
|
|
13
|
+
*/
|
|
14
|
+
export const ContainerFileSource = {
|
|
15
|
+
Assistant: "assistant",
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const ContainerFileObject$inboundSchema = z.enum(ContainerFileObject);
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const ContainerFileSource$inboundSchema = z.enum(ContainerFileSource);
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const ContainerFile$inboundSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
bytes: z.int(),
|
|
25
|
+
container_id: z.string(),
|
|
26
|
+
created_at: z.int(),
|
|
27
|
+
id: z.string(),
|
|
28
|
+
object: ContainerFileObject$inboundSchema,
|
|
29
|
+
path: z.string(),
|
|
30
|
+
source: ContainerFileSource$inboundSchema,
|
|
31
|
+
}).transform((v) => {
|
|
32
|
+
return remap$(v, {
|
|
33
|
+
"container_id": "containerId",
|
|
34
|
+
"created_at": "createdAt",
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
export function containerFileFromJSON(jsonString) {
|
|
38
|
+
return safeParse(jsonString, (x) => ContainerFile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContainerFile' from JSON`);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=containerfile.js.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { ContainerFile } from "./containerfile.js";
|
|
5
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
6
|
+
export declare const ContainerFileListResponseObject: {
|
|
7
|
+
readonly List: "list";
|
|
8
|
+
};
|
|
9
|
+
export type ContainerFileListResponseObject = ClosedEnum<typeof ContainerFileListResponseObject>;
|
|
10
|
+
export type ContainerFileListResponse = {
|
|
11
|
+
data: Array<ContainerFile>;
|
|
12
|
+
firstId: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* True when another page can be fetched by passing `after=last_id`.
|
|
15
|
+
*/
|
|
16
|
+
hasMore: boolean;
|
|
17
|
+
lastId: string | null;
|
|
18
|
+
object: ContainerFileListResponseObject;
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const ContainerFileListResponseObject$inboundSchema: z.ZodEnum<typeof ContainerFileListResponseObject>;
|
|
22
|
+
/** @internal */
|
|
23
|
+
export declare const ContainerFileListResponse$inboundSchema: z.ZodType<ContainerFileListResponse, unknown>;
|
|
24
|
+
export declare function containerFileListResponseFromJSON(jsonString: string): SafeParseResult<ContainerFileListResponse, SDKValidationError>;
|
|
25
|
+
//# sourceMappingURL=containerfilelistresponse.d.ts.map
|