@openrouter/sdk 1.5.90 → 1.5.92
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/workspacesBulkAddMembers.d.ts +1 -1
- package/esm/funcs/workspacesBulkAddMembers.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/batchobject.d.ts +4 -0
- package/esm/models/batchobject.js +5 -0
- package/esm/models/bulkaddworkspacemembersrequest.d.ts +1 -1
- package/esm/models/bulkaddworkspacemembersresponse.d.ts +1 -1
- package/esm/models/createworkspacerequest.d.ts +1 -1
- package/esm/models/operations/createembeddings.d.ts +9 -5
- package/esm/models/operations/createembeddings.js +7 -0
- package/esm/models/updateworkspacerequest.d.ts +1 -1
- package/esm/sdk/workspaces.d.ts +1 -1
- package/esm/sdk/workspaces.js +1 -1
- package/jsr.json +1 -1
- package/package.json +3 -3
|
@@ -13,7 +13,7 @@ import { Result } from "../types/fp.js";
|
|
|
13
13
|
* Bulk add members to a workspace
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Add multiple organization members to a workspace.
|
|
16
|
+
* Add multiple organization members to a workspace. New members are assigned the workspace role that matches their organization role. Users who are already members of the workspace keep their current role and are not included in the response. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
17
17
|
*/
|
|
18
18
|
export declare function workspacesBulkAddMembers(client: OpenRouterCore, request: operations.BulkAddWorkspaceMembersRequest, options?: RequestOptions): APIPromise<Result<models.BulkAddWorkspaceMembersResponse, errors.BadRequestResponseError | errors.UnauthorizedResponseError | errors.ForbiddenResponseError | errors.NotFoundResponseError | errors.InternalServerResponseError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
19
19
|
//# sourceMappingURL=workspacesBulkAddMembers.d.ts.map
|
|
@@ -17,7 +17,7 @@ import { APIPromise } from "../types/async.js";
|
|
|
17
17
|
* Bulk add members to a workspace
|
|
18
18
|
*
|
|
19
19
|
* @remarks
|
|
20
|
-
* Add multiple organization members to a workspace.
|
|
20
|
+
* Add multiple organization members to a workspace. New members are assigned the workspace role that matches their organization role. Users who are already members of the workspace keep their current role and are not included in the response. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
21
21
|
*/
|
|
22
22
|
export function workspacesBulkAddMembers(client, request, options) {
|
|
23
23
|
return new APIPromise($do(client, request, options));
|
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.92";
|
|
54
54
|
readonly genVersion: "2.950.13";
|
|
55
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.5.
|
|
55
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.5.92 2.950.13 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.92",
|
|
33
33
|
genVersion: "2.950.13",
|
|
34
|
-
userAgent: "speakeasy-sdk/typescript 1.5.
|
|
34
|
+
userAgent: "speakeasy-sdk/typescript 1.5.92 2.950.13 1.0.0 @openrouter/sdk",
|
|
35
35
|
};
|
|
36
36
|
//# sourceMappingURL=config.js.map
|
|
@@ -104,6 +104,10 @@ export type ObjectEmbedding = ClosedEnum<typeof ObjectEmbedding>;
|
|
|
104
104
|
* A single embedding object
|
|
105
105
|
*/
|
|
106
106
|
export type BatchObjectData = {
|
|
107
|
+
/**
|
|
108
|
+
* Index of the source document when `input` was a list of documents (contextual embeddings). Absent otherwise.
|
|
109
|
+
*/
|
|
110
|
+
documentIndex?: number | undefined;
|
|
107
111
|
/**
|
|
108
112
|
* Embedding vector as an array of floats or a base64 string
|
|
109
113
|
*/
|
|
@@ -208,9 +208,14 @@ export function embeddingFromJSON(jsonString) {
|
|
|
208
208
|
export const ObjectEmbedding$inboundSchema = z.enum(ObjectEmbedding);
|
|
209
209
|
/** @internal */
|
|
210
210
|
export const BatchObjectData$inboundSchema = z.object({
|
|
211
|
+
document_index: z.int().optional(),
|
|
211
212
|
embedding: z.union([z.array(z.number()), z.string()]),
|
|
212
213
|
index: z.int().optional(),
|
|
213
214
|
object: ObjectEmbedding$inboundSchema,
|
|
215
|
+
}).transform((v) => {
|
|
216
|
+
return remap$(v, {
|
|
217
|
+
"document_index": "documentIndex",
|
|
218
|
+
});
|
|
214
219
|
});
|
|
215
220
|
export function batchObjectDataFromJSON(jsonString) {
|
|
216
221
|
return safeParse(jsonString, (x) => BatchObjectData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BatchObjectData' from JSON`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
2
|
export type BulkAddWorkspaceMembersRequest = {
|
|
3
3
|
/**
|
|
4
|
-
* List of user IDs to add to the workspace.
|
|
4
|
+
* List of user IDs to add to the workspace. New members are assigned the workspace role that matches their organization role; users already in the workspace keep their current role.
|
|
5
5
|
*/
|
|
6
6
|
userIds: Array<string>;
|
|
7
7
|
};
|
|
@@ -4,7 +4,7 @@ import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
|
4
4
|
import { WorkspaceMember } from "./workspacemember.js";
|
|
5
5
|
export type BulkAddWorkspaceMembersResponse = {
|
|
6
6
|
/**
|
|
7
|
-
* Number of workspace memberships created
|
|
7
|
+
* Number of workspace memberships created
|
|
8
8
|
*/
|
|
9
9
|
addedCount: number;
|
|
10
10
|
/**
|
|
@@ -46,7 +46,7 @@ export type CreateWorkspaceRequest = {
|
|
|
46
46
|
*/
|
|
47
47
|
ioLoggingSamplingRate?: number | undefined;
|
|
48
48
|
/**
|
|
49
|
-
* Whether data discount logging is enabled
|
|
49
|
+
* Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403.
|
|
50
50
|
*/
|
|
51
51
|
isDataDiscountLoggingEnabled?: boolean | undefined;
|
|
52
52
|
/**
|
|
@@ -53,7 +53,7 @@ export type Input = {
|
|
|
53
53
|
/**
|
|
54
54
|
* Text, token, or multimodal input(s) to embed
|
|
55
55
|
*/
|
|
56
|
-
export type InputUnion = string | Array<string> | Array<number> | Array<Array<number>> | Array<Input>;
|
|
56
|
+
export type InputUnion = string | Array<string> | Array<Array<string>> | Array<number> | Array<Array<number>> | Array<Input>;
|
|
57
57
|
/**
|
|
58
58
|
* Embeddings request input
|
|
59
59
|
*/
|
|
@@ -69,9 +69,9 @@ export type CreateEmbeddingsRequestBody = {
|
|
|
69
69
|
/**
|
|
70
70
|
* Text, token, or multimodal input(s) to embed
|
|
71
71
|
*/
|
|
72
|
-
input: string | Array<string> | Array<number> | Array<Array<number>> | Array<Input>;
|
|
72
|
+
input: string | Array<string> | Array<Array<string>> | Array<number> | Array<Array<number>> | Array<Input>;
|
|
73
73
|
/**
|
|
74
|
-
* The type of input (e.g. search_query, search_document)
|
|
74
|
+
* The type of input (e.g. search_query, search_document). Document-chunk input (`string[][]`) is only valid with a document input type.
|
|
75
75
|
*/
|
|
76
76
|
inputType?: string | undefined;
|
|
77
77
|
/**
|
|
@@ -126,6 +126,10 @@ export type ObjectEmbedding = ClosedEnum<typeof ObjectEmbedding>;
|
|
|
126
126
|
* A single embedding object
|
|
127
127
|
*/
|
|
128
128
|
export type CreateEmbeddingsData = {
|
|
129
|
+
/**
|
|
130
|
+
* Index of the source document when `input` was a list of documents (contextual embeddings). Absent otherwise.
|
|
131
|
+
*/
|
|
132
|
+
documentIndex?: number | undefined;
|
|
129
133
|
/**
|
|
130
134
|
* Embedding vector as an array of floats or a base64 string
|
|
131
135
|
*/
|
|
@@ -255,7 +259,7 @@ export type Input$Outbound = {
|
|
|
255
259
|
export declare const Input$outboundSchema: z.ZodType<Input$Outbound, Input>;
|
|
256
260
|
export declare function inputToJSON(input: Input): string;
|
|
257
261
|
/** @internal */
|
|
258
|
-
export type InputUnion$Outbound = string | Array<string> | Array<number> | Array<Array<number>> | Array<Input$Outbound>;
|
|
262
|
+
export type InputUnion$Outbound = string | Array<string> | Array<Array<string>> | Array<number> | Array<Array<number>> | Array<Input$Outbound>;
|
|
259
263
|
/** @internal */
|
|
260
264
|
export declare const InputUnion$outboundSchema: z.ZodType<InputUnion$Outbound, InputUnion>;
|
|
261
265
|
export declare function inputUnionToJSON(inputUnion: InputUnion): string;
|
|
@@ -263,7 +267,7 @@ export declare function inputUnionToJSON(inputUnion: InputUnion): string;
|
|
|
263
267
|
export type CreateEmbeddingsRequestBody$Outbound = {
|
|
264
268
|
dimensions?: number | undefined;
|
|
265
269
|
encoding_format?: string | undefined;
|
|
266
|
-
input: string | Array<string> | Array<number> | Array<Array<number>> | Array<Input$Outbound>;
|
|
270
|
+
input: string | Array<string> | Array<Array<string>> | Array<number> | Array<Array<number>> | Array<Input$Outbound>;
|
|
267
271
|
input_type?: string | undefined;
|
|
268
272
|
model: string;
|
|
269
273
|
provider?: models.ProviderPreferences$Outbound | null | undefined;
|
|
@@ -79,6 +79,7 @@ export function inputToJSON(input) {
|
|
|
79
79
|
export const InputUnion$outboundSchema = z.union([
|
|
80
80
|
z.string(),
|
|
81
81
|
z.array(z.string()),
|
|
82
|
+
z.array(z.array(z.string())),
|
|
82
83
|
z.array(z.number()),
|
|
83
84
|
z.array(z.array(z.number())),
|
|
84
85
|
z.array(z.lazy(() => Input$outboundSchema)),
|
|
@@ -93,6 +94,7 @@ export const CreateEmbeddingsRequestBody$outboundSchema = z.object({
|
|
|
93
94
|
input: z.union([
|
|
94
95
|
z.string(),
|
|
95
96
|
z.array(z.string()),
|
|
97
|
+
z.array(z.array(z.string())),
|
|
96
98
|
z.array(z.number()),
|
|
97
99
|
z.array(z.array(z.number())),
|
|
98
100
|
z.array(z.lazy(() => Input$outboundSchema)),
|
|
@@ -140,9 +142,14 @@ export function embeddingFromJSON(jsonString) {
|
|
|
140
142
|
export const ObjectEmbedding$inboundSchema = z.enum(ObjectEmbedding);
|
|
141
143
|
/** @internal */
|
|
142
144
|
export const CreateEmbeddingsData$inboundSchema = z.object({
|
|
145
|
+
document_index: z.int().optional(),
|
|
143
146
|
embedding: z.union([z.array(z.number()), z.string()]),
|
|
144
147
|
index: z.int().optional(),
|
|
145
148
|
object: ObjectEmbedding$inboundSchema,
|
|
149
|
+
}).transform((v) => {
|
|
150
|
+
return remap$(v, {
|
|
151
|
+
"document_index": "documentIndex",
|
|
152
|
+
});
|
|
146
153
|
});
|
|
147
154
|
export function createEmbeddingsDataFromJSON(jsonString) {
|
|
148
155
|
return safeParse(jsonString, (x) => CreateEmbeddingsData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateEmbeddingsData' from JSON`);
|
|
@@ -46,7 +46,7 @@ export type UpdateWorkspaceRequest = {
|
|
|
46
46
|
*/
|
|
47
47
|
ioLoggingSamplingRate?: number | undefined;
|
|
48
48
|
/**
|
|
49
|
-
* Whether data discount logging is enabled
|
|
49
|
+
* Whether data discount logging is enabled. Enabling it requires the account to allow workspace data-discount logging; otherwise the request returns 403.
|
|
50
50
|
*/
|
|
51
51
|
isDataDiscountLoggingEnabled?: boolean | undefined;
|
|
52
52
|
/**
|
package/esm/sdk/workspaces.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export declare class Workspaces extends ClientSDK {
|
|
|
53
53
|
* Bulk add members to a workspace
|
|
54
54
|
*
|
|
55
55
|
* @remarks
|
|
56
|
-
* Add multiple organization members to a workspace.
|
|
56
|
+
* Add multiple organization members to a workspace. New members are assigned the workspace role that matches their organization role. Users who are already members of the workspace keep their current role and are not included in the response. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
57
57
|
*/
|
|
58
58
|
bulkAddMembers(request: operations.BulkAddWorkspaceMembersRequest, options?: RequestOptions): Promise<models.BulkAddWorkspaceMembersResponse>;
|
|
59
59
|
/**
|
package/esm/sdk/workspaces.js
CHANGED
|
@@ -76,7 +76,7 @@ export class Workspaces extends ClientSDK {
|
|
|
76
76
|
* Bulk add members to a workspace
|
|
77
77
|
*
|
|
78
78
|
* @remarks
|
|
79
|
-
* Add multiple organization members to a workspace.
|
|
79
|
+
* Add multiple organization members to a workspace. New members are assigned the workspace role that matches their organization role. Users who are already members of the workspace keep their current role and are not included in the response. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
80
80
|
*/
|
|
81
81
|
async bulkAddMembers(request, options) {
|
|
82
82
|
return unwrapAsync(workspacesBulkAddMembers(this, request, options));
|
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.92",
|
|
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": [
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
"build": "tsc && node scripts/unbarrel-imports.js",
|
|
75
75
|
"prepublishOnly": "npm run build",
|
|
76
76
|
"compile": "tsc && node scripts/unbarrel-imports.js",
|
|
77
|
-
"postinstall": "node scripts/check-types.js || true",
|
|
78
|
-
"prepare": "npm run build",
|
|
79
77
|
"test:e2e": "vitest --run --project e2e",
|
|
80
78
|
"typecheck": "tsc --noEmit",
|
|
81
79
|
"typecheck:transit": "exit 0",
|
|
80
|
+
"postinstall": "node scripts/check-types.js || true",
|
|
81
|
+
"prepare": "npm run build",
|
|
82
82
|
"test": "vitest --run --project unit",
|
|
83
83
|
"test:transit": "exit 0",
|
|
84
84
|
"test:watch": "vitest --watch --project unit"
|