@openrouter/sdk 0.0.0-beta.37 → 0.0.0-beta.38
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/dist/commonjs/funcs/betaResponsesSend.d.ts +2 -2
- package/dist/commonjs/funcs/betaResponsesSend.d.ts.map +1 -1
- package/dist/commonjs/funcs/betaResponsesSend.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/models/createapikeydata.d.ts +120 -0
- package/dist/commonjs/models/createapikeydata.d.ts.map +1 -0
- package/dist/commonjs/models/createapikeydata.js +134 -0
- package/dist/commonjs/models/createapikeydata.js.map +1 -0
- package/dist/commonjs/models/getapikeydata.d.ts +120 -0
- package/dist/commonjs/models/getapikeydata.d.ts.map +1 -0
- package/dist/commonjs/models/getapikeydata.js +134 -0
- package/dist/commonjs/models/getapikeydata.js.map +1 -0
- package/dist/commonjs/models/index.d.ts +4 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +4 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/keyinfo.d.ts +8 -8
- package/dist/commonjs/models/listapikeysdata.d.ts +117 -0
- package/dist/commonjs/models/listapikeysdata.d.ts.map +1 -0
- package/dist/commonjs/models/listapikeysdata.js +134 -0
- package/dist/commonjs/models/listapikeysdata.js.map +1 -0
- package/dist/commonjs/models/operations/create.d.ts +43 -68
- package/dist/commonjs/models/operations/create.d.ts.map +1 -1
- package/dist/commonjs/models/operations/create.js +31 -54
- package/dist/commonjs/models/operations/create.js.map +1 -1
- package/dist/commonjs/models/operations/getapikey.d.ts +3 -68
- package/dist/commonjs/models/operations/getapikey.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getapikey.js +4 -55
- package/dist/commonjs/models/operations/getapikey.js.map +1 -1
- package/dist/commonjs/models/operations/listapikeys.d.ts +3 -65
- package/dist/commonjs/models/operations/listapikeys.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listapikeys.js +4 -54
- package/dist/commonjs/models/operations/listapikeys.js.map +1 -1
- package/dist/commonjs/models/operations/update.d.ts +43 -68
- package/dist/commonjs/models/operations/update.d.ts.map +1 -1
- package/dist/commonjs/models/operations/update.js +31 -54
- package/dist/commonjs/models/operations/update.js.map +1 -1
- package/dist/commonjs/models/responsesoutputitemreasoning.d.ts +3 -0
- package/dist/commonjs/models/responsesoutputitemreasoning.d.ts.map +1 -1
- package/dist/commonjs/models/responsesoutputitemreasoning.js +1 -0
- package/dist/commonjs/models/responsesoutputitemreasoning.js.map +1 -1
- package/dist/commonjs/models/updateapikeydata.d.ts +120 -0
- package/dist/commonjs/models/updateapikeydata.d.ts.map +1 -0
- package/dist/commonjs/models/updateapikeydata.js +134 -0
- package/dist/commonjs/models/updateapikeydata.js.map +1 -0
- package/dist/commonjs/sdk/responses.d.ts +2 -2
- package/dist/commonjs/sdk/responses.d.ts.map +1 -1
- package/dist/esm/funcs/betaResponsesSend.d.ts +2 -2
- package/dist/esm/funcs/betaResponsesSend.d.ts.map +1 -1
- package/dist/esm/funcs/betaResponsesSend.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/models/createapikeydata.d.ts +120 -0
- package/dist/esm/models/createapikeydata.d.ts.map +1 -0
- package/dist/esm/models/createapikeydata.js +96 -0
- package/dist/esm/models/createapikeydata.js.map +1 -0
- package/dist/esm/models/getapikeydata.d.ts +120 -0
- package/dist/esm/models/getapikeydata.d.ts.map +1 -0
- package/dist/esm/models/getapikeydata.js +96 -0
- package/dist/esm/models/getapikeydata.js.map +1 -0
- package/dist/esm/models/index.d.ts +4 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +4 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/keyinfo.d.ts +8 -8
- package/dist/esm/models/listapikeysdata.d.ts +117 -0
- package/dist/esm/models/listapikeysdata.d.ts.map +1 -0
- package/dist/esm/models/listapikeysdata.js +96 -0
- package/dist/esm/models/listapikeysdata.js.map +1 -0
- package/dist/esm/models/operations/create.d.ts +43 -68
- package/dist/esm/models/operations/create.d.ts.map +1 -1
- package/dist/esm/models/operations/create.js +30 -51
- package/dist/esm/models/operations/create.js.map +1 -1
- package/dist/esm/models/operations/getapikey.d.ts +3 -68
- package/dist/esm/models/operations/getapikey.d.ts.map +1 -1
- package/dist/esm/models/operations/getapikey.js +3 -52
- package/dist/esm/models/operations/getapikey.js.map +1 -1
- package/dist/esm/models/operations/listapikeys.d.ts +3 -65
- package/dist/esm/models/operations/listapikeys.d.ts.map +1 -1
- package/dist/esm/models/operations/listapikeys.js +3 -51
- package/dist/esm/models/operations/listapikeys.js.map +1 -1
- package/dist/esm/models/operations/update.d.ts +43 -68
- package/dist/esm/models/operations/update.d.ts.map +1 -1
- package/dist/esm/models/operations/update.js +30 -51
- package/dist/esm/models/operations/update.js.map +1 -1
- package/dist/esm/models/responsesoutputitemreasoning.d.ts +3 -0
- package/dist/esm/models/responsesoutputitemreasoning.d.ts.map +1 -1
- package/dist/esm/models/responsesoutputitemreasoning.js +1 -0
- package/dist/esm/models/responsesoutputitemreasoning.js.map +1 -1
- package/dist/esm/models/updateapikeydata.d.ts +120 -0
- package/dist/esm/models/updateapikeydata.d.ts.map +1 -0
- package/dist/esm/models/updateapikeydata.js +96 -0
- package/dist/esm/models/updateapikeydata.js.map +1 -0
- package/dist/esm/sdk/responses.d.ts +2 -2
- package/dist/esm/sdk/responses.d.ts.map +1 -1
- package/docs/sdks/apikeys/README.md +4 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/betaResponsesSend.ts +2 -2
- package/src/lib/config.ts +3 -3
- package/src/models/createapikeydata.ts +222 -0
- package/src/models/getapikeydata.ts +218 -0
- package/src/models/index.ts +4 -0
- package/src/models/keyinfo.ts +8 -8
- package/src/models/listapikeysdata.ts +217 -0
- package/src/models/operations/create.ts +49 -123
- package/src/models/operations/getapikey.ts +5 -124
- package/src/models/operations/listapikeys.ts +5 -122
- package/src/models/operations/update.ts +49 -123
- package/src/models/responsesoutputitemreasoning.ts +1 -0
- package/src/models/updateapikeydata.ts +222 -0
- package/src/sdk/responses.ts +2 -2
|
@@ -5,8 +5,23 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
10
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import * as models from "../index.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday.
|
|
15
|
+
*/
|
|
16
|
+
export const CreateLimitReset = {
|
|
17
|
+
Daily: "daily",
|
|
18
|
+
Weekly: "weekly",
|
|
19
|
+
Monthly: "monthly",
|
|
20
|
+
} as const;
|
|
21
|
+
/**
|
|
22
|
+
* Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday.
|
|
23
|
+
*/
|
|
24
|
+
export type CreateLimitReset = ClosedEnum<typeof CreateLimitReset>;
|
|
10
25
|
|
|
11
26
|
export type CreateRequest = {
|
|
12
27
|
/**
|
|
@@ -18,47 +33,13 @@ export type CreateRequest = {
|
|
|
18
33
|
*/
|
|
19
34
|
limit?: number | null | undefined;
|
|
20
35
|
/**
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
includeByokInLimit?: boolean | undefined;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* The created API key information
|
|
28
|
-
*/
|
|
29
|
-
export type CreateData = {
|
|
30
|
-
/**
|
|
31
|
-
* Unique hash identifier for the API key
|
|
32
|
-
*/
|
|
33
|
-
hash: string;
|
|
34
|
-
/**
|
|
35
|
-
* Name of the API key
|
|
36
|
-
*/
|
|
37
|
-
name: string;
|
|
38
|
-
/**
|
|
39
|
-
* Human-readable label for the API key
|
|
40
|
-
*/
|
|
41
|
-
label: string;
|
|
42
|
-
/**
|
|
43
|
-
* Whether the API key is disabled
|
|
44
|
-
*/
|
|
45
|
-
disabled: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Spending limit for the API key in USD
|
|
48
|
-
*/
|
|
49
|
-
limit: number | null;
|
|
50
|
-
/**
|
|
51
|
-
* Current usage of the API key in USD
|
|
36
|
+
* Type of limit reset for the API key (daily, weekly, monthly, or null for no reset). Resets happen automatically at midnight UTC, and weeks are Monday through Sunday.
|
|
52
37
|
*/
|
|
53
|
-
|
|
38
|
+
limitReset?: CreateLimitReset | null | undefined;
|
|
54
39
|
/**
|
|
55
|
-
*
|
|
56
|
-
*/
|
|
57
|
-
createdAt: string;
|
|
58
|
-
/**
|
|
59
|
-
* ISO 8601 timestamp of when the API key was last updated
|
|
40
|
+
* Whether to include BYOK usage in the limit
|
|
60
41
|
*/
|
|
61
|
-
|
|
42
|
+
includeByokInLimit?: boolean | undefined;
|
|
62
43
|
};
|
|
63
44
|
|
|
64
45
|
/**
|
|
@@ -68,13 +49,34 @@ export type CreateResponse = {
|
|
|
68
49
|
/**
|
|
69
50
|
* The created API key information
|
|
70
51
|
*/
|
|
71
|
-
data:
|
|
52
|
+
data: models.CreateAPIKeyData;
|
|
72
53
|
/**
|
|
73
54
|
* The actual API key string (only shown once)
|
|
74
55
|
*/
|
|
75
56
|
key: string;
|
|
76
57
|
};
|
|
77
58
|
|
|
59
|
+
/** @internal */
|
|
60
|
+
export const CreateLimitReset$inboundSchema: z.ZodNativeEnum<
|
|
61
|
+
typeof CreateLimitReset
|
|
62
|
+
> = z.nativeEnum(CreateLimitReset);
|
|
63
|
+
|
|
64
|
+
/** @internal */
|
|
65
|
+
export const CreateLimitReset$outboundSchema: z.ZodNativeEnum<
|
|
66
|
+
typeof CreateLimitReset
|
|
67
|
+
> = CreateLimitReset$inboundSchema;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
72
|
+
*/
|
|
73
|
+
export namespace CreateLimitReset$ {
|
|
74
|
+
/** @deprecated use `CreateLimitReset$inboundSchema` instead. */
|
|
75
|
+
export const inboundSchema = CreateLimitReset$inboundSchema;
|
|
76
|
+
/** @deprecated use `CreateLimitReset$outboundSchema` instead. */
|
|
77
|
+
export const outboundSchema = CreateLimitReset$outboundSchema;
|
|
78
|
+
}
|
|
79
|
+
|
|
78
80
|
/** @internal */
|
|
79
81
|
export const CreateRequest$inboundSchema: z.ZodType<
|
|
80
82
|
CreateRequest,
|
|
@@ -83,9 +85,11 @@ export const CreateRequest$inboundSchema: z.ZodType<
|
|
|
83
85
|
> = z.object({
|
|
84
86
|
name: z.string(),
|
|
85
87
|
limit: z.nullable(z.number()).optional(),
|
|
88
|
+
limit_reset: z.nullable(CreateLimitReset$inboundSchema).optional(),
|
|
86
89
|
include_byok_in_limit: z.boolean().optional(),
|
|
87
90
|
}).transform((v) => {
|
|
88
91
|
return remap$(v, {
|
|
92
|
+
"limit_reset": "limitReset",
|
|
89
93
|
"include_byok_in_limit": "includeByokInLimit",
|
|
90
94
|
});
|
|
91
95
|
});
|
|
@@ -94,6 +98,7 @@ export const CreateRequest$inboundSchema: z.ZodType<
|
|
|
94
98
|
export type CreateRequest$Outbound = {
|
|
95
99
|
name: string;
|
|
96
100
|
limit?: number | null | undefined;
|
|
101
|
+
limit_reset?: string | null | undefined;
|
|
97
102
|
include_byok_in_limit?: boolean | undefined;
|
|
98
103
|
};
|
|
99
104
|
|
|
@@ -105,9 +110,11 @@ export const CreateRequest$outboundSchema: z.ZodType<
|
|
|
105
110
|
> = z.object({
|
|
106
111
|
name: z.string(),
|
|
107
112
|
limit: z.nullable(z.number()).optional(),
|
|
113
|
+
limitReset: z.nullable(CreateLimitReset$outboundSchema).optional(),
|
|
108
114
|
includeByokInLimit: z.boolean().optional(),
|
|
109
115
|
}).transform((v) => {
|
|
110
116
|
return remap$(v, {
|
|
117
|
+
limitReset: "limit_reset",
|
|
111
118
|
includeByokInLimit: "include_byok_in_limit",
|
|
112
119
|
});
|
|
113
120
|
});
|
|
@@ -139,100 +146,19 @@ export function createRequestFromJSON(
|
|
|
139
146
|
);
|
|
140
147
|
}
|
|
141
148
|
|
|
142
|
-
/** @internal */
|
|
143
|
-
export const CreateData$inboundSchema: z.ZodType<
|
|
144
|
-
CreateData,
|
|
145
|
-
z.ZodTypeDef,
|
|
146
|
-
unknown
|
|
147
|
-
> = z.object({
|
|
148
|
-
hash: z.string(),
|
|
149
|
-
name: z.string(),
|
|
150
|
-
label: z.string(),
|
|
151
|
-
disabled: z.boolean(),
|
|
152
|
-
limit: z.nullable(z.number()),
|
|
153
|
-
usage: z.number(),
|
|
154
|
-
created_at: z.string(),
|
|
155
|
-
updated_at: z.nullable(z.string()),
|
|
156
|
-
}).transform((v) => {
|
|
157
|
-
return remap$(v, {
|
|
158
|
-
"created_at": "createdAt",
|
|
159
|
-
"updated_at": "updatedAt",
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
/** @internal */
|
|
164
|
-
export type CreateData$Outbound = {
|
|
165
|
-
hash: string;
|
|
166
|
-
name: string;
|
|
167
|
-
label: string;
|
|
168
|
-
disabled: boolean;
|
|
169
|
-
limit: number | null;
|
|
170
|
-
usage: number;
|
|
171
|
-
created_at: string;
|
|
172
|
-
updated_at: string | null;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
/** @internal */
|
|
176
|
-
export const CreateData$outboundSchema: z.ZodType<
|
|
177
|
-
CreateData$Outbound,
|
|
178
|
-
z.ZodTypeDef,
|
|
179
|
-
CreateData
|
|
180
|
-
> = z.object({
|
|
181
|
-
hash: z.string(),
|
|
182
|
-
name: z.string(),
|
|
183
|
-
label: z.string(),
|
|
184
|
-
disabled: z.boolean(),
|
|
185
|
-
limit: z.nullable(z.number()),
|
|
186
|
-
usage: z.number(),
|
|
187
|
-
createdAt: z.string(),
|
|
188
|
-
updatedAt: z.nullable(z.string()),
|
|
189
|
-
}).transform((v) => {
|
|
190
|
-
return remap$(v, {
|
|
191
|
-
createdAt: "created_at",
|
|
192
|
-
updatedAt: "updated_at",
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* @internal
|
|
198
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
199
|
-
*/
|
|
200
|
-
export namespace CreateData$ {
|
|
201
|
-
/** @deprecated use `CreateData$inboundSchema` instead. */
|
|
202
|
-
export const inboundSchema = CreateData$inboundSchema;
|
|
203
|
-
/** @deprecated use `CreateData$outboundSchema` instead. */
|
|
204
|
-
export const outboundSchema = CreateData$outboundSchema;
|
|
205
|
-
/** @deprecated use `CreateData$Outbound` instead. */
|
|
206
|
-
export type Outbound = CreateData$Outbound;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
export function createDataToJSON(createData: CreateData): string {
|
|
210
|
-
return JSON.stringify(CreateData$outboundSchema.parse(createData));
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export function createDataFromJSON(
|
|
214
|
-
jsonString: string,
|
|
215
|
-
): SafeParseResult<CreateData, SDKValidationError> {
|
|
216
|
-
return safeParse(
|
|
217
|
-
jsonString,
|
|
218
|
-
(x) => CreateData$inboundSchema.parse(JSON.parse(x)),
|
|
219
|
-
`Failed to parse 'CreateData' from JSON`,
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
149
|
/** @internal */
|
|
224
150
|
export const CreateResponse$inboundSchema: z.ZodType<
|
|
225
151
|
CreateResponse,
|
|
226
152
|
z.ZodTypeDef,
|
|
227
153
|
unknown
|
|
228
154
|
> = z.object({
|
|
229
|
-
data:
|
|
155
|
+
data: models.CreateAPIKeyData$inboundSchema,
|
|
230
156
|
key: z.string(),
|
|
231
157
|
});
|
|
232
158
|
|
|
233
159
|
/** @internal */
|
|
234
160
|
export type CreateResponse$Outbound = {
|
|
235
|
-
data:
|
|
161
|
+
data: models.CreateAPIKeyData$Outbound;
|
|
236
162
|
key: string;
|
|
237
163
|
};
|
|
238
164
|
|
|
@@ -242,7 +168,7 @@ export const CreateResponse$outboundSchema: z.ZodType<
|
|
|
242
168
|
z.ZodTypeDef,
|
|
243
169
|
CreateResponse
|
|
244
170
|
> = z.object({
|
|
245
|
-
data:
|
|
171
|
+
data: models.CreateAPIKeyData$outboundSchema,
|
|
246
172
|
key: z.string(),
|
|
247
173
|
});
|
|
248
174
|
|
|
@@ -3,53 +3,15 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import * as models from "../index.js";
|
|
10
10
|
|
|
11
11
|
export type GetApiKeyRequest = {
|
|
12
12
|
hash: string;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* The API key information
|
|
17
|
-
*/
|
|
18
|
-
export type GetApiKeyData = {
|
|
19
|
-
/**
|
|
20
|
-
* Unique hash identifier for the API key
|
|
21
|
-
*/
|
|
22
|
-
hash: string;
|
|
23
|
-
/**
|
|
24
|
-
* Name of the API key
|
|
25
|
-
*/
|
|
26
|
-
name: string;
|
|
27
|
-
/**
|
|
28
|
-
* Human-readable label for the API key
|
|
29
|
-
*/
|
|
30
|
-
label: string;
|
|
31
|
-
/**
|
|
32
|
-
* Whether the API key is disabled
|
|
33
|
-
*/
|
|
34
|
-
disabled: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Spending limit for the API key in USD
|
|
37
|
-
*/
|
|
38
|
-
limit: number | null;
|
|
39
|
-
/**
|
|
40
|
-
* Current usage of the API key in USD
|
|
41
|
-
*/
|
|
42
|
-
usage: number;
|
|
43
|
-
/**
|
|
44
|
-
* ISO 8601 timestamp of when the API key was created
|
|
45
|
-
*/
|
|
46
|
-
createdAt: string;
|
|
47
|
-
/**
|
|
48
|
-
* ISO 8601 timestamp of when the API key was last updated
|
|
49
|
-
*/
|
|
50
|
-
updatedAt: string | null;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
15
|
/**
|
|
54
16
|
* API key details
|
|
55
17
|
*/
|
|
@@ -57,7 +19,7 @@ export type GetApiKeyResponse = {
|
|
|
57
19
|
/**
|
|
58
20
|
* The API key information
|
|
59
21
|
*/
|
|
60
|
-
data:
|
|
22
|
+
data: models.GetAPIKeyData;
|
|
61
23
|
};
|
|
62
24
|
|
|
63
25
|
/** @internal */
|
|
@@ -114,99 +76,18 @@ export function getApiKeyRequestFromJSON(
|
|
|
114
76
|
);
|
|
115
77
|
}
|
|
116
78
|
|
|
117
|
-
/** @internal */
|
|
118
|
-
export const GetApiKeyData$inboundSchema: z.ZodType<
|
|
119
|
-
GetApiKeyData,
|
|
120
|
-
z.ZodTypeDef,
|
|
121
|
-
unknown
|
|
122
|
-
> = z.object({
|
|
123
|
-
hash: z.string(),
|
|
124
|
-
name: z.string(),
|
|
125
|
-
label: z.string(),
|
|
126
|
-
disabled: z.boolean(),
|
|
127
|
-
limit: z.nullable(z.number()),
|
|
128
|
-
usage: z.number(),
|
|
129
|
-
created_at: z.string(),
|
|
130
|
-
updated_at: z.nullable(z.string()),
|
|
131
|
-
}).transform((v) => {
|
|
132
|
-
return remap$(v, {
|
|
133
|
-
"created_at": "createdAt",
|
|
134
|
-
"updated_at": "updatedAt",
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
/** @internal */
|
|
139
|
-
export type GetApiKeyData$Outbound = {
|
|
140
|
-
hash: string;
|
|
141
|
-
name: string;
|
|
142
|
-
label: string;
|
|
143
|
-
disabled: boolean;
|
|
144
|
-
limit: number | null;
|
|
145
|
-
usage: number;
|
|
146
|
-
created_at: string;
|
|
147
|
-
updated_at: string | null;
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
/** @internal */
|
|
151
|
-
export const GetApiKeyData$outboundSchema: z.ZodType<
|
|
152
|
-
GetApiKeyData$Outbound,
|
|
153
|
-
z.ZodTypeDef,
|
|
154
|
-
GetApiKeyData
|
|
155
|
-
> = z.object({
|
|
156
|
-
hash: z.string(),
|
|
157
|
-
name: z.string(),
|
|
158
|
-
label: z.string(),
|
|
159
|
-
disabled: z.boolean(),
|
|
160
|
-
limit: z.nullable(z.number()),
|
|
161
|
-
usage: z.number(),
|
|
162
|
-
createdAt: z.string(),
|
|
163
|
-
updatedAt: z.nullable(z.string()),
|
|
164
|
-
}).transform((v) => {
|
|
165
|
-
return remap$(v, {
|
|
166
|
-
createdAt: "created_at",
|
|
167
|
-
updatedAt: "updated_at",
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* @internal
|
|
173
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
174
|
-
*/
|
|
175
|
-
export namespace GetApiKeyData$ {
|
|
176
|
-
/** @deprecated use `GetApiKeyData$inboundSchema` instead. */
|
|
177
|
-
export const inboundSchema = GetApiKeyData$inboundSchema;
|
|
178
|
-
/** @deprecated use `GetApiKeyData$outboundSchema` instead. */
|
|
179
|
-
export const outboundSchema = GetApiKeyData$outboundSchema;
|
|
180
|
-
/** @deprecated use `GetApiKeyData$Outbound` instead. */
|
|
181
|
-
export type Outbound = GetApiKeyData$Outbound;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export function getApiKeyDataToJSON(getApiKeyData: GetApiKeyData): string {
|
|
185
|
-
return JSON.stringify(GetApiKeyData$outboundSchema.parse(getApiKeyData));
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
export function getApiKeyDataFromJSON(
|
|
189
|
-
jsonString: string,
|
|
190
|
-
): SafeParseResult<GetApiKeyData, SDKValidationError> {
|
|
191
|
-
return safeParse(
|
|
192
|
-
jsonString,
|
|
193
|
-
(x) => GetApiKeyData$inboundSchema.parse(JSON.parse(x)),
|
|
194
|
-
`Failed to parse 'GetApiKeyData' from JSON`,
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
79
|
/** @internal */
|
|
199
80
|
export const GetApiKeyResponse$inboundSchema: z.ZodType<
|
|
200
81
|
GetApiKeyResponse,
|
|
201
82
|
z.ZodTypeDef,
|
|
202
83
|
unknown
|
|
203
84
|
> = z.object({
|
|
204
|
-
data:
|
|
85
|
+
data: models.GetAPIKeyData$inboundSchema,
|
|
205
86
|
});
|
|
206
87
|
|
|
207
88
|
/** @internal */
|
|
208
89
|
export type GetApiKeyResponse$Outbound = {
|
|
209
|
-
data:
|
|
90
|
+
data: models.GetAPIKeyData$Outbound;
|
|
210
91
|
};
|
|
211
92
|
|
|
212
93
|
/** @internal */
|
|
@@ -215,7 +96,7 @@ export const GetApiKeyResponse$outboundSchema: z.ZodType<
|
|
|
215
96
|
z.ZodTypeDef,
|
|
216
97
|
GetApiKeyResponse
|
|
217
98
|
> = z.object({
|
|
218
|
-
data:
|
|
99
|
+
data: models.GetAPIKeyData$outboundSchema,
|
|
219
100
|
});
|
|
220
101
|
|
|
221
102
|
/**
|
|
@@ -7,47 +7,13 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import * as models from "../index.js";
|
|
10
11
|
|
|
11
12
|
export type ListApiKeysRequest = {
|
|
12
13
|
includeDisabled?: string | undefined;
|
|
13
14
|
offset?: string | undefined;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
|
-
export type ListApiKeysData = {
|
|
17
|
-
/**
|
|
18
|
-
* Unique hash identifier for the API key
|
|
19
|
-
*/
|
|
20
|
-
hash: string;
|
|
21
|
-
/**
|
|
22
|
-
* Name of the API key
|
|
23
|
-
*/
|
|
24
|
-
name: string;
|
|
25
|
-
/**
|
|
26
|
-
* Human-readable label for the API key
|
|
27
|
-
*/
|
|
28
|
-
label: string;
|
|
29
|
-
/**
|
|
30
|
-
* Whether the API key is disabled
|
|
31
|
-
*/
|
|
32
|
-
disabled: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Spending limit for the API key in USD
|
|
35
|
-
*/
|
|
36
|
-
limit: number | null;
|
|
37
|
-
/**
|
|
38
|
-
* Current usage of the API key in USD
|
|
39
|
-
*/
|
|
40
|
-
usage: number;
|
|
41
|
-
/**
|
|
42
|
-
* ISO 8601 timestamp of when the API key was created
|
|
43
|
-
*/
|
|
44
|
-
createdAt: string;
|
|
45
|
-
/**
|
|
46
|
-
* ISO 8601 timestamp of when the API key was last updated
|
|
47
|
-
*/
|
|
48
|
-
updatedAt: string | null;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
17
|
/**
|
|
52
18
|
* List of API keys
|
|
53
19
|
*/
|
|
@@ -55,7 +21,7 @@ export type ListApiKeysResponse = {
|
|
|
55
21
|
/**
|
|
56
22
|
* List of API keys
|
|
57
23
|
*/
|
|
58
|
-
data: Array<
|
|
24
|
+
data: Array<models.ListAPIKeysData>;
|
|
59
25
|
};
|
|
60
26
|
|
|
61
27
|
/** @internal */
|
|
@@ -123,101 +89,18 @@ export function listApiKeysRequestFromJSON(
|
|
|
123
89
|
);
|
|
124
90
|
}
|
|
125
91
|
|
|
126
|
-
/** @internal */
|
|
127
|
-
export const ListApiKeysData$inboundSchema: z.ZodType<
|
|
128
|
-
ListApiKeysData,
|
|
129
|
-
z.ZodTypeDef,
|
|
130
|
-
unknown
|
|
131
|
-
> = z.object({
|
|
132
|
-
hash: z.string(),
|
|
133
|
-
name: z.string(),
|
|
134
|
-
label: z.string(),
|
|
135
|
-
disabled: z.boolean(),
|
|
136
|
-
limit: z.nullable(z.number()),
|
|
137
|
-
usage: z.number(),
|
|
138
|
-
created_at: z.string(),
|
|
139
|
-
updated_at: z.nullable(z.string()),
|
|
140
|
-
}).transform((v) => {
|
|
141
|
-
return remap$(v, {
|
|
142
|
-
"created_at": "createdAt",
|
|
143
|
-
"updated_at": "updatedAt",
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
/** @internal */
|
|
148
|
-
export type ListApiKeysData$Outbound = {
|
|
149
|
-
hash: string;
|
|
150
|
-
name: string;
|
|
151
|
-
label: string;
|
|
152
|
-
disabled: boolean;
|
|
153
|
-
limit: number | null;
|
|
154
|
-
usage: number;
|
|
155
|
-
created_at: string;
|
|
156
|
-
updated_at: string | null;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
/** @internal */
|
|
160
|
-
export const ListApiKeysData$outboundSchema: z.ZodType<
|
|
161
|
-
ListApiKeysData$Outbound,
|
|
162
|
-
z.ZodTypeDef,
|
|
163
|
-
ListApiKeysData
|
|
164
|
-
> = z.object({
|
|
165
|
-
hash: z.string(),
|
|
166
|
-
name: z.string(),
|
|
167
|
-
label: z.string(),
|
|
168
|
-
disabled: z.boolean(),
|
|
169
|
-
limit: z.nullable(z.number()),
|
|
170
|
-
usage: z.number(),
|
|
171
|
-
createdAt: z.string(),
|
|
172
|
-
updatedAt: z.nullable(z.string()),
|
|
173
|
-
}).transform((v) => {
|
|
174
|
-
return remap$(v, {
|
|
175
|
-
createdAt: "created_at",
|
|
176
|
-
updatedAt: "updated_at",
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* @internal
|
|
182
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
183
|
-
*/
|
|
184
|
-
export namespace ListApiKeysData$ {
|
|
185
|
-
/** @deprecated use `ListApiKeysData$inboundSchema` instead. */
|
|
186
|
-
export const inboundSchema = ListApiKeysData$inboundSchema;
|
|
187
|
-
/** @deprecated use `ListApiKeysData$outboundSchema` instead. */
|
|
188
|
-
export const outboundSchema = ListApiKeysData$outboundSchema;
|
|
189
|
-
/** @deprecated use `ListApiKeysData$Outbound` instead. */
|
|
190
|
-
export type Outbound = ListApiKeysData$Outbound;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export function listApiKeysDataToJSON(
|
|
194
|
-
listApiKeysData: ListApiKeysData,
|
|
195
|
-
): string {
|
|
196
|
-
return JSON.stringify(ListApiKeysData$outboundSchema.parse(listApiKeysData));
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export function listApiKeysDataFromJSON(
|
|
200
|
-
jsonString: string,
|
|
201
|
-
): SafeParseResult<ListApiKeysData, SDKValidationError> {
|
|
202
|
-
return safeParse(
|
|
203
|
-
jsonString,
|
|
204
|
-
(x) => ListApiKeysData$inboundSchema.parse(JSON.parse(x)),
|
|
205
|
-
`Failed to parse 'ListApiKeysData' from JSON`,
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
92
|
/** @internal */
|
|
210
93
|
export const ListApiKeysResponse$inboundSchema: z.ZodType<
|
|
211
94
|
ListApiKeysResponse,
|
|
212
95
|
z.ZodTypeDef,
|
|
213
96
|
unknown
|
|
214
97
|
> = z.object({
|
|
215
|
-
data: z.array(
|
|
98
|
+
data: z.array(models.ListAPIKeysData$inboundSchema),
|
|
216
99
|
});
|
|
217
100
|
|
|
218
101
|
/** @internal */
|
|
219
102
|
export type ListApiKeysResponse$Outbound = {
|
|
220
|
-
data: Array<
|
|
103
|
+
data: Array<models.ListAPIKeysData$Outbound>;
|
|
221
104
|
};
|
|
222
105
|
|
|
223
106
|
/** @internal */
|
|
@@ -226,7 +109,7 @@ export const ListApiKeysResponse$outboundSchema: z.ZodType<
|
|
|
226
109
|
z.ZodTypeDef,
|
|
227
110
|
ListApiKeysResponse
|
|
228
111
|
> = z.object({
|
|
229
|
-
data: z.array(
|
|
112
|
+
data: z.array(models.ListAPIKeysData$outboundSchema),
|
|
230
113
|
});
|
|
231
114
|
|
|
232
115
|
/**
|