@openrouter/sdk 1.2.134 → 1.2.136
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/containersListContainerFiles.d.ts +1 -1
- package/esm/funcs/containersListContainerFiles.js +1 -1
- package/esm/funcs/internsCreateIntern.d.ts +21 -0
- package/esm/funcs/internsCreateIntern.js +103 -0
- package/esm/funcs/internsDeleteIntern.d.ts +21 -0
- package/esm/funcs/internsDeleteIntern.js +105 -0
- package/esm/funcs/internsGetIntern.d.ts +21 -0
- package/esm/funcs/internsGetIntern.js +105 -0
- package/esm/funcs/internsListInterns.d.ts +21 -0
- package/esm/funcs/internsListInterns.js +106 -0
- package/esm/funcs/internsProvisionIntern.d.ts +21 -0
- package/esm/funcs/internsProvisionIntern.js +105 -0
- package/esm/funcs/internsSuspendIntern.d.ts +21 -0
- package/esm/funcs/internsSuspendIntern.js +105 -0
- package/esm/funcs/internsUpdateIntern.d.ts +21 -0
- package/esm/funcs/internsUpdateIntern.js +108 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/containerfilelistresponse.d.ts +4 -1
- package/esm/models/createinternrequest.d.ts +43 -0
- package/esm/models/createinternrequest.js +24 -0
- package/esm/models/deleteinternresponse.d.ts +10 -0
- package/esm/models/deleteinternresponse.js +14 -0
- package/esm/models/errors/index.d.ts +1 -0
- package/esm/models/errors/index.js +1 -0
- package/esm/models/errors/internlifecycleerror.d.ts +25 -0
- package/esm/models/errors/internlifecycleerror.js +35 -0
- package/esm/models/index.d.ts +8 -0
- package/esm/models/index.js +8 -0
- package/esm/models/intern.d.ts +108 -0
- package/esm/models/intern.js +58 -0
- package/esm/models/internlifecycleerror.d.ts +15 -0
- package/esm/models/internlifecycleerror.js +23 -0
- package/esm/models/internlistresponse.d.ts +18 -0
- package/esm/models/internlistresponse.js +21 -0
- package/esm/models/operations/createintern.d.ts +61 -0
- package/esm/models/operations/createintern.js +25 -0
- package/esm/models/operations/deleteintern.d.ts +58 -0
- package/esm/models/operations/deleteintern.js +21 -0
- package/esm/models/operations/getintern.d.ts +58 -0
- package/esm/models/operations/getintern.js +21 -0
- package/esm/models/operations/index.d.ts +7 -0
- package/esm/models/operations/index.js +7 -0
- package/esm/models/operations/listcontainerfiles.d.ts +1 -1
- package/esm/models/operations/listinterns.d.ts +82 -0
- package/esm/models/operations/listinterns.js +38 -0
- package/esm/models/operations/provisionintern.d.ts +58 -0
- package/esm/models/operations/provisionintern.js +21 -0
- package/esm/models/operations/suspendintern.d.ts +58 -0
- package/esm/models/operations/suspendintern.js +21 -0
- package/esm/models/operations/updateintern.d.ts +61 -0
- package/esm/models/operations/updateintern.js +24 -0
- package/esm/models/provisioninternresponse.d.ts +10 -0
- package/esm/models/provisioninternresponse.js +14 -0
- package/esm/models/responseserrorfield.d.ts +4 -4
- package/esm/models/responseserrorfield.js +4 -4
- package/esm/models/suspendinternresponse.d.ts +10 -0
- package/esm/models/suspendinternresponse.js +14 -0
- package/esm/models/updateinternrequest.d.ts +33 -0
- package/esm/models/updateinternrequest.js +16 -0
- package/esm/sdk/containers.d.ts +1 -1
- package/esm/sdk/containers.js +1 -1
- package/esm/sdk/interns.d.ts +55 -0
- package/esm/sdk/interns.js +79 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +4 -0
- package/jsr.json +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: fc3b4e6c5008
|
|
4
|
+
*/
|
|
5
|
+
import { internsCreateIntern } from "../funcs/internsCreateIntern.js";
|
|
6
|
+
import { internsDeleteIntern } from "../funcs/internsDeleteIntern.js";
|
|
7
|
+
import { internsGetIntern } from "../funcs/internsGetIntern.js";
|
|
8
|
+
import { internsListInterns } from "../funcs/internsListInterns.js";
|
|
9
|
+
import { internsProvisionIntern } from "../funcs/internsProvisionIntern.js";
|
|
10
|
+
import { internsSuspendIntern } from "../funcs/internsSuspendIntern.js";
|
|
11
|
+
import { internsUpdateIntern } from "../funcs/internsUpdateIntern.js";
|
|
12
|
+
import { ClientSDK } from "../lib/sdks.js";
|
|
13
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
14
|
+
export class Interns extends ClientSDK {
|
|
15
|
+
/**
|
|
16
|
+
* List interns
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Lists interns visible to the authenticated key, newest first. Filter by workspace and one or more lifecycle statuses. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
20
|
+
*/
|
|
21
|
+
async listInterns(request, options) {
|
|
22
|
+
return unwrapAsync(internsListInterns(this, request, options));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Create an intern
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Creates an intern in an explicit workspace. The operation also creates its private vault. It can start provisioning immediately or wait for a later provision call. A retry with the same idempotency key and body resumes unfinished work. The request body is capped at 1048576 bytes and a larger body is refused with 413. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
29
|
+
*/
|
|
30
|
+
async createIntern(request, options) {
|
|
31
|
+
return unwrapAsync(internsCreateIntern(this, request, options));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Delete an intern
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* Starts safe teardown of the intern, its runtime and its private vault. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
38
|
+
*/
|
|
39
|
+
async deleteIntern(request, options) {
|
|
40
|
+
return unwrapAsync(internsDeleteIntern(this, request, options));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get an intern
|
|
44
|
+
*
|
|
45
|
+
* @remarks
|
|
46
|
+
* Returns the public lifecycle state and settings for one visible intern. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
47
|
+
*/
|
|
48
|
+
async getIntern(request, options) {
|
|
49
|
+
return unwrapAsync(internsGetIntern(this, request, options));
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Update an intern
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* Changes the intern name, description, instructions or model. Omitted fields stay unchanged. The request body is capped at 1048576 bytes and a larger body is refused with 413. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
56
|
+
*/
|
|
57
|
+
async updateIntern(request, options) {
|
|
58
|
+
return unwrapAsync(internsUpdateIntern(this, request, options));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Provision an intern
|
|
62
|
+
*
|
|
63
|
+
* @remarks
|
|
64
|
+
* Starts the first boot, or resumes an intern after suspension. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
65
|
+
*/
|
|
66
|
+
async provisionIntern(request, options) {
|
|
67
|
+
return unwrapAsync(internsProvisionIntern(this, request, options));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Suspend an intern
|
|
71
|
+
*
|
|
72
|
+
* @remarks
|
|
73
|
+
* Stops the intern runtime while keeping its disk and configuration for a later provision call. The API key selects the caller, workspace and visible interns. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
|
|
74
|
+
*/
|
|
75
|
+
async suspendIntern(request, options) {
|
|
76
|
+
return unwrapAsync(internsSuspendIntern(this, request, options));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=interns.js.map
|
package/esm/sdk/sdk.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { Files } from "./files.js";
|
|
|
15
15
|
import { Generations } from "./generations.js";
|
|
16
16
|
import { Guardrails } from "./guardrails.js";
|
|
17
17
|
import { Images } from "./images.js";
|
|
18
|
+
import { Interns } from "./interns.js";
|
|
18
19
|
import { Models } from "./models.js";
|
|
19
20
|
import { OAuth } from "./oauth.js";
|
|
20
21
|
import { Observability } from "./observability.js";
|
|
@@ -70,6 +71,8 @@ export declare class OpenRouter extends ClientSDK {
|
|
|
70
71
|
get guardrails(): Guardrails;
|
|
71
72
|
private _images?;
|
|
72
73
|
get images(): Images;
|
|
74
|
+
private _interns?;
|
|
75
|
+
get interns(): Interns;
|
|
73
76
|
private _apiKeys?;
|
|
74
77
|
get apiKeys(): APIKeys;
|
|
75
78
|
private _models?;
|
package/esm/sdk/sdk.js
CHANGED
|
@@ -19,6 +19,7 @@ import { Files } from "./files.js";
|
|
|
19
19
|
import { Generations } from "./generations.js";
|
|
20
20
|
import { Guardrails } from "./guardrails.js";
|
|
21
21
|
import { Images } from "./images.js";
|
|
22
|
+
import { Interns } from "./interns.js";
|
|
22
23
|
import { Models } from "./models.js";
|
|
23
24
|
import { OAuth } from "./oauth.js";
|
|
24
25
|
import { Observability } from "./observability.js";
|
|
@@ -89,6 +90,9 @@ export class OpenRouter extends ClientSDK {
|
|
|
89
90
|
get images() {
|
|
90
91
|
return (this._images ?? (this._images = new Images(this._options)));
|
|
91
92
|
}
|
|
93
|
+
get interns() {
|
|
94
|
+
return (this._interns ?? (this._interns = new Interns(this._options)));
|
|
95
|
+
}
|
|
92
96
|
get apiKeys() {
|
|
93
97
|
return (this._apiKeys ?? (this._apiKeys = new APIKeys(this._options)));
|
|
94
98
|
}
|
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.136",
|
|
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": [
|
|
@@ -73,14 +73,14 @@
|
|
|
73
73
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
74
74
|
"build": "tsc",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"compile": "tsc",
|
|
77
76
|
"postinstall": "node scripts/check-types.js || true",
|
|
78
77
|
"prepare": "npm run build",
|
|
79
|
-
"test": "vitest --run --project
|
|
78
|
+
"test:e2e": "vitest --run --project e2e",
|
|
80
79
|
"test:transit": "exit 0",
|
|
81
80
|
"test:watch": "vitest --watch --project unit",
|
|
82
81
|
"typecheck": "tsc --noEmit",
|
|
83
|
-
"
|
|
82
|
+
"compile": "tsc",
|
|
83
|
+
"test": "vitest --run --project unit",
|
|
84
84
|
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|