@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.
Files changed (227) hide show
  1. package/FUNCTIONS.md +109 -1
  2. package/REACT_QUERY.md +109 -1
  3. package/README.md +686 -15
  4. package/esm/funcs/analyticsGetUserActivity.d.ts +1 -1
  5. package/esm/funcs/analyticsGetUserActivity.js +2 -2
  6. package/esm/funcs/apiKeysCreate.d.ts +1 -1
  7. package/esm/funcs/apiKeysCreate.js +2 -2
  8. package/esm/funcs/apiKeysDelete.d.ts +1 -1
  9. package/esm/funcs/apiKeysDelete.js +2 -2
  10. package/esm/funcs/apiKeysGet.d.ts +1 -1
  11. package/esm/funcs/apiKeysGet.js +2 -2
  12. package/esm/funcs/apiKeysGetCurrentKeyMetadata.d.ts +1 -1
  13. package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +2 -2
  14. package/esm/funcs/apiKeysList.d.ts +1 -1
  15. package/esm/funcs/apiKeysList.js +2 -2
  16. package/esm/funcs/apiKeysUpdate.d.ts +1 -1
  17. package/esm/funcs/apiKeysUpdate.js +2 -2
  18. package/esm/funcs/betaResponsesSend.d.ts +9 -1
  19. package/esm/funcs/betaResponsesSend.js +38 -14
  20. package/esm/funcs/chatSend.d.ts +1 -1
  21. package/esm/funcs/creditsCreateCoinbaseCharge.d.ts +1 -1
  22. package/esm/funcs/creditsCreateCoinbaseCharge.js +15 -5
  23. package/esm/funcs/creditsGetCredits.d.ts +1 -1
  24. package/esm/funcs/creditsGetCredits.js +2 -2
  25. package/esm/funcs/endpointsList.d.ts +1 -1
  26. package/esm/funcs/endpointsList.js +2 -2
  27. package/esm/funcs/endpointsListZdrEndpoints.d.ts +2 -1
  28. package/esm/funcs/endpointsListZdrEndpoints.js +6 -2
  29. package/esm/funcs/generationsGetGeneration.d.ts +1 -1
  30. package/esm/funcs/generationsGetGeneration.js +13 -2
  31. package/esm/funcs/modelsCount.d.ts +3 -2
  32. package/esm/funcs/modelsCount.js +7 -3
  33. package/esm/funcs/modelsList.d.ts +3 -1
  34. package/esm/funcs/modelsList.js +8 -7
  35. package/esm/funcs/modelsListForUser.d.ts +3 -1
  36. package/esm/funcs/modelsListForUser.js +7 -3
  37. package/esm/funcs/oAuthCreateAuthCode.d.ts +18 -0
  38. package/esm/funcs/oAuthCreateAuthCode.js +82 -0
  39. package/esm/funcs/oAuthCreateAuthorizationUrl.d.ts +2 -2
  40. package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.d.ts +18 -0
  41. package/esm/funcs/oAuthExchangeAuthCodeForAPIKey.js +82 -0
  42. package/esm/funcs/parametersGetParameters.d.ts +1 -1
  43. package/esm/funcs/parametersGetParameters.js +2 -2
  44. package/esm/funcs/providersList.d.ts +1 -1
  45. package/esm/funcs/providersList.js +1 -1
  46. package/esm/lib/config.d.ts +2 -2
  47. package/esm/lib/config.js +2 -2
  48. package/esm/lib/event-streams.d.ts +1 -1
  49. package/esm/models/badgatewayresponseerrordata.d.ts +40 -0
  50. package/esm/models/badgatewayresponseerrordata.js +35 -0
  51. package/esm/models/badrequestresponseerrordata.d.ts +40 -0
  52. package/esm/models/badrequestresponseerrordata.js +35 -0
  53. package/esm/models/chatmessagecontentitemaudio.d.ts +10 -10
  54. package/esm/models/chatmessagecontentitemaudio.js +14 -14
  55. package/esm/models/chatstreamingresponsechunk.d.ts +15 -15
  56. package/esm/models/chatstreamingresponsechunk.js +15 -15
  57. package/esm/models/createchargerequest.d.ts +31 -2
  58. package/esm/models/createchargerequest.js +47 -2
  59. package/esm/models/defaultparameters.d.ts +36 -0
  60. package/esm/models/defaultparameters.js +46 -0
  61. package/esm/models/edgenetworktimeoutresponseerrordata.d.ts +40 -0
  62. package/esm/models/edgenetworktimeoutresponseerrordata.js +35 -0
  63. package/esm/models/endpointstatus.d.ts +26 -0
  64. package/esm/models/endpointstatus.js +36 -0
  65. package/esm/models/errors/badgatewayresponseerror.d.ts +52 -0
  66. package/esm/models/errors/badgatewayresponseerror.js +63 -0
  67. package/esm/models/errors/badrequestresponseerror.d.ts +52 -0
  68. package/esm/models/errors/badrequestresponseerror.js +63 -0
  69. package/esm/models/errors/edgenetworktimeoutresponseerror.d.ts +52 -0
  70. package/esm/models/errors/edgenetworktimeoutresponseerror.js +63 -0
  71. package/esm/models/errors/forbiddenresponseerror.d.ts +52 -0
  72. package/esm/models/errors/forbiddenresponseerror.js +63 -0
  73. package/esm/models/errors/index.d.ts +14 -2
  74. package/esm/models/errors/index.js +14 -2
  75. package/esm/models/errors/internalserverresponseerror.d.ts +52 -0
  76. package/esm/models/errors/internalserverresponseerror.js +63 -0
  77. package/esm/models/errors/notfoundresponseerror.d.ts +52 -0
  78. package/esm/models/errors/{errorresponse.js → notfoundresponseerror.js} +16 -17
  79. package/esm/models/errors/payloadtoolargeresponseerror.d.ts +52 -0
  80. package/esm/models/errors/payloadtoolargeresponseerror.js +63 -0
  81. package/esm/models/errors/paymentrequiredresponseerror.d.ts +52 -0
  82. package/esm/models/errors/paymentrequiredresponseerror.js +63 -0
  83. package/esm/models/errors/provideroverloadedresponseerror.d.ts +52 -0
  84. package/esm/models/errors/provideroverloadedresponseerror.js +63 -0
  85. package/esm/models/errors/requesttimeoutresponseerror.d.ts +52 -0
  86. package/esm/models/errors/requesttimeoutresponseerror.js +63 -0
  87. package/esm/models/errors/serviceunavailableresponseerror.d.ts +52 -0
  88. package/esm/models/errors/serviceunavailableresponseerror.js +63 -0
  89. package/esm/models/errors/toomanyrequestsresponseerror.d.ts +52 -0
  90. package/esm/models/errors/toomanyrequestsresponseerror.js +63 -0
  91. package/esm/models/errors/unauthorizedresponseerror.d.ts +52 -0
  92. package/esm/models/errors/unauthorizedresponseerror.js +63 -0
  93. package/esm/models/errors/unprocessableentityresponseerror.d.ts +52 -0
  94. package/esm/models/errors/unprocessableentityresponseerror.js +63 -0
  95. package/esm/models/forbiddenresponseerrordata.d.ts +40 -0
  96. package/esm/models/forbiddenresponseerrordata.js +35 -0
  97. package/esm/models/index.d.ts +37 -1
  98. package/esm/models/index.js +37 -1
  99. package/esm/models/inputmodality.d.ts +24 -0
  100. package/esm/models/inputmodality.js +34 -0
  101. package/esm/models/instructtype.d.ts +48 -0
  102. package/esm/models/instructtype.js +55 -0
  103. package/esm/models/internalserverresponseerrordata.d.ts +40 -0
  104. package/esm/models/internalserverresponseerrordata.js +35 -0
  105. package/esm/models/listendpointsresponse.d.ts +126 -2
  106. package/esm/models/listendpointsresponse.js +115 -2
  107. package/esm/models/model.d.ts +101 -0
  108. package/esm/models/model.js +82 -0
  109. package/esm/models/modelarchitecture.d.ts +104 -0
  110. package/esm/models/modelarchitecture.js +107 -0
  111. package/esm/models/modelgroup.d.ts +45 -0
  112. package/esm/models/modelgroup.js +53 -0
  113. package/esm/models/modelscountresponse.d.ts +40 -2
  114. package/esm/models/modelscountresponse.js +31 -2
  115. package/esm/models/modelslistresponse.d.ts +10 -2
  116. package/esm/models/modelslistresponse.js +7 -2
  117. package/esm/models/notfoundresponseerrordata.d.ts +40 -0
  118. package/esm/models/notfoundresponseerrordata.js +35 -0
  119. package/esm/models/openairesponsesincludable.d.ts +25 -0
  120. package/esm/models/openairesponsesincludable.js +35 -0
  121. package/esm/models/openairesponsesinputunion.d.ts +78 -78
  122. package/esm/models/openairesponsesinputunion.js +124 -126
  123. package/esm/models/openresponseseasyinputmessage.d.ts +246 -0
  124. package/esm/models/openresponseseasyinputmessage.js +283 -0
  125. package/esm/models/openresponsesfunctioncalloutput.d.ts +64 -0
  126. package/esm/models/openresponsesfunctioncalloutput.js +67 -0
  127. package/esm/models/openresponsesfunctiontoolcall.d.ts +66 -0
  128. package/esm/models/openresponsesfunctiontoolcall.js +69 -0
  129. package/esm/models/openresponsesinput.d.ts +60 -0
  130. package/esm/models/openresponsesinput.js +113 -0
  131. package/esm/models/openresponsesinputmessageitem.d.ts +193 -0
  132. package/esm/models/openresponsesinputmessageitem.js +210 -0
  133. package/esm/models/openresponsesnonstreamingresponse.d.ts +13 -13
  134. package/esm/models/openresponsesnonstreamingresponse.js +13 -13
  135. package/esm/models/openresponsesreasoning.d.ts +179 -0
  136. package/esm/models/openresponsesreasoning.js +194 -0
  137. package/esm/models/openresponsesreasoningconfig.d.ts +40 -0
  138. package/esm/models/openresponsesreasoningconfig.js +48 -0
  139. package/esm/models/openresponsesrequest.d.ts +736 -2
  140. package/esm/models/openresponsesrequest.js +789 -2
  141. package/esm/models/openresponsesresponsetext.d.ts +59 -0
  142. package/esm/models/openresponsesresponsetext.js +64 -0
  143. package/esm/models/operations/createauthkeyscode.d.ts +145 -0
  144. package/esm/models/operations/createauthkeyscode.js +146 -0
  145. package/esm/models/operations/createresponses.d.ts +58 -0
  146. package/esm/models/operations/createresponses.js +80 -0
  147. package/esm/models/operations/exchangeauthcodeforapikey.d.ts +104 -0
  148. package/esm/models/operations/exchangeauthcodeforapikey.js +111 -0
  149. package/esm/models/operations/getmodels.d.ts +0 -26
  150. package/esm/models/operations/getmodels.js +0 -38
  151. package/esm/models/operations/index.d.ts +3 -2
  152. package/esm/models/operations/index.js +3 -2
  153. package/esm/models/operations/listendpointszdr.d.ts +3 -24
  154. package/esm/models/operations/listendpointszdr.js +2 -29
  155. package/esm/models/operations/listmodelsuser.d.ts +0 -22
  156. package/esm/models/operations/listmodelsuser.js +0 -28
  157. package/esm/models/operations/listproviders.d.ts +0 -36
  158. package/esm/models/operations/listproviders.js +0 -28
  159. package/esm/models/operations/sendchatcompletionrequest.d.ts +1 -1
  160. package/esm/models/operations/sendchatcompletionrequest.js +2 -1
  161. package/esm/models/outputmodality.d.ts +23 -0
  162. package/esm/models/outputmodality.js +33 -0
  163. package/esm/models/parameter.d.ts +43 -0
  164. package/esm/models/parameter.js +54 -0
  165. package/esm/models/payloadtoolargeresponseerrordata.d.ts +40 -0
  166. package/esm/models/payloadtoolargeresponseerrordata.js +35 -0
  167. package/esm/models/paymentrequiredresponseerrordata.d.ts +40 -0
  168. package/esm/models/paymentrequiredresponseerrordata.js +35 -0
  169. package/esm/models/perrequestlimits.d.ts +40 -0
  170. package/esm/models/perrequestlimits.js +44 -0
  171. package/esm/models/providername.d.ts +106 -0
  172. package/esm/models/providername.js +116 -0
  173. package/esm/models/provideroverloadedresponseerrordata.d.ts +40 -0
  174. package/esm/models/provideroverloadedresponseerrordata.js +35 -0
  175. package/esm/models/publicendpoint.d.ts +140 -2
  176. package/esm/models/publicendpoint.js +156 -2
  177. package/esm/models/publicpricing.d.ts +87 -0
  178. package/esm/models/publicpricing.js +73 -0
  179. package/esm/models/quantization.d.ts +29 -0
  180. package/esm/models/quantization.js +39 -0
  181. package/esm/models/requesttimeoutresponseerrordata.d.ts +40 -0
  182. package/esm/models/requesttimeoutresponseerrordata.js +35 -0
  183. package/esm/models/responseserrorfield.d.ts +10 -10
  184. package/esm/models/responseserrorfield.js +14 -14
  185. package/esm/models/responsetextconfig.d.ts +10 -10
  186. package/esm/models/responsetextconfig.js +14 -15
  187. package/esm/models/serviceunavailableresponseerrordata.d.ts +40 -0
  188. package/esm/models/serviceunavailableresponseerrordata.js +35 -0
  189. package/esm/models/toomanyrequestsresponseerrordata.d.ts +40 -0
  190. package/esm/models/toomanyrequestsresponseerrordata.js +35 -0
  191. package/esm/models/topproviderinfo.d.ts +45 -0
  192. package/esm/models/topproviderinfo.js +48 -0
  193. package/esm/models/unauthorizedresponseerrordata.d.ts +40 -0
  194. package/esm/models/unauthorizedresponseerrordata.js +35 -0
  195. package/esm/models/unprocessableentityresponseerrordata.d.ts +40 -0
  196. package/esm/models/unprocessableentityresponseerrordata.js +35 -0
  197. package/esm/react-query/betaResponsesSend.d.ts +1 -1
  198. package/esm/react-query/index.d.ts +2 -0
  199. package/esm/react-query/index.js +2 -0
  200. package/esm/react-query/modelsCount.d.ts +2 -2
  201. package/esm/react-query/modelsList.d.ts +2 -7
  202. package/esm/react-query/modelsList.js +0 -2
  203. package/esm/react-query/modelsListForUser.d.ts +2 -1
  204. package/esm/react-query/oAuthCreateAuthCode.d.ts +23 -0
  205. package/esm/react-query/oAuthCreateAuthCode.js +42 -0
  206. package/esm/react-query/oAuthExchangeAuthCodeForAPIKey.d.ts +23 -0
  207. package/esm/react-query/oAuthExchangeAuthCodeForAPIKey.js +42 -0
  208. package/esm/sdk/chat.d.ts +1 -1
  209. package/esm/sdk/models.d.ts +4 -3
  210. package/esm/sdk/oauth.d.ts +46 -0
  211. package/esm/sdk/oauth.js +67 -0
  212. package/esm/sdk/responses.d.ts +8 -1
  213. package/esm/sdk/responses.js +0 -6
  214. package/esm/sdk/sdk.d.ts +3 -0
  215. package/esm/sdk/sdk.js +4 -0
  216. package/jsr.json +1 -1
  217. package/package.json +3 -1
  218. package/vitest.config.ts +8 -1
  219. package/esm/models/errorresponse.d.ts +0 -155
  220. package/esm/models/errorresponse.js +0 -167
  221. package/esm/models/errors/errorresponse.d.ts +0 -46
  222. package/esm/models/errors/listproviders.d.ts +0 -49
  223. package/esm/models/errors/listproviders.js +0 -51
  224. package/esm/models/operations/createapialpharesponses.d.ts +0 -58
  225. package/esm/models/operations/createapialpharesponses.js +0 -83
  226. package/esm/models/operations/listmodelscount.d.ts +0 -26
  227. 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 Format = {
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 Format$inboundSchema = z
18
+ export const ChatMessageContentItemAudioFormat$inboundSchema = z
19
19
  .union([
20
- z.enum(Format),
20
+ z.enum(ChatMessageContentItemAudioFormat),
21
21
  z.string().transform(catchUnrecognizedEnum),
22
22
  ]);
23
23
  /** @internal */
24
- export const Format$outboundSchema = z.union([
25
- z.enum(Format),
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 Format$;
33
- (function (Format$) {
34
- /** @deprecated use `Format$inboundSchema` instead. */
35
- Format$.inboundSchema = Format$inboundSchema;
36
- /** @deprecated use `Format$outboundSchema` instead. */
37
- Format$.outboundSchema = Format$outboundSchema;
38
- })(Format$ || (Format$ = {}));
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: Format$inboundSchema,
43
+ format: ChatMessageContentItemAudioFormat$inboundSchema,
44
44
  });
45
45
  /** @internal */
46
46
  export const InputAudio$outboundSchema = z.object({
47
47
  data: z.string(),
48
- format: Format$outboundSchema,
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 Data = {
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: 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 Data$inboundSchema: z.ZodType<Data, unknown>;
47
+ export declare const ChatStreamingResponseChunkData$inboundSchema: z.ZodType<ChatStreamingResponseChunkData, unknown>;
48
48
  /** @internal */
49
- export type Data$Outbound = {
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 Data$outboundSchema: z.ZodType<Data$Outbound, Data>;
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 Data$ {
66
- /** @deprecated use `Data$inboundSchema` instead. */
67
- const inboundSchema: z.ZodType<Data, unknown, z.core.$ZodTypeInternals<Data, unknown>>;
68
- /** @deprecated use `Data$outboundSchema` instead. */
69
- const outboundSchema: z.ZodType<Data$Outbound, Data, z.core.$ZodTypeInternals<Data$Outbound, Data>>;
70
- /** @deprecated use `Data$Outbound` instead. */
71
- type Outbound = Data$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 dataToJSON(data: Data): string;
74
- export declare function dataFromJSON(jsonString: string): SafeParseResult<Data, SDKValidationError>;
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: Data$Outbound;
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 Data$inboundSchema = z.object({
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 Data$outboundSchema = z.object({
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 Data$;
72
- (function (Data$) {
73
- /** @deprecated use `Data$inboundSchema` instead. */
74
- Data$.inboundSchema = Data$inboundSchema;
75
- /** @deprecated use `Data$outboundSchema` instead. */
76
- Data$.outboundSchema = Data$outboundSchema;
77
- })(Data$ || (Data$ = {}));
78
- export function dataToJSON(data) {
79
- return JSON.stringify(Data$outboundSchema.parse(data));
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 dataFromJSON(jsonString) {
82
- return safeParse(jsonString, (x) => Data$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Data' from JSON`);
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(() => Data$inboundSchema)),
97
+ }).pipe(z.lazy(() => ChatStreamingResponseChunkData$inboundSchema)),
98
98
  });
99
99
  /** @internal */
100
100
  export const ChatStreamingResponseChunk$outboundSchema = z.object({
101
- data: z.lazy(() => Data$outboundSchema),
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 CreateChargeRequest$inboundSchema = z.object({});
14
+ export const ChainId$inboundSchema = z
15
+ .union([
16
+ z.enum(ChainId),
17
+ z.number().transform(catchUnrecognizedEnum),
18
+ ]);
8
19
  /** @internal */
9
- export const CreateChargeRequest$outboundSchema = z.object({});
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