@openrouter/sdk 1.5.0 → 1.5.1
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/organizationGetSettings.d.ts +1 -1
- package/esm/funcs/organizationGetSettings.js +2 -2
- package/esm/funcs/organizationListMembers.d.ts +1 -1
- package/esm/funcs/organizationListMembers.js +2 -2
- package/esm/funcs/organizationUpdateSettings.d.ts +1 -1
- package/esm/funcs/organizationUpdateSettings.js +2 -2
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/interndaemonaccess.d.ts +11 -1
- package/esm/models/interndaemonaccess.js +8 -0
- package/jsr.json +1 -1
- package/package.json +8 -8
|
@@ -14,5 +14,5 @@ import { Result } from "../types/fp.js";
|
|
|
14
14
|
* @remarks
|
|
15
15
|
* Get the settings of the organization associated with the authenticated management key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
|
-
export declare function organizationGetSettings(client: OpenRouterCore, request?: operations.GetOrganizationSettingsRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.GetOrganizationSettingsResponse, errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
17
|
+
export declare function organizationGetSettings(client: OpenRouterCore, request?: operations.GetOrganizationSettingsRequest | undefined, options?: RequestOptions): APIPromise<Result<operations.GetOrganizationSettingsResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=organizationGetSettings.d.ts.map
|
|
@@ -9,7 +9,7 @@ import { compactMap } from "../lib/primitives.js";
|
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
11
|
import { pathToFunc } from "../lib/url.js";
|
|
12
|
-
import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
|
|
12
|
+
import { ForbiddenResponseError$inboundSchema as errors_ForbiddenResponseError$inboundSchema } from "../models/errors/forbiddenresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
|
|
13
13
|
import { GetOrganizationSettingsRequest$outboundSchema as operations_GetOrganizationSettingsRequest$outboundSchema, GetOrganizationSettingsResponse$inboundSchema as operations_GetOrganizationSettingsResponse$inboundSchema } from "../models/operations/getorganizationsettings.js";
|
|
14
14
|
import { APIPromise } from "../types/async.js";
|
|
15
15
|
/**
|
|
@@ -87,7 +87,7 @@ async function $do(client, request, options) {
|
|
|
87
87
|
const responseFields = {
|
|
88
88
|
HttpMeta: { Response: response, Request: req },
|
|
89
89
|
};
|
|
90
|
-
const [result] = await M.match(M.json(200, operations_GetOrganizationSettingsResponse$inboundSchema), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
90
|
+
const [result] = await M.match(M.json(200, operations_GetOrganizationSettingsResponse$inboundSchema), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors_ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
91
91
|
if (!result.ok) {
|
|
92
92
|
return [result, { status: "complete", request: req, response }];
|
|
93
93
|
}
|
|
@@ -15,7 +15,7 @@ import { PageIterator } from "../types/operations.js";
|
|
|
15
15
|
* @remarks
|
|
16
16
|
* List all members of the organization associated with the authenticated management key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
17
|
*/
|
|
18
|
-
export declare function organizationListMembers(client: OpenRouterCore, request?: operations.ListOrganizationMembersRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListOrganizationMembersResponse, errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
|
|
18
|
+
export declare function organizationListMembers(client: OpenRouterCore, request?: operations.ListOrganizationMembersRequest | undefined, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListOrganizationMembersResponse, errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
|
|
19
19
|
offset: number;
|
|
20
20
|
}>>;
|
|
21
21
|
//# sourceMappingURL=organizationListMembers.d.ts.map
|
|
@@ -9,7 +9,7 @@ import { compactMap } from "../lib/primitives.js";
|
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
11
|
import { pathToFunc } from "../lib/url.js";
|
|
12
|
-
import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
|
|
12
|
+
import { ForbiddenResponseError$inboundSchema as errors_ForbiddenResponseError$inboundSchema } from "../models/errors/forbiddenresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
|
|
13
13
|
import { ListOrganizationMembersRequest$outboundSchema as operations_ListOrganizationMembersRequest$outboundSchema, ListOrganizationMembersResponse$inboundSchema as operations_ListOrganizationMembersResponse$inboundSchema } from "../models/operations/listorganizationmembers.js";
|
|
14
14
|
import { APIPromise } from "../types/async.js";
|
|
15
15
|
import { createPageIterator, haltIterator, } from "../types/operations.js";
|
|
@@ -95,7 +95,7 @@ async function $do(client, request, options) {
|
|
|
95
95
|
};
|
|
96
96
|
const [result, raw] = await M.match(M.json(200, operations_ListOrganizationMembersResponse$inboundSchema, {
|
|
97
97
|
key: "Result",
|
|
98
|
-
}), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
98
|
+
}), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(403, errors_ForbiddenResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
99
99
|
if (!result.ok) {
|
|
100
100
|
return [haltIterator(result), {
|
|
101
101
|
status: "complete",
|
|
@@ -14,5 +14,5 @@ import { Result } from "../types/fp.js";
|
|
|
14
14
|
* @remarks
|
|
15
15
|
* Update the settings of the organization associated with the authenticated management key. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
16
16
|
*/
|
|
17
|
-
export declare function organizationUpdateSettings(client: OpenRouterCore, request: operations.UpdateOrganizationSettingsRequest, options?: RequestOptions): APIPromise<Result<operations.UpdateOrganizationSettingsResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
17
|
+
export declare function organizationUpdateSettings(client: OpenRouterCore, request: operations.UpdateOrganizationSettingsRequest, options?: RequestOptions): APIPromise<Result<operations.UpdateOrganizationSettingsResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=organizationUpdateSettings.d.ts.map
|
|
@@ -9,7 +9,7 @@ import { compactMap } from "../lib/primitives.js";
|
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
11
|
import { pathToFunc } from "../lib/url.js";
|
|
12
|
-
import { BadRequestResponseError$inboundSchema as errors_BadRequestResponseError$inboundSchema } from "../models/errors/badrequestresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
|
|
12
|
+
import { BadRequestResponseError$inboundSchema as errors_BadRequestResponseError$inboundSchema } from "../models/errors/badrequestresponseerror.js"; import { ForbiddenResponseError$inboundSchema as errors_ForbiddenResponseError$inboundSchema } from "../models/errors/forbiddenresponseerror.js"; import { InternalServerResponseError$inboundSchema as errors_InternalServerResponseError$inboundSchema } from "../models/errors/internalserverresponseerror.js"; import { NotFoundResponseError$inboundSchema as errors_NotFoundResponseError$inboundSchema } from "../models/errors/notfoundresponseerror.js"; import { UnauthorizedResponseError$inboundSchema as errors_UnauthorizedResponseError$inboundSchema } from "../models/errors/unauthorizedresponseerror.js";
|
|
13
13
|
import { UpdateOrganizationSettingsRequest$outboundSchema as operations_UpdateOrganizationSettingsRequest$outboundSchema, UpdateOrganizationSettingsResponse$inboundSchema as operations_UpdateOrganizationSettingsResponse$inboundSchema } from "../models/operations/updateorganizationsettings.js";
|
|
14
14
|
import { APIPromise } from "../types/async.js";
|
|
15
15
|
/**
|
|
@@ -90,7 +90,7 @@ async function $do(client, request, options) {
|
|
|
90
90
|
const responseFields = {
|
|
91
91
|
HttpMeta: { Response: response, Request: req },
|
|
92
92
|
};
|
|
93
|
-
const [result] = await M.match(M.json(200, operations_UpdateOrganizationSettingsResponse$inboundSchema), M.jsonErr(400, errors_BadRequestResponseError$inboundSchema), M.jsonErr(401, errors_UnauthorizedResponseError$inboundSchema), M.jsonErr(404, errors_NotFoundResponseError$inboundSchema), M.jsonErr(500, errors_InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
93
|
+
const [result] = await M.match(M.json(200, operations_UpdateOrganizationSettingsResponse$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(500, errors_InternalServerResponseError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
94
94
|
if (!result.ok) {
|
|
95
95
|
return [result, { status: "complete", request: req, response }];
|
|
96
96
|
}
|
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.5.
|
|
53
|
+
readonly sdkVersion: "1.5.1";
|
|
54
54
|
readonly genVersion: "2.948.4";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.1 2.948.4 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.5.
|
|
32
|
+
sdkVersion: "1.5.1",
|
|
33
33
|
genVersion: "2.948.4",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.5.1 2.948.4 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
export type Viewer = {
|
|
5
|
+
/**
|
|
6
|
+
* The caller's Ori principals on this intern: `clerk:<user>`, and, when the grant carries `vault:read`, `slack:<team>:<user>` for each Slack account they linked to it. A session started by one of them in a one-to-one Slack DM is the caller's to see.
|
|
7
|
+
*/
|
|
8
|
+
principals: Array<string>;
|
|
9
|
+
};
|
|
4
10
|
/**
|
|
5
|
-
* The intern daemon's origin
|
|
11
|
+
* The intern daemon's origin, the bearer `ori tui --host` sends to it as `ORI_DAEMON_TOKEN`, and who the caller is on the intern.
|
|
6
12
|
*/
|
|
7
13
|
export type InternDaemonAccess = {
|
|
8
14
|
origin: string;
|
|
9
15
|
token: string;
|
|
16
|
+
viewer: Viewer;
|
|
10
17
|
};
|
|
11
18
|
/** @internal */
|
|
19
|
+
export declare const Viewer$inboundSchema: z.ZodType<Viewer, unknown>;
|
|
20
|
+
export declare function viewerFromJSON(jsonString: string): SafeParseResult<Viewer, SDKValidationError>;
|
|
21
|
+
/** @internal */
|
|
12
22
|
export declare const InternDaemonAccess$inboundSchema: z.ZodType<InternDaemonAccess, unknown>;
|
|
13
23
|
export declare function internDaemonAccessFromJSON(jsonString: string): SafeParseResult<InternDaemonAccess, SDKValidationError>;
|
|
14
24
|
//# sourceMappingURL=interndaemonaccess.d.ts.map
|
|
@@ -5,9 +5,17 @@
|
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
/** @internal */
|
|
8
|
+
export const Viewer$inboundSchema = z.object({
|
|
9
|
+
principals: z.array(z.string()),
|
|
10
|
+
});
|
|
11
|
+
export function viewerFromJSON(jsonString) {
|
|
12
|
+
return safeParse(jsonString, (x) => Viewer$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Viewer' from JSON`);
|
|
13
|
+
}
|
|
14
|
+
/** @internal */
|
|
8
15
|
export const InternDaemonAccess$inboundSchema = z.object({
|
|
9
16
|
origin: z.string(),
|
|
10
17
|
token: z.string(),
|
|
18
|
+
viewer: z.lazy(() => Viewer$inboundSchema),
|
|
11
19
|
});
|
|
12
20
|
export function internDaemonAccessFromJSON(jsonString) {
|
|
13
21
|
return safeParse(jsonString, (x) => InternDaemonAccess$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InternDaemonAccess' from JSON`);
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
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
|
+
"provenance": true,
|
|
25
|
+
"access": "public"
|
|
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 && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
|
-
"typecheck": "tsc --noEmit",
|
|
77
|
-
"typecheck:transit": "exit 0",
|
|
78
|
-
"prepare": "npm run build",
|
|
79
76
|
"test": "vitest --run --project unit",
|
|
80
|
-
"test:e2e": "vitest --run --project e2e",
|
|
81
77
|
"test:transit": "exit 0",
|
|
78
|
+
"typecheck": "tsc --noEmit",
|
|
79
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
80
|
+
"test:e2e": "vitest --run --project e2e",
|
|
82
81
|
"test:watch": "vitest --watch --project unit",
|
|
82
|
+
"typecheck:transit": "exit 0",
|
|
83
83
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
84
|
-
"
|
|
84
|
+
"prepare": "npm run build"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
|