@openrouter/sdk 0.12.16 → 0.12.18
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/ttsCreateSpeech.d.ts +1 -1
- package/esm/funcs/ttsCreateSpeech.js +6 -6
- 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/chatrequest.d.ts +5 -4
- package/esm/models/chatrequest.js +3 -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 +18 -0
- package/esm/models/index.js +18 -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/createaudiospeech.d.ts +56 -0
- package/esm/models/operations/createaudiospeech.js +23 -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 +9 -1
- package/esm/models/operations/index.js +9 -1
- 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/paretorouterplugin.d.ts +22 -0
- package/esm/models/paretorouterplugin.js +20 -0
- package/esm/models/responsesrequest.d.ts +5 -4
- package/esm/models/responsesrequest.js +3 -0
- package/esm/models/{operations/createtts.d.ts → speechrequest.d.ts} +23 -76
- package/esm/models/{operations/createtts.js → speechrequest.js} +18 -35
- 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/videogenerationrequest.d.ts +12 -12
- package/esm/models/videogenerationrequest.js +10 -10
- 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 +5 -2
- package/esm/sdk/sdk.js +7 -3
- package/esm/sdk/tts.d.ts +1 -1
- package/esm/sdk/workspaces.d.ts +58 -0
- package/esm/sdk/workspaces.js +80 -0
- package/jsr.json +1 -1
- package/package.json +5 -5
|
@@ -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
|
|
@@ -21,7 +21,7 @@ export type AspectRatio = OpenEnum<typeof AspectRatio>;
|
|
|
21
21
|
/**
|
|
22
22
|
* Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body.
|
|
23
23
|
*/
|
|
24
|
-
export type
|
|
24
|
+
export type VideoGenerationRequestOptions = {
|
|
25
25
|
oneai?: {
|
|
26
26
|
[k: string]: any | null;
|
|
27
27
|
} | undefined;
|
|
@@ -347,11 +347,11 @@ export type Options = {
|
|
|
347
347
|
/**
|
|
348
348
|
* Provider-specific passthrough configuration
|
|
349
349
|
*/
|
|
350
|
-
export type
|
|
350
|
+
export type VideoGenerationRequestProvider = {
|
|
351
351
|
/**
|
|
352
352
|
* Provider-specific options keyed by provider slug. The options for the matched provider are spread into the upstream request body.
|
|
353
353
|
*/
|
|
354
|
-
options?:
|
|
354
|
+
options?: VideoGenerationRequestOptions | undefined;
|
|
355
355
|
};
|
|
356
356
|
/**
|
|
357
357
|
* Resolution of the generated video
|
|
@@ -394,7 +394,7 @@ export type VideoGenerationRequest = {
|
|
|
394
394
|
/**
|
|
395
395
|
* Provider-specific passthrough configuration
|
|
396
396
|
*/
|
|
397
|
-
provider?:
|
|
397
|
+
provider?: VideoGenerationRequestProvider | undefined;
|
|
398
398
|
/**
|
|
399
399
|
* Resolution of the generated video
|
|
400
400
|
*/
|
|
@@ -411,7 +411,7 @@ export type VideoGenerationRequest = {
|
|
|
411
411
|
/** @internal */
|
|
412
412
|
export declare const AspectRatio$outboundSchema: z.ZodType<string, AspectRatio>;
|
|
413
413
|
/** @internal */
|
|
414
|
-
export type
|
|
414
|
+
export type VideoGenerationRequestOptions$Outbound = {
|
|
415
415
|
"01ai"?: {
|
|
416
416
|
[k: string]: any | null;
|
|
417
417
|
} | undefined;
|
|
@@ -735,15 +735,15 @@ export type Options$Outbound = {
|
|
|
735
735
|
} | undefined;
|
|
736
736
|
};
|
|
737
737
|
/** @internal */
|
|
738
|
-
export declare const
|
|
739
|
-
export declare function
|
|
738
|
+
export declare const VideoGenerationRequestOptions$outboundSchema: z.ZodType<VideoGenerationRequestOptions$Outbound, VideoGenerationRequestOptions>;
|
|
739
|
+
export declare function videoGenerationRequestOptionsToJSON(videoGenerationRequestOptions: VideoGenerationRequestOptions): string;
|
|
740
740
|
/** @internal */
|
|
741
|
-
export type
|
|
742
|
-
options?:
|
|
741
|
+
export type VideoGenerationRequestProvider$Outbound = {
|
|
742
|
+
options?: VideoGenerationRequestOptions$Outbound | undefined;
|
|
743
743
|
};
|
|
744
744
|
/** @internal */
|
|
745
|
-
export declare const
|
|
746
|
-
export declare function
|
|
745
|
+
export declare const VideoGenerationRequestProvider$outboundSchema: z.ZodType<VideoGenerationRequestProvider$Outbound, VideoGenerationRequestProvider>;
|
|
746
|
+
export declare function videoGenerationRequestProviderToJSON(videoGenerationRequestProvider: VideoGenerationRequestProvider): string;
|
|
747
747
|
/** @internal */
|
|
748
748
|
export declare const Resolution$outboundSchema: z.ZodType<string, Resolution>;
|
|
749
749
|
/** @internal */
|
|
@@ -755,7 +755,7 @@ export type VideoGenerationRequest$Outbound = {
|
|
|
755
755
|
input_references?: Array<ContentPartImage$Outbound> | undefined;
|
|
756
756
|
model: string;
|
|
757
757
|
prompt: string;
|
|
758
|
-
provider?:
|
|
758
|
+
provider?: VideoGenerationRequestProvider$Outbound | undefined;
|
|
759
759
|
resolution?: string | undefined;
|
|
760
760
|
seed?: number | undefined;
|
|
761
761
|
size?: string | undefined;
|
|
@@ -33,8 +33,7 @@ export const Resolution = {
|
|
|
33
33
|
/** @internal */
|
|
34
34
|
export const AspectRatio$outboundSchema = openEnums.outboundSchema(AspectRatio);
|
|
35
35
|
/** @internal */
|
|
36
|
-
export const
|
|
37
|
-
.object({
|
|
36
|
+
export const VideoGenerationRequestOptions$outboundSchema = z.object({
|
|
38
37
|
oneai: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
39
38
|
ai21: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
40
39
|
aionLabs: z.record(z.string(), z.nullable(z.any())).optional(),
|
|
@@ -166,16 +165,16 @@ export const Options$outboundSchema = z
|
|
|
166
165
|
zAi: "z-ai",
|
|
167
166
|
});
|
|
168
167
|
});
|
|
169
|
-
export function
|
|
170
|
-
return JSON.stringify(
|
|
168
|
+
export function videoGenerationRequestOptionsToJSON(videoGenerationRequestOptions) {
|
|
169
|
+
return JSON.stringify(VideoGenerationRequestOptions$outboundSchema.parse(videoGenerationRequestOptions));
|
|
171
170
|
}
|
|
172
171
|
/** @internal */
|
|
173
|
-
export const
|
|
174
|
-
.
|
|
175
|
-
|
|
172
|
+
export const VideoGenerationRequestProvider$outboundSchema = z.object({
|
|
173
|
+
options: z.lazy(() => VideoGenerationRequestOptions$outboundSchema)
|
|
174
|
+
.optional(),
|
|
176
175
|
});
|
|
177
|
-
export function
|
|
178
|
-
return JSON.stringify(
|
|
176
|
+
export function videoGenerationRequestProviderToJSON(videoGenerationRequestProvider) {
|
|
177
|
+
return JSON.stringify(VideoGenerationRequestProvider$outboundSchema.parse(videoGenerationRequestProvider));
|
|
179
178
|
}
|
|
180
179
|
/** @internal */
|
|
181
180
|
export const Resolution$outboundSchema = openEnums.outboundSchema(Resolution);
|
|
@@ -188,7 +187,8 @@ export const VideoGenerationRequest$outboundSchema = z.object({
|
|
|
188
187
|
inputReferences: z.array(ContentPartImage$outboundSchema).optional(),
|
|
189
188
|
model: z.string(),
|
|
190
189
|
prompt: z.string(),
|
|
191
|
-
provider: z.lazy(() =>
|
|
190
|
+
provider: z.lazy(() => VideoGenerationRequestProvider$outboundSchema)
|
|
191
|
+
.optional(),
|
|
192
192
|
resolution: Resolution$outboundSchema.optional(),
|
|
193
193
|
seed: z.int().optional(),
|
|
194
194
|
size: z.string().optional(),
|
|
@@ -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";
|
|
@@ -24,6 +25,8 @@ export { ToolType };
|
|
|
24
25
|
export declare class OpenRouter extends ClientSDK {
|
|
25
26
|
private _analytics?;
|
|
26
27
|
get analytics(): Analytics;
|
|
28
|
+
private _tts?;
|
|
29
|
+
get tts(): Tts;
|
|
27
30
|
private _oAuth?;
|
|
28
31
|
get oAuth(): OAuth;
|
|
29
32
|
private _chat?;
|
|
@@ -50,10 +53,10 @@ export declare class OpenRouter extends ClientSDK {
|
|
|
50
53
|
get rerank(): Rerank;
|
|
51
54
|
private _beta?;
|
|
52
55
|
get beta(): Beta;
|
|
53
|
-
private _tts?;
|
|
54
|
-
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 };
|
|
@@ -27,6 +28,9 @@ export class OpenRouter extends ClientSDK {
|
|
|
27
28
|
get analytics() {
|
|
28
29
|
return (this._analytics ?? (this._analytics = new Analytics(this._options)));
|
|
29
30
|
}
|
|
31
|
+
get tts() {
|
|
32
|
+
return (this._tts ?? (this._tts = new Tts(this._options)));
|
|
33
|
+
}
|
|
30
34
|
get oAuth() {
|
|
31
35
|
return (this._oAuth ?? (this._oAuth = new OAuth(this._options)));
|
|
32
36
|
}
|
|
@@ -66,12 +70,12 @@ export class OpenRouter extends ClientSDK {
|
|
|
66
70
|
get beta() {
|
|
67
71
|
return (this._beta ?? (this._beta = new Beta(this._options)));
|
|
68
72
|
}
|
|
69
|
-
get tts() {
|
|
70
|
-
return (this._tts ?? (this._tts = new Tts(this._options)));
|
|
71
|
-
}
|
|
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);
|
package/esm/sdk/tts.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ export declare class Tts extends ClientSDK {
|
|
|
7
7
|
* @remarks
|
|
8
8
|
* Synthesizes audio from the input text
|
|
9
9
|
*/
|
|
10
|
-
createSpeech(request: operations.
|
|
10
|
+
createSpeech(request: operations.CreateAudioSpeechRequest, options?: RequestOptions): Promise<ReadableStream<Uint8Array>>;
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=tts.d.ts.map
|
|
@@ -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
|