@unkey/api 2.0.4 → 2.0.5
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/README.md +2 -1
- package/bin/mcp-server.js +119 -22
- package/bin/mcp-server.js.map +17 -14
- package/dist/commonjs/funcs/identitiesListIdentities.js +3 -0
- package/dist/commonjs/funcs/identitiesListIdentities.js.map +1 -1
- package/dist/commonjs/funcs/ratelimitLimit.d.ts +2 -2
- package/dist/commonjs/funcs/ratelimitLimit.d.ts.map +1 -1
- package/dist/commonjs/funcs/ratelimitLimit.js +3 -3
- package/dist/commonjs/funcs/ratelimitLimit.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/mcp-server/tools/ratelimitLimit.js +1 -1
- package/dist/commonjs/models/components/index.d.ts +2 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +2 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/keycreditsrefill.d.ts +8 -8
- package/dist/commonjs/models/components/keycreditsrefill.d.ts.map +1 -1
- package/dist/commonjs/models/components/keycreditsrefill.js +13 -14
- package/dist/commonjs/models/components/keycreditsrefill.js.map +1 -1
- package/dist/commonjs/models/components/updatekeycreditsdata.d.ts +41 -0
- package/dist/commonjs/models/components/updatekeycreditsdata.d.ts.map +1 -0
- package/dist/commonjs/models/components/updatekeycreditsdata.js +72 -0
- package/dist/commonjs/models/components/updatekeycreditsdata.js.map +1 -0
- package/dist/commonjs/models/components/updatekeycreditsrefill.d.ts +81 -0
- package/dist/commonjs/models/components/updatekeycreditsrefill.d.ts.map +1 -0
- package/dist/commonjs/models/components/updatekeycreditsrefill.js +95 -0
- package/dist/commonjs/models/components/updatekeycreditsrefill.js.map +1 -0
- package/dist/commonjs/models/components/v2keysupdatekeyrequestbody.d.ts +3 -3
- package/dist/commonjs/models/components/v2keysupdatekeyrequestbody.d.ts.map +1 -1
- package/dist/commonjs/models/components/v2keysupdatekeyrequestbody.js +3 -3
- package/dist/commonjs/models/components/v2keysupdatekeyrequestbody.js.map +1 -1
- package/dist/commonjs/models/errors/goneerrorresponse.d.ts +72 -0
- package/dist/commonjs/models/errors/goneerrorresponse.d.ts.map +1 -0
- package/dist/commonjs/models/errors/goneerrorresponse.js +99 -0
- package/dist/commonjs/models/errors/goneerrorresponse.js.map +1 -0
- package/dist/commonjs/models/errors/index.d.ts +1 -0
- package/dist/commonjs/models/errors/index.d.ts.map +1 -1
- package/dist/commonjs/models/errors/index.js +1 -0
- package/dist/commonjs/models/errors/index.js.map +1 -1
- package/dist/commonjs/sdk/ratelimit.d.ts +1 -1
- package/dist/commonjs/sdk/ratelimit.js +1 -1
- package/dist/esm/funcs/identitiesListIdentities.js +3 -0
- package/dist/esm/funcs/identitiesListIdentities.js.map +1 -1
- package/dist/esm/funcs/ratelimitLimit.d.ts +2 -2
- package/dist/esm/funcs/ratelimitLimit.d.ts.map +1 -1
- package/dist/esm/funcs/ratelimitLimit.js +3 -3
- package/dist/esm/funcs/ratelimitLimit.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/mcp-server/tools/ratelimitLimit.js +1 -1
- package/dist/esm/models/components/index.d.ts +2 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +2 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/keycreditsrefill.d.ts +8 -8
- package/dist/esm/models/components/keycreditsrefill.d.ts.map +1 -1
- package/dist/esm/models/components/keycreditsrefill.js +12 -13
- package/dist/esm/models/components/keycreditsrefill.js.map +1 -1
- package/dist/esm/models/components/updatekeycreditsdata.d.ts +41 -0
- package/dist/esm/models/components/updatekeycreditsdata.d.ts.map +1 -0
- package/dist/esm/models/components/updatekeycreditsdata.js +34 -0
- package/dist/esm/models/components/updatekeycreditsdata.js.map +1 -0
- package/dist/esm/models/components/updatekeycreditsrefill.d.ts +81 -0
- package/dist/esm/models/components/updatekeycreditsrefill.d.ts.map +1 -0
- package/dist/esm/models/components/updatekeycreditsrefill.js +57 -0
- package/dist/esm/models/components/updatekeycreditsrefill.js.map +1 -0
- package/dist/esm/models/components/v2keysupdatekeyrequestbody.d.ts +3 -3
- package/dist/esm/models/components/v2keysupdatekeyrequestbody.d.ts.map +1 -1
- package/dist/esm/models/components/v2keysupdatekeyrequestbody.js +3 -3
- package/dist/esm/models/components/v2keysupdatekeyrequestbody.js.map +1 -1
- package/dist/esm/models/errors/goneerrorresponse.d.ts +72 -0
- package/dist/esm/models/errors/goneerrorresponse.d.ts.map +1 -0
- package/dist/esm/models/errors/goneerrorresponse.js +62 -0
- package/dist/esm/models/errors/goneerrorresponse.js.map +1 -0
- package/dist/esm/models/errors/index.d.ts +1 -0
- package/dist/esm/models/errors/index.d.ts.map +1 -1
- package/dist/esm/models/errors/index.js +1 -0
- package/dist/esm/models/errors/index.js.map +1 -1
- package/dist/esm/sdk/ratelimit.d.ts +1 -1
- package/dist/esm/sdk/ratelimit.js +1 -1
- package/docs/sdks/ratelimit/README.md +2 -1
- package/examples/apisCreateApi.example.ts +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/identitiesListIdentities.ts +3 -0
- package/src/funcs/ratelimitLimit.ts +6 -2
- package/src/lib/config.ts +3 -3
- package/src/lib/security.ts +4 -1
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/ratelimitLimit.ts +1 -1
- package/src/models/components/index.ts +2 -0
- package/src/models/components/keycreditsrefill.ts +18 -14
- package/src/models/components/updatekeycreditsdata.ts +85 -0
- package/src/models/components/updatekeycreditsrefill.ts +126 -0
- package/src/models/components/v2keysupdatekeyrequestbody.ts +10 -10
- package/src/models/errors/goneerrorresponse.ts +118 -0
- package/src/models/errors/index.ts +1 -0
- package/src/sdk/ratelimit.ts +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
import * as components from "../components/index.js";
|
|
6
|
+
import { UnkeyError } from "./unkeyerror.js";
|
|
7
|
+
/**
|
|
8
|
+
* Error response when the requested resource has been soft-deleted and is no longer available. This occurs when:
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* - The resource has been marked as deleted but still exists in the database
|
|
12
|
+
* - The resource is intentionally unavailable but could potentially be restored
|
|
13
|
+
* - The resource cannot be restored through the API or dashboard
|
|
14
|
+
*
|
|
15
|
+
* To resolve this error, contact support if you need the resource restored.
|
|
16
|
+
*/
|
|
17
|
+
export class GoneErrorResponse extends UnkeyError {
|
|
18
|
+
constructor(err, httpMeta) {
|
|
19
|
+
const message = "message" in err && typeof err.message === "string"
|
|
20
|
+
? err.message
|
|
21
|
+
: `API error occurred: ${JSON.stringify(err)}`;
|
|
22
|
+
super(message, httpMeta);
|
|
23
|
+
this.data$ = err;
|
|
24
|
+
this.meta = err.meta;
|
|
25
|
+
this.error = err.error;
|
|
26
|
+
this.name = "GoneErrorResponse";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const GoneErrorResponse$inboundSchema = z.object({
|
|
31
|
+
meta: components.Meta$inboundSchema,
|
|
32
|
+
error: components.BaseError$inboundSchema,
|
|
33
|
+
request$: z.instanceof(Request),
|
|
34
|
+
response$: z.instanceof(Response),
|
|
35
|
+
body$: z.string(),
|
|
36
|
+
})
|
|
37
|
+
.transform((v) => {
|
|
38
|
+
return new GoneErrorResponse(v, {
|
|
39
|
+
request: v.request$,
|
|
40
|
+
response: v.response$,
|
|
41
|
+
body: v.body$,
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const GoneErrorResponse$outboundSchema = z.instanceof(GoneErrorResponse)
|
|
46
|
+
.transform(v => v.data$)
|
|
47
|
+
.pipe(z.object({
|
|
48
|
+
meta: components.Meta$outboundSchema,
|
|
49
|
+
error: components.BaseError$outboundSchema,
|
|
50
|
+
}));
|
|
51
|
+
/**
|
|
52
|
+
* @internal
|
|
53
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
54
|
+
*/
|
|
55
|
+
export var GoneErrorResponse$;
|
|
56
|
+
(function (GoneErrorResponse$) {
|
|
57
|
+
/** @deprecated use `GoneErrorResponse$inboundSchema` instead. */
|
|
58
|
+
GoneErrorResponse$.inboundSchema = GoneErrorResponse$inboundSchema;
|
|
59
|
+
/** @deprecated use `GoneErrorResponse$outboundSchema` instead. */
|
|
60
|
+
GoneErrorResponse$.outboundSchema = GoneErrorResponse$outboundSchema;
|
|
61
|
+
})(GoneErrorResponse$ || (GoneErrorResponse$ = {}));
|
|
62
|
+
//# sourceMappingURL=goneerrorresponse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goneerrorresponse.js","sourceRoot":"","sources":["../../../../src/models/errors/goneerrorresponse.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAuB7C;;;;;;;;;GASG;AACH,MAAM,OAAO,iBAAkB,SAAQ,UAAU;IAa/C,YACE,GAA0B,EAC1B,QAAgE;QAEhE,MAAM,OAAO,GAAG,SAAS,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ;YACjE,CAAC,CAAC,GAAG,CAAC,OAAO;YACb,CAAC,CAAC,uBAAuB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;QACjD,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;QAEvB,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,+BAA+B,GAIxC,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,CAAC,kBAAkB;IACnC,KAAK,EAAE,UAAU,CAAC,uBAAuB;IACzC,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC;IAC/B,SAAS,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC;IACjC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC;KACC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACf,OAAO,IAAI,iBAAiB,CAAC,CAAC,EAAE;QAC9B,OAAO,EAAE,CAAC,CAAC,QAAQ;QACnB,QAAQ,EAAE,CAAC,CAAC,SAAS;QACrB,IAAI,EAAE,CAAC,CAAC,KAAK;KACd,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAQL,gBAAgB;AAChB,MAAM,CAAC,MAAM,gCAAgC,GAIzC,CAAC,CAAC,UAAU,CAAC,iBAAiB,CAAC;KAChC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;KACvB,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC,mBAAmB;IACpC,KAAK,EAAE,UAAU,CAAC,wBAAwB;CAC3C,CAAC,CAAC,CAAC;AAEN;;;GAGG;AACH,MAAM,KAAW,kBAAkB,CAOlC;AAPD,WAAiB,kBAAkB;IACjC,iEAAiE;IACpD,gCAAa,GAAG,+BAA+B,CAAC;IAC7D,kEAAkE;IACrD,iCAAc,GAAG,gCAAgC,CAAC;AAGjE,CAAC,EAPgB,kBAAkB,KAAlB,kBAAkB,QAOlC"}
|
|
@@ -2,6 +2,7 @@ export * from "./apierror.js";
|
|
|
2
2
|
export * from "./badrequesterrorresponse.js";
|
|
3
3
|
export * from "./conflicterrorresponse.js";
|
|
4
4
|
export * from "./forbiddenerrorresponse.js";
|
|
5
|
+
export * from "./goneerrorresponse.js";
|
|
5
6
|
export * from "./httpclienterrors.js";
|
|
6
7
|
export * from "./internalservererrorresponse.js";
|
|
7
8
|
export * from "./notfounderrorresponse.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/errors/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/errors/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC"}
|
|
@@ -5,6 +5,7 @@ export * from "./apierror.js";
|
|
|
5
5
|
export * from "./badrequesterrorresponse.js";
|
|
6
6
|
export * from "./conflicterrorresponse.js";
|
|
7
7
|
export * from "./forbiddenerrorresponse.js";
|
|
8
|
+
export * from "./goneerrorresponse.js";
|
|
8
9
|
export * from "./httpclienterrors.js";
|
|
9
10
|
export * from "./internalservererrorresponse.js";
|
|
10
11
|
export * from "./notfounderrorresponse.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/errors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/errors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC"}
|
|
@@ -35,7 +35,7 @@ export declare class Ratelimit extends ClientSDK {
|
|
|
35
35
|
*
|
|
36
36
|
* Use this for rate limiting beyond API keys - limit users by ID, IPs by address, or any custom identifier. Supports namespace organization, variable costs, and custom overrides.
|
|
37
37
|
*
|
|
38
|
-
* **
|
|
38
|
+
* **Response Codes**: Rate limit checks return HTTP 200 regardless of whether the limit is exceeded - check the `success` field in the response to determine if the request should be allowed. 4xx responses indicate auth, namespace existence/deletion, or validation errors (e.g., 410 Gone for deleted namespaces). 5xx responses indicate server errors.
|
|
39
39
|
*
|
|
40
40
|
* **Required Permissions**
|
|
41
41
|
*
|
|
@@ -47,7 +47,7 @@ export class Ratelimit extends ClientSDK {
|
|
|
47
47
|
*
|
|
48
48
|
* Use this for rate limiting beyond API keys - limit users by ID, IPs by address, or any custom identifier. Supports namespace organization, variable costs, and custom overrides.
|
|
49
49
|
*
|
|
50
|
-
* **
|
|
50
|
+
* **Response Codes**: Rate limit checks return HTTP 200 regardless of whether the limit is exceeded - check the `success` field in the response to determine if the request should be allowed. 4xx responses indicate auth, namespace existence/deletion, or validation errors (e.g., 410 Gone for deleted namespaces). 5xx responses indicate server errors.
|
|
51
51
|
*
|
|
52
52
|
* **Required Permissions**
|
|
53
53
|
*
|
|
@@ -193,7 +193,7 @@ Check and enforce rate limits for any identifier (user ID, IP address, API clien
|
|
|
193
193
|
|
|
194
194
|
Use this for rate limiting beyond API keys - limit users by ID, IPs by address, or any custom identifier. Supports namespace organization, variable costs, and custom overrides.
|
|
195
195
|
|
|
196
|
-
**
|
|
196
|
+
**Response Codes**: Rate limit checks return HTTP 200 regardless of whether the limit is exceeded - check the `success` field in the response to determine if the request should be allowed. 4xx responses indicate auth, namespace existence/deletion, or validation errors (e.g., 410 Gone for deleted namespaces). 5xx responses indicate server errors.
|
|
197
197
|
|
|
198
198
|
**Required Permissions**
|
|
199
199
|
|
|
@@ -285,6 +285,7 @@ run();
|
|
|
285
285
|
| errors.UnauthorizedErrorResponse | 401 | application/json |
|
|
286
286
|
| errors.ForbiddenErrorResponse | 403 | application/json |
|
|
287
287
|
| errors.NotFoundErrorResponse | 404 | application/json |
|
|
288
|
+
| errors.GoneErrorResponse | 410 | application/json |
|
|
288
289
|
| errors.InternalServerErrorResponse | 500 | application/json |
|
|
289
290
|
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
290
291
|
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -33,7 +33,7 @@ import { Result } from "../types/fp.js";
|
|
|
33
33
|
*
|
|
34
34
|
* Use this for rate limiting beyond API keys - limit users by ID, IPs by address, or any custom identifier. Supports namespace organization, variable costs, and custom overrides.
|
|
35
35
|
*
|
|
36
|
-
* **
|
|
36
|
+
* **Response Codes**: Rate limit checks return HTTP 200 regardless of whether the limit is exceeded - check the `success` field in the response to determine if the request should be allowed. 4xx responses indicate auth, namespace existence/deletion, or validation errors (e.g., 410 Gone for deleted namespaces). 5xx responses indicate server errors.
|
|
37
37
|
*
|
|
38
38
|
* **Required Permissions**
|
|
39
39
|
*
|
|
@@ -56,6 +56,7 @@ export function ratelimitLimit(
|
|
|
56
56
|
| errors.UnauthorizedErrorResponse
|
|
57
57
|
| errors.ForbiddenErrorResponse
|
|
58
58
|
| errors.NotFoundErrorResponse
|
|
59
|
+
| errors.GoneErrorResponse
|
|
59
60
|
| errors.InternalServerErrorResponse
|
|
60
61
|
| UnkeyError
|
|
61
62
|
| ResponseValidationError
|
|
@@ -86,6 +87,7 @@ async function $do(
|
|
|
86
87
|
| errors.UnauthorizedErrorResponse
|
|
87
88
|
| errors.ForbiddenErrorResponse
|
|
88
89
|
| errors.NotFoundErrorResponse
|
|
90
|
+
| errors.GoneErrorResponse
|
|
89
91
|
| errors.InternalServerErrorResponse
|
|
90
92
|
| UnkeyError
|
|
91
93
|
| ResponseValidationError
|
|
@@ -164,7 +166,7 @@ async function $do(
|
|
|
164
166
|
|
|
165
167
|
const doResult = await client._do(req, {
|
|
166
168
|
context,
|
|
167
|
-
errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
|
|
169
|
+
errorCodes: ["400", "401", "403", "404", "410", "4XX", "500", "5XX"],
|
|
168
170
|
retryConfig: context.retryConfig,
|
|
169
171
|
retryCodes: context.retryCodes,
|
|
170
172
|
});
|
|
@@ -183,6 +185,7 @@ async function $do(
|
|
|
183
185
|
| errors.UnauthorizedErrorResponse
|
|
184
186
|
| errors.ForbiddenErrorResponse
|
|
185
187
|
| errors.NotFoundErrorResponse
|
|
188
|
+
| errors.GoneErrorResponse
|
|
186
189
|
| errors.InternalServerErrorResponse
|
|
187
190
|
| UnkeyError
|
|
188
191
|
| ResponseValidationError
|
|
@@ -198,6 +201,7 @@ async function $do(
|
|
|
198
201
|
M.jsonErr(401, errors.UnauthorizedErrorResponse$inboundSchema),
|
|
199
202
|
M.jsonErr(403, errors.ForbiddenErrorResponse$inboundSchema),
|
|
200
203
|
M.jsonErr(404, errors.NotFoundErrorResponse$inboundSchema),
|
|
204
|
+
M.jsonErr(410, errors.GoneErrorResponse$inboundSchema),
|
|
201
205
|
M.jsonErr(500, errors.InternalServerErrorResponse$inboundSchema),
|
|
202
206
|
M.fail("4XX"),
|
|
203
207
|
M.fail("5XX"),
|
package/src/lib/config.ts
CHANGED
|
@@ -58,7 +58,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
58
58
|
export const SDK_METADATA = {
|
|
59
59
|
language: "typescript",
|
|
60
60
|
openapiDocVersion: "2.0.0",
|
|
61
|
-
sdkVersion: "2.0.
|
|
62
|
-
genVersion: "2.
|
|
63
|
-
userAgent: "speakeasy-sdk/typescript 2.0.
|
|
61
|
+
sdkVersion: "2.0.5",
|
|
62
|
+
genVersion: "2.698.4",
|
|
63
|
+
userAgent: "speakeasy-sdk/typescript 2.0.5 2.698.4 2.0.0 @unkey/api",
|
|
64
64
|
} as const;
|
package/src/lib/security.ts
CHANGED
|
@@ -84,7 +84,10 @@ type SecurityInputOAuth2 = {
|
|
|
84
84
|
type SecurityInputOAuth2ClientCredentials = {
|
|
85
85
|
type: "oauth2:client_credentials";
|
|
86
86
|
value:
|
|
87
|
-
| {
|
|
87
|
+
| {
|
|
88
|
+
clientID?: string | undefined;
|
|
89
|
+
clientSecret?: string | undefined;
|
|
90
|
+
}
|
|
88
91
|
| null
|
|
89
92
|
| string
|
|
90
93
|
| undefined;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -18,7 +18,7 @@ Check and enforce rate limits for any identifier (user ID, IP address, API clien
|
|
|
18
18
|
|
|
19
19
|
Use this for rate limiting beyond API keys - limit users by ID, IPs by address, or any custom identifier. Supports namespace organization, variable costs, and custom overrides.
|
|
20
20
|
|
|
21
|
-
**
|
|
21
|
+
**Response Codes**: Rate limit checks return HTTP 200 regardless of whether the limit is exceeded - check the \`success\` field in the response to determine if the request should be allowed. 4xx responses indicate auth, namespace existence/deletion, or validation errors (e.g., 410 Gone for deleted namespaces). 5xx responses indicate server errors.
|
|
22
22
|
|
|
23
23
|
**Required Permissions**
|
|
24
24
|
|
|
@@ -19,6 +19,8 @@ export * from "./ratelimitrequest.js";
|
|
|
19
19
|
export * from "./ratelimitresponse.js";
|
|
20
20
|
export * from "./role.js";
|
|
21
21
|
export * from "./security.js";
|
|
22
|
+
export * from "./updatekeycreditsdata.js";
|
|
23
|
+
export * from "./updatekeycreditsrefill.js";
|
|
22
24
|
export * from "./v2apiscreateapirequestbody.js";
|
|
23
25
|
export * from "./v2apiscreateapiresponsebody.js";
|
|
24
26
|
export * from "./v2apiscreateapiresponsedata.js";
|
|
@@ -11,14 +11,16 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
11
11
|
/**
|
|
12
12
|
* How often credits are automatically refilled.
|
|
13
13
|
*/
|
|
14
|
-
export const
|
|
14
|
+
export const KeyCreditsRefillInterval = {
|
|
15
15
|
Daily: "daily",
|
|
16
16
|
Monthly: "monthly",
|
|
17
17
|
} as const;
|
|
18
18
|
/**
|
|
19
19
|
* How often credits are automatically refilled.
|
|
20
20
|
*/
|
|
21
|
-
export type
|
|
21
|
+
export type KeyCreditsRefillInterval = ClosedEnum<
|
|
22
|
+
typeof KeyCreditsRefillInterval
|
|
23
|
+
>;
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* Configuration for automatic credit refill behavior.
|
|
@@ -27,7 +29,7 @@ export type KeyCreditsRefill = {
|
|
|
27
29
|
/**
|
|
28
30
|
* How often credits are automatically refilled.
|
|
29
31
|
*/
|
|
30
|
-
interval:
|
|
32
|
+
interval: KeyCreditsRefillInterval;
|
|
31
33
|
/**
|
|
32
34
|
* Number of credits to add during each refill cycle.
|
|
33
35
|
*/
|
|
@@ -43,22 +45,24 @@ export type KeyCreditsRefill = {
|
|
|
43
45
|
};
|
|
44
46
|
|
|
45
47
|
/** @internal */
|
|
46
|
-
export const
|
|
47
|
-
|
|
48
|
+
export const KeyCreditsRefillInterval$inboundSchema: z.ZodNativeEnum<
|
|
49
|
+
typeof KeyCreditsRefillInterval
|
|
50
|
+
> = z.nativeEnum(KeyCreditsRefillInterval);
|
|
48
51
|
|
|
49
52
|
/** @internal */
|
|
50
|
-
export const
|
|
51
|
-
|
|
53
|
+
export const KeyCreditsRefillInterval$outboundSchema: z.ZodNativeEnum<
|
|
54
|
+
typeof KeyCreditsRefillInterval
|
|
55
|
+
> = KeyCreditsRefillInterval$inboundSchema;
|
|
52
56
|
|
|
53
57
|
/**
|
|
54
58
|
* @internal
|
|
55
59
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
56
60
|
*/
|
|
57
|
-
export namespace
|
|
58
|
-
/** @deprecated use `
|
|
59
|
-
export const inboundSchema =
|
|
60
|
-
/** @deprecated use `
|
|
61
|
-
export const outboundSchema =
|
|
61
|
+
export namespace KeyCreditsRefillInterval$ {
|
|
62
|
+
/** @deprecated use `KeyCreditsRefillInterval$inboundSchema` instead. */
|
|
63
|
+
export const inboundSchema = KeyCreditsRefillInterval$inboundSchema;
|
|
64
|
+
/** @deprecated use `KeyCreditsRefillInterval$outboundSchema` instead. */
|
|
65
|
+
export const outboundSchema = KeyCreditsRefillInterval$outboundSchema;
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
/** @internal */
|
|
@@ -67,7 +71,7 @@ export const KeyCreditsRefill$inboundSchema: z.ZodType<
|
|
|
67
71
|
z.ZodTypeDef,
|
|
68
72
|
unknown
|
|
69
73
|
> = z.object({
|
|
70
|
-
interval:
|
|
74
|
+
interval: KeyCreditsRefillInterval$inboundSchema,
|
|
71
75
|
amount: z.number().int(),
|
|
72
76
|
refillDay: z.number().int().optional(),
|
|
73
77
|
});
|
|
@@ -85,7 +89,7 @@ export const KeyCreditsRefill$outboundSchema: z.ZodType<
|
|
|
85
89
|
z.ZodTypeDef,
|
|
86
90
|
KeyCreditsRefill
|
|
87
91
|
> = z.object({
|
|
88
|
-
interval:
|
|
92
|
+
interval: KeyCreditsRefillInterval$outboundSchema,
|
|
89
93
|
amount: z.number().int(),
|
|
90
94
|
refillDay: z.number().int().optional(),
|
|
91
95
|
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
UpdateKeyCreditsRefill,
|
|
11
|
+
UpdateKeyCreditsRefill$inboundSchema,
|
|
12
|
+
UpdateKeyCreditsRefill$Outbound,
|
|
13
|
+
UpdateKeyCreditsRefill$outboundSchema,
|
|
14
|
+
} from "./updatekeycreditsrefill.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Credit configuration and remaining balance for this key.
|
|
18
|
+
*/
|
|
19
|
+
export type UpdateKeyCreditsData = {
|
|
20
|
+
/**
|
|
21
|
+
* Number of credits remaining (null for unlimited). This also clears the refilling schedule.
|
|
22
|
+
*/
|
|
23
|
+
remaining?: number | null | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Configuration for automatic credit refill behavior.
|
|
26
|
+
*/
|
|
27
|
+
refill?: UpdateKeyCreditsRefill | null | undefined;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const UpdateKeyCreditsData$inboundSchema: z.ZodType<
|
|
32
|
+
UpdateKeyCreditsData,
|
|
33
|
+
z.ZodTypeDef,
|
|
34
|
+
unknown
|
|
35
|
+
> = z.object({
|
|
36
|
+
remaining: z.nullable(z.number().int()).optional(),
|
|
37
|
+
refill: z.nullable(UpdateKeyCreditsRefill$inboundSchema).optional(),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export type UpdateKeyCreditsData$Outbound = {
|
|
42
|
+
remaining?: number | null | undefined;
|
|
43
|
+
refill?: UpdateKeyCreditsRefill$Outbound | null | undefined;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** @internal */
|
|
47
|
+
export const UpdateKeyCreditsData$outboundSchema: z.ZodType<
|
|
48
|
+
UpdateKeyCreditsData$Outbound,
|
|
49
|
+
z.ZodTypeDef,
|
|
50
|
+
UpdateKeyCreditsData
|
|
51
|
+
> = z.object({
|
|
52
|
+
remaining: z.nullable(z.number().int()).optional(),
|
|
53
|
+
refill: z.nullable(UpdateKeyCreditsRefill$outboundSchema).optional(),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
59
|
+
*/
|
|
60
|
+
export namespace UpdateKeyCreditsData$ {
|
|
61
|
+
/** @deprecated use `UpdateKeyCreditsData$inboundSchema` instead. */
|
|
62
|
+
export const inboundSchema = UpdateKeyCreditsData$inboundSchema;
|
|
63
|
+
/** @deprecated use `UpdateKeyCreditsData$outboundSchema` instead. */
|
|
64
|
+
export const outboundSchema = UpdateKeyCreditsData$outboundSchema;
|
|
65
|
+
/** @deprecated use `UpdateKeyCreditsData$Outbound` instead. */
|
|
66
|
+
export type Outbound = UpdateKeyCreditsData$Outbound;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function updateKeyCreditsDataToJSON(
|
|
70
|
+
updateKeyCreditsData: UpdateKeyCreditsData,
|
|
71
|
+
): string {
|
|
72
|
+
return JSON.stringify(
|
|
73
|
+
UpdateKeyCreditsData$outboundSchema.parse(updateKeyCreditsData),
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function updateKeyCreditsDataFromJSON(
|
|
78
|
+
jsonString: string,
|
|
79
|
+
): SafeParseResult<UpdateKeyCreditsData, SDKValidationError> {
|
|
80
|
+
return safeParse(
|
|
81
|
+
jsonString,
|
|
82
|
+
(x) => UpdateKeyCreditsData$inboundSchema.parse(JSON.parse(x)),
|
|
83
|
+
`Failed to parse 'UpdateKeyCreditsData' from JSON`,
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* How often credits are automatically refilled.
|
|
13
|
+
*/
|
|
14
|
+
export const UpdateKeyCreditsRefillInterval = {
|
|
15
|
+
Daily: "daily",
|
|
16
|
+
Monthly: "monthly",
|
|
17
|
+
} as const;
|
|
18
|
+
/**
|
|
19
|
+
* How often credits are automatically refilled.
|
|
20
|
+
*/
|
|
21
|
+
export type UpdateKeyCreditsRefillInterval = ClosedEnum<
|
|
22
|
+
typeof UpdateKeyCreditsRefillInterval
|
|
23
|
+
>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for automatic credit refill behavior.
|
|
27
|
+
*/
|
|
28
|
+
export type UpdateKeyCreditsRefill = {
|
|
29
|
+
/**
|
|
30
|
+
* How often credits are automatically refilled.
|
|
31
|
+
*/
|
|
32
|
+
interval: UpdateKeyCreditsRefillInterval;
|
|
33
|
+
/**
|
|
34
|
+
* Number of credits to add during each refill cycle.
|
|
35
|
+
*/
|
|
36
|
+
amount: number;
|
|
37
|
+
/**
|
|
38
|
+
* Day of the month for monthly refills (1-31).
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* Only required when interval is 'monthly'.
|
|
42
|
+
* For days beyond the month's length, refill occurs on the last day of the month.
|
|
43
|
+
*/
|
|
44
|
+
refillDay?: number | undefined;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
export const UpdateKeyCreditsRefillInterval$inboundSchema: z.ZodNativeEnum<
|
|
49
|
+
typeof UpdateKeyCreditsRefillInterval
|
|
50
|
+
> = z.nativeEnum(UpdateKeyCreditsRefillInterval);
|
|
51
|
+
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const UpdateKeyCreditsRefillInterval$outboundSchema: z.ZodNativeEnum<
|
|
54
|
+
typeof UpdateKeyCreditsRefillInterval
|
|
55
|
+
> = UpdateKeyCreditsRefillInterval$inboundSchema;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @internal
|
|
59
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
60
|
+
*/
|
|
61
|
+
export namespace UpdateKeyCreditsRefillInterval$ {
|
|
62
|
+
/** @deprecated use `UpdateKeyCreditsRefillInterval$inboundSchema` instead. */
|
|
63
|
+
export const inboundSchema = UpdateKeyCreditsRefillInterval$inboundSchema;
|
|
64
|
+
/** @deprecated use `UpdateKeyCreditsRefillInterval$outboundSchema` instead. */
|
|
65
|
+
export const outboundSchema = UpdateKeyCreditsRefillInterval$outboundSchema;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** @internal */
|
|
69
|
+
export const UpdateKeyCreditsRefill$inboundSchema: z.ZodType<
|
|
70
|
+
UpdateKeyCreditsRefill,
|
|
71
|
+
z.ZodTypeDef,
|
|
72
|
+
unknown
|
|
73
|
+
> = z.object({
|
|
74
|
+
interval: UpdateKeyCreditsRefillInterval$inboundSchema,
|
|
75
|
+
amount: z.number().int(),
|
|
76
|
+
refillDay: z.number().int().optional(),
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/** @internal */
|
|
80
|
+
export type UpdateKeyCreditsRefill$Outbound = {
|
|
81
|
+
interval: string;
|
|
82
|
+
amount: number;
|
|
83
|
+
refillDay?: number | undefined;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** @internal */
|
|
87
|
+
export const UpdateKeyCreditsRefill$outboundSchema: z.ZodType<
|
|
88
|
+
UpdateKeyCreditsRefill$Outbound,
|
|
89
|
+
z.ZodTypeDef,
|
|
90
|
+
UpdateKeyCreditsRefill
|
|
91
|
+
> = z.object({
|
|
92
|
+
interval: UpdateKeyCreditsRefillInterval$outboundSchema,
|
|
93
|
+
amount: z.number().int(),
|
|
94
|
+
refillDay: z.number().int().optional(),
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @internal
|
|
99
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
100
|
+
*/
|
|
101
|
+
export namespace UpdateKeyCreditsRefill$ {
|
|
102
|
+
/** @deprecated use `UpdateKeyCreditsRefill$inboundSchema` instead. */
|
|
103
|
+
export const inboundSchema = UpdateKeyCreditsRefill$inboundSchema;
|
|
104
|
+
/** @deprecated use `UpdateKeyCreditsRefill$outboundSchema` instead. */
|
|
105
|
+
export const outboundSchema = UpdateKeyCreditsRefill$outboundSchema;
|
|
106
|
+
/** @deprecated use `UpdateKeyCreditsRefill$Outbound` instead. */
|
|
107
|
+
export type Outbound = UpdateKeyCreditsRefill$Outbound;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function updateKeyCreditsRefillToJSON(
|
|
111
|
+
updateKeyCreditsRefill: UpdateKeyCreditsRefill,
|
|
112
|
+
): string {
|
|
113
|
+
return JSON.stringify(
|
|
114
|
+
UpdateKeyCreditsRefill$outboundSchema.parse(updateKeyCreditsRefill),
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function updateKeyCreditsRefillFromJSON(
|
|
119
|
+
jsonString: string,
|
|
120
|
+
): SafeParseResult<UpdateKeyCreditsRefill, SDKValidationError> {
|
|
121
|
+
return safeParse(
|
|
122
|
+
jsonString,
|
|
123
|
+
(x) => UpdateKeyCreditsRefill$inboundSchema.parse(JSON.parse(x)),
|
|
124
|
+
`Failed to parse 'UpdateKeyCreditsRefill' from JSON`,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
@@ -6,18 +6,18 @@ import * as z from "zod";
|
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
-
import {
|
|
10
|
-
KeyCreditsData,
|
|
11
|
-
KeyCreditsData$inboundSchema,
|
|
12
|
-
KeyCreditsData$Outbound,
|
|
13
|
-
KeyCreditsData$outboundSchema,
|
|
14
|
-
} from "./keycreditsdata.js";
|
|
15
9
|
import {
|
|
16
10
|
RatelimitRequest,
|
|
17
11
|
RatelimitRequest$inboundSchema,
|
|
18
12
|
RatelimitRequest$Outbound,
|
|
19
13
|
RatelimitRequest$outboundSchema,
|
|
20
14
|
} from "./ratelimitrequest.js";
|
|
15
|
+
import {
|
|
16
|
+
UpdateKeyCreditsData,
|
|
17
|
+
UpdateKeyCreditsData$inboundSchema,
|
|
18
|
+
UpdateKeyCreditsData$Outbound,
|
|
19
|
+
UpdateKeyCreditsData$outboundSchema,
|
|
20
|
+
} from "./updatekeycreditsdata.js";
|
|
21
21
|
|
|
22
22
|
export type V2KeysUpdateKeyRequestBody = {
|
|
23
23
|
/**
|
|
@@ -68,7 +68,7 @@ export type V2KeysUpdateKeyRequestBody = {
|
|
|
68
68
|
/**
|
|
69
69
|
* Credit configuration and remaining balance for this key.
|
|
70
70
|
*/
|
|
71
|
-
credits?:
|
|
71
|
+
credits?: UpdateKeyCreditsData | null | undefined;
|
|
72
72
|
/**
|
|
73
73
|
* Defines time-based rate limits that protect against abuse by controlling request frequency.
|
|
74
74
|
*
|
|
@@ -102,7 +102,7 @@ export const V2KeysUpdateKeyRequestBody$inboundSchema: z.ZodType<
|
|
|
102
102
|
externalId: z.nullable(z.string()).optional(),
|
|
103
103
|
meta: z.nullable(z.record(z.any())).optional(),
|
|
104
104
|
expires: z.nullable(z.number().int()).optional(),
|
|
105
|
-
credits:
|
|
105
|
+
credits: z.nullable(UpdateKeyCreditsData$inboundSchema).optional(),
|
|
106
106
|
ratelimits: z.array(RatelimitRequest$inboundSchema).optional(),
|
|
107
107
|
enabled: z.boolean().optional(),
|
|
108
108
|
roles: z.array(z.string()).optional(),
|
|
@@ -116,7 +116,7 @@ export type V2KeysUpdateKeyRequestBody$Outbound = {
|
|
|
116
116
|
externalId?: string | null | undefined;
|
|
117
117
|
meta?: { [k: string]: any } | null | undefined;
|
|
118
118
|
expires?: number | null | undefined;
|
|
119
|
-
credits?:
|
|
119
|
+
credits?: UpdateKeyCreditsData$Outbound | null | undefined;
|
|
120
120
|
ratelimits?: Array<RatelimitRequest$Outbound> | undefined;
|
|
121
121
|
enabled?: boolean | undefined;
|
|
122
122
|
roles?: Array<string> | undefined;
|
|
@@ -134,7 +134,7 @@ export const V2KeysUpdateKeyRequestBody$outboundSchema: z.ZodType<
|
|
|
134
134
|
externalId: z.nullable(z.string()).optional(),
|
|
135
135
|
meta: z.nullable(z.record(z.any())).optional(),
|
|
136
136
|
expires: z.nullable(z.number().int()).optional(),
|
|
137
|
-
credits:
|
|
137
|
+
credits: z.nullable(UpdateKeyCreditsData$outboundSchema).optional(),
|
|
138
138
|
ratelimits: z.array(RatelimitRequest$outboundSchema).optional(),
|
|
139
139
|
enabled: z.boolean().optional(),
|
|
140
140
|
roles: z.array(z.string()).optional(),
|