@openrouter/sdk 1.2.63 → 1.2.65
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/containersPromoteContainerFile.d.ts +19 -0
- package/esm/funcs/containersPromoteContainerFile.js +107 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/containerautoenvironment.d.ts +5 -0
- package/esm/models/containerautoenvironment.js +2 -0
- package/esm/models/containerreferenceenvironment.d.ts +5 -0
- package/esm/models/containerreferenceenvironment.js +2 -0
- package/esm/models/operations/index.d.ts +1 -0
- package/esm/models/operations/index.js +1 -0
- package/esm/models/operations/promotecontainerfile.d.ts +63 -0
- package/esm/models/operations/promotecontainerfile.js +24 -0
- package/esm/sdk/containers.d.ts +7 -0
- package/esm/sdk/containers.js +10 -0
- package/jsr.json +1 -1
- package/package.json +8 -8
|
@@ -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
|
+
* Promote a container file into workspace documents
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* Copies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace's storage quota exactly like an upload.
|
|
17
|
+
*/
|
|
18
|
+
export declare function containersPromoteContainerFile(client: OpenRouterCore, request: operations.PromoteContainerFileRequest, options?: RequestOptions): APIPromise<Result<models.FileResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.PayloadTooLargeResponseError | errors.TooManyRequestsResponseError | errors.InternalServerResponseError | errors.ServiceUnavailableResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
|
+
//# sourceMappingURL=containersPromoteContainerFile.d.ts.map
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: b1e9dfab640d
|
|
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
|
+
* Promote a container file into workspace documents
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Copies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace's storage quota exactly like an upload.
|
|
21
|
+
*/
|
|
22
|
+
export function containersPromoteContainerFile(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.PromoteContainerFileRequest$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
|
+
container_id: encodeSimple("container_id", payload.container_id, {
|
|
34
|
+
explode: false,
|
|
35
|
+
charEncoding: "percent",
|
|
36
|
+
}),
|
|
37
|
+
file_id: encodeSimple("file_id", payload.file_id, {
|
|
38
|
+
explode: false,
|
|
39
|
+
charEncoding: "percent",
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
42
|
+
const path = pathToFunc("/containers/{container_id}/files/{file_id}/promote")(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: "promoteContainerFile",
|
|
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: "POST",
|
|
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.FileResponse$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(413, errors.PayloadTooLargeResponseError$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=containersPromoteContainerFile.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.65";
|
|
54
54
|
readonly genVersion: "2.914.0";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.2.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.2.65 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.65",
|
|
33
33
|
genVersion: "2.914.0",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.2.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.2.65 2.914.0 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -4,6 +4,10 @@ import { ContainerNetworkPolicy, ContainerNetworkPolicy$Outbound } from "./conta
|
|
|
4
4
|
* An OpenRouter-managed, auto-provisioned ephemeral container.
|
|
5
5
|
*/
|
|
6
6
|
export type ContainerAutoEnvironment = {
|
|
7
|
+
/**
|
|
8
|
+
* Workspace file ids (or_file_…) to attach into the container before the first command runs. Each file is copied to the container home as a writable copy named {last 8 characters of the file id}-{base filename} (a file stored as data/report.csv with id or_file_…NR6q4V8w attaches to ~/NR6q4V8w-report.csv), so same-named files never collide; the source document is never modified. Unknown, foreign, or malformed ids fail the request with a 400 before any command executes. Max 20 ids.
|
|
9
|
+
*/
|
|
10
|
+
fileIds?: Array<string> | undefined;
|
|
7
11
|
/**
|
|
8
12
|
* Network egress policy for the container. "disabled" blocks all outbound internet; "allowlist" permits only hosts matching the listed hostnames or * glob patterns (ports 80/443, DNS via Cloudflare resolvers). The policy is fixed when a container starts: sending a different policy to a warm container fails the request with a 409. Omitted: defaults to "disabled" (no outbound internet). For unrestricted egress, use an allowlist of ["*"].
|
|
9
13
|
*/
|
|
@@ -12,6 +16,7 @@ export type ContainerAutoEnvironment = {
|
|
|
12
16
|
};
|
|
13
17
|
/** @internal */
|
|
14
18
|
export type ContainerAutoEnvironment$Outbound = {
|
|
19
|
+
file_ids?: Array<string> | undefined;
|
|
15
20
|
network_policy?: ContainerNetworkPolicy$Outbound | undefined;
|
|
16
21
|
type: "container_auto";
|
|
17
22
|
};
|
|
@@ -7,10 +7,12 @@ import { remap as remap$ } from "../lib/primitives.js";
|
|
|
7
7
|
import { ContainerNetworkPolicy$outboundSchema, } from "./containernetworkpolicy.js";
|
|
8
8
|
/** @internal */
|
|
9
9
|
export const ContainerAutoEnvironment$outboundSchema = z.object({
|
|
10
|
+
fileIds: z.array(z.string()).optional(),
|
|
10
11
|
networkPolicy: ContainerNetworkPolicy$outboundSchema.optional(),
|
|
11
12
|
type: z.literal("container_auto"),
|
|
12
13
|
}).transform((v) => {
|
|
13
14
|
return remap$(v, {
|
|
15
|
+
fileIds: "file_ids",
|
|
14
16
|
networkPolicy: "network_policy",
|
|
15
17
|
});
|
|
16
18
|
});
|
|
@@ -8,6 +8,10 @@ export type ContainerReferenceEnvironment = {
|
|
|
8
8
|
* Canonical container id to reuse (max 40 characters, letters/digits/underscores/hyphens). Any container_id previously returned by a bash or shell tool result works here and reattaches to the same container and files — including session-derived ids (sess_...) and generation-derived ids (gen_...). Note that a session-derived id is always sess_ + the sanitized session key, which is not necessarily the raw session id you sent. Using the same container_id from both the bash and shell tools shares the same files, with last-write-wins when both flush concurrently. A fresh name creates a new persistent container. Containers are always scoped to your account and workspace.
|
|
9
9
|
*/
|
|
10
10
|
containerId: string;
|
|
11
|
+
/**
|
|
12
|
+
* Workspace file ids (or_file_…) to attach into the container before the first command runs. Each file is copied to the container home as a writable copy named {last 8 characters of the file id}-{base filename} (a file stored as data/report.csv with id or_file_…NR6q4V8w attaches to ~/NR6q4V8w-report.csv), so same-named files never collide; the source document is never modified. Unknown, foreign, or malformed ids fail the request with a 400 before any command executes. Max 20 ids.
|
|
13
|
+
*/
|
|
14
|
+
fileIds?: Array<string> | undefined;
|
|
11
15
|
/**
|
|
12
16
|
* Network egress policy for the container. "disabled" blocks all outbound internet; "allowlist" permits only hosts matching the listed hostnames or * glob patterns (ports 80/443, DNS via Cloudflare resolvers). The policy is fixed when a container starts: sending a different policy to a warm container fails the request with a 409. Omitted: defaults to "disabled" (no outbound internet). For unrestricted egress, use an allowlist of ["*"].
|
|
13
17
|
*/
|
|
@@ -17,6 +21,7 @@ export type ContainerReferenceEnvironment = {
|
|
|
17
21
|
/** @internal */
|
|
18
22
|
export type ContainerReferenceEnvironment$Outbound = {
|
|
19
23
|
container_id: string;
|
|
24
|
+
file_ids?: Array<string> | undefined;
|
|
20
25
|
network_policy?: ContainerNetworkPolicy$Outbound | undefined;
|
|
21
26
|
type: "container_reference";
|
|
22
27
|
};
|
|
@@ -8,11 +8,13 @@ import { ContainerNetworkPolicy$outboundSchema, } from "./containernetworkpolicy
|
|
|
8
8
|
/** @internal */
|
|
9
9
|
export const ContainerReferenceEnvironment$outboundSchema = z.object({
|
|
10
10
|
containerId: z.string(),
|
|
11
|
+
fileIds: z.array(z.string()).optional(),
|
|
11
12
|
networkPolicy: ContainerNetworkPolicy$outboundSchema.optional(),
|
|
12
13
|
type: z.literal("container_reference"),
|
|
13
14
|
}).transform((v) => {
|
|
14
15
|
return remap$(v, {
|
|
15
16
|
containerId: "container_id",
|
|
17
|
+
fileIds: "file_ids",
|
|
16
18
|
networkPolicy: "network_policy",
|
|
17
19
|
});
|
|
18
20
|
});
|
|
@@ -86,6 +86,7 @@ export * from "./listvideosmodels.js";
|
|
|
86
86
|
export * from "./listworkspacebudgets.js";
|
|
87
87
|
export * from "./listworkspacemembers.js";
|
|
88
88
|
export * from "./listworkspaces.js";
|
|
89
|
+
export * from "./promotecontainerfile.js";
|
|
89
90
|
export * from "./queryanalytics.js";
|
|
90
91
|
export * from "./sendchatcompletionrequest.js";
|
|
91
92
|
export * from "./submitgenerationfeedback.js";
|
|
@@ -90,6 +90,7 @@ export * from "./listvideosmodels.js";
|
|
|
90
90
|
export * from "./listworkspacebudgets.js";
|
|
91
91
|
export * from "./listworkspacemembers.js";
|
|
92
92
|
export * from "./listworkspaces.js";
|
|
93
|
+
export * from "./promotecontainerfile.js";
|
|
93
94
|
export * from "./queryanalytics.js";
|
|
94
95
|
export * from "./sendchatcompletionrequest.js";
|
|
95
96
|
export * from "./submitgenerationfeedback.js";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type PromoteContainerFileGlobals = {
|
|
3
|
+
/**
|
|
4
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* This is used to track API usage per application.
|
|
8
|
+
*/
|
|
9
|
+
httpReferer?: string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
*/
|
|
15
|
+
appTitle?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
*/
|
|
21
|
+
appCategories?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
export type PromoteContainerFileRequest = {
|
|
24
|
+
/**
|
|
25
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* This is used to track API usage per application.
|
|
29
|
+
*/
|
|
30
|
+
httpReferer?: string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
*/
|
|
36
|
+
appTitle?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
*/
|
|
42
|
+
appCategories?: string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* The canonical container id, exactly as returned in a bash/shell tool result — a restarted session has its own `-r<nonce>`-suffixed id. A session-derived id is always `sess_` + the sanitized session key, which is not necessarily the raw session id that was sent.
|
|
45
|
+
*/
|
|
46
|
+
containerId: string;
|
|
47
|
+
/**
|
|
48
|
+
* Container file id (`cfile_` + base64url of the file path).
|
|
49
|
+
*/
|
|
50
|
+
fileId: string;
|
|
51
|
+
};
|
|
52
|
+
/** @internal */
|
|
53
|
+
export type PromoteContainerFileRequest$Outbound = {
|
|
54
|
+
"HTTP-Referer"?: string | undefined;
|
|
55
|
+
appTitle?: string | undefined;
|
|
56
|
+
appCategories?: string | undefined;
|
|
57
|
+
container_id: string;
|
|
58
|
+
file_id: string;
|
|
59
|
+
};
|
|
60
|
+
/** @internal */
|
|
61
|
+
export declare const PromoteContainerFileRequest$outboundSchema: z.ZodType<PromoteContainerFileRequest$Outbound, PromoteContainerFileRequest>;
|
|
62
|
+
export declare function promoteContainerFileRequestToJSON(promoteContainerFileRequest: PromoteContainerFileRequest): string;
|
|
63
|
+
//# sourceMappingURL=promotecontainerfile.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 83724b6f486c
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const PromoteContainerFileRequest$outboundSchema = z.object({
|
|
9
|
+
httpReferer: z.string().optional(),
|
|
10
|
+
appTitle: z.string().optional(),
|
|
11
|
+
appCategories: z.string().optional(),
|
|
12
|
+
containerId: z.string(),
|
|
13
|
+
fileId: z.string(),
|
|
14
|
+
}).transform((v) => {
|
|
15
|
+
return remap$(v, {
|
|
16
|
+
httpReferer: "HTTP-Referer",
|
|
17
|
+
containerId: "container_id",
|
|
18
|
+
fileId: "file_id",
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
export function promoteContainerFileRequestToJSON(promoteContainerFileRequest) {
|
|
22
|
+
return JSON.stringify(PromoteContainerFileRequest$outboundSchema.parse(promoteContainerFileRequest));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=promotecontainerfile.js.map
|
package/esm/sdk/containers.d.ts
CHANGED
|
@@ -23,5 +23,12 @@ export declare class Containers extends ClientSDK {
|
|
|
23
23
|
* Streams the raw bytes of a file in a container.
|
|
24
24
|
*/
|
|
25
25
|
downloadContainerFileContent(request: operations.DownloadContainerFileContentRequest, options?: RequestOptions): Promise<ReadableStream<Uint8Array>>;
|
|
26
|
+
/**
|
|
27
|
+
* Promote a container file into workspace documents
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Copies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace's storage quota exactly like an upload.
|
|
31
|
+
*/
|
|
32
|
+
promoteContainerFile(request: operations.PromoteContainerFileRequest, options?: RequestOptions): Promise<models.FileResponse>;
|
|
26
33
|
}
|
|
27
34
|
//# sourceMappingURL=containers.d.ts.map
|
package/esm/sdk/containers.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { containersDownloadContainerFileContent } from "../funcs/containersDownloadContainerFileContent.js";
|
|
6
6
|
import { containersGetContainerFile } from "../funcs/containersGetContainerFile.js";
|
|
7
7
|
import { containersListContainerFiles } from "../funcs/containersListContainerFiles.js";
|
|
8
|
+
import { containersPromoteContainerFile } from "../funcs/containersPromoteContainerFile.js";
|
|
8
9
|
import { ClientSDK } from "../lib/sdks.js";
|
|
9
10
|
import { unwrapAsync } from "../types/fp.js";
|
|
10
11
|
export class Containers extends ClientSDK {
|
|
@@ -35,5 +36,14 @@ export class Containers extends ClientSDK {
|
|
|
35
36
|
async downloadContainerFileContent(request, options) {
|
|
36
37
|
return unwrapAsync(containersDownloadContainerFileContent(this, request, options));
|
|
37
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Promote a container file into workspace documents
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* Copies a file from the container's sandbox prefix into the workspace's durable document storage, so it outlives the container. Returns the new document in the Files API shape, with a durable file id in the documents namespace. The copy counts against the workspace's storage quota exactly like an upload.
|
|
44
|
+
*/
|
|
45
|
+
async promoteContainerFile(request, options) {
|
|
46
|
+
return unwrapAsync(containersPromoteContainerFile(this, request, options));
|
|
47
|
+
}
|
|
38
48
|
}
|
|
39
49
|
//# sourceMappingURL=containers.js.map
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.65",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 400+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"packageManager": "pnpm@10.22.0",
|
|
23
23
|
"publishConfig": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"access": "public",
|
|
25
|
+
"provenance": true
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./esm/index.js",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
+
"typecheck": "tsc --noEmit",
|
|
77
|
+
"typecheck:transit": "exit 0",
|
|
78
|
+
"prepare": "npm run build",
|
|
79
|
+
"test": "vitest --run --project unit",
|
|
76
80
|
"test:watch": "vitest --watch --project unit",
|
|
77
81
|
"compile": "tsc",
|
|
78
82
|
"postinstall": "node scripts/check-types.js || true",
|
|
79
|
-
"prepare": "npm run build",
|
|
80
|
-
"test": "vitest --run --project unit",
|
|
81
83
|
"test:e2e": "vitest --run --project e2e",
|
|
82
|
-
"test:transit": "exit 0"
|
|
83
|
-
"typecheck": "tsc --noEmit",
|
|
84
|
-
"typecheck:transit": "exit 0"
|
|
84
|
+
"test:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|
|
87
87
|
"devDependencies": {
|