@openrouter/sdk 1.1.18 → 1.1.19
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/filesDelete.d.ts +1 -1
- package/esm/funcs/filesDelete.js +2 -1
- package/esm/funcs/filesDownload.d.ts +1 -1
- package/esm/funcs/filesDownload.js +2 -1
- package/esm/funcs/filesList.d.ts +1 -1
- package/esm/funcs/filesList.js +10 -3
- package/esm/funcs/filesRetrieve.d.ts +1 -1
- package/esm/funcs/filesRetrieve.js +2 -1
- package/esm/funcs/filesUpload.d.ts +1 -1
- package/esm/funcs/filesUpload.js +2 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/anthropicfile.d.ts +33 -0
- package/esm/models/anthropicfile.js +40 -0
- package/esm/models/anthropicfiledeleted.d.ts +22 -0
- package/esm/models/anthropicfiledeleted.js +26 -0
- package/esm/models/anthropicfilelist.d.ts +18 -0
- package/esm/models/anthropicfilelist.js +27 -0
- package/esm/models/filedeleteresponse.d.ts +6 -12
- package/esm/models/filedeleteresponse.js +9 -10
- package/esm/models/filelistresponse.d.ts +6 -12
- package/esm/models/filelistresponse.js +9 -16
- package/esm/models/fileprovider.d.ts +16 -0
- package/esm/models/fileprovider.js +15 -0
- package/esm/models/fileresponse.d.ts +21 -0
- package/esm/models/fileresponse.js +26 -0
- package/esm/models/index.d.ts +11 -1
- package/esm/models/index.js +11 -1
- package/esm/models/openaifile.d.ts +53 -0
- package/esm/models/openaifile.js +58 -0
- package/esm/models/openaifiledeleted.d.ts +23 -0
- package/esm/models/openaifiledeleted.js +27 -0
- package/esm/models/openaifilelist.d.ts +26 -0
- package/esm/models/openaifilelist.js +33 -0
- package/esm/models/openrouterfile.d.ts +33 -0
- package/esm/models/openrouterfile.js +39 -0
- package/esm/models/openrouterfiledeleted.d.ts +22 -0
- package/esm/models/openrouterfiledeleted.js +26 -0
- package/esm/models/openrouterfilelist.d.ts +22 -0
- package/esm/models/openrouterfilelist.js +28 -0
- package/esm/models/operations/deletefile.d.ts +6 -0
- package/esm/models/operations/deletefile.js +2 -0
- package/esm/models/operations/downloadfilecontent.d.ts +6 -0
- package/esm/models/operations/downloadfilecontent.js +2 -0
- package/esm/models/operations/getfilemetadata.d.ts +6 -0
- package/esm/models/operations/getfilemetadata.js +2 -0
- package/esm/models/operations/listfiles.d.ts +39 -0
- package/esm/models/operations/listfiles.js +18 -0
- package/esm/models/operations/uploadfile.d.ts +6 -0
- package/esm/models/operations/uploadfile.js +2 -0
- package/esm/sdk/files.d.ts +2 -2
- package/jsr.json +1 -1
- package/package.json +7 -7
- package/esm/models/filemetadata.d.ts +0 -26
- package/esm/models/filemetadata.js +0 -33
package/esm/models/index.js
CHANGED
|
@@ -26,7 +26,10 @@ export * from "./anthropiccitationsearchresultlocationparam.js";
|
|
|
26
26
|
export * from "./anthropiccitationwebsearchresultlocationparam.js";
|
|
27
27
|
export * from "./anthropiccompactionusageiteration.js";
|
|
28
28
|
export * from "./anthropicdocumentblockparam.js";
|
|
29
|
+
export * from "./anthropicfile.js";
|
|
30
|
+
export * from "./anthropicfiledeleted.js";
|
|
29
31
|
export * from "./anthropicfiledocumentsource.js";
|
|
32
|
+
export * from "./anthropicfilelist.js";
|
|
30
33
|
export * from "./anthropicimageblockparam.js";
|
|
31
34
|
export * from "./anthropicimagemimetype.js";
|
|
32
35
|
export * from "./anthropicinputtokensclearatleast.js";
|
|
@@ -195,9 +198,10 @@ export * from "./errorevent.js";
|
|
|
195
198
|
export * from "./filecitation.js";
|
|
196
199
|
export * from "./filedeleteresponse.js";
|
|
197
200
|
export * from "./filelistresponse.js";
|
|
198
|
-
export * from "./filemetadata.js";
|
|
199
201
|
export * from "./fileparserplugin.js";
|
|
200
202
|
export * from "./filepath.js";
|
|
203
|
+
export * from "./fileprovider.js";
|
|
204
|
+
export * from "./fileresponse.js";
|
|
201
205
|
export * from "./filesearchservertool.js";
|
|
202
206
|
export * from "./filesservertool.js";
|
|
203
207
|
export * from "./filesservertoolconfig.js";
|
|
@@ -343,6 +347,9 @@ export * from "./observabilitysentrydestination.js";
|
|
|
343
347
|
export * from "./observabilitysnowflakedestination.js";
|
|
344
348
|
export * from "./observabilityweavedestination.js";
|
|
345
349
|
export * from "./observabilitywebhookdestination.js";
|
|
350
|
+
export * from "./openaifile.js";
|
|
351
|
+
export * from "./openaifiledeleted.js";
|
|
352
|
+
export * from "./openaifilelist.js";
|
|
346
353
|
export * from "./openairesponsecustomtoolcall.js";
|
|
347
354
|
export * from "./openairesponsecustomtoolcalloutput.js";
|
|
348
355
|
export * from "./openairesponsefunctiontoolcall.js";
|
|
@@ -356,6 +363,9 @@ export * from "./openairesponsestruncation.js";
|
|
|
356
363
|
export * from "./openresponsescreatedevent.js";
|
|
357
364
|
export * from "./openresponsesinprogressevent.js";
|
|
358
365
|
export * from "./openresponsesresult.js";
|
|
366
|
+
export * from "./openrouterfile.js";
|
|
367
|
+
export * from "./openrouterfiledeleted.js";
|
|
368
|
+
export * from "./openrouterfilelist.js";
|
|
359
369
|
export * from "./openroutermetadata.js";
|
|
360
370
|
export * from "./openrouterwebsearchservertool.js";
|
|
361
371
|
export * from "./outputadvisorservertoolitem.js";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum, OpenEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const OpenAIFileShape: {
|
|
6
|
+
readonly Openai: "openai";
|
|
7
|
+
};
|
|
8
|
+
export type OpenAIFileShape = ClosedEnum<typeof OpenAIFileShape>;
|
|
9
|
+
export declare const OpenAIFileObject: {
|
|
10
|
+
readonly File: "file";
|
|
11
|
+
};
|
|
12
|
+
export type OpenAIFileObject = ClosedEnum<typeof OpenAIFileObject>;
|
|
13
|
+
export declare const Purpose: {
|
|
14
|
+
readonly Assistants: "assistants";
|
|
15
|
+
readonly Batch: "batch";
|
|
16
|
+
readonly FineTune: "fine-tune";
|
|
17
|
+
readonly Vision: "vision";
|
|
18
|
+
readonly UserData: "user_data";
|
|
19
|
+
readonly Evals: "evals";
|
|
20
|
+
readonly AssistantsOutput: "assistants_output";
|
|
21
|
+
readonly BatchOutput: "batch_output";
|
|
22
|
+
readonly FineTuneResults: "fine-tune-results";
|
|
23
|
+
};
|
|
24
|
+
export type Purpose = OpenEnum<typeof Purpose>;
|
|
25
|
+
export declare const OpenAIFileStatus: {
|
|
26
|
+
readonly Processed: "processed";
|
|
27
|
+
};
|
|
28
|
+
export type OpenAIFileStatus = ClosedEnum<typeof OpenAIFileStatus>;
|
|
29
|
+
/**
|
|
30
|
+
* A stored file in OpenAI's Files API shape.
|
|
31
|
+
*/
|
|
32
|
+
export type OpenAIFile = {
|
|
33
|
+
shape: OpenAIFileShape;
|
|
34
|
+
bytes: number;
|
|
35
|
+
createdAt: number;
|
|
36
|
+
filename: string;
|
|
37
|
+
id: string;
|
|
38
|
+
object: OpenAIFileObject;
|
|
39
|
+
purpose: Purpose;
|
|
40
|
+
status: OpenAIFileStatus;
|
|
41
|
+
};
|
|
42
|
+
/** @internal */
|
|
43
|
+
export declare const OpenAIFileShape$inboundSchema: z.ZodEnum<typeof OpenAIFileShape>;
|
|
44
|
+
/** @internal */
|
|
45
|
+
export declare const OpenAIFileObject$inboundSchema: z.ZodEnum<typeof OpenAIFileObject>;
|
|
46
|
+
/** @internal */
|
|
47
|
+
export declare const Purpose$inboundSchema: z.ZodType<Purpose, unknown>;
|
|
48
|
+
/** @internal */
|
|
49
|
+
export declare const OpenAIFileStatus$inboundSchema: z.ZodEnum<typeof OpenAIFileStatus>;
|
|
50
|
+
/** @internal */
|
|
51
|
+
export declare const OpenAIFile$inboundSchema: z.ZodType<OpenAIFile, unknown>;
|
|
52
|
+
export declare function openAIFileFromJSON(jsonString: string): SafeParseResult<OpenAIFile, SDKValidationError>;
|
|
53
|
+
//# sourceMappingURL=openaifile.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 63e8910c7eb7
|
|
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
|
+
export const OpenAIFileShape = {
|
|
10
|
+
Openai: "openai",
|
|
11
|
+
};
|
|
12
|
+
export const OpenAIFileObject = {
|
|
13
|
+
File: "file",
|
|
14
|
+
};
|
|
15
|
+
export const Purpose = {
|
|
16
|
+
Assistants: "assistants",
|
|
17
|
+
Batch: "batch",
|
|
18
|
+
FineTune: "fine-tune",
|
|
19
|
+
Vision: "vision",
|
|
20
|
+
UserData: "user_data",
|
|
21
|
+
Evals: "evals",
|
|
22
|
+
AssistantsOutput: "assistants_output",
|
|
23
|
+
BatchOutput: "batch_output",
|
|
24
|
+
FineTuneResults: "fine-tune-results",
|
|
25
|
+
};
|
|
26
|
+
export const OpenAIFileStatus = {
|
|
27
|
+
Processed: "processed",
|
|
28
|
+
};
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const OpenAIFileShape$inboundSchema = z.enum(OpenAIFileShape);
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const OpenAIFileObject$inboundSchema = z.enum(OpenAIFileObject);
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const Purpose$inboundSchema = openEnums
|
|
35
|
+
.inboundSchema(Purpose);
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const OpenAIFileStatus$inboundSchema = z.enum(OpenAIFileStatus);
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const OpenAIFile$inboundSchema = z
|
|
40
|
+
.object({
|
|
41
|
+
_shape: OpenAIFileShape$inboundSchema,
|
|
42
|
+
bytes: z.int(),
|
|
43
|
+
created_at: z.int(),
|
|
44
|
+
filename: z.string(),
|
|
45
|
+
id: z.string(),
|
|
46
|
+
object: OpenAIFileObject$inboundSchema,
|
|
47
|
+
purpose: Purpose$inboundSchema,
|
|
48
|
+
status: OpenAIFileStatus$inboundSchema,
|
|
49
|
+
}).transform((v) => {
|
|
50
|
+
return remap$(v, {
|
|
51
|
+
"_shape": "shape",
|
|
52
|
+
"created_at": "createdAt",
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
export function openAIFileFromJSON(jsonString) {
|
|
56
|
+
return safeParse(jsonString, (x) => OpenAIFile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIFile' from JSON`);
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=openaifile.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const OpenAIFileDeletedObject: {
|
|
6
|
+
readonly File: "file";
|
|
7
|
+
};
|
|
8
|
+
export type OpenAIFileDeletedObject = ClosedEnum<typeof OpenAIFileDeletedObject>;
|
|
9
|
+
/**
|
|
10
|
+
* Deletion result in OpenAI's shape.
|
|
11
|
+
*/
|
|
12
|
+
export type OpenAIFileDeleted = {
|
|
13
|
+
shape: "openai";
|
|
14
|
+
deleted: true;
|
|
15
|
+
id: string;
|
|
16
|
+
object: OpenAIFileDeletedObject;
|
|
17
|
+
};
|
|
18
|
+
/** @internal */
|
|
19
|
+
export declare const OpenAIFileDeletedObject$inboundSchema: z.ZodEnum<typeof OpenAIFileDeletedObject>;
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const OpenAIFileDeleted$inboundSchema: z.ZodType<OpenAIFileDeleted, unknown>;
|
|
22
|
+
export declare function openAIFileDeletedFromJSON(jsonString: string): SafeParseResult<OpenAIFileDeleted, SDKValidationError>;
|
|
23
|
+
//# sourceMappingURL=openaifiledeleted.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 78cdbf4c6848
|
|
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
|
+
export const OpenAIFileDeletedObject = {
|
|
9
|
+
File: "file",
|
|
10
|
+
};
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const OpenAIFileDeletedObject$inboundSchema = z.enum(OpenAIFileDeletedObject);
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const OpenAIFileDeleted$inboundSchema = z.object({
|
|
15
|
+
_shape: z.literal("openai"),
|
|
16
|
+
deleted: z.literal(true),
|
|
17
|
+
id: z.string(),
|
|
18
|
+
object: OpenAIFileDeletedObject$inboundSchema,
|
|
19
|
+
}).transform((v) => {
|
|
20
|
+
return remap$(v, {
|
|
21
|
+
"_shape": "shape",
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
export function openAIFileDeletedFromJSON(jsonString) {
|
|
25
|
+
return safeParse(jsonString, (x) => OpenAIFileDeleted$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIFileDeleted' from JSON`);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=openaifiledeleted.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
import { OpenAIFile } from "./openaifile.js";
|
|
6
|
+
export declare const OpenAIFileListObject: {
|
|
7
|
+
readonly List: "list";
|
|
8
|
+
};
|
|
9
|
+
export type OpenAIFileListObject = ClosedEnum<typeof OpenAIFileListObject>;
|
|
10
|
+
/**
|
|
11
|
+
* A page of files in OpenAI's shape.
|
|
12
|
+
*/
|
|
13
|
+
export type OpenAIFileList = {
|
|
14
|
+
shape: "openai";
|
|
15
|
+
data: Array<OpenAIFile>;
|
|
16
|
+
firstId: string | null;
|
|
17
|
+
hasMore: boolean;
|
|
18
|
+
lastId: string | null;
|
|
19
|
+
object: OpenAIFileListObject;
|
|
20
|
+
};
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const OpenAIFileListObject$inboundSchema: z.ZodEnum<typeof OpenAIFileListObject>;
|
|
23
|
+
/** @internal */
|
|
24
|
+
export declare const OpenAIFileList$inboundSchema: z.ZodType<OpenAIFileList, unknown>;
|
|
25
|
+
export declare function openAIFileListFromJSON(jsonString: string): SafeParseResult<OpenAIFileList, SDKValidationError>;
|
|
26
|
+
//# sourceMappingURL=openaifilelist.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 6d79794dae8e
|
|
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 { OpenAIFile$inboundSchema } from "./openaifile.js";
|
|
9
|
+
export const OpenAIFileListObject = {
|
|
10
|
+
List: "list",
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const OpenAIFileListObject$inboundSchema = z.enum(OpenAIFileListObject);
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const OpenAIFileList$inboundSchema = z.object({
|
|
16
|
+
_shape: z.literal("openai"),
|
|
17
|
+
data: z.array(OpenAIFile$inboundSchema),
|
|
18
|
+
first_id: z.nullable(z.string()),
|
|
19
|
+
has_more: z.boolean(),
|
|
20
|
+
last_id: z.nullable(z.string()),
|
|
21
|
+
object: OpenAIFileListObject$inboundSchema,
|
|
22
|
+
}).transform((v) => {
|
|
23
|
+
return remap$(v, {
|
|
24
|
+
"_shape": "shape",
|
|
25
|
+
"first_id": "firstId",
|
|
26
|
+
"has_more": "hasMore",
|
|
27
|
+
"last_id": "lastId",
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
export function openAIFileListFromJSON(jsonString) {
|
|
31
|
+
return safeParse(jsonString, (x) => OpenAIFileList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenAIFileList' from JSON`);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=openaifilelist.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const OpenRouterFileShape: {
|
|
6
|
+
readonly Openrouter: "openrouter";
|
|
7
|
+
};
|
|
8
|
+
export type OpenRouterFileShape = ClosedEnum<typeof OpenRouterFileShape>;
|
|
9
|
+
export declare const OpenRouterFileType: {
|
|
10
|
+
readonly File: "file";
|
|
11
|
+
};
|
|
12
|
+
export type OpenRouterFileType = ClosedEnum<typeof OpenRouterFileType>;
|
|
13
|
+
/**
|
|
14
|
+
* A stored file in the OpenRouter superset shape: Anthropic-shaped, plus OpenRouter-only fields.
|
|
15
|
+
*/
|
|
16
|
+
export type OpenRouterFile = {
|
|
17
|
+
shape: OpenRouterFileShape;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
downloadable: boolean;
|
|
20
|
+
filename: string;
|
|
21
|
+
id: string;
|
|
22
|
+
mimeType: string;
|
|
23
|
+
sizeBytes: number;
|
|
24
|
+
type: OpenRouterFileType;
|
|
25
|
+
};
|
|
26
|
+
/** @internal */
|
|
27
|
+
export declare const OpenRouterFileShape$inboundSchema: z.ZodEnum<typeof OpenRouterFileShape>;
|
|
28
|
+
/** @internal */
|
|
29
|
+
export declare const OpenRouterFileType$inboundSchema: z.ZodEnum<typeof OpenRouterFileType>;
|
|
30
|
+
/** @internal */
|
|
31
|
+
export declare const OpenRouterFile$inboundSchema: z.ZodType<OpenRouterFile, unknown>;
|
|
32
|
+
export declare function openRouterFileFromJSON(jsonString: string): SafeParseResult<OpenRouterFile, SDKValidationError>;
|
|
33
|
+
//# sourceMappingURL=openrouterfile.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: acb151305aa2
|
|
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
|
+
export const OpenRouterFileShape = {
|
|
9
|
+
Openrouter: "openrouter",
|
|
10
|
+
};
|
|
11
|
+
export const OpenRouterFileType = {
|
|
12
|
+
File: "file",
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const OpenRouterFileShape$inboundSchema = z.enum(OpenRouterFileShape);
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const OpenRouterFileType$inboundSchema = z.enum(OpenRouterFileType);
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const OpenRouterFile$inboundSchema = z.object({
|
|
20
|
+
_shape: OpenRouterFileShape$inboundSchema,
|
|
21
|
+
created_at: z.string(),
|
|
22
|
+
downloadable: z.boolean(),
|
|
23
|
+
filename: z.string(),
|
|
24
|
+
id: z.string(),
|
|
25
|
+
mime_type: z.string(),
|
|
26
|
+
size_bytes: z.int(),
|
|
27
|
+
type: OpenRouterFileType$inboundSchema,
|
|
28
|
+
}).transform((v) => {
|
|
29
|
+
return remap$(v, {
|
|
30
|
+
"_shape": "shape",
|
|
31
|
+
"created_at": "createdAt",
|
|
32
|
+
"mime_type": "mimeType",
|
|
33
|
+
"size_bytes": "sizeBytes",
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
export function openRouterFileFromJSON(jsonString) {
|
|
37
|
+
return safeParse(jsonString, (x) => OpenRouterFile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenRouterFile' from JSON`);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=openrouterfile.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
3
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
4
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
5
|
+
export declare const OpenRouterFileDeletedType: {
|
|
6
|
+
readonly FileDeleted: "file_deleted";
|
|
7
|
+
};
|
|
8
|
+
export type OpenRouterFileDeletedType = ClosedEnum<typeof OpenRouterFileDeletedType>;
|
|
9
|
+
/**
|
|
10
|
+
* Deletion result in the OpenRouter shape.
|
|
11
|
+
*/
|
|
12
|
+
export type OpenRouterFileDeleted = {
|
|
13
|
+
shape: "openrouter";
|
|
14
|
+
id: string;
|
|
15
|
+
type: OpenRouterFileDeletedType;
|
|
16
|
+
};
|
|
17
|
+
/** @internal */
|
|
18
|
+
export declare const OpenRouterFileDeletedType$inboundSchema: z.ZodEnum<typeof OpenRouterFileDeletedType>;
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const OpenRouterFileDeleted$inboundSchema: z.ZodType<OpenRouterFileDeleted, unknown>;
|
|
21
|
+
export declare function openRouterFileDeletedFromJSON(jsonString: string): SafeParseResult<OpenRouterFileDeleted, SDKValidationError>;
|
|
22
|
+
//# sourceMappingURL=openrouterfiledeleted.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: a03c20a453cd
|
|
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
|
+
export const OpenRouterFileDeletedType = {
|
|
9
|
+
FileDeleted: "file_deleted",
|
|
10
|
+
};
|
|
11
|
+
/** @internal */
|
|
12
|
+
export const OpenRouterFileDeletedType$inboundSchema = z.enum(OpenRouterFileDeletedType);
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const OpenRouterFileDeleted$inboundSchema = z.object({
|
|
15
|
+
_shape: z.literal("openrouter"),
|
|
16
|
+
id: z.string(),
|
|
17
|
+
type: OpenRouterFileDeletedType$inboundSchema,
|
|
18
|
+
}).transform((v) => {
|
|
19
|
+
return remap$(v, {
|
|
20
|
+
"_shape": "shape",
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
export function openRouterFileDeletedFromJSON(jsonString) {
|
|
24
|
+
return safeParse(jsonString, (x) => OpenRouterFileDeleted$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenRouterFileDeleted' from JSON`);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=openrouterfiledeleted.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { OpenRouterFile } from "./openrouterfile.js";
|
|
5
|
+
/**
|
|
6
|
+
* A page of files in the OpenRouter shape.
|
|
7
|
+
*/
|
|
8
|
+
export type OpenRouterFileList = {
|
|
9
|
+
shape: "openrouter";
|
|
10
|
+
/**
|
|
11
|
+
* Opaque cursor for the next page; null when there are no more results.
|
|
12
|
+
*/
|
|
13
|
+
cursor: string | null;
|
|
14
|
+
data: Array<OpenRouterFile>;
|
|
15
|
+
firstId: string | null;
|
|
16
|
+
hasMore: boolean;
|
|
17
|
+
lastId: string | null;
|
|
18
|
+
};
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const OpenRouterFileList$inboundSchema: z.ZodType<OpenRouterFileList, unknown>;
|
|
21
|
+
export declare function openRouterFileListFromJSON(jsonString: string): SafeParseResult<OpenRouterFileList, SDKValidationError>;
|
|
22
|
+
//# sourceMappingURL=openrouterfilelist.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: ff3c776b9f81
|
|
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 { OpenRouterFile$inboundSchema, } from "./openrouterfile.js";
|
|
9
|
+
/** @internal */
|
|
10
|
+
export const OpenRouterFileList$inboundSchema = z.object({
|
|
11
|
+
_shape: z.literal("openrouter"),
|
|
12
|
+
cursor: z.nullable(z.string()),
|
|
13
|
+
data: z.array(OpenRouterFile$inboundSchema),
|
|
14
|
+
first_id: z.nullable(z.string()),
|
|
15
|
+
has_more: z.boolean(),
|
|
16
|
+
last_id: z.nullable(z.string()),
|
|
17
|
+
}).transform((v) => {
|
|
18
|
+
return remap$(v, {
|
|
19
|
+
"_shape": "shape",
|
|
20
|
+
"first_id": "firstId",
|
|
21
|
+
"has_more": "hasMore",
|
|
22
|
+
"last_id": "lastId",
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
export function openRouterFileListFromJSON(jsonString) {
|
|
26
|
+
return safeParse(jsonString, (x) => OpenRouterFileList$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OpenRouterFileList' from JSON`);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=openrouterfilelist.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import * as models from "../index.js";
|
|
2
3
|
export type DeleteFileGlobals = {
|
|
3
4
|
/**
|
|
4
5
|
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
@@ -45,6 +46,10 @@ export type DeleteFileRequest = {
|
|
|
45
46
|
* Workspace to scope the request to. Defaults to the caller’s default workspace.
|
|
46
47
|
*/
|
|
47
48
|
workspaceId?: string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
|
|
51
|
+
*/
|
|
52
|
+
provider?: models.FileProvider | undefined;
|
|
48
53
|
};
|
|
49
54
|
/** @internal */
|
|
50
55
|
export type DeleteFileRequest$Outbound = {
|
|
@@ -53,6 +58,7 @@ export type DeleteFileRequest$Outbound = {
|
|
|
53
58
|
appCategories?: string | undefined;
|
|
54
59
|
file_id: string;
|
|
55
60
|
workspace_id?: string | undefined;
|
|
61
|
+
provider?: string | undefined;
|
|
56
62
|
};
|
|
57
63
|
/** @internal */
|
|
58
64
|
export declare const DeleteFileRequest$outboundSchema: z.ZodType<DeleteFileRequest$Outbound, DeleteFileRequest>;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
7
8
|
/** @internal */
|
|
8
9
|
export const DeleteFileRequest$outboundSchema = z.object({
|
|
9
10
|
httpReferer: z.string().optional(),
|
|
@@ -11,6 +12,7 @@ export const DeleteFileRequest$outboundSchema = z.object({
|
|
|
11
12
|
appCategories: z.string().optional(),
|
|
12
13
|
fileId: z.string(),
|
|
13
14
|
workspaceId: z.string().optional(),
|
|
15
|
+
provider: models.FileProvider$outboundSchema.optional(),
|
|
14
16
|
}).transform((v) => {
|
|
15
17
|
return remap$(v, {
|
|
16
18
|
httpReferer: "HTTP-Referer",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import * as models from "../index.js";
|
|
2
3
|
export type DownloadFileContentGlobals = {
|
|
3
4
|
/**
|
|
4
5
|
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
@@ -45,6 +46,10 @@ export type DownloadFileContentRequest = {
|
|
|
45
46
|
* Workspace to scope the request to. Defaults to the caller’s default workspace.
|
|
46
47
|
*/
|
|
47
48
|
workspaceId?: string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
|
|
51
|
+
*/
|
|
52
|
+
provider?: models.FileProvider | undefined;
|
|
48
53
|
};
|
|
49
54
|
/** @internal */
|
|
50
55
|
export type DownloadFileContentRequest$Outbound = {
|
|
@@ -53,6 +58,7 @@ export type DownloadFileContentRequest$Outbound = {
|
|
|
53
58
|
appCategories?: string | undefined;
|
|
54
59
|
file_id: string;
|
|
55
60
|
workspace_id?: string | undefined;
|
|
61
|
+
provider?: string | undefined;
|
|
56
62
|
};
|
|
57
63
|
/** @internal */
|
|
58
64
|
export declare const DownloadFileContentRequest$outboundSchema: z.ZodType<DownloadFileContentRequest$Outbound, DownloadFileContentRequest>;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
7
8
|
/** @internal */
|
|
8
9
|
export const DownloadFileContentRequest$outboundSchema = z.object({
|
|
9
10
|
httpReferer: z.string().optional(),
|
|
@@ -11,6 +12,7 @@ export const DownloadFileContentRequest$outboundSchema = z.object({
|
|
|
11
12
|
appCategories: z.string().optional(),
|
|
12
13
|
fileId: z.string(),
|
|
13
14
|
workspaceId: z.string().optional(),
|
|
15
|
+
provider: models.FileProvider$outboundSchema.optional(),
|
|
14
16
|
}).transform((v) => {
|
|
15
17
|
return remap$(v, {
|
|
16
18
|
httpReferer: "HTTP-Referer",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import * as models from "../index.js";
|
|
2
3
|
export type GetFileMetadataGlobals = {
|
|
3
4
|
/**
|
|
4
5
|
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
@@ -45,6 +46,10 @@ export type GetFileMetadataRequest = {
|
|
|
45
46
|
* Workspace to scope the request to. Defaults to the caller’s default workspace.
|
|
46
47
|
*/
|
|
47
48
|
workspaceId?: string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
|
|
51
|
+
*/
|
|
52
|
+
provider?: models.FileProvider | undefined;
|
|
48
53
|
};
|
|
49
54
|
/** @internal */
|
|
50
55
|
export type GetFileMetadataRequest$Outbound = {
|
|
@@ -53,6 +58,7 @@ export type GetFileMetadataRequest$Outbound = {
|
|
|
53
58
|
appCategories?: string | undefined;
|
|
54
59
|
file_id: string;
|
|
55
60
|
workspace_id?: string | undefined;
|
|
61
|
+
provider?: string | undefined;
|
|
56
62
|
};
|
|
57
63
|
/** @internal */
|
|
58
64
|
export declare const GetFileMetadataRequest$outboundSchema: z.ZodType<GetFileMetadataRequest$Outbound, GetFileMetadataRequest>;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as z from "zod/v4";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
7
8
|
/** @internal */
|
|
8
9
|
export const GetFileMetadataRequest$outboundSchema = z.object({
|
|
9
10
|
httpReferer: z.string().optional(),
|
|
@@ -11,6 +12,7 @@ export const GetFileMetadataRequest$outboundSchema = z.object({
|
|
|
11
12
|
appCategories: z.string().optional(),
|
|
12
13
|
fileId: z.string(),
|
|
13
14
|
workspaceId: z.string().optional(),
|
|
15
|
+
provider: models.FileProvider$outboundSchema.optional(),
|
|
14
16
|
}).transform((v) => {
|
|
15
17
|
return remap$(v, {
|
|
16
18
|
httpReferer: "HTTP-Referer",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
2
3
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
4
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
4
5
|
import * as models from "../index.js";
|
|
@@ -23,6 +24,17 @@ export type ListFilesGlobals = {
|
|
|
23
24
|
*/
|
|
24
25
|
appCategories?: string | undefined;
|
|
25
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* Sort direction. Only `asc` is supported by OpenRouter storage.
|
|
29
|
+
*/
|
|
30
|
+
export declare const Order: {
|
|
31
|
+
readonly Asc: "asc";
|
|
32
|
+
readonly Desc: "desc";
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Sort direction. Only `asc` is supported by OpenRouter storage.
|
|
36
|
+
*/
|
|
37
|
+
export type Order = OpenEnum<typeof Order>;
|
|
26
38
|
export type ListFilesRequest = {
|
|
27
39
|
/**
|
|
28
40
|
* The app identifier should be your app's URL and is used as the primary identifier for rankings.
|
|
@@ -55,11 +67,33 @@ export type ListFilesRequest = {
|
|
|
55
67
|
* Workspace to scope the request to. Defaults to the caller’s default workspace.
|
|
56
68
|
*/
|
|
57
69
|
workspaceId?: string | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Store or read this file on the named provider using your own API key for it. Omit to use OpenRouter storage.
|
|
72
|
+
*/
|
|
73
|
+
provider?: models.FileProvider | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* OpenAI-style forward cursor: the id to list after.
|
|
76
|
+
*/
|
|
77
|
+
after?: string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Anthropic-style forward cursor: the id to list after.
|
|
80
|
+
*/
|
|
81
|
+
afterId?: string | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Anthropic-style reverse cursor. Not supported by OpenRouter storage.
|
|
84
|
+
*/
|
|
85
|
+
beforeId?: string | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Sort direction. Only `asc` is supported by OpenRouter storage.
|
|
88
|
+
*/
|
|
89
|
+
order?: Order | undefined;
|
|
58
90
|
};
|
|
59
91
|
export type ListFilesResponse = {
|
|
60
92
|
result: models.FileListResponse;
|
|
61
93
|
};
|
|
62
94
|
/** @internal */
|
|
95
|
+
export declare const Order$outboundSchema: z.ZodType<string, Order>;
|
|
96
|
+
/** @internal */
|
|
63
97
|
export type ListFilesRequest$Outbound = {
|
|
64
98
|
"HTTP-Referer"?: string | undefined;
|
|
65
99
|
appTitle?: string | undefined;
|
|
@@ -67,6 +101,11 @@ export type ListFilesRequest$Outbound = {
|
|
|
67
101
|
limit?: number | undefined;
|
|
68
102
|
cursor?: string | undefined;
|
|
69
103
|
workspace_id?: string | undefined;
|
|
104
|
+
provider?: string | undefined;
|
|
105
|
+
after?: string | undefined;
|
|
106
|
+
after_id?: string | undefined;
|
|
107
|
+
before_id?: string | undefined;
|
|
108
|
+
order?: string | undefined;
|
|
70
109
|
};
|
|
71
110
|
/** @internal */
|
|
72
111
|
export declare const ListFilesRequest$outboundSchema: z.ZodType<ListFilesRequest$Outbound, ListFilesRequest>;
|