@openrouter/sdk 1.2.134 → 1.2.135
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/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/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/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/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 +3 -3
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 3fe8f2b8da99
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as openEnums from "../../types/enums.js";
|
|
8
|
+
export const Status = {
|
|
9
|
+
AwaitingSlackInstall: "awaiting_slack_install",
|
|
10
|
+
Queued: "queued",
|
|
11
|
+
Provisioning: "provisioning",
|
|
12
|
+
Running: "running",
|
|
13
|
+
Failed: "failed",
|
|
14
|
+
Stopped: "stopped",
|
|
15
|
+
Destroying: "destroying",
|
|
16
|
+
DestroyFailed: "destroy_failed",
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const Status$outboundSchema = openEnums
|
|
20
|
+
.outboundSchema(Status);
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const ListInternsRequest$outboundSchema = z.object({
|
|
23
|
+
httpReferer: z.string().optional(),
|
|
24
|
+
appTitle: z.string().optional(),
|
|
25
|
+
appCategories: z.string().optional(),
|
|
26
|
+
limit: z.int().optional(),
|
|
27
|
+
status: z.array(Status$outboundSchema).optional(),
|
|
28
|
+
workspaceId: z.string().optional(),
|
|
29
|
+
}).transform((v) => {
|
|
30
|
+
return remap$(v, {
|
|
31
|
+
httpReferer: "HTTP-Referer",
|
|
32
|
+
workspaceId: "workspace_id",
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
export function listInternsRequestToJSON(listInternsRequest) {
|
|
36
|
+
return JSON.stringify(ListInternsRequest$outboundSchema.parse(listInternsRequest));
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=listinterns.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type ProvisionInternGlobals = {
|
|
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 ProvisionInternRequest = {
|
|
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
|
+
* ID of an intern visible to the authenticated API key.
|
|
45
|
+
*/
|
|
46
|
+
internId: string;
|
|
47
|
+
};
|
|
48
|
+
/** @internal */
|
|
49
|
+
export type ProvisionInternRequest$Outbound = {
|
|
50
|
+
"HTTP-Referer"?: string | undefined;
|
|
51
|
+
appTitle?: string | undefined;
|
|
52
|
+
appCategories?: string | undefined;
|
|
53
|
+
internId: string;
|
|
54
|
+
};
|
|
55
|
+
/** @internal */
|
|
56
|
+
export declare const ProvisionInternRequest$outboundSchema: z.ZodType<ProvisionInternRequest$Outbound, ProvisionInternRequest>;
|
|
57
|
+
export declare function provisionInternRequestToJSON(provisionInternRequest: ProvisionInternRequest): string;
|
|
58
|
+
//# sourceMappingURL=provisionintern.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 10202b36a7cd
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const ProvisionInternRequest$outboundSchema = z.object({
|
|
9
|
+
httpReferer: z.string().optional(),
|
|
10
|
+
appTitle: z.string().optional(),
|
|
11
|
+
appCategories: z.string().optional(),
|
|
12
|
+
internId: z.string(),
|
|
13
|
+
}).transform((v) => {
|
|
14
|
+
return remap$(v, {
|
|
15
|
+
httpReferer: "HTTP-Referer",
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
export function provisionInternRequestToJSON(provisionInternRequest) {
|
|
19
|
+
return JSON.stringify(ProvisionInternRequest$outboundSchema.parse(provisionInternRequest));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=provisionintern.js.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type SuspendInternGlobals = {
|
|
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 SuspendInternRequest = {
|
|
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
|
+
* ID of an intern visible to the authenticated API key.
|
|
45
|
+
*/
|
|
46
|
+
internId: string;
|
|
47
|
+
};
|
|
48
|
+
/** @internal */
|
|
49
|
+
export type SuspendInternRequest$Outbound = {
|
|
50
|
+
"HTTP-Referer"?: string | undefined;
|
|
51
|
+
appTitle?: string | undefined;
|
|
52
|
+
appCategories?: string | undefined;
|
|
53
|
+
internId: string;
|
|
54
|
+
};
|
|
55
|
+
/** @internal */
|
|
56
|
+
export declare const SuspendInternRequest$outboundSchema: z.ZodType<SuspendInternRequest$Outbound, SuspendInternRequest>;
|
|
57
|
+
export declare function suspendInternRequestToJSON(suspendInternRequest: SuspendInternRequest): string;
|
|
58
|
+
//# sourceMappingURL=suspendintern.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 189ee7e2d8bb
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const SuspendInternRequest$outboundSchema = z.object({
|
|
9
|
+
httpReferer: z.string().optional(),
|
|
10
|
+
appTitle: z.string().optional(),
|
|
11
|
+
appCategories: z.string().optional(),
|
|
12
|
+
internId: z.string(),
|
|
13
|
+
}).transform((v) => {
|
|
14
|
+
return remap$(v, {
|
|
15
|
+
httpReferer: "HTTP-Referer",
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
export function suspendInternRequestToJSON(suspendInternRequest) {
|
|
19
|
+
return JSON.stringify(SuspendInternRequest$outboundSchema.parse(suspendInternRequest));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=suspendintern.js.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import * as models from "../index.js";
|
|
3
|
+
export type UpdateInternGlobals = {
|
|
4
|
+
/**
|
|
5
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* This is used to track API usage per application.
|
|
9
|
+
*/
|
|
10
|
+
httpReferer?: string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
*/
|
|
16
|
+
appTitle?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
*/
|
|
22
|
+
appCategories?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
export type UpdateInternRequest = {
|
|
25
|
+
/**
|
|
26
|
+
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* This is used to track API usage per application.
|
|
30
|
+
*/
|
|
31
|
+
httpReferer?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* The app display name allows you to customize how your app appears in OpenRouter's dashboard.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
*/
|
|
37
|
+
appTitle?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Comma-separated list of app categories (e.g. "cli-agent,cloud-agent"). Used for marketplace rankings.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
*/
|
|
43
|
+
appCategories?: string | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* ID of an intern visible to the authenticated API key.
|
|
46
|
+
*/
|
|
47
|
+
internId: string;
|
|
48
|
+
updateInternRequest: models.UpdateInternRequest;
|
|
49
|
+
};
|
|
50
|
+
/** @internal */
|
|
51
|
+
export type UpdateInternRequest$Outbound = {
|
|
52
|
+
"HTTP-Referer"?: string | undefined;
|
|
53
|
+
appTitle?: string | undefined;
|
|
54
|
+
appCategories?: string | undefined;
|
|
55
|
+
internId: string;
|
|
56
|
+
UpdateInternRequest: models.UpdateInternRequest$Outbound;
|
|
57
|
+
};
|
|
58
|
+
/** @internal */
|
|
59
|
+
export declare const UpdateInternRequest$outboundSchema: z.ZodType<UpdateInternRequest$Outbound, UpdateInternRequest>;
|
|
60
|
+
export declare function updateInternRequestToJSON(updateInternRequest: UpdateInternRequest): string;
|
|
61
|
+
//# sourceMappingURL=updateintern.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: fb05d7710bfa
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const UpdateInternRequest$outboundSchema = z.object({
|
|
10
|
+
httpReferer: z.string().optional(),
|
|
11
|
+
appTitle: z.string().optional(),
|
|
12
|
+
appCategories: z.string().optional(),
|
|
13
|
+
internId: z.string(),
|
|
14
|
+
updateInternRequest: models.UpdateInternRequest$outboundSchema,
|
|
15
|
+
}).transform((v) => {
|
|
16
|
+
return remap$(v, {
|
|
17
|
+
httpReferer: "HTTP-Referer",
|
|
18
|
+
updateInternRequest: "UpdateInternRequest",
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
export function updateInternRequestToJSON(updateInternRequest) {
|
|
22
|
+
return JSON.stringify(UpdateInternRequest$outboundSchema.parse(updateInternRequest));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=updateintern.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
export type ProvisionInternResponse = {
|
|
5
|
+
provisioning: true;
|
|
6
|
+
};
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare const ProvisionInternResponse$inboundSchema: z.ZodType<ProvisionInternResponse, unknown>;
|
|
9
|
+
export declare function provisionInternResponseFromJSON(jsonString: string): SafeParseResult<ProvisionInternResponse, SDKValidationError>;
|
|
10
|
+
//# sourceMappingURL=provisioninternresponse.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 43ed2389f509
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const ProvisionInternResponse$inboundSchema = z.object({
|
|
9
|
+
provisioning: z.literal(true),
|
|
10
|
+
});
|
|
11
|
+
export function provisionInternResponseFromJSON(jsonString) {
|
|
12
|
+
return safeParse(jsonString, (x) => ProvisionInternResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ProvisionInternResponse' from JSON`);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=provisioninternresponse.js.map
|
|
@@ -2,7 +2,7 @@ import * as z from "zod/v4";
|
|
|
2
2
|
import { OpenEnum } from "../types/enums.js";
|
|
3
3
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const CodeEnum: {
|
|
6
6
|
readonly ServerError: "server_error";
|
|
7
7
|
readonly RateLimitExceeded: "rate_limit_exceeded";
|
|
8
8
|
readonly InvalidPrompt: "invalid_prompt";
|
|
@@ -26,16 +26,16 @@ export declare const Code: {
|
|
|
26
26
|
readonly MisalignmentPolicyViolation: "misalignment_policy_violation";
|
|
27
27
|
readonly DataResidencyMismatch: "data_residency_mismatch";
|
|
28
28
|
};
|
|
29
|
-
export type
|
|
29
|
+
export type CodeEnum = OpenEnum<typeof CodeEnum>;
|
|
30
30
|
/**
|
|
31
31
|
* Error information returned from the API
|
|
32
32
|
*/
|
|
33
33
|
export type ResponsesErrorField = {
|
|
34
|
-
code:
|
|
34
|
+
code: CodeEnum;
|
|
35
35
|
message: string;
|
|
36
36
|
};
|
|
37
37
|
/** @internal */
|
|
38
|
-
export declare const
|
|
38
|
+
export declare const CodeEnum$inboundSchema: z.ZodType<CodeEnum, unknown>;
|
|
39
39
|
/** @internal */
|
|
40
40
|
export declare const ResponsesErrorField$inboundSchema: z.ZodType<ResponsesErrorField, unknown>;
|
|
41
41
|
export declare function responsesErrorFieldFromJSON(jsonString: string): SafeParseResult<ResponsesErrorField, SDKValidationError>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import * as openEnums from "../types/enums.js";
|
|
8
|
-
export const
|
|
8
|
+
export const CodeEnum = {
|
|
9
9
|
ServerError: "server_error",
|
|
10
10
|
RateLimitExceeded: "rate_limit_exceeded",
|
|
11
11
|
InvalidPrompt: "invalid_prompt",
|
|
@@ -30,11 +30,11 @@ export const Code = {
|
|
|
30
30
|
DataResidencyMismatch: "data_residency_mismatch",
|
|
31
31
|
};
|
|
32
32
|
/** @internal */
|
|
33
|
-
export const
|
|
34
|
-
.inboundSchema(
|
|
33
|
+
export const CodeEnum$inboundSchema = openEnums
|
|
34
|
+
.inboundSchema(CodeEnum);
|
|
35
35
|
/** @internal */
|
|
36
36
|
export const ResponsesErrorField$inboundSchema = z.object({
|
|
37
|
-
code:
|
|
37
|
+
code: CodeEnum$inboundSchema,
|
|
38
38
|
message: z.string(),
|
|
39
39
|
});
|
|
40
40
|
export function responsesErrorFieldFromJSON(jsonString) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
export type SuspendInternResponse = {
|
|
5
|
+
suspended: true;
|
|
6
|
+
};
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare const SuspendInternResponse$inboundSchema: z.ZodType<SuspendInternResponse, unknown>;
|
|
9
|
+
export declare function suspendInternResponseFromJSON(jsonString: string): SafeParseResult<SuspendInternResponse, SDKValidationError>;
|
|
10
|
+
//# sourceMappingURL=suspendinternresponse.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 1a88b3e1ceb1
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const SuspendInternResponse$inboundSchema = z.object({
|
|
9
|
+
suspended: z.literal(true),
|
|
10
|
+
});
|
|
11
|
+
export function suspendInternResponseFromJSON(jsonString) {
|
|
12
|
+
return safeParse(jsonString, (x) => SuspendInternResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SuspendInternResponse' from JSON`);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=suspendinternresponse.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
/**
|
|
3
|
+
* Lifecycle settings to change. Omitted fields stay unchanged and null clears a field.
|
|
4
|
+
*/
|
|
5
|
+
export type UpdateInternRequest = {
|
|
6
|
+
/**
|
|
7
|
+
* New free-form description. Null clears it.
|
|
8
|
+
*/
|
|
9
|
+
description?: string | null | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* New standing instructions. Null clears them.
|
|
12
|
+
*/
|
|
13
|
+
instructions?: string | null | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* New OpenRouter model slug. Null restores the workspace default.
|
|
16
|
+
*/
|
|
17
|
+
model?: string | null | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* New intern name, unique per creator within the workspace.
|
|
20
|
+
*/
|
|
21
|
+
name?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type UpdateInternRequest$Outbound = {
|
|
25
|
+
description?: string | null | undefined;
|
|
26
|
+
instructions?: string | null | undefined;
|
|
27
|
+
model?: string | null | undefined;
|
|
28
|
+
name?: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
/** @internal */
|
|
31
|
+
export declare const UpdateInternRequest$outboundSchema: z.ZodType<UpdateInternRequest$Outbound, UpdateInternRequest>;
|
|
32
|
+
export declare function updateInternRequestToJSON(updateInternRequest: UpdateInternRequest): string;
|
|
33
|
+
//# sourceMappingURL=updateinternrequest.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 8e76ee00847f
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const UpdateInternRequest$outboundSchema = z.object({
|
|
8
|
+
description: z.nullable(z.string()).optional(),
|
|
9
|
+
instructions: z.nullable(z.string()).optional(),
|
|
10
|
+
model: z.nullable(z.string()).optional(),
|
|
11
|
+
name: z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
export function updateInternRequestToJSON(updateInternRequest) {
|
|
14
|
+
return JSON.stringify(UpdateInternRequest$outboundSchema.parse(updateInternRequest));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=updateinternrequest.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
|
+
import * as models from "../models/index.js";
|
|
3
|
+
import * as operations from "../models/operations/index.js";
|
|
4
|
+
export declare class Interns extends ClientSDK {
|
|
5
|
+
/**
|
|
6
|
+
* List interns
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* 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.
|
|
10
|
+
*/
|
|
11
|
+
listInterns(request?: operations.ListInternsRequest | undefined, options?: RequestOptions): Promise<models.InternListResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Create an intern
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* 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.
|
|
17
|
+
*/
|
|
18
|
+
createIntern(request: operations.CreateInternRequest, options?: RequestOptions): Promise<models.Intern>;
|
|
19
|
+
/**
|
|
20
|
+
* Delete an intern
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* 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.
|
|
24
|
+
*/
|
|
25
|
+
deleteIntern(request: operations.DeleteInternRequest, options?: RequestOptions): Promise<models.DeleteInternResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Get an intern
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* 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.
|
|
31
|
+
*/
|
|
32
|
+
getIntern(request: operations.GetInternRequest, options?: RequestOptions): Promise<models.Intern>;
|
|
33
|
+
/**
|
|
34
|
+
* Update an intern
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* 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.
|
|
38
|
+
*/
|
|
39
|
+
updateIntern(request: operations.UpdateInternRequest, options?: RequestOptions): Promise<models.Intern>;
|
|
40
|
+
/**
|
|
41
|
+
* Provision an intern
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* 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.
|
|
45
|
+
*/
|
|
46
|
+
provisionIntern(request: operations.ProvisionInternRequest, options?: RequestOptions): Promise<models.ProvisionInternResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Suspend an intern
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* 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.
|
|
52
|
+
*/
|
|
53
|
+
suspendIntern(request: operations.SuspendInternRequest, options?: RequestOptions): Promise<models.SuspendInternResponse>;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=interns.d.ts.map
|
|
@@ -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.135",
|
|
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": [
|
|
@@ -76,11 +76,11 @@
|
|
|
76
76
|
"compile": "tsc",
|
|
77
77
|
"postinstall": "node scripts/check-types.js || true",
|
|
78
78
|
"prepare": "npm run build",
|
|
79
|
-
"test": "vitest --run --project unit",
|
|
80
|
-
"test:transit": "exit 0",
|
|
81
79
|
"test:watch": "vitest --watch --project unit",
|
|
82
80
|
"typecheck": "tsc --noEmit",
|
|
81
|
+
"test": "vitest --run --project unit",
|
|
83
82
|
"test:e2e": "vitest --run --project e2e",
|
|
83
|
+
"test:transit": "exit 0",
|
|
84
84
|
"typecheck:transit": "exit 0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {},
|