@openrouter/sdk 0.0.0-beta.32 → 0.0.0-beta.33
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 +2 -0
- package/REACT_QUERY.md +2 -0
- package/README.md +12 -0
- package/dist/commonjs/funcs/endpointsList.d.ts +1 -1
- package/dist/commonjs/funcs/endpointsList.d.ts.map +1 -1
- package/dist/commonjs/funcs/endpointsList.js +1 -1
- package/dist/commonjs/funcs/endpointsList.js.map +1 -1
- package/dist/commonjs/funcs/modelsList.d.ts +1 -1
- package/dist/commonjs/funcs/modelsList.d.ts.map +1 -1
- package/dist/commonjs/funcs/modelsList.js +1 -1
- package/dist/commonjs/funcs/modelsList.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/endpointslist.d.ts +768 -0
- package/dist/commonjs/models/endpointslist.d.ts.map +1 -0
- package/dist/commonjs/models/endpointslist.js +625 -0
- package/dist/commonjs/models/endpointslist.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +3 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +3 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/keyinfo.d.ts +155 -0
- package/dist/commonjs/models/keyinfo.d.ts.map +1 -0
- package/dist/commonjs/models/keyinfo.js +163 -0
- package/dist/commonjs/models/keyinfo.js.map +1 -0
- package/dist/commonjs/models/modelslist.d.ts +854 -0
- package/dist/commonjs/models/modelslist.d.ts.map +1 -0
- package/dist/commonjs/models/modelslist.js +768 -0
- package/dist/commonjs/models/modelslist.js.map +1 -0
- package/dist/commonjs/models/openairesponsesrequest.d.ts +52 -52
- package/dist/commonjs/models/openairesponsesrequest.d.ts.map +1 -1
- package/dist/commonjs/models/openairesponsesrequest.js +74 -76
- package/dist/commonjs/models/openairesponsesrequest.js.map +1 -1
- package/dist/commonjs/models/operations/getcurrentkey.d.ts +3 -108
- package/dist/commonjs/models/operations/getcurrentkey.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getcurrentkey.js +4 -88
- package/dist/commonjs/models/operations/getcurrentkey.js.map +1 -1
- package/dist/commonjs/models/operations/list.d.ts +63 -825
- package/dist/commonjs/models/operations/list.d.ts.map +1 -1
- package/dist/commonjs/models/operations/list.js +86 -667
- package/dist/commonjs/models/operations/list.js.map +1 -1
- package/dist/commonjs/models/operations/listmodels.d.ts +16 -865
- package/dist/commonjs/models/operations/listmodels.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listmodels.js +19 -742
- package/dist/commonjs/models/operations/listmodels.js.map +1 -1
- package/dist/commonjs/models/operations/listusermodels.d.ts +3 -852
- package/dist/commonjs/models/operations/listusermodels.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listusermodels.js +4 -730
- package/dist/commonjs/models/operations/listusermodels.js.map +1 -1
- package/dist/commonjs/models/operations/previewzdr.d.ts +97 -97
- package/dist/commonjs/models/operations/previewzdr.d.ts.map +1 -1
- package/dist/commonjs/models/operations/previewzdr.js +134 -133
- package/dist/commonjs/models/operations/previewzdr.js.map +1 -1
- package/dist/commonjs/models/responsereasoningconfig.d.ts +4 -0
- package/dist/commonjs/models/responsereasoningconfig.d.ts.map +1 -1
- package/dist/commonjs/models/responsereasoningconfig.js +13 -0
- package/dist/commonjs/models/responsereasoningconfig.js.map +1 -1
- package/dist/commonjs/models/responsesusage.d.ts +41 -0
- package/dist/commonjs/models/responsesusage.d.ts.map +1 -1
- package/dist/commonjs/models/responsesusage.js +54 -1
- package/dist/commonjs/models/responsesusage.js.map +1 -1
- package/dist/commonjs/react-query/endpointsList.d.ts +4 -4
- package/dist/commonjs/react-query/endpointsList.d.ts.map +1 -1
- package/dist/commonjs/react-query/endpointsList.js.map +1 -1
- package/dist/commonjs/react-query/modelsList.d.ts +4 -4
- package/dist/commonjs/react-query/modelsList.d.ts.map +1 -1
- package/dist/commonjs/react-query/modelsList.js.map +1 -1
- package/dist/commonjs/sdk/endpoints.d.ts +1 -1
- package/dist/commonjs/sdk/endpoints.d.ts.map +1 -1
- package/dist/commonjs/sdk/endpoints.js.map +1 -1
- package/dist/commonjs/sdk/models.d.ts +1 -1
- package/dist/commonjs/sdk/models.d.ts.map +1 -1
- package/dist/commonjs/sdk/models.js.map +1 -1
- package/dist/esm/funcs/endpointsList.d.ts +1 -1
- package/dist/esm/funcs/endpointsList.d.ts.map +1 -1
- package/dist/esm/funcs/endpointsList.js +1 -1
- package/dist/esm/funcs/endpointsList.js.map +1 -1
- package/dist/esm/funcs/modelsList.d.ts +1 -1
- package/dist/esm/funcs/modelsList.d.ts.map +1 -1
- package/dist/esm/funcs/modelsList.js +1 -1
- package/dist/esm/funcs/modelsList.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/endpointslist.d.ts +768 -0
- package/dist/esm/models/endpointslist.d.ts.map +1 -0
- package/dist/esm/models/endpointslist.js +562 -0
- package/dist/esm/models/endpointslist.js.map +1 -0
- package/dist/esm/models/index.d.ts +3 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +3 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/keyinfo.d.ts +155 -0
- package/dist/esm/models/keyinfo.d.ts.map +1 -0
- package/dist/esm/models/keyinfo.js +123 -0
- package/dist/esm/models/keyinfo.js.map +1 -0
- package/dist/esm/models/modelslist.d.ts +854 -0
- package/dist/esm/models/modelslist.d.ts.map +1 -0
- package/dist/esm/models/modelslist.js +697 -0
- package/dist/esm/models/modelslist.js.map +1 -0
- package/dist/esm/models/openairesponsesrequest.d.ts +52 -52
- package/dist/esm/models/openairesponsesrequest.d.ts.map +1 -1
- package/dist/esm/models/openairesponsesrequest.js +64 -66
- package/dist/esm/models/openairesponsesrequest.js.map +1 -1
- package/dist/esm/models/operations/getcurrentkey.d.ts +3 -108
- package/dist/esm/models/operations/getcurrentkey.d.ts.map +1 -1
- package/dist/esm/models/operations/getcurrentkey.js +3 -83
- package/dist/esm/models/operations/getcurrentkey.js.map +1 -1
- package/dist/esm/models/operations/list.d.ts +63 -825
- package/dist/esm/models/operations/list.d.ts.map +1 -1
- package/dist/esm/models/operations/list.js +81 -635
- package/dist/esm/models/operations/list.js.map +1 -1
- package/dist/esm/models/operations/listmodels.d.ts +16 -865
- package/dist/esm/models/operations/listmodels.d.ts.map +1 -1
- package/dist/esm/models/operations/listmodels.js +16 -704
- package/dist/esm/models/operations/listmodels.js.map +1 -1
- package/dist/esm/models/operations/listusermodels.d.ts +3 -852
- package/dist/esm/models/operations/listusermodels.d.ts.map +1 -1
- package/dist/esm/models/operations/listusermodels.js +3 -694
- package/dist/esm/models/operations/listusermodels.js.map +1 -1
- package/dist/esm/models/operations/previewzdr.d.ts +97 -97
- package/dist/esm/models/operations/previewzdr.d.ts.map +1 -1
- package/dist/esm/models/operations/previewzdr.js +118 -117
- package/dist/esm/models/operations/previewzdr.js.map +1 -1
- package/dist/esm/models/responsereasoningconfig.d.ts +4 -0
- package/dist/esm/models/responsereasoningconfig.d.ts.map +1 -1
- package/dist/esm/models/responsereasoningconfig.js +13 -0
- package/dist/esm/models/responsereasoningconfig.js.map +1 -1
- package/dist/esm/models/responsesusage.d.ts +41 -0
- package/dist/esm/models/responsesusage.d.ts.map +1 -1
- package/dist/esm/models/responsesusage.js +51 -0
- package/dist/esm/models/responsesusage.js.map +1 -1
- package/dist/esm/react-query/endpointsList.d.ts +4 -4
- package/dist/esm/react-query/endpointsList.d.ts.map +1 -1
- package/dist/esm/react-query/endpointsList.js.map +1 -1
- package/dist/esm/react-query/modelsList.d.ts +4 -4
- package/dist/esm/react-query/modelsList.d.ts.map +1 -1
- package/dist/esm/react-query/modelsList.js.map +1 -1
- package/dist/esm/sdk/endpoints.d.ts +1 -1
- package/dist/esm/sdk/endpoints.d.ts.map +1 -1
- package/dist/esm/sdk/endpoints.js.map +1 -1
- package/dist/esm/sdk/models.d.ts +1 -1
- package/dist/esm/sdk/models.d.ts.map +1 -1
- package/dist/esm/sdk/models.js.map +1 -1
- package/docs/sdks/endpoints/README.md +1 -1
- package/docs/sdks/models/README.md +1 -1
- package/docs/sdks/responses/README.md +4 -0
- package/examples/betaResponsesSendRequest.example.ts +2 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/endpointsList.ts +3 -3
- package/src/funcs/modelsList.ts +3 -5
- package/src/lib/config.ts +2 -2
- package/src/models/endpointslist.ts +1034 -0
- package/src/models/index.ts +3 -0
- package/src/models/keyinfo.ts +281 -0
- package/src/models/modelslist.ts +1394 -0
- package/src/models/openairesponsesrequest.ts +133 -94
- package/src/models/operations/getcurrentkey.ts +5 -203
- package/src/models/operations/list.ts +109 -1106
- package/src/models/operations/listmodels.ts +26 -1436
- package/src/models/operations/listusermodels.ts +5 -1440
- package/src/models/operations/previewzdr.ts +196 -225
- package/src/models/responsereasoningconfig.ts +17 -0
- package/src/models/responsesusage.ts +96 -0
- package/src/react-query/endpointsList.ts +4 -4
- package/src/react-query/modelsList.ts +4 -4
- package/src/sdk/endpoints.ts +1 -1
- package/src/sdk/models.ts +1 -1
package/src/models/index.ts
CHANGED
|
@@ -27,8 +27,11 @@ export * from "./completionfinishreason.js";
|
|
|
27
27
|
export * from "./completionlogprobs.js";
|
|
28
28
|
export * from "./completionresponse.js";
|
|
29
29
|
export * from "./completionusage.js";
|
|
30
|
+
export * from "./endpointslist.js";
|
|
30
31
|
export * from "./errorresponse.js";
|
|
32
|
+
export * from "./keyinfo.js";
|
|
31
33
|
export * from "./message.js";
|
|
34
|
+
export * from "./modelslist.js";
|
|
32
35
|
export * from "./namedtoolchoice.js";
|
|
33
36
|
export * from "./openairesponsesrequest.js";
|
|
34
37
|
export * from "./responseeasyinputmessage.js";
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Legacy rate limit information about a key. Will always return -1.
|
|
13
|
+
*
|
|
14
|
+
* @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
15
|
+
*/
|
|
16
|
+
export type RateLimit = {
|
|
17
|
+
/**
|
|
18
|
+
* Number of requests allowed per interval
|
|
19
|
+
*/
|
|
20
|
+
requests: number;
|
|
21
|
+
/**
|
|
22
|
+
* Rate limit interval
|
|
23
|
+
*/
|
|
24
|
+
interval: string;
|
|
25
|
+
/**
|
|
26
|
+
* Note about the rate limit
|
|
27
|
+
*/
|
|
28
|
+
note: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Current API key information
|
|
33
|
+
*/
|
|
34
|
+
export type KeyInfo = {
|
|
35
|
+
/**
|
|
36
|
+
* Human-readable label for the API key
|
|
37
|
+
*/
|
|
38
|
+
label: string;
|
|
39
|
+
/**
|
|
40
|
+
* Spending limit for the API key in USD
|
|
41
|
+
*/
|
|
42
|
+
limit: number | null;
|
|
43
|
+
/**
|
|
44
|
+
* Current OpenRouter credit usage for the API key in USD
|
|
45
|
+
*/
|
|
46
|
+
usage: number;
|
|
47
|
+
/**
|
|
48
|
+
* Current OpenRouter daily usage for the API key in USD
|
|
49
|
+
*/
|
|
50
|
+
usageDaily: number;
|
|
51
|
+
/**
|
|
52
|
+
* Current OpenRouter weekly usage for the API key in USD
|
|
53
|
+
*/
|
|
54
|
+
usageWeekly: number;
|
|
55
|
+
/**
|
|
56
|
+
* Current OpenRouter monthly usage for the API key in USD
|
|
57
|
+
*/
|
|
58
|
+
usageMonthly: number;
|
|
59
|
+
/**
|
|
60
|
+
* Current external BYOK credit usage for the API key in USD
|
|
61
|
+
*/
|
|
62
|
+
byokUsage: number;
|
|
63
|
+
/**
|
|
64
|
+
* Current external BYOK daily usage for the API key in USD
|
|
65
|
+
*/
|
|
66
|
+
byokUsageDaily: number;
|
|
67
|
+
/**
|
|
68
|
+
* Current external BYOK weekly usage for the API key in USD
|
|
69
|
+
*/
|
|
70
|
+
byokUsageWeekly: number;
|
|
71
|
+
/**
|
|
72
|
+
* Current external BYOK monthly usage for the API key in USD
|
|
73
|
+
*/
|
|
74
|
+
byokUsageMonthly: number;
|
|
75
|
+
/**
|
|
76
|
+
* Whether this is a free tier API key
|
|
77
|
+
*/
|
|
78
|
+
isFreeTier: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Whether this is a provisioning key
|
|
81
|
+
*/
|
|
82
|
+
isProvisioningKey: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Remaining spending limit in USD
|
|
85
|
+
*/
|
|
86
|
+
limitRemaining: number | null;
|
|
87
|
+
/**
|
|
88
|
+
* Type of limit reset for the API key
|
|
89
|
+
*/
|
|
90
|
+
limitReset: string | null;
|
|
91
|
+
/**
|
|
92
|
+
* Whether to include external BYOK usage in the credit limit
|
|
93
|
+
*/
|
|
94
|
+
includeByokInLimit: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Legacy rate limit information about a key. Will always return -1.
|
|
97
|
+
*
|
|
98
|
+
* @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
99
|
+
*/
|
|
100
|
+
rateLimit: RateLimit;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/** @internal */
|
|
104
|
+
export const RateLimit$inboundSchema: z.ZodType<
|
|
105
|
+
RateLimit,
|
|
106
|
+
z.ZodTypeDef,
|
|
107
|
+
unknown
|
|
108
|
+
> = z.object({
|
|
109
|
+
requests: z.number(),
|
|
110
|
+
interval: z.string(),
|
|
111
|
+
note: z.string(),
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
/** @internal */
|
|
115
|
+
export type RateLimit$Outbound = {
|
|
116
|
+
requests: number;
|
|
117
|
+
interval: string;
|
|
118
|
+
note: string;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/** @internal */
|
|
122
|
+
export const RateLimit$outboundSchema: z.ZodType<
|
|
123
|
+
RateLimit$Outbound,
|
|
124
|
+
z.ZodTypeDef,
|
|
125
|
+
RateLimit
|
|
126
|
+
> = z.object({
|
|
127
|
+
requests: z.number(),
|
|
128
|
+
interval: z.string(),
|
|
129
|
+
note: z.string(),
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @internal
|
|
134
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
135
|
+
*/
|
|
136
|
+
export namespace RateLimit$ {
|
|
137
|
+
/** @deprecated use `RateLimit$inboundSchema` instead. */
|
|
138
|
+
export const inboundSchema = RateLimit$inboundSchema;
|
|
139
|
+
/** @deprecated use `RateLimit$outboundSchema` instead. */
|
|
140
|
+
export const outboundSchema = RateLimit$outboundSchema;
|
|
141
|
+
/** @deprecated use `RateLimit$Outbound` instead. */
|
|
142
|
+
export type Outbound = RateLimit$Outbound;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function rateLimitToJSON(rateLimit: RateLimit): string {
|
|
146
|
+
return JSON.stringify(RateLimit$outboundSchema.parse(rateLimit));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export function rateLimitFromJSON(
|
|
150
|
+
jsonString: string,
|
|
151
|
+
): SafeParseResult<RateLimit, SDKValidationError> {
|
|
152
|
+
return safeParse(
|
|
153
|
+
jsonString,
|
|
154
|
+
(x) => RateLimit$inboundSchema.parse(JSON.parse(x)),
|
|
155
|
+
`Failed to parse 'RateLimit' from JSON`,
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** @internal */
|
|
160
|
+
export const KeyInfo$inboundSchema: z.ZodType<KeyInfo, z.ZodTypeDef, unknown> =
|
|
161
|
+
z.object({
|
|
162
|
+
label: z.string(),
|
|
163
|
+
limit: z.nullable(z.number()),
|
|
164
|
+
usage: z.number(),
|
|
165
|
+
usage_daily: z.number(),
|
|
166
|
+
usage_weekly: z.number(),
|
|
167
|
+
usage_monthly: z.number(),
|
|
168
|
+
byok_usage: z.number(),
|
|
169
|
+
byok_usage_daily: z.number(),
|
|
170
|
+
byok_usage_weekly: z.number(),
|
|
171
|
+
byok_usage_monthly: z.number(),
|
|
172
|
+
is_free_tier: z.boolean(),
|
|
173
|
+
is_provisioning_key: z.boolean(),
|
|
174
|
+
limit_remaining: z.nullable(z.number()),
|
|
175
|
+
limit_reset: z.nullable(z.string()),
|
|
176
|
+
include_byok_in_limit: z.boolean(),
|
|
177
|
+
rate_limit: z.lazy(() => RateLimit$inboundSchema),
|
|
178
|
+
}).transform((v) => {
|
|
179
|
+
return remap$(v, {
|
|
180
|
+
"usage_daily": "usageDaily",
|
|
181
|
+
"usage_weekly": "usageWeekly",
|
|
182
|
+
"usage_monthly": "usageMonthly",
|
|
183
|
+
"byok_usage": "byokUsage",
|
|
184
|
+
"byok_usage_daily": "byokUsageDaily",
|
|
185
|
+
"byok_usage_weekly": "byokUsageWeekly",
|
|
186
|
+
"byok_usage_monthly": "byokUsageMonthly",
|
|
187
|
+
"is_free_tier": "isFreeTier",
|
|
188
|
+
"is_provisioning_key": "isProvisioningKey",
|
|
189
|
+
"limit_remaining": "limitRemaining",
|
|
190
|
+
"limit_reset": "limitReset",
|
|
191
|
+
"include_byok_in_limit": "includeByokInLimit",
|
|
192
|
+
"rate_limit": "rateLimit",
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
/** @internal */
|
|
197
|
+
export type KeyInfo$Outbound = {
|
|
198
|
+
label: string;
|
|
199
|
+
limit: number | null;
|
|
200
|
+
usage: number;
|
|
201
|
+
usage_daily: number;
|
|
202
|
+
usage_weekly: number;
|
|
203
|
+
usage_monthly: number;
|
|
204
|
+
byok_usage: number;
|
|
205
|
+
byok_usage_daily: number;
|
|
206
|
+
byok_usage_weekly: number;
|
|
207
|
+
byok_usage_monthly: number;
|
|
208
|
+
is_free_tier: boolean;
|
|
209
|
+
is_provisioning_key: boolean;
|
|
210
|
+
limit_remaining: number | null;
|
|
211
|
+
limit_reset: string | null;
|
|
212
|
+
include_byok_in_limit: boolean;
|
|
213
|
+
rate_limit: RateLimit$Outbound;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
/** @internal */
|
|
217
|
+
export const KeyInfo$outboundSchema: z.ZodType<
|
|
218
|
+
KeyInfo$Outbound,
|
|
219
|
+
z.ZodTypeDef,
|
|
220
|
+
KeyInfo
|
|
221
|
+
> = z.object({
|
|
222
|
+
label: z.string(),
|
|
223
|
+
limit: z.nullable(z.number()),
|
|
224
|
+
usage: z.number(),
|
|
225
|
+
usageDaily: z.number(),
|
|
226
|
+
usageWeekly: z.number(),
|
|
227
|
+
usageMonthly: z.number(),
|
|
228
|
+
byokUsage: z.number(),
|
|
229
|
+
byokUsageDaily: z.number(),
|
|
230
|
+
byokUsageWeekly: z.number(),
|
|
231
|
+
byokUsageMonthly: z.number(),
|
|
232
|
+
isFreeTier: z.boolean(),
|
|
233
|
+
isProvisioningKey: z.boolean(),
|
|
234
|
+
limitRemaining: z.nullable(z.number()),
|
|
235
|
+
limitReset: z.nullable(z.string()),
|
|
236
|
+
includeByokInLimit: z.boolean(),
|
|
237
|
+
rateLimit: z.lazy(() => RateLimit$outboundSchema),
|
|
238
|
+
}).transform((v) => {
|
|
239
|
+
return remap$(v, {
|
|
240
|
+
usageDaily: "usage_daily",
|
|
241
|
+
usageWeekly: "usage_weekly",
|
|
242
|
+
usageMonthly: "usage_monthly",
|
|
243
|
+
byokUsage: "byok_usage",
|
|
244
|
+
byokUsageDaily: "byok_usage_daily",
|
|
245
|
+
byokUsageWeekly: "byok_usage_weekly",
|
|
246
|
+
byokUsageMonthly: "byok_usage_monthly",
|
|
247
|
+
isFreeTier: "is_free_tier",
|
|
248
|
+
isProvisioningKey: "is_provisioning_key",
|
|
249
|
+
limitRemaining: "limit_remaining",
|
|
250
|
+
limitReset: "limit_reset",
|
|
251
|
+
includeByokInLimit: "include_byok_in_limit",
|
|
252
|
+
rateLimit: "rate_limit",
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* @internal
|
|
258
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
259
|
+
*/
|
|
260
|
+
export namespace KeyInfo$ {
|
|
261
|
+
/** @deprecated use `KeyInfo$inboundSchema` instead. */
|
|
262
|
+
export const inboundSchema = KeyInfo$inboundSchema;
|
|
263
|
+
/** @deprecated use `KeyInfo$outboundSchema` instead. */
|
|
264
|
+
export const outboundSchema = KeyInfo$outboundSchema;
|
|
265
|
+
/** @deprecated use `KeyInfo$Outbound` instead. */
|
|
266
|
+
export type Outbound = KeyInfo$Outbound;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export function keyInfoToJSON(keyInfo: KeyInfo): string {
|
|
270
|
+
return JSON.stringify(KeyInfo$outboundSchema.parse(keyInfo));
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export function keyInfoFromJSON(
|
|
274
|
+
jsonString: string,
|
|
275
|
+
): SafeParseResult<KeyInfo, SDKValidationError> {
|
|
276
|
+
return safeParse(
|
|
277
|
+
jsonString,
|
|
278
|
+
(x) => KeyInfo$inboundSchema.parse(JSON.parse(x)),
|
|
279
|
+
`Failed to parse 'KeyInfo' from JSON`,
|
|
280
|
+
);
|
|
281
|
+
}
|