@openrouter/sdk 0.0.1-beta.11 → 0.0.1-beta.14
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/FUNCTIONS.md +109 -1
- package/REACT_QUERY.md +109 -1
- package/README.md +686 -15
- package/esm/funcs/analyticsGetUserActivity.d.ts +1 -1
- package/esm/funcs/analyticsGetUserActivity.js +2 -2
- package/esm/funcs/apiKeysCreate.d.ts +1 -1
- package/esm/funcs/apiKeysCreate.js +2 -2
- package/esm/funcs/apiKeysDelete.d.ts +1 -1
- package/esm/funcs/apiKeysDelete.js +2 -2
- package/esm/funcs/apiKeysGet.d.ts +1 -1
- package/esm/funcs/apiKeysGet.js +2 -2
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.d.ts +1 -1
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +2 -2
- package/esm/funcs/apiKeysList.d.ts +1 -1
- package/esm/funcs/apiKeysList.js +2 -2
- package/esm/funcs/apiKeysUpdate.d.ts +1 -1
- package/esm/funcs/apiKeysUpdate.js +2 -2
- package/esm/funcs/betaResponsesSend.d.ts +9 -1
- package/esm/funcs/betaResponsesSend.js +38 -14
- package/esm/funcs/chatSend.d.ts +1 -1
- package/esm/funcs/creditsCreateCoinbaseCharge.d.ts +1 -1
- package/esm/funcs/creditsCreateCoinbaseCharge.js +15 -5
- package/esm/funcs/creditsGetCredits.d.ts +1 -1
- package/esm/funcs/creditsGetCredits.js +2 -2
- package/esm/funcs/endpointsList.d.ts +1 -1
- package/esm/funcs/endpointsList.js +2 -2
- package/esm/funcs/endpointsListZdrEndpoints.d.ts +2 -1
- package/esm/funcs/endpointsListZdrEndpoints.js +6 -2
- package/esm/funcs/generationsGetGeneration.d.ts +1 -1
- package/esm/funcs/generationsGetGeneration.js +13 -2
- package/esm/funcs/modelsCount.d.ts +3 -2
- package/esm/funcs/modelsCount.js +7 -3
- package/esm/funcs/modelsList.d.ts +3 -1
- package/esm/funcs/modelsList.js +8 -7
- package/esm/funcs/modelsListForUser.d.ts +3 -1
- package/esm/funcs/modelsListForUser.js +7 -3
- package/esm/funcs/oAuthCreateAuthCode.d.ts +18 -0
- package/esm/funcs/oAuthCreateAuthCode.js +82 -0
- package/esm/funcs/oAuthCreateAuthorizationUrl.d.ts +2 -2
- package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.d.ts +18 -0
- package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.js +82 -0
- package/esm/funcs/parametersGetParameters.d.ts +1 -1
- package/esm/funcs/parametersGetParameters.js +2 -2
- package/esm/funcs/providersList.d.ts +1 -1
- package/esm/funcs/providersList.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/lib/event-streams.d.ts +1 -1
- package/esm/models/badgatewayresponseerrordata.d.ts +40 -0
- package/esm/models/badgatewayresponseerrordata.js +35 -0
- package/esm/models/badrequestresponseerrordata.d.ts +40 -0
- package/esm/models/badrequestresponseerrordata.js +35 -0
- package/esm/models/chatmessagecontentitemaudio.d.ts +10 -10
- package/esm/models/chatmessagecontentitemaudio.js +14 -14
- package/esm/models/chatstreamingresponsechunk.d.ts +15 -15
- package/esm/models/chatstreamingresponsechunk.js +15 -15
- package/esm/models/createchargerequest.d.ts +31 -2
- package/esm/models/createchargerequest.js +47 -2
- package/esm/models/defaultparameters.d.ts +36 -0
- package/esm/models/defaultparameters.js +46 -0
- package/esm/models/edgenetworktimeoutresponseerrordata.d.ts +40 -0
- package/esm/models/edgenetworktimeoutresponseerrordata.js +35 -0
- package/esm/models/endpointstatus.d.ts +26 -0
- package/esm/models/endpointstatus.js +36 -0
- package/esm/models/errors/badgatewayresponseerror.d.ts +52 -0
- package/esm/models/errors/badgatewayresponseerror.js +63 -0
- package/esm/models/errors/badrequestresponseerror.d.ts +52 -0
- package/esm/models/errors/badrequestresponseerror.js +63 -0
- package/esm/models/errors/edgenetworktimeoutresponseerror.d.ts +52 -0
- package/esm/models/errors/edgenetworktimeoutresponseerror.js +63 -0
- package/esm/models/errors/forbiddenresponseerror.d.ts +52 -0
- package/esm/models/errors/forbiddenresponseerror.js +63 -0
- package/esm/models/errors/index.d.ts +14 -2
- package/esm/models/errors/index.js +14 -2
- package/esm/models/errors/internalserverresponseerror.d.ts +52 -0
- package/esm/models/errors/internalserverresponseerror.js +63 -0
- package/esm/models/errors/notfoundresponseerror.d.ts +52 -0
- package/esm/models/errors/{errorresponse.js → notfoundresponseerror.js} +16 -17
- package/esm/models/errors/payloadtoolargeresponseerror.d.ts +52 -0
- package/esm/models/errors/payloadtoolargeresponseerror.js +63 -0
- package/esm/models/errors/paymentrequiredresponseerror.d.ts +52 -0
- package/esm/models/errors/paymentrequiredresponseerror.js +63 -0
- package/esm/models/errors/provideroverloadedresponseerror.d.ts +52 -0
- package/esm/models/errors/provideroverloadedresponseerror.js +63 -0
- package/esm/models/errors/requesttimeoutresponseerror.d.ts +52 -0
- package/esm/models/errors/requesttimeoutresponseerror.js +63 -0
- package/esm/models/errors/serviceunavailableresponseerror.d.ts +52 -0
- package/esm/models/errors/serviceunavailableresponseerror.js +63 -0
- package/esm/models/errors/toomanyrequestsresponseerror.d.ts +52 -0
- package/esm/models/errors/toomanyrequestsresponseerror.js +63 -0
- package/esm/models/errors/unauthorizedresponseerror.d.ts +52 -0
- package/esm/models/errors/unauthorizedresponseerror.js +63 -0
- package/esm/models/errors/unprocessableentityresponseerror.d.ts +52 -0
- package/esm/models/errors/unprocessableentityresponseerror.js +63 -0
- package/esm/models/forbiddenresponseerrordata.d.ts +40 -0
- package/esm/models/forbiddenresponseerrordata.js +35 -0
- package/esm/models/index.d.ts +37 -1
- package/esm/models/index.js +37 -1
- package/esm/models/inputmodality.d.ts +24 -0
- package/esm/models/inputmodality.js +34 -0
- package/esm/models/instructtype.d.ts +48 -0
- package/esm/models/instructtype.js +55 -0
- package/esm/models/internalserverresponseerrordata.d.ts +40 -0
- package/esm/models/internalserverresponseerrordata.js +35 -0
- package/esm/models/listendpointsresponse.d.ts +126 -2
- package/esm/models/listendpointsresponse.js +115 -2
- package/esm/models/model.d.ts +101 -0
- package/esm/models/model.js +82 -0
- package/esm/models/modelarchitecture.d.ts +104 -0
- package/esm/models/modelarchitecture.js +107 -0
- package/esm/models/modelgroup.d.ts +45 -0
- package/esm/models/modelgroup.js +53 -0
- package/esm/models/modelscountresponse.d.ts +40 -2
- package/esm/models/modelscountresponse.js +31 -2
- package/esm/models/modelslistresponse.d.ts +10 -2
- package/esm/models/modelslistresponse.js +7 -2
- package/esm/models/notfoundresponseerrordata.d.ts +40 -0
- package/esm/models/notfoundresponseerrordata.js +35 -0
- package/esm/models/openairesponsesincludable.d.ts +25 -0
- package/esm/models/openairesponsesincludable.js +35 -0
- package/esm/models/openairesponsesinputunion.d.ts +78 -78
- package/esm/models/openairesponsesinputunion.js +124 -126
- package/esm/models/openresponseseasyinputmessage.d.ts +246 -0
- package/esm/models/openresponseseasyinputmessage.js +283 -0
- package/esm/models/openresponsesfunctioncalloutput.d.ts +64 -0
- package/esm/models/openresponsesfunctioncalloutput.js +67 -0
- package/esm/models/openresponsesfunctiontoolcall.d.ts +66 -0
- package/esm/models/openresponsesfunctiontoolcall.js +69 -0
- package/esm/models/openresponsesinput.d.ts +60 -0
- package/esm/models/openresponsesinput.js +113 -0
- package/esm/models/openresponsesinputmessageitem.d.ts +193 -0
- package/esm/models/openresponsesinputmessageitem.js +210 -0
- package/esm/models/openresponsesnonstreamingresponse.d.ts +13 -13
- package/esm/models/openresponsesnonstreamingresponse.js +13 -13
- package/esm/models/openresponsesreasoning.d.ts +179 -0
- package/esm/models/openresponsesreasoning.js +194 -0
- package/esm/models/openresponsesreasoningconfig.d.ts +40 -0
- package/esm/models/openresponsesreasoningconfig.js +48 -0
- package/esm/models/openresponsesrequest.d.ts +736 -2
- package/esm/models/openresponsesrequest.js +789 -2
- package/esm/models/openresponsesresponsetext.d.ts +59 -0
- package/esm/models/openresponsesresponsetext.js +64 -0
- package/esm/models/operations/createauthkeyscode.d.ts +145 -0
- package/esm/models/operations/createauthkeyscode.js +146 -0
- package/esm/models/operations/createresponses.d.ts +58 -0
- package/esm/models/operations/createresponses.js +80 -0
- package/esm/models/operations/exchangeauthcodeforapikey.d.ts +104 -0
- package/esm/models/operations/exchangeauthcodeforapikey.js +111 -0
- package/esm/models/operations/getmodels.d.ts +0 -26
- package/esm/models/operations/getmodels.js +0 -38
- package/esm/models/operations/index.d.ts +3 -2
- package/esm/models/operations/index.js +3 -2
- package/esm/models/operations/listendpointszdr.d.ts +3 -24
- package/esm/models/operations/listendpointszdr.js +2 -29
- package/esm/models/operations/listmodelsuser.d.ts +0 -22
- package/esm/models/operations/listmodelsuser.js +0 -28
- package/esm/models/operations/listproviders.d.ts +0 -36
- package/esm/models/operations/listproviders.js +0 -28
- package/esm/models/operations/sendchatcompletionrequest.d.ts +1 -1
- package/esm/models/operations/sendchatcompletionrequest.js +2 -1
- package/esm/models/outputmodality.d.ts +23 -0
- package/esm/models/outputmodality.js +33 -0
- package/esm/models/parameter.d.ts +43 -0
- package/esm/models/parameter.js +54 -0
- package/esm/models/payloadtoolargeresponseerrordata.d.ts +40 -0
- package/esm/models/payloadtoolargeresponseerrordata.js +35 -0
- package/esm/models/paymentrequiredresponseerrordata.d.ts +40 -0
- package/esm/models/paymentrequiredresponseerrordata.js +35 -0
- package/esm/models/perrequestlimits.d.ts +40 -0
- package/esm/models/perrequestlimits.js +44 -0
- package/esm/models/providername.d.ts +106 -0
- package/esm/models/providername.js +116 -0
- package/esm/models/provideroverloadedresponseerrordata.d.ts +40 -0
- package/esm/models/provideroverloadedresponseerrordata.js +35 -0
- package/esm/models/publicendpoint.d.ts +140 -2
- package/esm/models/publicendpoint.js +156 -2
- package/esm/models/publicpricing.d.ts +87 -0
- package/esm/models/publicpricing.js +73 -0
- package/esm/models/quantization.d.ts +29 -0
- package/esm/models/quantization.js +39 -0
- package/esm/models/requesttimeoutresponseerrordata.d.ts +40 -0
- package/esm/models/requesttimeoutresponseerrordata.js +35 -0
- package/esm/models/responseserrorfield.d.ts +10 -10
- package/esm/models/responseserrorfield.js +14 -14
- package/esm/models/responsetextconfig.d.ts +10 -10
- package/esm/models/responsetextconfig.js +14 -15
- package/esm/models/serviceunavailableresponseerrordata.d.ts +40 -0
- package/esm/models/serviceunavailableresponseerrordata.js +35 -0
- package/esm/models/toomanyrequestsresponseerrordata.d.ts +40 -0
- package/esm/models/toomanyrequestsresponseerrordata.js +35 -0
- package/esm/models/topproviderinfo.d.ts +45 -0
- package/esm/models/topproviderinfo.js +48 -0
- package/esm/models/unauthorizedresponseerrordata.d.ts +40 -0
- package/esm/models/unauthorizedresponseerrordata.js +35 -0
- package/esm/models/unprocessableentityresponseerrordata.d.ts +40 -0
- package/esm/models/unprocessableentityresponseerrordata.js +35 -0
- package/esm/react-query/betaResponsesSend.d.ts +1 -1
- package/esm/react-query/index.d.ts +2 -0
- package/esm/react-query/index.js +2 -0
- package/esm/react-query/modelsCount.d.ts +2 -2
- package/esm/react-query/modelsList.d.ts +2 -7
- package/esm/react-query/modelsList.js +0 -2
- package/esm/react-query/modelsListForUser.d.ts +2 -1
- package/esm/react-query/oAuthCreateAuthCode.d.ts +23 -0
- package/esm/react-query/oAuthCreateAuthCode.js +42 -0
- package/esm/react-query/oAuthExchangeAuthCodeForAPIKey.d.ts +23 -0
- package/esm/react-query/oAuthExchangeAuthCodeForAPIKey.js +42 -0
- package/esm/sdk/chat.d.ts +1 -1
- package/esm/sdk/models.d.ts +4 -3
- package/esm/sdk/oauth.d.ts +46 -0
- package/esm/sdk/oauth.js +67 -0
- package/esm/sdk/responses.d.ts +8 -1
- package/esm/sdk/responses.js +0 -6
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.js +4 -0
- package/jsr.json +1 -1
- package/package.json +3 -1
- package/vitest.config.ts +8 -1
- package/esm/models/errorresponse.d.ts +0 -155
- package/esm/models/errorresponse.js +0 -167
- package/esm/models/errors/errorresponse.d.ts +0 -46
- package/esm/models/errors/listproviders.d.ts +0 -49
- package/esm/models/errors/listproviders.js +0 -51
- package/esm/models/operations/createapialpharesponses.d.ts +0 -58
- package/esm/models/operations/createapialpharesponses.js +0 -83
- package/esm/models/operations/listmodelscount.d.ts +0 -26
- package/esm/models/operations/listmodelscount.js +0 -34
|
@@ -5,7 +5,7 @@ import * as z from "zod/v4";
|
|
|
5
5
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
7
|
import { catchUnrecognizedEnum, } from "../types/enums.js";
|
|
8
|
-
export const
|
|
8
|
+
export const ChatMessageContentItemAudioFormat = {
|
|
9
9
|
Wav: "wav",
|
|
10
10
|
Mp3: "mp3",
|
|
11
11
|
Flac: "flac",
|
|
@@ -15,37 +15,37 @@ export const Format = {
|
|
|
15
15
|
Pcm24: "pcm24",
|
|
16
16
|
};
|
|
17
17
|
/** @internal */
|
|
18
|
-
export const
|
|
18
|
+
export const ChatMessageContentItemAudioFormat$inboundSchema = z
|
|
19
19
|
.union([
|
|
20
|
-
z.enum(
|
|
20
|
+
z.enum(ChatMessageContentItemAudioFormat),
|
|
21
21
|
z.string().transform(catchUnrecognizedEnum),
|
|
22
22
|
]);
|
|
23
23
|
/** @internal */
|
|
24
|
-
export const
|
|
25
|
-
z.enum(
|
|
24
|
+
export const ChatMessageContentItemAudioFormat$outboundSchema = z.union([
|
|
25
|
+
z.enum(ChatMessageContentItemAudioFormat),
|
|
26
26
|
z.string().and(z.custom()),
|
|
27
27
|
]);
|
|
28
28
|
/**
|
|
29
29
|
* @internal
|
|
30
30
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
31
31
|
*/
|
|
32
|
-
export var
|
|
33
|
-
(function (
|
|
34
|
-
/** @deprecated use `
|
|
35
|
-
|
|
36
|
-
/** @deprecated use `
|
|
37
|
-
|
|
38
|
-
})(
|
|
32
|
+
export var ChatMessageContentItemAudioFormat$;
|
|
33
|
+
(function (ChatMessageContentItemAudioFormat$) {
|
|
34
|
+
/** @deprecated use `ChatMessageContentItemAudioFormat$inboundSchema` instead. */
|
|
35
|
+
ChatMessageContentItemAudioFormat$.inboundSchema = ChatMessageContentItemAudioFormat$inboundSchema;
|
|
36
|
+
/** @deprecated use `ChatMessageContentItemAudioFormat$outboundSchema` instead. */
|
|
37
|
+
ChatMessageContentItemAudioFormat$.outboundSchema = ChatMessageContentItemAudioFormat$outboundSchema;
|
|
38
|
+
})(ChatMessageContentItemAudioFormat$ || (ChatMessageContentItemAudioFormat$ = {}));
|
|
39
39
|
/** @internal */
|
|
40
40
|
export const InputAudio$inboundSchema = z
|
|
41
41
|
.object({
|
|
42
42
|
data: z.string(),
|
|
43
|
-
format:
|
|
43
|
+
format: ChatMessageContentItemAudioFormat$inboundSchema,
|
|
44
44
|
});
|
|
45
45
|
/** @internal */
|
|
46
46
|
export const InputAudio$outboundSchema = z.object({
|
|
47
47
|
data: z.string(),
|
|
48
|
-
format:
|
|
48
|
+
format: ChatMessageContentItemAudioFormat$outboundSchema,
|
|
49
49
|
});
|
|
50
50
|
/**
|
|
51
51
|
* @internal
|
|
@@ -7,7 +7,7 @@ export type ChatStreamingResponseChunkError = {
|
|
|
7
7
|
message: string;
|
|
8
8
|
code: number;
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
10
|
+
export type ChatStreamingResponseChunkData = {
|
|
11
11
|
id: string;
|
|
12
12
|
choices: Array<ChatStreamingChoice>;
|
|
13
13
|
created: number;
|
|
@@ -18,7 +18,7 @@ export type Data = {
|
|
|
18
18
|
usage?: ChatGenerationTokenUsage | undefined;
|
|
19
19
|
};
|
|
20
20
|
export type ChatStreamingResponseChunk = {
|
|
21
|
-
data:
|
|
21
|
+
data: ChatStreamingResponseChunkData;
|
|
22
22
|
};
|
|
23
23
|
/** @internal */
|
|
24
24
|
export declare const ChatStreamingResponseChunkError$inboundSchema: z.ZodType<ChatStreamingResponseChunkError, unknown>;
|
|
@@ -44,9 +44,9 @@ export declare namespace ChatStreamingResponseChunkError$ {
|
|
|
44
44
|
export declare function chatStreamingResponseChunkErrorToJSON(chatStreamingResponseChunkError: ChatStreamingResponseChunkError): string;
|
|
45
45
|
export declare function chatStreamingResponseChunkErrorFromJSON(jsonString: string): SafeParseResult<ChatStreamingResponseChunkError, SDKValidationError>;
|
|
46
46
|
/** @internal */
|
|
47
|
-
export declare const
|
|
47
|
+
export declare const ChatStreamingResponseChunkData$inboundSchema: z.ZodType<ChatStreamingResponseChunkData, unknown>;
|
|
48
48
|
/** @internal */
|
|
49
|
-
export type
|
|
49
|
+
export type ChatStreamingResponseChunkData$Outbound = {
|
|
50
50
|
id: string;
|
|
51
51
|
choices: Array<ChatStreamingChoice$Outbound>;
|
|
52
52
|
created: number;
|
|
@@ -57,26 +57,26 @@ export type Data$Outbound = {
|
|
|
57
57
|
usage?: ChatGenerationTokenUsage$Outbound | undefined;
|
|
58
58
|
};
|
|
59
59
|
/** @internal */
|
|
60
|
-
export declare const
|
|
60
|
+
export declare const ChatStreamingResponseChunkData$outboundSchema: z.ZodType<ChatStreamingResponseChunkData$Outbound, ChatStreamingResponseChunkData>;
|
|
61
61
|
/**
|
|
62
62
|
* @internal
|
|
63
63
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
64
64
|
*/
|
|
65
|
-
export declare namespace
|
|
66
|
-
/** @deprecated use `
|
|
67
|
-
const inboundSchema: z.ZodType<
|
|
68
|
-
/** @deprecated use `
|
|
69
|
-
const outboundSchema: z.ZodType<
|
|
70
|
-
/** @deprecated use `
|
|
71
|
-
type Outbound =
|
|
65
|
+
export declare namespace ChatStreamingResponseChunkData$ {
|
|
66
|
+
/** @deprecated use `ChatStreamingResponseChunkData$inboundSchema` instead. */
|
|
67
|
+
const inboundSchema: z.ZodType<ChatStreamingResponseChunkData, unknown, z.core.$ZodTypeInternals<ChatStreamingResponseChunkData, unknown>>;
|
|
68
|
+
/** @deprecated use `ChatStreamingResponseChunkData$outboundSchema` instead. */
|
|
69
|
+
const outboundSchema: z.ZodType<ChatStreamingResponseChunkData$Outbound, ChatStreamingResponseChunkData, z.core.$ZodTypeInternals<ChatStreamingResponseChunkData$Outbound, ChatStreamingResponseChunkData>>;
|
|
70
|
+
/** @deprecated use `ChatStreamingResponseChunkData$Outbound` instead. */
|
|
71
|
+
type Outbound = ChatStreamingResponseChunkData$Outbound;
|
|
72
72
|
}
|
|
73
|
-
export declare function
|
|
74
|
-
export declare function
|
|
73
|
+
export declare function chatStreamingResponseChunkDataToJSON(chatStreamingResponseChunkData: ChatStreamingResponseChunkData): string;
|
|
74
|
+
export declare function chatStreamingResponseChunkDataFromJSON(jsonString: string): SafeParseResult<ChatStreamingResponseChunkData, SDKValidationError>;
|
|
75
75
|
/** @internal */
|
|
76
76
|
export declare const ChatStreamingResponseChunk$inboundSchema: z.ZodType<ChatStreamingResponseChunk, unknown>;
|
|
77
77
|
/** @internal */
|
|
78
78
|
export type ChatStreamingResponseChunk$Outbound = {
|
|
79
|
-
data:
|
|
79
|
+
data: ChatStreamingResponseChunkData$Outbound;
|
|
80
80
|
};
|
|
81
81
|
/** @internal */
|
|
82
82
|
export declare const ChatStreamingResponseChunk$outboundSchema: z.ZodType<ChatStreamingResponseChunk$Outbound, ChatStreamingResponseChunk>;
|
|
@@ -34,7 +34,7 @@ export function chatStreamingResponseChunkErrorFromJSON(jsonString) {
|
|
|
34
34
|
return safeParse(jsonString, (x) => ChatStreamingResponseChunkError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatStreamingResponseChunkError' from JSON`);
|
|
35
35
|
}
|
|
36
36
|
/** @internal */
|
|
37
|
-
export const
|
|
37
|
+
export const ChatStreamingResponseChunkData$inboundSchema = z.object({
|
|
38
38
|
id: z.string(),
|
|
39
39
|
choices: z.array(ChatStreamingChoice$inboundSchema),
|
|
40
40
|
created: z.number(),
|
|
@@ -49,7 +49,7 @@ export const Data$inboundSchema = z.object({
|
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
51
|
/** @internal */
|
|
52
|
-
export const
|
|
52
|
+
export const ChatStreamingResponseChunkData$outboundSchema = z.object({
|
|
53
53
|
id: z.string(),
|
|
54
54
|
choices: z.array(ChatStreamingChoice$outboundSchema),
|
|
55
55
|
created: z.number(),
|
|
@@ -68,18 +68,18 @@ export const Data$outboundSchema = z.object({
|
|
|
68
68
|
* @internal
|
|
69
69
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
70
70
|
*/
|
|
71
|
-
export var
|
|
72
|
-
(function (
|
|
73
|
-
/** @deprecated use `
|
|
74
|
-
|
|
75
|
-
/** @deprecated use `
|
|
76
|
-
|
|
77
|
-
})(
|
|
78
|
-
export function
|
|
79
|
-
return JSON.stringify(
|
|
71
|
+
export var ChatStreamingResponseChunkData$;
|
|
72
|
+
(function (ChatStreamingResponseChunkData$) {
|
|
73
|
+
/** @deprecated use `ChatStreamingResponseChunkData$inboundSchema` instead. */
|
|
74
|
+
ChatStreamingResponseChunkData$.inboundSchema = ChatStreamingResponseChunkData$inboundSchema;
|
|
75
|
+
/** @deprecated use `ChatStreamingResponseChunkData$outboundSchema` instead. */
|
|
76
|
+
ChatStreamingResponseChunkData$.outboundSchema = ChatStreamingResponseChunkData$outboundSchema;
|
|
77
|
+
})(ChatStreamingResponseChunkData$ || (ChatStreamingResponseChunkData$ = {}));
|
|
78
|
+
export function chatStreamingResponseChunkDataToJSON(chatStreamingResponseChunkData) {
|
|
79
|
+
return JSON.stringify(ChatStreamingResponseChunkData$outboundSchema.parse(chatStreamingResponseChunkData));
|
|
80
80
|
}
|
|
81
|
-
export function
|
|
82
|
-
return safeParse(jsonString, (x) =>
|
|
81
|
+
export function chatStreamingResponseChunkDataFromJSON(jsonString) {
|
|
82
|
+
return safeParse(jsonString, (x) => ChatStreamingResponseChunkData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatStreamingResponseChunkData' from JSON`);
|
|
83
83
|
}
|
|
84
84
|
/** @internal */
|
|
85
85
|
export const ChatStreamingResponseChunk$inboundSchema = z.object({
|
|
@@ -94,11 +94,11 @@ export const ChatStreamingResponseChunk$inboundSchema = z.object({
|
|
|
94
94
|
});
|
|
95
95
|
return z.NEVER;
|
|
96
96
|
}
|
|
97
|
-
}).pipe(z.lazy(() =>
|
|
97
|
+
}).pipe(z.lazy(() => ChatStreamingResponseChunkData$inboundSchema)),
|
|
98
98
|
});
|
|
99
99
|
/** @internal */
|
|
100
100
|
export const ChatStreamingResponseChunk$outboundSchema = z.object({
|
|
101
|
-
data: z.lazy(() =>
|
|
101
|
+
data: z.lazy(() => ChatStreamingResponseChunkData$outboundSchema),
|
|
102
102
|
});
|
|
103
103
|
/**
|
|
104
104
|
* @internal
|
|
@@ -1,14 +1,43 @@
|
|
|
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";
|
|
5
|
+
export declare const ChainId: {
|
|
6
|
+
readonly One: 1;
|
|
7
|
+
readonly OneHundredAndThirtySeven: 137;
|
|
8
|
+
readonly EightThousandFourHundredAndFiftyThree: 8453;
|
|
9
|
+
};
|
|
10
|
+
export type ChainId = OpenEnum<typeof ChainId>;
|
|
4
11
|
/**
|
|
5
12
|
* Create a Coinbase charge for crypto payment
|
|
6
13
|
*/
|
|
7
|
-
export type CreateChargeRequest = {
|
|
14
|
+
export type CreateChargeRequest = {
|
|
15
|
+
amount: number;
|
|
16
|
+
sender: string;
|
|
17
|
+
chainId: ChainId;
|
|
18
|
+
};
|
|
19
|
+
/** @internal */
|
|
20
|
+
export declare const ChainId$inboundSchema: z.ZodType<ChainId, unknown>;
|
|
21
|
+
/** @internal */
|
|
22
|
+
export declare const ChainId$outboundSchema: z.ZodType<ChainId, ChainId>;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
26
|
+
*/
|
|
27
|
+
export declare namespace ChainId$ {
|
|
28
|
+
/** @deprecated use `ChainId$inboundSchema` instead. */
|
|
29
|
+
const inboundSchema: z.ZodType<ChainId, unknown, z.core.$ZodTypeInternals<ChainId, unknown>>;
|
|
30
|
+
/** @deprecated use `ChainId$outboundSchema` instead. */
|
|
31
|
+
const outboundSchema: z.ZodType<ChainId, ChainId, z.core.$ZodTypeInternals<ChainId, ChainId>>;
|
|
32
|
+
}
|
|
8
33
|
/** @internal */
|
|
9
34
|
export declare const CreateChargeRequest$inboundSchema: z.ZodType<CreateChargeRequest, unknown>;
|
|
10
35
|
/** @internal */
|
|
11
|
-
export type CreateChargeRequest$Outbound = {
|
|
36
|
+
export type CreateChargeRequest$Outbound = {
|
|
37
|
+
amount: number;
|
|
38
|
+
sender: string;
|
|
39
|
+
chain_id: number;
|
|
40
|
+
};
|
|
12
41
|
/** @internal */
|
|
13
42
|
export declare const CreateChargeRequest$outboundSchema: z.ZodType<CreateChargeRequest$Outbound, CreateChargeRequest>;
|
|
14
43
|
/**
|
|
@@ -2,11 +2,56 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod/v4";
|
|
5
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
5
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { catchUnrecognizedEnum, } from "../types/enums.js";
|
|
8
|
+
export const ChainId = {
|
|
9
|
+
One: 1,
|
|
10
|
+
OneHundredAndThirtySeven: 137,
|
|
11
|
+
EightThousandFourHundredAndFiftyThree: 8453,
|
|
12
|
+
};
|
|
6
13
|
/** @internal */
|
|
7
|
-
export const
|
|
14
|
+
export const ChainId$inboundSchema = z
|
|
15
|
+
.union([
|
|
16
|
+
z.enum(ChainId),
|
|
17
|
+
z.number().transform(catchUnrecognizedEnum),
|
|
18
|
+
]);
|
|
8
19
|
/** @internal */
|
|
9
|
-
export const
|
|
20
|
+
export const ChainId$outboundSchema = z.union([
|
|
21
|
+
z.enum(ChainId),
|
|
22
|
+
z.number().and(z.custom()),
|
|
23
|
+
]);
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
27
|
+
*/
|
|
28
|
+
export var ChainId$;
|
|
29
|
+
(function (ChainId$) {
|
|
30
|
+
/** @deprecated use `ChainId$inboundSchema` instead. */
|
|
31
|
+
ChainId$.inboundSchema = ChainId$inboundSchema;
|
|
32
|
+
/** @deprecated use `ChainId$outboundSchema` instead. */
|
|
33
|
+
ChainId$.outboundSchema = ChainId$outboundSchema;
|
|
34
|
+
})(ChainId$ || (ChainId$ = {}));
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const CreateChargeRequest$inboundSchema = z.object({
|
|
37
|
+
amount: z.number(),
|
|
38
|
+
sender: z.string(),
|
|
39
|
+
chain_id: ChainId$inboundSchema,
|
|
40
|
+
}).transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
"chain_id": "chainId",
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
/** @internal */
|
|
46
|
+
export const CreateChargeRequest$outboundSchema = z.object({
|
|
47
|
+
amount: z.number(),
|
|
48
|
+
sender: z.string(),
|
|
49
|
+
chainId: ChainId$outboundSchema,
|
|
50
|
+
}).transform((v) => {
|
|
51
|
+
return remap$(v, {
|
|
52
|
+
chainId: "chain_id",
|
|
53
|
+
});
|
|
54
|
+
});
|
|
10
55
|
/**
|
|
11
56
|
* @internal
|
|
12
57
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Default parameters for this model
|
|
6
|
+
*/
|
|
7
|
+
export type DefaultParameters = {
|
|
8
|
+
temperature?: number | null | undefined;
|
|
9
|
+
topP?: number | null | undefined;
|
|
10
|
+
frequencyPenalty?: number | null | undefined;
|
|
11
|
+
};
|
|
12
|
+
/** @internal */
|
|
13
|
+
export declare const DefaultParameters$inboundSchema: z.ZodType<DefaultParameters, unknown>;
|
|
14
|
+
/** @internal */
|
|
15
|
+
export type DefaultParameters$Outbound = {
|
|
16
|
+
temperature?: number | null | undefined;
|
|
17
|
+
top_p?: number | null | undefined;
|
|
18
|
+
frequency_penalty?: number | null | undefined;
|
|
19
|
+
};
|
|
20
|
+
/** @internal */
|
|
21
|
+
export declare const DefaultParameters$outboundSchema: z.ZodType<DefaultParameters$Outbound, DefaultParameters>;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
25
|
+
*/
|
|
26
|
+
export declare namespace DefaultParameters$ {
|
|
27
|
+
/** @deprecated use `DefaultParameters$inboundSchema` instead. */
|
|
28
|
+
const inboundSchema: z.ZodType<DefaultParameters, unknown, z.core.$ZodTypeInternals<DefaultParameters, unknown>>;
|
|
29
|
+
/** @deprecated use `DefaultParameters$outboundSchema` instead. */
|
|
30
|
+
const outboundSchema: z.ZodType<DefaultParameters$Outbound, DefaultParameters, z.core.$ZodTypeInternals<DefaultParameters$Outbound, DefaultParameters>>;
|
|
31
|
+
/** @deprecated use `DefaultParameters$Outbound` instead. */
|
|
32
|
+
type Outbound = DefaultParameters$Outbound;
|
|
33
|
+
}
|
|
34
|
+
export declare function defaultParametersToJSON(defaultParameters: DefaultParameters): string;
|
|
35
|
+
export declare function defaultParametersFromJSON(jsonString: string): SafeParseResult<DefaultParameters, SDKValidationError>;
|
|
36
|
+
//# sourceMappingURL=defaultparameters.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
/** @internal */
|
|
8
|
+
export const DefaultParameters$inboundSchema = z.object({
|
|
9
|
+
temperature: z.nullable(z.number()).optional(),
|
|
10
|
+
top_p: z.nullable(z.number()).optional(),
|
|
11
|
+
frequency_penalty: z.nullable(z.number()).optional(),
|
|
12
|
+
}).transform((v) => {
|
|
13
|
+
return remap$(v, {
|
|
14
|
+
"top_p": "topP",
|
|
15
|
+
"frequency_penalty": "frequencyPenalty",
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const DefaultParameters$outboundSchema = z.object({
|
|
20
|
+
temperature: z.nullable(z.number()).optional(),
|
|
21
|
+
topP: z.nullable(z.number()).optional(),
|
|
22
|
+
frequencyPenalty: z.nullable(z.number()).optional(),
|
|
23
|
+
}).transform((v) => {
|
|
24
|
+
return remap$(v, {
|
|
25
|
+
topP: "top_p",
|
|
26
|
+
frequencyPenalty: "frequency_penalty",
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* @internal
|
|
31
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
32
|
+
*/
|
|
33
|
+
export var DefaultParameters$;
|
|
34
|
+
(function (DefaultParameters$) {
|
|
35
|
+
/** @deprecated use `DefaultParameters$inboundSchema` instead. */
|
|
36
|
+
DefaultParameters$.inboundSchema = DefaultParameters$inboundSchema;
|
|
37
|
+
/** @deprecated use `DefaultParameters$outboundSchema` instead. */
|
|
38
|
+
DefaultParameters$.outboundSchema = DefaultParameters$outboundSchema;
|
|
39
|
+
})(DefaultParameters$ || (DefaultParameters$ = {}));
|
|
40
|
+
export function defaultParametersToJSON(defaultParameters) {
|
|
41
|
+
return JSON.stringify(DefaultParameters$outboundSchema.parse(defaultParameters));
|
|
42
|
+
}
|
|
43
|
+
export function defaultParametersFromJSON(jsonString) {
|
|
44
|
+
return safeParse(jsonString, (x) => DefaultParameters$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DefaultParameters' from JSON`);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=defaultparameters.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Error data for EdgeNetworkTimeoutResponse
|
|
6
|
+
*/
|
|
7
|
+
export type EdgeNetworkTimeoutResponseErrorData = {
|
|
8
|
+
code: number;
|
|
9
|
+
message: string;
|
|
10
|
+
metadata?: {
|
|
11
|
+
[k: string]: any | null;
|
|
12
|
+
} | null | undefined;
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const EdgeNetworkTimeoutResponseErrorData$inboundSchema: z.ZodType<EdgeNetworkTimeoutResponseErrorData, unknown>;
|
|
16
|
+
/** @internal */
|
|
17
|
+
export type EdgeNetworkTimeoutResponseErrorData$Outbound = {
|
|
18
|
+
code: number;
|
|
19
|
+
message: string;
|
|
20
|
+
metadata?: {
|
|
21
|
+
[k: string]: any | null;
|
|
22
|
+
} | null | undefined;
|
|
23
|
+
};
|
|
24
|
+
/** @internal */
|
|
25
|
+
export declare const EdgeNetworkTimeoutResponseErrorData$outboundSchema: z.ZodType<EdgeNetworkTimeoutResponseErrorData$Outbound, EdgeNetworkTimeoutResponseErrorData>;
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
29
|
+
*/
|
|
30
|
+
export declare namespace EdgeNetworkTimeoutResponseErrorData$ {
|
|
31
|
+
/** @deprecated use `EdgeNetworkTimeoutResponseErrorData$inboundSchema` instead. */
|
|
32
|
+
const inboundSchema: z.ZodType<EdgeNetworkTimeoutResponseErrorData, unknown, z.core.$ZodTypeInternals<EdgeNetworkTimeoutResponseErrorData, unknown>>;
|
|
33
|
+
/** @deprecated use `EdgeNetworkTimeoutResponseErrorData$outboundSchema` instead. */
|
|
34
|
+
const outboundSchema: z.ZodType<EdgeNetworkTimeoutResponseErrorData$Outbound, EdgeNetworkTimeoutResponseErrorData, z.core.$ZodTypeInternals<EdgeNetworkTimeoutResponseErrorData$Outbound, EdgeNetworkTimeoutResponseErrorData>>;
|
|
35
|
+
/** @deprecated use `EdgeNetworkTimeoutResponseErrorData$Outbound` instead. */
|
|
36
|
+
type Outbound = EdgeNetworkTimeoutResponseErrorData$Outbound;
|
|
37
|
+
}
|
|
38
|
+
export declare function edgeNetworkTimeoutResponseErrorDataToJSON(edgeNetworkTimeoutResponseErrorData: EdgeNetworkTimeoutResponseErrorData): string;
|
|
39
|
+
export declare function edgeNetworkTimeoutResponseErrorDataFromJSON(jsonString: string): SafeParseResult<EdgeNetworkTimeoutResponseErrorData, SDKValidationError>;
|
|
40
|
+
//# sourceMappingURL=edgenetworktimeoutresponseerrordata.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { safeParse } from "../lib/schemas.js";
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const EdgeNetworkTimeoutResponseErrorData$inboundSchema = z.object({
|
|
8
|
+
code: z.number().int(),
|
|
9
|
+
message: z.string(),
|
|
10
|
+
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
11
|
+
});
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const EdgeNetworkTimeoutResponseErrorData$outboundSchema = z.object({
|
|
14
|
+
code: z.number().int(),
|
|
15
|
+
message: z.string(),
|
|
16
|
+
metadata: z.nullable(z.record(z.string(), z.nullable(z.any()))).optional(),
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
21
|
+
*/
|
|
22
|
+
export var EdgeNetworkTimeoutResponseErrorData$;
|
|
23
|
+
(function (EdgeNetworkTimeoutResponseErrorData$) {
|
|
24
|
+
/** @deprecated use `EdgeNetworkTimeoutResponseErrorData$inboundSchema` instead. */
|
|
25
|
+
EdgeNetworkTimeoutResponseErrorData$.inboundSchema = EdgeNetworkTimeoutResponseErrorData$inboundSchema;
|
|
26
|
+
/** @deprecated use `EdgeNetworkTimeoutResponseErrorData$outboundSchema` instead. */
|
|
27
|
+
EdgeNetworkTimeoutResponseErrorData$.outboundSchema = EdgeNetworkTimeoutResponseErrorData$outboundSchema;
|
|
28
|
+
})(EdgeNetworkTimeoutResponseErrorData$ || (EdgeNetworkTimeoutResponseErrorData$ = {}));
|
|
29
|
+
export function edgeNetworkTimeoutResponseErrorDataToJSON(edgeNetworkTimeoutResponseErrorData) {
|
|
30
|
+
return JSON.stringify(EdgeNetworkTimeoutResponseErrorData$outboundSchema.parse(edgeNetworkTimeoutResponseErrorData));
|
|
31
|
+
}
|
|
32
|
+
export function edgeNetworkTimeoutResponseErrorDataFromJSON(jsonString) {
|
|
33
|
+
return safeParse(jsonString, (x) => EdgeNetworkTimeoutResponseErrorData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EdgeNetworkTimeoutResponseErrorData' from JSON`);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=edgenetworktimeoutresponseerrordata.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import { OpenEnum } from "../types/enums.js";
|
|
3
|
+
export declare const EndpointStatus: {
|
|
4
|
+
readonly Zero: 0;
|
|
5
|
+
readonly Minus1: -1;
|
|
6
|
+
readonly Minus2: -2;
|
|
7
|
+
readonly Minus3: -3;
|
|
8
|
+
readonly Minus5: -5;
|
|
9
|
+
readonly Minus10: -10;
|
|
10
|
+
};
|
|
11
|
+
export type EndpointStatus = OpenEnum<typeof EndpointStatus>;
|
|
12
|
+
/** @internal */
|
|
13
|
+
export declare const EndpointStatus$inboundSchema: z.ZodType<EndpointStatus, unknown>;
|
|
14
|
+
/** @internal */
|
|
15
|
+
export declare const EndpointStatus$outboundSchema: z.ZodType<EndpointStatus, EndpointStatus>;
|
|
16
|
+
/**
|
|
17
|
+
* @internal
|
|
18
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
19
|
+
*/
|
|
20
|
+
export declare namespace EndpointStatus$ {
|
|
21
|
+
/** @deprecated use `EndpointStatus$inboundSchema` instead. */
|
|
22
|
+
const inboundSchema: z.ZodType<EndpointStatus, unknown, z.core.$ZodTypeInternals<EndpointStatus, unknown>>;
|
|
23
|
+
/** @deprecated use `EndpointStatus$outboundSchema` instead. */
|
|
24
|
+
const outboundSchema: z.ZodType<EndpointStatus, EndpointStatus, z.core.$ZodTypeInternals<EndpointStatus, EndpointStatus>>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=endpointstatus.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { catchUnrecognizedEnum, } from "../types/enums.js";
|
|
6
|
+
export const EndpointStatus = {
|
|
7
|
+
Zero: 0,
|
|
8
|
+
Minus1: -1,
|
|
9
|
+
Minus2: -2,
|
|
10
|
+
Minus3: -3,
|
|
11
|
+
Minus5: -5,
|
|
12
|
+
Minus10: -10,
|
|
13
|
+
};
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const EndpointStatus$inboundSchema = z
|
|
16
|
+
.union([
|
|
17
|
+
z.enum(EndpointStatus),
|
|
18
|
+
z.number().transform(catchUnrecognizedEnum),
|
|
19
|
+
]);
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const EndpointStatus$outboundSchema = z.union([
|
|
22
|
+
z.enum(EndpointStatus),
|
|
23
|
+
z.number().and(z.custom()),
|
|
24
|
+
]);
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
28
|
+
*/
|
|
29
|
+
export var EndpointStatus$;
|
|
30
|
+
(function (EndpointStatus$) {
|
|
31
|
+
/** @deprecated use `EndpointStatus$inboundSchema` instead. */
|
|
32
|
+
EndpointStatus$.inboundSchema = EndpointStatus$inboundSchema;
|
|
33
|
+
/** @deprecated use `EndpointStatus$outboundSchema` instead. */
|
|
34
|
+
EndpointStatus$.outboundSchema = EndpointStatus$outboundSchema;
|
|
35
|
+
})(EndpointStatus$ || (EndpointStatus$ = {}));
|
|
36
|
+
//# sourceMappingURL=endpointstatus.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as z from "zod/v4";
|
|
2
|
+
import * as models from "../index.js";
|
|
3
|
+
import { OpenRouterError } from "./openroutererror.js";
|
|
4
|
+
/**
|
|
5
|
+
* Bad Gateway - Provider/upstream API failure
|
|
6
|
+
*/
|
|
7
|
+
export type BadGatewayResponseErrorData = {
|
|
8
|
+
/**
|
|
9
|
+
* Error data for BadGatewayResponse
|
|
10
|
+
*/
|
|
11
|
+
error: models.BadGatewayResponseErrorData;
|
|
12
|
+
userId?: string | null | undefined;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Bad Gateway - Provider/upstream API failure
|
|
16
|
+
*/
|
|
17
|
+
export declare class BadGatewayResponseError extends OpenRouterError {
|
|
18
|
+
/**
|
|
19
|
+
* Error data for BadGatewayResponse
|
|
20
|
+
*/
|
|
21
|
+
error: models.BadGatewayResponseErrorData;
|
|
22
|
+
userId?: string | null | undefined;
|
|
23
|
+
/** The original data that was passed to this error instance. */
|
|
24
|
+
data$: BadGatewayResponseErrorData;
|
|
25
|
+
constructor(err: BadGatewayResponseErrorData, httpMeta: {
|
|
26
|
+
response: Response;
|
|
27
|
+
request: Request;
|
|
28
|
+
body: string;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/** @internal */
|
|
32
|
+
export declare const BadGatewayResponseError$inboundSchema: z.ZodType<BadGatewayResponseError, unknown>;
|
|
33
|
+
/** @internal */
|
|
34
|
+
export type BadGatewayResponseError$Outbound = {
|
|
35
|
+
error: models.BadGatewayResponseErrorData$Outbound;
|
|
36
|
+
user_id?: string | null | undefined;
|
|
37
|
+
};
|
|
38
|
+
/** @internal */
|
|
39
|
+
export declare const BadGatewayResponseError$outboundSchema: z.ZodType<BadGatewayResponseError$Outbound, BadGatewayResponseError>;
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
43
|
+
*/
|
|
44
|
+
export declare namespace BadGatewayResponseError$ {
|
|
45
|
+
/** @deprecated use `BadGatewayResponseError$inboundSchema` instead. */
|
|
46
|
+
const inboundSchema: z.ZodType<BadGatewayResponseError, unknown, z.core.$ZodTypeInternals<BadGatewayResponseError, unknown>>;
|
|
47
|
+
/** @deprecated use `BadGatewayResponseError$outboundSchema` instead. */
|
|
48
|
+
const outboundSchema: z.ZodType<BadGatewayResponseError$Outbound, BadGatewayResponseError, z.core.$ZodTypeInternals<BadGatewayResponseError$Outbound, BadGatewayResponseError>>;
|
|
49
|
+
/** @deprecated use `BadGatewayResponseError$Outbound` instead. */
|
|
50
|
+
type Outbound = BadGatewayResponseError$Outbound;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=badgatewayresponseerror.d.ts.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod/v4";
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
+
import * as models from "../index.js";
|
|
7
|
+
import { OpenRouterError } from "./openroutererror.js";
|
|
8
|
+
/**
|
|
9
|
+
* Bad Gateway - Provider/upstream API failure
|
|
10
|
+
*/
|
|
11
|
+
export class BadGatewayResponseError extends OpenRouterError {
|
|
12
|
+
constructor(err, httpMeta) {
|
|
13
|
+
const message = err.error?.message
|
|
14
|
+
|| `API error occurred: ${JSON.stringify(err)}`;
|
|
15
|
+
super(message, httpMeta);
|
|
16
|
+
this.data$ = err;
|
|
17
|
+
this.error = err.error;
|
|
18
|
+
if (err.userId != null)
|
|
19
|
+
this.userId = err.userId;
|
|
20
|
+
this.name = "BadGatewayResponseError";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const BadGatewayResponseError$inboundSchema = z.object({
|
|
25
|
+
error: models.BadGatewayResponseErrorData$inboundSchema,
|
|
26
|
+
user_id: z.nullable(z.string()).optional(),
|
|
27
|
+
request$: z.custom(x => x instanceof Request),
|
|
28
|
+
response$: z.custom(x => x instanceof Response),
|
|
29
|
+
body$: z.string(),
|
|
30
|
+
})
|
|
31
|
+
.transform((v) => {
|
|
32
|
+
const remapped = remap$(v, {
|
|
33
|
+
"user_id": "userId",
|
|
34
|
+
});
|
|
35
|
+
return new BadGatewayResponseError(remapped, {
|
|
36
|
+
request: v.request$,
|
|
37
|
+
response: v.response$,
|
|
38
|
+
body: v.body$,
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
/** @internal */
|
|
42
|
+
export const BadGatewayResponseError$outboundSchema = z.custom(x => x instanceof BadGatewayResponseError)
|
|
43
|
+
.transform(v => v.data$)
|
|
44
|
+
.pipe(z.object({
|
|
45
|
+
error: models.BadGatewayResponseErrorData$outboundSchema,
|
|
46
|
+
userId: z.nullable(z.string()).optional(),
|
|
47
|
+
}).transform((v) => {
|
|
48
|
+
return remap$(v, {
|
|
49
|
+
userId: "user_id",
|
|
50
|
+
});
|
|
51
|
+
}));
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
55
|
+
*/
|
|
56
|
+
export var BadGatewayResponseError$;
|
|
57
|
+
(function (BadGatewayResponseError$) {
|
|
58
|
+
/** @deprecated use `BadGatewayResponseError$inboundSchema` instead. */
|
|
59
|
+
BadGatewayResponseError$.inboundSchema = BadGatewayResponseError$inboundSchema;
|
|
60
|
+
/** @deprecated use `BadGatewayResponseError$outboundSchema` instead. */
|
|
61
|
+
BadGatewayResponseError$.outboundSchema = BadGatewayResponseError$outboundSchema;
|
|
62
|
+
})(BadGatewayResponseError$ || (BadGatewayResponseError$ = {}));
|
|
63
|
+
//# sourceMappingURL=badgatewayresponseerror.js.map
|