@openrouter/sdk 0.12.16 → 0.12.17
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/generationsGetGeneration.d.ts +2 -1
- package/esm/funcs/generationsGetGeneration.js +2 -1
- package/esm/funcs/generationsListGenerationContent.d.ts +16 -0
- package/esm/funcs/generationsListGenerationContent.js +108 -0
- package/esm/funcs/workspacesBulkAddMembers.d.ts +19 -0
- package/esm/funcs/workspacesBulkAddMembers.js +105 -0
- package/esm/funcs/workspacesBulkRemoveMembers.d.ts +19 -0
- package/esm/funcs/workspacesBulkRemoveMembers.js +105 -0
- package/esm/funcs/workspacesCreate.d.ts +19 -0
- package/esm/funcs/workspacesCreate.js +99 -0
- package/esm/funcs/workspacesDelete.d.ts +19 -0
- package/esm/funcs/workspacesDelete.js +102 -0
- package/esm/funcs/workspacesGet.d.ts +19 -0
- package/esm/funcs/workspacesGet.js +102 -0
- package/esm/funcs/workspacesList.d.ts +21 -0
- package/esm/funcs/workspacesList.js +133 -0
- package/esm/funcs/workspacesUpdate.d.ts +19 -0
- package/esm/funcs/workspacesUpdate.js +105 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/bulkaddworkspacemembersrequest.d.ts +15 -0
- package/esm/models/bulkaddworkspacemembersrequest.js +18 -0
- package/esm/models/bulkaddworkspacemembersresponse.d.ts +18 -0
- package/esm/models/bulkaddworkspacemembersresponse.js +21 -0
- package/esm/models/bulkremoveworkspacemembersrequest.d.ts +15 -0
- package/esm/models/bulkremoveworkspacemembersrequest.js +18 -0
- package/esm/models/bulkremoveworkspacemembersresponse.d.ts +13 -0
- package/esm/models/bulkremoveworkspacemembersresponse.js +19 -0
- package/esm/models/createworkspacerequest.d.ts +55 -0
- package/esm/models/createworkspacerequest.js +31 -0
- package/esm/models/createworkspaceresponse.d.ts +11 -0
- package/esm/models/createworkspaceresponse.js +15 -0
- package/esm/models/deleteworkspaceresponse.d.ts +13 -0
- package/esm/models/deleteworkspaceresponse.js +14 -0
- package/esm/models/generationcontentdata.d.ts +55 -0
- package/esm/models/generationcontentdata.js +45 -0
- package/esm/models/generationcontentresponse.d.ts +17 -0
- package/esm/models/generationcontentresponse.js +15 -0
- package/esm/models/generationresponse.d.ts +198 -0
- package/esm/models/generationresponse.js +109 -0
- package/esm/models/getworkspaceresponse.d.ts +11 -0
- package/esm/models/getworkspaceresponse.js +15 -0
- package/esm/models/index.d.ts +16 -0
- package/esm/models/index.js +16 -0
- package/esm/models/listworkspacesresponse.d.ts +18 -0
- package/esm/models/listworkspacesresponse.js +21 -0
- package/esm/models/modelscountresponse.d.ts +4 -4
- package/esm/models/modelscountresponse.js +4 -4
- package/esm/models/operations/bulkaddworkspacemembers.d.ts +61 -0
- package/esm/models/operations/bulkaddworkspacemembers.js +24 -0
- package/esm/models/operations/bulkremoveworkspacemembers.d.ts +61 -0
- package/esm/models/operations/bulkremoveworkspacemembers.js +24 -0
- package/esm/models/operations/createworkspace.d.ts +56 -0
- package/esm/models/operations/createworkspace.js +23 -0
- package/esm/models/operations/deleteworkspace.d.ts +58 -0
- package/esm/models/operations/deleteworkspace.js +21 -0
- package/esm/models/operations/getgeneration.d.ts +0 -196
- package/esm/models/operations/getgeneration.js +0 -102
- package/esm/models/operations/getworkspace.d.ts +58 -0
- package/esm/models/operations/getworkspace.js +21 -0
- package/esm/models/operations/index.d.ts +8 -0
- package/esm/models/operations/index.js +8 -0
- package/esm/models/operations/listgenerationcontent.d.ts +58 -0
- package/esm/models/operations/listgenerationcontent.js +21 -0
- package/esm/models/operations/listworkspaces.d.ts +72 -0
- package/esm/models/operations/listworkspaces.js +35 -0
- package/esm/models/operations/updateworkspace.d.ts +61 -0
- package/esm/models/operations/updateworkspace.js +24 -0
- package/esm/models/updateworkspacerequest.d.ts +55 -0
- package/esm/models/updateworkspacerequest.js +31 -0
- package/esm/models/updateworkspaceresponse.d.ts +11 -0
- package/esm/models/updateworkspaceresponse.js +15 -0
- package/esm/models/workspace.d.ts +61 -0
- package/esm/models/workspace.js +39 -0
- package/esm/models/workspacemember.d.ts +43 -0
- package/esm/models/workspacemember.js +35 -0
- package/esm/sdk/generations.d.ts +6 -1
- package/esm/sdk/generations.js +7 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +4 -0
- package/esm/sdk/workspaces.d.ts +58 -0
- package/esm/sdk/workspaces.js +80 -0
- package/jsr.json +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import * as models from "../index.js";
|
|
3
|
+
export type UpdateWorkspaceGlobals = {
|
|
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 UpdateWorkspaceRequest = {
|
|
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
|
+
* The workspace ID (UUID) or slug
|
|
46
|
+
*/
|
|
47
|
+
id: string;
|
|
48
|
+
updateWorkspaceRequest: models.UpdateWorkspaceRequest;
|
|
49
|
+
};
|
|
50
|
+
/** @internal */
|
|
51
|
+
export type UpdateWorkspaceRequest$Outbound = {
|
|
52
|
+
"HTTP-Referer"?: string | undefined;
|
|
53
|
+
appTitle?: string | undefined;
|
|
54
|
+
appCategories?: string | undefined;
|
|
55
|
+
id: string;
|
|
56
|
+
UpdateWorkspaceRequest: models.UpdateWorkspaceRequest$Outbound;
|
|
57
|
+
};
|
|
58
|
+
/** @internal */
|
|
59
|
+
export declare const UpdateWorkspaceRequest$outboundSchema: z.ZodType<UpdateWorkspaceRequest$Outbound, UpdateWorkspaceRequest>;
|
|
60
|
+
export declare function updateWorkspaceRequestToJSON(updateWorkspaceRequest: UpdateWorkspaceRequest): string;
|
|
61
|
+
//# sourceMappingURL=updateworkspace.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: b10c83b1ce4f
|
|
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 UpdateWorkspaceRequest$outboundSchema = z.object({
|
|
10
|
+
httpReferer: z.string().optional(),
|
|
11
|
+
appTitle: z.string().optional(),
|
|
12
|
+
appCategories: z.string().optional(),
|
|
13
|
+
id: z.string(),
|
|
14
|
+
updateWorkspaceRequest: models.UpdateWorkspaceRequest$outboundSchema,
|
|
15
|
+
}).transform((v) => {
|
|
16
|
+
return remap$(v, {
|
|
17
|
+
httpReferer: "HTTP-Referer",
|
|
18
|
+
updateWorkspaceRequest: "UpdateWorkspaceRequest",
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
export function updateWorkspaceRequestToJSON(updateWorkspaceRequest) {
|
|
22
|
+
return JSON.stringify(UpdateWorkspaceRequest$outboundSchema.parse(updateWorkspaceRequest));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=updateworkspace.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
export type UpdateWorkspaceRequest = {
|
|
3
|
+
/**
|
|
4
|
+
* Default image model for this workspace
|
|
5
|
+
*/
|
|
6
|
+
defaultImageModel?: string | null | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Default provider sort preference (price, throughput, latency, exacto)
|
|
9
|
+
*/
|
|
10
|
+
defaultProviderSort?: string | null | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Default text model for this workspace
|
|
13
|
+
*/
|
|
14
|
+
defaultTextModel?: string | null | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* New description for the workspace
|
|
17
|
+
*/
|
|
18
|
+
description?: string | null | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Whether data discount logging is enabled
|
|
21
|
+
*/
|
|
22
|
+
isDataDiscountLoggingEnabled?: boolean | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Whether broadcast is enabled
|
|
25
|
+
*/
|
|
26
|
+
isObservabilityBroadcastEnabled?: boolean | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Whether private logging is enabled
|
|
29
|
+
*/
|
|
30
|
+
isObservabilityIoLoggingEnabled?: boolean | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* New name for the workspace
|
|
33
|
+
*/
|
|
34
|
+
name?: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* New URL-friendly slug
|
|
37
|
+
*/
|
|
38
|
+
slug?: string | undefined;
|
|
39
|
+
};
|
|
40
|
+
/** @internal */
|
|
41
|
+
export type UpdateWorkspaceRequest$Outbound = {
|
|
42
|
+
default_image_model?: string | null | undefined;
|
|
43
|
+
default_provider_sort?: string | null | undefined;
|
|
44
|
+
default_text_model?: string | null | undefined;
|
|
45
|
+
description?: string | null | undefined;
|
|
46
|
+
is_data_discount_logging_enabled?: boolean | undefined;
|
|
47
|
+
is_observability_broadcast_enabled?: boolean | undefined;
|
|
48
|
+
is_observability_io_logging_enabled?: boolean | undefined;
|
|
49
|
+
name?: string | undefined;
|
|
50
|
+
slug?: string | undefined;
|
|
51
|
+
};
|
|
52
|
+
/** @internal */
|
|
53
|
+
export declare const UpdateWorkspaceRequest$outboundSchema: z.ZodType<UpdateWorkspaceRequest$Outbound, UpdateWorkspaceRequest>;
|
|
54
|
+
export declare function updateWorkspaceRequestToJSON(updateWorkspaceRequest: UpdateWorkspaceRequest): string;
|
|
55
|
+
//# sourceMappingURL=updateworkspacerequest.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 84dd4f01b245
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const UpdateWorkspaceRequest$outboundSchema = z.object({
|
|
9
|
+
defaultImageModel: z.nullable(z.string()).optional(),
|
|
10
|
+
defaultProviderSort: z.nullable(z.string()).optional(),
|
|
11
|
+
defaultTextModel: z.nullable(z.string()).optional(),
|
|
12
|
+
description: z.nullable(z.string()).optional(),
|
|
13
|
+
isDataDiscountLoggingEnabled: z.boolean().optional(),
|
|
14
|
+
isObservabilityBroadcastEnabled: z.boolean().optional(),
|
|
15
|
+
isObservabilityIoLoggingEnabled: z.boolean().optional(),
|
|
16
|
+
name: z.string().optional(),
|
|
17
|
+
slug: z.string().optional(),
|
|
18
|
+
}).transform((v) => {
|
|
19
|
+
return remap$(v, {
|
|
20
|
+
defaultImageModel: "default_image_model",
|
|
21
|
+
defaultProviderSort: "default_provider_sort",
|
|
22
|
+
defaultTextModel: "default_text_model",
|
|
23
|
+
isDataDiscountLoggingEnabled: "is_data_discount_logging_enabled",
|
|
24
|
+
isObservabilityBroadcastEnabled: "is_observability_broadcast_enabled",
|
|
25
|
+
isObservabilityIoLoggingEnabled: "is_observability_io_logging_enabled",
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
export function updateWorkspaceRequestToJSON(updateWorkspaceRequest) {
|
|
29
|
+
return JSON.stringify(UpdateWorkspaceRequest$outboundSchema.parse(updateWorkspaceRequest));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=updateworkspacerequest.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
import { Workspace } from "./workspace.js";
|
|
5
|
+
export type UpdateWorkspaceResponse = {
|
|
6
|
+
data: Workspace;
|
|
7
|
+
};
|
|
8
|
+
/** @internal */
|
|
9
|
+
export declare const UpdateWorkspaceResponse$inboundSchema: z.ZodType<UpdateWorkspaceResponse, unknown>;
|
|
10
|
+
export declare function updateWorkspaceResponseFromJSON(jsonString: string): SafeParseResult<UpdateWorkspaceResponse, SDKValidationError>;
|
|
11
|
+
//# sourceMappingURL=updateworkspaceresponse.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 5b6906dad2d6
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Workspace$inboundSchema } from "./workspace.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const UpdateWorkspaceResponse$inboundSchema = z.object({
|
|
10
|
+
data: Workspace$inboundSchema,
|
|
11
|
+
});
|
|
12
|
+
export function updateWorkspaceResponseFromJSON(jsonString) {
|
|
13
|
+
return safeParse(jsonString, (x) => UpdateWorkspaceResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateWorkspaceResponse' from JSON`);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=updateworkspaceresponse.js.map
|
|
@@ -0,0 +1,61 @@
|
|
|
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 Workspace = {
|
|
5
|
+
/**
|
|
6
|
+
* ISO 8601 timestamp of when the workspace was created
|
|
7
|
+
*/
|
|
8
|
+
createdAt: string;
|
|
9
|
+
/**
|
|
10
|
+
* User ID of the workspace creator
|
|
11
|
+
*/
|
|
12
|
+
createdBy: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* Default image model for this workspace
|
|
15
|
+
*/
|
|
16
|
+
defaultImageModel: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Default provider sort preference (price, throughput, latency, exacto)
|
|
19
|
+
*/
|
|
20
|
+
defaultProviderSort: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Default text model for this workspace
|
|
23
|
+
*/
|
|
24
|
+
defaultTextModel: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Description of the workspace
|
|
27
|
+
*/
|
|
28
|
+
description: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Unique identifier for the workspace
|
|
31
|
+
*/
|
|
32
|
+
id: string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether data discount logging is enabled for this workspace
|
|
35
|
+
*/
|
|
36
|
+
isDataDiscountLoggingEnabled: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Whether broadcast is enabled for this workspace
|
|
39
|
+
*/
|
|
40
|
+
isObservabilityBroadcastEnabled: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether private logging is enabled for this workspace
|
|
43
|
+
*/
|
|
44
|
+
isObservabilityIoLoggingEnabled: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Name of the workspace
|
|
47
|
+
*/
|
|
48
|
+
name: string;
|
|
49
|
+
/**
|
|
50
|
+
* URL-friendly slug for the workspace
|
|
51
|
+
*/
|
|
52
|
+
slug: string;
|
|
53
|
+
/**
|
|
54
|
+
* ISO 8601 timestamp of when the workspace was last updated
|
|
55
|
+
*/
|
|
56
|
+
updatedAt: string | null;
|
|
57
|
+
};
|
|
58
|
+
/** @internal */
|
|
59
|
+
export declare const Workspace$inboundSchema: z.ZodType<Workspace, unknown>;
|
|
60
|
+
export declare function workspaceFromJSON(jsonString: string): SafeParseResult<Workspace, SDKValidationError>;
|
|
61
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: f3a6e662c47b
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
/** @internal */
|
|
9
|
+
export const Workspace$inboundSchema = z.object({
|
|
10
|
+
created_at: z.string(),
|
|
11
|
+
created_by: z.nullable(z.string()),
|
|
12
|
+
default_image_model: z.nullable(z.string()),
|
|
13
|
+
default_provider_sort: z.nullable(z.string()),
|
|
14
|
+
default_text_model: z.nullable(z.string()),
|
|
15
|
+
description: z.nullable(z.string()),
|
|
16
|
+
id: z.string(),
|
|
17
|
+
is_data_discount_logging_enabled: z.boolean(),
|
|
18
|
+
is_observability_broadcast_enabled: z.boolean(),
|
|
19
|
+
is_observability_io_logging_enabled: z.boolean(),
|
|
20
|
+
name: z.string(),
|
|
21
|
+
slug: z.string(),
|
|
22
|
+
updated_at: z.nullable(z.string()),
|
|
23
|
+
}).transform((v) => {
|
|
24
|
+
return remap$(v, {
|
|
25
|
+
"created_at": "createdAt",
|
|
26
|
+
"created_by": "createdBy",
|
|
27
|
+
"default_image_model": "defaultImageModel",
|
|
28
|
+
"default_provider_sort": "defaultProviderSort",
|
|
29
|
+
"default_text_model": "defaultTextModel",
|
|
30
|
+
"is_data_discount_logging_enabled": "isDataDiscountLoggingEnabled",
|
|
31
|
+
"is_observability_broadcast_enabled": "isObservabilityBroadcastEnabled",
|
|
32
|
+
"is_observability_io_logging_enabled": "isObservabilityIoLoggingEnabled",
|
|
33
|
+
"updated_at": "updatedAt",
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
export function workspaceFromJSON(jsonString) {
|
|
37
|
+
return safeParse(jsonString, (x) => Workspace$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Workspace' from JSON`);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=workspace.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
/**
|
|
6
|
+
* Role of the member in the workspace
|
|
7
|
+
*/
|
|
8
|
+
export declare const WorkspaceMemberRole: {
|
|
9
|
+
readonly Admin: "admin";
|
|
10
|
+
readonly Member: "member";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Role of the member in the workspace
|
|
14
|
+
*/
|
|
15
|
+
export type WorkspaceMemberRole = OpenEnum<typeof WorkspaceMemberRole>;
|
|
16
|
+
export type WorkspaceMember = {
|
|
17
|
+
/**
|
|
18
|
+
* ISO 8601 timestamp of when the membership was created
|
|
19
|
+
*/
|
|
20
|
+
createdAt: string;
|
|
21
|
+
/**
|
|
22
|
+
* Unique identifier for the workspace membership
|
|
23
|
+
*/
|
|
24
|
+
id: string;
|
|
25
|
+
/**
|
|
26
|
+
* Role of the member in the workspace
|
|
27
|
+
*/
|
|
28
|
+
role: WorkspaceMemberRole;
|
|
29
|
+
/**
|
|
30
|
+
* Clerk user ID of the member
|
|
31
|
+
*/
|
|
32
|
+
userId: string;
|
|
33
|
+
/**
|
|
34
|
+
* ID of the workspace
|
|
35
|
+
*/
|
|
36
|
+
workspaceId: string;
|
|
37
|
+
};
|
|
38
|
+
/** @internal */
|
|
39
|
+
export declare const WorkspaceMemberRole$inboundSchema: z.ZodType<WorkspaceMemberRole, unknown>;
|
|
40
|
+
/** @internal */
|
|
41
|
+
export declare const WorkspaceMember$inboundSchema: z.ZodType<WorkspaceMember, unknown>;
|
|
42
|
+
export declare function workspaceMemberFromJSON(jsonString: string): SafeParseResult<WorkspaceMember, SDKValidationError>;
|
|
43
|
+
//# sourceMappingURL=workspacemember.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 42cb4568aa7e
|
|
4
|
+
*/
|
|
5
|
+
import * as z from "zod/v4";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import * as openEnums from "../types/enums.js";
|
|
9
|
+
/**
|
|
10
|
+
* Role of the member in the workspace
|
|
11
|
+
*/
|
|
12
|
+
export const WorkspaceMemberRole = {
|
|
13
|
+
Admin: "admin",
|
|
14
|
+
Member: "member",
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const WorkspaceMemberRole$inboundSchema = openEnums.inboundSchema(WorkspaceMemberRole);
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const WorkspaceMember$inboundSchema = z.object({
|
|
20
|
+
created_at: z.string(),
|
|
21
|
+
id: z.string(),
|
|
22
|
+
role: WorkspaceMemberRole$inboundSchema,
|
|
23
|
+
user_id: z.string(),
|
|
24
|
+
workspace_id: z.string(),
|
|
25
|
+
}).transform((v) => {
|
|
26
|
+
return remap$(v, {
|
|
27
|
+
"created_at": "createdAt",
|
|
28
|
+
"user_id": "userId",
|
|
29
|
+
"workspace_id": "workspaceId",
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
export function workspaceMemberFromJSON(jsonString) {
|
|
33
|
+
return safeParse(jsonString, (x) => WorkspaceMember$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkspaceMember' from JSON`);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=workspacemember.js.map
|
package/esm/sdk/generations.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
2
|
+
import * as models from "../models/index.js";
|
|
2
3
|
import * as operations from "../models/operations/index.js";
|
|
3
4
|
export declare class Generations extends ClientSDK {
|
|
4
5
|
/**
|
|
5
6
|
* Get request & usage metadata for a generation
|
|
6
7
|
*/
|
|
7
|
-
getGeneration(request: operations.GetGenerationRequest, options?: RequestOptions): Promise<
|
|
8
|
+
getGeneration(request: operations.GetGenerationRequest, options?: RequestOptions): Promise<models.GenerationResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Get stored prompt and completion content for a generation
|
|
11
|
+
*/
|
|
12
|
+
listGenerationContent(request: operations.ListGenerationContentRequest, options?: RequestOptions): Promise<models.GenerationContentResponse>;
|
|
8
13
|
}
|
|
9
14
|
//# sourceMappingURL=generations.d.ts.map
|
package/esm/sdk/generations.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @generated-id: e28b205da063
|
|
4
4
|
*/
|
|
5
5
|
import { generationsGetGeneration } from "../funcs/generationsGetGeneration.js";
|
|
6
|
+
import { generationsListGenerationContent } from "../funcs/generationsListGenerationContent.js";
|
|
6
7
|
import { ClientSDK } from "../lib/sdks.js";
|
|
7
8
|
import { unwrapAsync } from "../types/fp.js";
|
|
8
9
|
export class Generations extends ClientSDK {
|
|
@@ -12,5 +13,11 @@ export class Generations extends ClientSDK {
|
|
|
12
13
|
async getGeneration(request, options) {
|
|
13
14
|
return unwrapAsync(generationsGetGeneration(this, request, options));
|
|
14
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Get stored prompt and completion content for a generation
|
|
18
|
+
*/
|
|
19
|
+
async listGenerationContent(request, options) {
|
|
20
|
+
return unwrapAsync(generationsListGenerationContent(this, request, options));
|
|
21
|
+
}
|
|
15
22
|
}
|
|
16
23
|
//# sourceMappingURL=generations.js.map
|
package/esm/sdk/sdk.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { Providers } from "./providers.js";
|
|
|
15
15
|
import { Rerank } from "./rerank.js";
|
|
16
16
|
import { Tts } from "./tts.js";
|
|
17
17
|
import { VideoGeneration } from "./videogeneration.js";
|
|
18
|
+
import { Workspaces } from "./workspaces.js";
|
|
18
19
|
import type { $ZodObject, $ZodShape, infer as zodInfer } from "zod/v4/core";
|
|
19
20
|
import { type CallModelInput } from "../funcs/call-model.js";
|
|
20
21
|
import type { ModelResult } from "../lib/model-result.js";
|
|
@@ -54,6 +55,8 @@ export declare class OpenRouter extends ClientSDK {
|
|
|
54
55
|
get tts(): Tts;
|
|
55
56
|
private _videoGeneration?;
|
|
56
57
|
get videoGeneration(): VideoGeneration;
|
|
58
|
+
private _workspaces?;
|
|
59
|
+
get workspaces(): Workspaces;
|
|
57
60
|
callModel<TTools extends readonly Tool[], TSharedSchema extends $ZodObject<$ZodShape> | undefined = undefined, TShared extends Record<string, unknown> = TSharedSchema extends $ZodObject<$ZodShape> ? zodInfer<TSharedSchema> : Record<string, never>>(request: CallModelInput<TTools, TShared> & {
|
|
58
61
|
sharedContextSchema?: TSharedSchema;
|
|
59
62
|
}, options?: RequestOptions): ModelResult<TTools, TShared>;
|
package/esm/sdk/sdk.js
CHANGED
|
@@ -19,6 +19,7 @@ import { Providers } from "./providers.js";
|
|
|
19
19
|
import { Rerank } from "./rerank.js";
|
|
20
20
|
import { Tts } from "./tts.js";
|
|
21
21
|
import { VideoGeneration } from "./videogeneration.js";
|
|
22
|
+
import { Workspaces } from "./workspaces.js";
|
|
22
23
|
import { callModel as callModelFunc, } from "../funcs/call-model.js";
|
|
23
24
|
import { ToolType } from "../lib/tool-types.js";
|
|
24
25
|
export { ToolType };
|
|
@@ -72,6 +73,9 @@ export class OpenRouter extends ClientSDK {
|
|
|
72
73
|
get videoGeneration() {
|
|
73
74
|
return (this._videoGeneration ?? (this._videoGeneration = new VideoGeneration(this._options)));
|
|
74
75
|
}
|
|
76
|
+
get workspaces() {
|
|
77
|
+
return (this._workspaces ?? (this._workspaces = new Workspaces(this._options)));
|
|
78
|
+
}
|
|
75
79
|
// #region sdk-class-body
|
|
76
80
|
callModel(request, options) {
|
|
77
81
|
return callModelFunc(this, request, options);
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
import { PageIterator } from "../types/operations.js";
|
|
5
|
+
export declare class Workspaces extends ClientSDK {
|
|
6
|
+
/**
|
|
7
|
+
* List workspaces
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* List all workspaces for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
11
|
+
*/
|
|
12
|
+
list(request?: operations.ListWorkspacesRequest | undefined, options?: RequestOptions): Promise<PageIterator<operations.ListWorkspacesResponse, {
|
|
13
|
+
offset: number;
|
|
14
|
+
}>>;
|
|
15
|
+
/**
|
|
16
|
+
* Create a workspace
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Create a new workspace for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
20
|
+
*/
|
|
21
|
+
create(request: operations.CreateWorkspaceRequest, options?: RequestOptions): Promise<models.CreateWorkspaceResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Delete a workspace
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* Delete an existing workspace. The default workspace cannot be deleted. Workspaces with active API keys cannot be deleted. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
27
|
+
*/
|
|
28
|
+
delete(request: operations.DeleteWorkspaceRequest, options?: RequestOptions): Promise<models.DeleteWorkspaceResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Get a workspace
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Get a single workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
34
|
+
*/
|
|
35
|
+
get(request: operations.GetWorkspaceRequest, options?: RequestOptions): Promise<models.GetWorkspaceResponse>;
|
|
36
|
+
/**
|
|
37
|
+
* Update a workspace
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* Update an existing workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
41
|
+
*/
|
|
42
|
+
update(request: operations.UpdateWorkspaceRequest, options?: RequestOptions): Promise<models.UpdateWorkspaceResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Bulk add members to a workspace
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* Add multiple organization members to a workspace. Members are assigned the same role they hold in the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
48
|
+
*/
|
|
49
|
+
bulkAddMembers(request: operations.BulkAddWorkspaceMembersRequest, options?: RequestOptions): Promise<models.BulkAddWorkspaceMembersResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* Bulk remove members from a workspace
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
55
|
+
*/
|
|
56
|
+
bulkRemoveMembers(request: operations.BulkRemoveWorkspaceMembersRequest, options?: RequestOptions): Promise<models.BulkRemoveWorkspaceMembersResponse>;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=workspaces.d.ts.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 72b45379c8d9
|
|
4
|
+
*/
|
|
5
|
+
import { workspacesBulkAddMembers } from "../funcs/workspacesBulkAddMembers.js";
|
|
6
|
+
import { workspacesBulkRemoveMembers } from "../funcs/workspacesBulkRemoveMembers.js";
|
|
7
|
+
import { workspacesCreate } from "../funcs/workspacesCreate.js";
|
|
8
|
+
import { workspacesDelete } from "../funcs/workspacesDelete.js";
|
|
9
|
+
import { workspacesGet } from "../funcs/workspacesGet.js";
|
|
10
|
+
import { workspacesList } from "../funcs/workspacesList.js";
|
|
11
|
+
import { workspacesUpdate } from "../funcs/workspacesUpdate.js";
|
|
12
|
+
import { ClientSDK } from "../lib/sdks.js";
|
|
13
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
14
|
+
import { unwrapResultIterator } from "../types/operations.js";
|
|
15
|
+
export class Workspaces extends ClientSDK {
|
|
16
|
+
/**
|
|
17
|
+
* List workspaces
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* List all workspaces for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
21
|
+
*/
|
|
22
|
+
async list(request, options) {
|
|
23
|
+
return unwrapResultIterator(workspacesList(this, request, options));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create a workspace
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Create a new workspace for the authenticated user. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
30
|
+
*/
|
|
31
|
+
async create(request, options) {
|
|
32
|
+
return unwrapAsync(workspacesCreate(this, request, options));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Delete a workspace
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* Delete an existing workspace. The default workspace cannot be deleted. Workspaces with active API keys cannot be deleted. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
39
|
+
*/
|
|
40
|
+
async delete(request, options) {
|
|
41
|
+
return unwrapAsync(workspacesDelete(this, request, options));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get a workspace
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* Get a single workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
48
|
+
*/
|
|
49
|
+
async get(request, options) {
|
|
50
|
+
return unwrapAsync(workspacesGet(this, request, options));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Update a workspace
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* Update an existing workspace by ID or slug. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
57
|
+
*/
|
|
58
|
+
async update(request, options) {
|
|
59
|
+
return unwrapAsync(workspacesUpdate(this, request, options));
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Bulk add members to a workspace
|
|
63
|
+
*
|
|
64
|
+
* @remarks
|
|
65
|
+
* Add multiple organization members to a workspace. Members are assigned the same role they hold in the organization. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
66
|
+
*/
|
|
67
|
+
async bulkAddMembers(request, options) {
|
|
68
|
+
return unwrapAsync(workspacesBulkAddMembers(this, request, options));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Bulk remove members from a workspace
|
|
72
|
+
*
|
|
73
|
+
* @remarks
|
|
74
|
+
* Remove multiple members from a workspace. Members with active API keys in the workspace cannot be removed. [Management key](/docs/guides/overview/auth/management-api-keys) required.
|
|
75
|
+
*/
|
|
76
|
+
async bulkRemoveMembers(request, options) {
|
|
77
|
+
return unwrapAsync(workspacesBulkRemoveMembers(this, request, options));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=workspaces.js.map
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openrouter/sdk",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.17",
|
|
4
4
|
"author": "OpenRouter",
|
|
5
5
|
"description": "The OpenRouter TypeScript SDK is a type-safe toolkit for building AI applications with access to 300+ language models through a unified API.",
|
|
6
6
|
"keywords": [
|
|
@@ -69,15 +69,15 @@
|
|
|
69
69
|
"lint": "eslint --cache --max-warnings=0 src",
|
|
70
70
|
"build": "tsc",
|
|
71
71
|
"prepublishOnly": "npm run build",
|
|
72
|
-
"
|
|
73
|
-
"test:transit": "exit 0",
|
|
74
|
-
"typecheck": "tsc --noEmit",
|
|
72
|
+
"compile": "tsc",
|
|
75
73
|
"postinstall": "node scripts/check-types.js || true",
|
|
74
|
+
"test": "vitest --run --project unit",
|
|
76
75
|
"test:e2e": "vitest --run --project e2e",
|
|
77
76
|
"test:watch": "vitest --watch --project unit",
|
|
78
77
|
"typecheck:transit": "exit 0",
|
|
79
|
-
"
|
|
80
|
-
"
|
|
78
|
+
"prepare": "npm run build",
|
|
79
|
+
"test:transit": "exit 0",
|
|
80
|
+
"typecheck": "tsc --noEmit"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {},
|
|
83
83
|
"devDependencies": {
|