@unkey/api 2.1.0 → 2.1.2
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 +10 -6
- package/bin/mcp-server.js +806 -347
- package/bin/mcp-server.js.map +26 -13
- package/dist/commonjs/funcs/keysMigrateKeys.d.ts +23 -0
- package/dist/commonjs/funcs/keysMigrateKeys.d.ts.map +1 -0
- package/dist/commonjs/funcs/keysMigrateKeys.js +133 -0
- package/dist/commonjs/funcs/keysMigrateKeys.js.map +1 -0
- package/dist/commonjs/funcs/ratelimitLimit.d.ts +0 -4
- package/dist/commonjs/funcs/ratelimitLimit.d.ts.map +1 -1
- package/dist/commonjs/funcs/ratelimitLimit.js +0 -4
- package/dist/commonjs/funcs/ratelimitLimit.js.map +1 -1
- package/dist/commonjs/funcs/ratelimitMultiLimit.d.ts +28 -0
- package/dist/commonjs/funcs/ratelimitMultiLimit.d.ts.map +1 -0
- package/dist/commonjs/funcs/ratelimitMultiLimit.js +139 -0
- package/dist/commonjs/funcs/ratelimitMultiLimit.js.map +1 -0
- package/dist/commonjs/hooks/custom/vercel-edge-fetcher.d.ts +5 -0
- package/dist/commonjs/hooks/custom/vercel-edge-fetcher.d.ts.map +1 -0
- package/dist/commonjs/hooks/custom/vercel-edge-fetcher.js +63 -0
- package/dist/commonjs/hooks/custom/vercel-edge-fetcher.js.map +1 -0
- package/dist/commonjs/hooks/registration.d.ts.map +1 -1
- package/dist/commonjs/hooks/registration.js +3 -4
- package/dist/commonjs/hooks/registration.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +5 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/keysMigrateKeys.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/keysMigrateKeys.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/keysMigrateKeys.js +70 -0
- package/dist/commonjs/mcp-server/tools/keysMigrateKeys.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/ratelimitLimit.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/tools/ratelimitLimit.js +0 -4
- package/dist/commonjs/mcp-server/tools/ratelimitLimit.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/ratelimitMultiLimit.d.ts +9 -0
- package/dist/commonjs/mcp-server/tools/ratelimitMultiLimit.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/ratelimitMultiLimit.js +76 -0
- package/dist/commonjs/mcp-server/tools/ratelimitMultiLimit.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +8 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +8 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/v2keysmigratekeydata.d.ts +113 -0
- package/dist/commonjs/models/components/v2keysmigratekeydata.d.ts.map +1 -0
- package/dist/commonjs/models/components/v2keysmigratekeydata.js +78 -0
- package/dist/commonjs/models/components/v2keysmigratekeydata.js.map +1 -0
- package/dist/commonjs/models/components/v2keysmigratekeysmigration.d.ts +25 -0
- package/dist/commonjs/models/components/v2keysmigratekeysmigration.d.ts.map +1 -0
- package/dist/commonjs/models/components/v2keysmigratekeysmigration.js +60 -0
- package/dist/commonjs/models/components/v2keysmigratekeysmigration.js.map +1 -0
- package/dist/commonjs/models/components/v2keysmigratekeysrequestbody.d.ts +28 -0
- package/dist/commonjs/models/components/v2keysmigratekeysrequestbody.d.ts.map +1 -0
- package/dist/commonjs/models/components/v2keysmigratekeysrequestbody.js +63 -0
- package/dist/commonjs/models/components/v2keysmigratekeysrequestbody.js.map +1 -0
- package/dist/commonjs/models/components/v2keysmigratekeysresponsebody.d.ts +24 -0
- package/dist/commonjs/models/components/v2keysmigratekeysresponsebody.d.ts.map +1 -0
- package/dist/commonjs/models/components/v2keysmigratekeysresponsebody.js +62 -0
- package/dist/commonjs/models/components/v2keysmigratekeysresponsebody.js.map +1 -0
- package/dist/commonjs/models/components/v2keysmigratekeysresponsedata.d.ts +26 -0
- package/dist/commonjs/models/components/v2keysmigratekeysresponsedata.d.ts.map +1 -0
- package/dist/commonjs/models/components/v2keysmigratekeysresponsedata.js +61 -0
- package/dist/commonjs/models/components/v2keysmigratekeysresponsedata.js.map +1 -0
- package/dist/commonjs/models/components/v2keysverifykeyrequestbody.d.ts +5 -0
- package/dist/commonjs/models/components/v2keysverifykeyrequestbody.d.ts.map +1 -1
- package/dist/commonjs/models/components/v2keysverifykeyrequestbody.js +2 -0
- package/dist/commonjs/models/components/v2keysverifykeyrequestbody.js.map +1 -1
- package/dist/commonjs/models/components/v2keysverifykeyresponsedata.d.ts +3 -3
- package/dist/commonjs/models/components/v2ratelimitmultilimitcheck.d.ts +84 -0
- package/dist/commonjs/models/components/v2ratelimitmultilimitcheck.d.ts.map +1 -0
- package/dist/commonjs/models/components/v2ratelimitmultilimitcheck.js +70 -0
- package/dist/commonjs/models/components/v2ratelimitmultilimitcheck.js.map +1 -0
- package/dist/commonjs/models/components/v2ratelimitmultilimitresponsebody.d.ts +27 -0
- package/dist/commonjs/models/components/v2ratelimitmultilimitresponsebody.d.ts.map +1 -0
- package/dist/commonjs/models/components/v2ratelimitmultilimitresponsebody.js +62 -0
- package/dist/commonjs/models/components/v2ratelimitmultilimitresponsebody.js.map +1 -0
- package/dist/commonjs/models/components/v2ratelimitmultilimitresponsedata.d.ts +33 -0
- package/dist/commonjs/models/components/v2ratelimitmultilimitresponsedata.d.ts.map +1 -0
- package/dist/commonjs/models/components/v2ratelimitmultilimitresponsedata.js +61 -0
- package/dist/commonjs/models/components/v2ratelimitmultilimitresponsedata.js.map +1 -0
- package/dist/commonjs/sdk/keys.d.ts +12 -0
- package/dist/commonjs/sdk/keys.d.ts.map +1 -1
- package/dist/commonjs/sdk/keys.js +15 -0
- package/dist/commonjs/sdk/keys.js.map +1 -1
- package/dist/commonjs/sdk/ratelimit.d.ts +17 -4
- package/dist/commonjs/sdk/ratelimit.d.ts.map +1 -1
- package/dist/commonjs/sdk/ratelimit.js +20 -4
- package/dist/commonjs/sdk/ratelimit.js.map +1 -1
- package/dist/commonjs/types/enums.d.ts +10 -6
- package/dist/commonjs/types/enums.d.ts.map +1 -1
- package/dist/commonjs/types/enums.js +76 -2
- package/dist/commonjs/types/enums.js.map +1 -1
- package/dist/commonjs/types/index.d.ts +0 -1
- package/dist/commonjs/types/index.d.ts.map +1 -1
- package/dist/commonjs/types/index.js +1 -3
- package/dist/commonjs/types/index.js.map +1 -1
- package/dist/esm/funcs/keysMigrateKeys.d.ts +23 -0
- package/dist/esm/funcs/keysMigrateKeys.d.ts.map +1 -0
- package/dist/esm/funcs/keysMigrateKeys.js +97 -0
- package/dist/esm/funcs/keysMigrateKeys.js.map +1 -0
- package/dist/esm/funcs/ratelimitLimit.d.ts +0 -4
- package/dist/esm/funcs/ratelimitLimit.d.ts.map +1 -1
- package/dist/esm/funcs/ratelimitLimit.js +0 -4
- package/dist/esm/funcs/ratelimitLimit.js.map +1 -1
- package/dist/esm/funcs/ratelimitMultiLimit.d.ts +28 -0
- package/dist/esm/funcs/ratelimitMultiLimit.d.ts.map +1 -0
- package/dist/esm/funcs/ratelimitMultiLimit.js +103 -0
- package/dist/esm/funcs/ratelimitMultiLimit.js.map +1 -0
- package/dist/esm/hooks/custom/vercel-edge-fetcher.d.ts +5 -0
- package/dist/esm/hooks/custom/vercel-edge-fetcher.d.ts.map +1 -0
- package/dist/esm/hooks/custom/vercel-edge-fetcher.js +59 -0
- package/dist/esm/hooks/custom/vercel-edge-fetcher.js.map +1 -0
- package/dist/esm/hooks/registration.d.ts.map +1 -1
- package/dist/esm/hooks/registration.js +3 -4
- package/dist/esm/hooks/registration.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +5 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/keysMigrateKeys.d.ts +8 -0
- package/dist/esm/mcp-server/tools/keysMigrateKeys.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/keysMigrateKeys.js +34 -0
- package/dist/esm/mcp-server/tools/keysMigrateKeys.js.map +1 -0
- package/dist/esm/mcp-server/tools/ratelimitLimit.d.ts.map +1 -1
- package/dist/esm/mcp-server/tools/ratelimitLimit.js +0 -4
- package/dist/esm/mcp-server/tools/ratelimitLimit.js.map +1 -1
- package/dist/esm/mcp-server/tools/ratelimitMultiLimit.d.ts +9 -0
- package/dist/esm/mcp-server/tools/ratelimitMultiLimit.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/ratelimitMultiLimit.js +40 -0
- package/dist/esm/mcp-server/tools/ratelimitMultiLimit.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +8 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +8 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/v2keysmigratekeydata.d.ts +113 -0
- package/dist/esm/models/components/v2keysmigratekeydata.d.ts.map +1 -0
- package/dist/esm/models/components/v2keysmigratekeydata.js +40 -0
- package/dist/esm/models/components/v2keysmigratekeydata.js.map +1 -0
- package/dist/esm/models/components/v2keysmigratekeysmigration.d.ts +25 -0
- package/dist/esm/models/components/v2keysmigratekeysmigration.d.ts.map +1 -0
- package/dist/esm/models/components/v2keysmigratekeysmigration.js +22 -0
- package/dist/esm/models/components/v2keysmigratekeysmigration.js.map +1 -0
- package/dist/esm/models/components/v2keysmigratekeysrequestbody.d.ts +28 -0
- package/dist/esm/models/components/v2keysmigratekeysrequestbody.d.ts.map +1 -0
- package/dist/esm/models/components/v2keysmigratekeysrequestbody.js +25 -0
- package/dist/esm/models/components/v2keysmigratekeysrequestbody.js.map +1 -0
- package/dist/esm/models/components/v2keysmigratekeysresponsebody.d.ts +24 -0
- package/dist/esm/models/components/v2keysmigratekeysresponsebody.d.ts.map +1 -0
- package/dist/esm/models/components/v2keysmigratekeysresponsebody.js +24 -0
- package/dist/esm/models/components/v2keysmigratekeysresponsebody.js.map +1 -0
- package/dist/esm/models/components/v2keysmigratekeysresponsedata.d.ts +26 -0
- package/dist/esm/models/components/v2keysmigratekeysresponsedata.d.ts.map +1 -0
- package/dist/esm/models/components/v2keysmigratekeysresponsedata.js +23 -0
- package/dist/esm/models/components/v2keysmigratekeysresponsedata.js.map +1 -0
- package/dist/esm/models/components/v2keysverifykeyrequestbody.d.ts +5 -0
- package/dist/esm/models/components/v2keysverifykeyrequestbody.d.ts.map +1 -1
- package/dist/esm/models/components/v2keysverifykeyrequestbody.js +2 -0
- package/dist/esm/models/components/v2keysverifykeyrequestbody.js.map +1 -1
- package/dist/esm/models/components/v2keysverifykeyresponsedata.d.ts +3 -3
- package/dist/esm/models/components/v2ratelimitmultilimitcheck.d.ts +84 -0
- package/dist/esm/models/components/v2ratelimitmultilimitcheck.d.ts.map +1 -0
- package/dist/esm/models/components/v2ratelimitmultilimitcheck.js +32 -0
- package/dist/esm/models/components/v2ratelimitmultilimitcheck.js.map +1 -0
- package/dist/esm/models/components/v2ratelimitmultilimitresponsebody.d.ts +27 -0
- package/dist/esm/models/components/v2ratelimitmultilimitresponsebody.d.ts.map +1 -0
- package/dist/esm/models/components/v2ratelimitmultilimitresponsebody.js +24 -0
- package/dist/esm/models/components/v2ratelimitmultilimitresponsebody.js.map +1 -0
- package/dist/esm/models/components/v2ratelimitmultilimitresponsedata.d.ts +33 -0
- package/dist/esm/models/components/v2ratelimitmultilimitresponsedata.d.ts.map +1 -0
- package/dist/esm/models/components/v2ratelimitmultilimitresponsedata.js +23 -0
- package/dist/esm/models/components/v2ratelimitmultilimitresponsedata.js.map +1 -0
- package/dist/esm/sdk/keys.d.ts +12 -0
- package/dist/esm/sdk/keys.d.ts.map +1 -1
- package/dist/esm/sdk/keys.js +15 -0
- package/dist/esm/sdk/keys.js.map +1 -1
- package/dist/esm/sdk/ratelimit.d.ts +17 -4
- package/dist/esm/sdk/ratelimit.d.ts.map +1 -1
- package/dist/esm/sdk/ratelimit.js +20 -4
- package/dist/esm/sdk/ratelimit.js.map +1 -1
- package/dist/esm/types/enums.d.ts +10 -6
- package/dist/esm/types/enums.d.ts.map +1 -1
- package/dist/esm/types/enums.js +38 -1
- package/dist/esm/types/enums.js.map +1 -1
- package/dist/esm/types/index.d.ts +0 -1
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/index.js +0 -1
- package/dist/esm/types/index.js.map +1 -1
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/keysMigrateKeys.ts +201 -0
- package/src/funcs/ratelimitLimit.ts +0 -4
- package/src/funcs/ratelimitMultiLimit.ts +213 -0
- package/src/hooks/custom/vercel-edge-fetcher.ts +64 -0
- package/src/hooks/registration.ts +3 -4
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/keysMigrateKeys.ts +43 -0
- package/src/mcp-server/tools/ratelimitLimit.ts +0 -4
- package/src/mcp-server/tools/ratelimitMultiLimit.ts +49 -0
- package/src/models/components/index.ts +8 -0
- package/src/models/components/v2keysmigratekeydata.ts +171 -0
- package/src/models/components/v2keysmigratekeysmigration.ts +61 -0
- package/src/models/components/v2keysmigratekeysrequestbody.ts +73 -0
- package/src/models/components/v2keysmigratekeysresponsebody.ts +72 -0
- package/src/models/components/v2keysmigratekeysresponsedata.ts +69 -0
- package/src/models/components/v2keysverifykeyrequestbody.ts +7 -0
- package/src/models/components/v2keysverifykeyresponsedata.ts +3 -3
- package/src/models/components/v2ratelimitmultilimitcheck.ts +130 -0
- package/src/models/components/v2ratelimitmultilimitresponsebody.ts +75 -0
- package/src/models/components/v2ratelimitmultilimitresponsedata.ts +76 -0
- package/src/sdk/keys.ts +23 -0
- package/src/sdk/ratelimit.ts +28 -4
- package/src/types/enums.ts +55 -6
- package/src/types/index.ts +0 -1
package/bin/mcp-server.js
CHANGED
|
@@ -34085,8 +34085,231 @@ var init_mcp = __esm(() => {
|
|
|
34085
34085
|
};
|
|
34086
34086
|
});
|
|
34087
34087
|
|
|
34088
|
+
// src/lib/http.ts
|
|
34089
|
+
class HTTPClient {
|
|
34090
|
+
options;
|
|
34091
|
+
fetcher;
|
|
34092
|
+
requestHooks = [];
|
|
34093
|
+
requestErrorHooks = [];
|
|
34094
|
+
responseHooks = [];
|
|
34095
|
+
constructor(options = {}) {
|
|
34096
|
+
this.options = options;
|
|
34097
|
+
this.fetcher = options.fetcher || DEFAULT_FETCHER;
|
|
34098
|
+
}
|
|
34099
|
+
async request(request) {
|
|
34100
|
+
let req = request;
|
|
34101
|
+
for (const hook of this.requestHooks) {
|
|
34102
|
+
const nextRequest = await hook(req);
|
|
34103
|
+
if (nextRequest) {
|
|
34104
|
+
req = nextRequest;
|
|
34105
|
+
}
|
|
34106
|
+
}
|
|
34107
|
+
try {
|
|
34108
|
+
const res = await this.fetcher(req);
|
|
34109
|
+
for (const hook of this.responseHooks) {
|
|
34110
|
+
await hook(res, req);
|
|
34111
|
+
}
|
|
34112
|
+
return res;
|
|
34113
|
+
} catch (err) {
|
|
34114
|
+
for (const hook of this.requestErrorHooks) {
|
|
34115
|
+
await hook(err, req);
|
|
34116
|
+
}
|
|
34117
|
+
throw err;
|
|
34118
|
+
}
|
|
34119
|
+
}
|
|
34120
|
+
addHook(...args) {
|
|
34121
|
+
if (args[0] === "beforeRequest") {
|
|
34122
|
+
this.requestHooks.push(args[1]);
|
|
34123
|
+
} else if (args[0] === "requestError") {
|
|
34124
|
+
this.requestErrorHooks.push(args[1]);
|
|
34125
|
+
} else if (args[0] === "response") {
|
|
34126
|
+
this.responseHooks.push(args[1]);
|
|
34127
|
+
} else {
|
|
34128
|
+
throw new Error(`Invalid hook type: ${args[0]}`);
|
|
34129
|
+
}
|
|
34130
|
+
return this;
|
|
34131
|
+
}
|
|
34132
|
+
removeHook(...args) {
|
|
34133
|
+
let target;
|
|
34134
|
+
if (args[0] === "beforeRequest") {
|
|
34135
|
+
target = this.requestHooks;
|
|
34136
|
+
} else if (args[0] === "requestError") {
|
|
34137
|
+
target = this.requestErrorHooks;
|
|
34138
|
+
} else if (args[0] === "response") {
|
|
34139
|
+
target = this.responseHooks;
|
|
34140
|
+
} else {
|
|
34141
|
+
throw new Error(`Invalid hook type: ${args[0]}`);
|
|
34142
|
+
}
|
|
34143
|
+
const index = target.findIndex((v2) => v2 === args[1]);
|
|
34144
|
+
if (index >= 0) {
|
|
34145
|
+
target.splice(index, 1);
|
|
34146
|
+
}
|
|
34147
|
+
return this;
|
|
34148
|
+
}
|
|
34149
|
+
clone() {
|
|
34150
|
+
const child = new HTTPClient(this.options);
|
|
34151
|
+
child.requestHooks = this.requestHooks.slice();
|
|
34152
|
+
child.requestErrorHooks = this.requestErrorHooks.slice();
|
|
34153
|
+
child.responseHooks = this.responseHooks.slice();
|
|
34154
|
+
return child;
|
|
34155
|
+
}
|
|
34156
|
+
}
|
|
34157
|
+
function matchContentType(response, pattern) {
|
|
34158
|
+
if (pattern === "*") {
|
|
34159
|
+
return true;
|
|
34160
|
+
}
|
|
34161
|
+
let contentType2 = response.headers.get("content-type")?.trim() || "application/octet-stream";
|
|
34162
|
+
contentType2 = contentType2.toLowerCase();
|
|
34163
|
+
const wantParts = pattern.toLowerCase().trim().split(mediaParamSeparator);
|
|
34164
|
+
const [wantType = "", ...wantParams] = wantParts;
|
|
34165
|
+
if (wantType.split("/").length !== 2) {
|
|
34166
|
+
return false;
|
|
34167
|
+
}
|
|
34168
|
+
const gotParts = contentType2.split(mediaParamSeparator);
|
|
34169
|
+
const [gotType = "", ...gotParams] = gotParts;
|
|
34170
|
+
const [type = "", subtype = ""] = gotType.split("/");
|
|
34171
|
+
if (!type || !subtype) {
|
|
34172
|
+
return false;
|
|
34173
|
+
}
|
|
34174
|
+
if (wantType !== "*/*" && gotType !== wantType && `${type}/*` !== wantType && `*/${subtype}` !== wantType) {
|
|
34175
|
+
return false;
|
|
34176
|
+
}
|
|
34177
|
+
if (gotParams.length < wantParams.length) {
|
|
34178
|
+
return false;
|
|
34179
|
+
}
|
|
34180
|
+
const params = new Set(gotParams);
|
|
34181
|
+
for (const wantParam of wantParams) {
|
|
34182
|
+
if (!params.has(wantParam)) {
|
|
34183
|
+
return false;
|
|
34184
|
+
}
|
|
34185
|
+
}
|
|
34186
|
+
return true;
|
|
34187
|
+
}
|
|
34188
|
+
function matchStatusCode(response, codes) {
|
|
34189
|
+
const actual = `${response.status}`;
|
|
34190
|
+
const expectedCodes = Array.isArray(codes) ? codes : [codes];
|
|
34191
|
+
if (!expectedCodes.length) {
|
|
34192
|
+
return false;
|
|
34193
|
+
}
|
|
34194
|
+
return expectedCodes.some((ec) => {
|
|
34195
|
+
const code = `${ec}`;
|
|
34196
|
+
if (code === "default") {
|
|
34197
|
+
return true;
|
|
34198
|
+
}
|
|
34199
|
+
if (!codeRangeRE.test(`${code}`)) {
|
|
34200
|
+
return code === actual;
|
|
34201
|
+
}
|
|
34202
|
+
const expectFamily = code.charAt(0);
|
|
34203
|
+
if (!expectFamily) {
|
|
34204
|
+
throw new Error("Invalid status code range");
|
|
34205
|
+
}
|
|
34206
|
+
const actualFamily = actual.charAt(0);
|
|
34207
|
+
if (!actualFamily) {
|
|
34208
|
+
throw new Error(`Invalid response status code: ${actual}`);
|
|
34209
|
+
}
|
|
34210
|
+
return actualFamily === expectFamily;
|
|
34211
|
+
});
|
|
34212
|
+
}
|
|
34213
|
+
function matchResponse(response, code, contentTypePattern) {
|
|
34214
|
+
return matchStatusCode(response, code) && matchContentType(response, contentTypePattern);
|
|
34215
|
+
}
|
|
34216
|
+
function isConnectionError(err) {
|
|
34217
|
+
if (typeof err !== "object" || err == null) {
|
|
34218
|
+
return false;
|
|
34219
|
+
}
|
|
34220
|
+
const isBrowserErr = err instanceof TypeError && err.message.toLowerCase().startsWith("failed to fetch");
|
|
34221
|
+
const isNodeErr = err instanceof TypeError && err.message.toLowerCase().startsWith("fetch failed");
|
|
34222
|
+
const isBunErr = "name" in err && err.name === "ConnectionError";
|
|
34223
|
+
const isGenericErr = "code" in err && typeof err.code === "string" && err.code.toLowerCase() === "econnreset";
|
|
34224
|
+
return isBrowserErr || isNodeErr || isGenericErr || isBunErr;
|
|
34225
|
+
}
|
|
34226
|
+
function isTimeoutError(err) {
|
|
34227
|
+
if (typeof err !== "object" || err == null) {
|
|
34228
|
+
return false;
|
|
34229
|
+
}
|
|
34230
|
+
const isNative = "name" in err && err.name === "TimeoutError";
|
|
34231
|
+
const isLegacyNative = "code" in err && err.code === 23;
|
|
34232
|
+
const isGenericErr = "code" in err && typeof err.code === "string" && err.code.toLowerCase() === "econnaborted";
|
|
34233
|
+
return isNative || isLegacyNative || isGenericErr;
|
|
34234
|
+
}
|
|
34235
|
+
function isAbortError(err) {
|
|
34236
|
+
if (typeof err !== "object" || err == null) {
|
|
34237
|
+
return false;
|
|
34238
|
+
}
|
|
34239
|
+
const isNative = "name" in err && err.name === "AbortError";
|
|
34240
|
+
const isLegacyNative = "code" in err && err.code === 20;
|
|
34241
|
+
const isGenericErr = "code" in err && typeof err.code === "string" && err.code.toLowerCase() === "econnaborted";
|
|
34242
|
+
return isNative || isLegacyNative || isGenericErr;
|
|
34243
|
+
}
|
|
34244
|
+
var DEFAULT_FETCHER = (input, init) => {
|
|
34245
|
+
if (init == null) {
|
|
34246
|
+
return fetch(input);
|
|
34247
|
+
} else {
|
|
34248
|
+
return fetch(input, init);
|
|
34249
|
+
}
|
|
34250
|
+
}, mediaParamSeparator, codeRangeRE;
|
|
34251
|
+
var init_http = __esm(() => {
|
|
34252
|
+
mediaParamSeparator = /\s*;\s*/g;
|
|
34253
|
+
codeRangeRE = new RegExp("^[0-9]xx$", "i");
|
|
34254
|
+
});
|
|
34255
|
+
|
|
34256
|
+
// src/hooks/custom/vercel-edge-fetcher.ts
|
|
34257
|
+
function isVercelEdgeRuntime() {
|
|
34258
|
+
if ("EdgeRuntime" in globalThis)
|
|
34259
|
+
return true;
|
|
34260
|
+
if (process.env["NEXT_RUNTIME"] === "edge")
|
|
34261
|
+
return true;
|
|
34262
|
+
return false;
|
|
34263
|
+
}
|
|
34264
|
+
|
|
34265
|
+
class FetcherOverrideForVercelEdgeHook {
|
|
34266
|
+
sdkInit(opts) {
|
|
34267
|
+
if (!isVercelEdgeRuntime()) {
|
|
34268
|
+
return opts;
|
|
34269
|
+
}
|
|
34270
|
+
const client = new HTTPClient({
|
|
34271
|
+
fetcher: vercelEdgeFetcher
|
|
34272
|
+
});
|
|
34273
|
+
return {
|
|
34274
|
+
...opts,
|
|
34275
|
+
client
|
|
34276
|
+
};
|
|
34277
|
+
}
|
|
34278
|
+
}
|
|
34279
|
+
var vercelEdgeFetcher = (input, init) => {
|
|
34280
|
+
const isRequestLike = typeof input === "object" && input !== null && "url" in input && "method" in input && "headers" in input;
|
|
34281
|
+
if (isRequestLike && !init) {
|
|
34282
|
+
const req = input;
|
|
34283
|
+
return fetch(req.url, {
|
|
34284
|
+
method: req.method,
|
|
34285
|
+
headers: req.headers,
|
|
34286
|
+
body: req.body,
|
|
34287
|
+
mode: req.mode,
|
|
34288
|
+
credentials: req.credentials,
|
|
34289
|
+
cache: req.cache,
|
|
34290
|
+
redirect: req.redirect,
|
|
34291
|
+
referrer: req.referrer,
|
|
34292
|
+
integrity: req.integrity,
|
|
34293
|
+
signal: req.signal
|
|
34294
|
+
});
|
|
34295
|
+
}
|
|
34296
|
+
if (init == null) {
|
|
34297
|
+
return fetch(input);
|
|
34298
|
+
} else {
|
|
34299
|
+
return fetch(input, init);
|
|
34300
|
+
}
|
|
34301
|
+
};
|
|
34302
|
+
var init_vercel_edge_fetcher = __esm(() => {
|
|
34303
|
+
init_http();
|
|
34304
|
+
});
|
|
34305
|
+
|
|
34088
34306
|
// src/hooks/registration.ts
|
|
34089
|
-
function initHooks(hooks) {
|
|
34307
|
+
function initHooks(hooks) {
|
|
34308
|
+
hooks.registerSDKInitHook(new FetcherOverrideForVercelEdgeHook);
|
|
34309
|
+
}
|
|
34310
|
+
var init_registration = __esm(() => {
|
|
34311
|
+
init_vercel_edge_fetcher();
|
|
34312
|
+
});
|
|
34090
34313
|
|
|
34091
34314
|
// src/hooks/hooks.ts
|
|
34092
34315
|
class SDKHooks {
|
|
@@ -34166,7 +34389,9 @@ class SDKHooks {
|
|
|
34166
34389
|
return { response: res, error: err };
|
|
34167
34390
|
}
|
|
34168
34391
|
}
|
|
34169
|
-
var init_hooks = () => {
|
|
34392
|
+
var init_hooks = __esm(() => {
|
|
34393
|
+
init_registration();
|
|
34394
|
+
});
|
|
34170
34395
|
|
|
34171
34396
|
// src/models/errors/httpclienterrors.ts
|
|
34172
34397
|
var HTTPClientError, UnexpectedClientError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, ConnectionError;
|
|
@@ -34274,9 +34499,9 @@ var init_config = __esm(() => {
|
|
|
34274
34499
|
SDK_METADATA = {
|
|
34275
34500
|
language: "typescript",
|
|
34276
34501
|
openapiDocVersion: "2.0.0",
|
|
34277
|
-
sdkVersion: "2.1.
|
|
34278
|
-
genVersion: "2.
|
|
34279
|
-
userAgent: "speakeasy-sdk/typescript 2.1.
|
|
34502
|
+
sdkVersion: "2.1.2",
|
|
34503
|
+
genVersion: "2.753.6",
|
|
34504
|
+
userAgent: "speakeasy-sdk/typescript 2.1.2 2.753.6 2.0.0 @unkey/api"
|
|
34280
34505
|
};
|
|
34281
34506
|
});
|
|
34282
34507
|
|
|
@@ -34494,186 +34719,18 @@ function env() {
|
|
|
34494
34719
|
if (isDeno()) {
|
|
34495
34720
|
envObject = globalThis.Deno?.env?.toObject?.() ?? {};
|
|
34496
34721
|
} else {
|
|
34497
|
-
envObject = dlv(globalThis, "process.env") ?? {};
|
|
34498
|
-
}
|
|
34499
|
-
envMemo = envSchema.parse(envObject);
|
|
34500
|
-
return envMemo;
|
|
34501
|
-
}
|
|
34502
|
-
var envSchema, envMemo = undefined;
|
|
34503
|
-
var init_env = __esm(() => {
|
|
34504
|
-
init_v3();
|
|
34505
|
-
envSchema = objectType({
|
|
34506
|
-
UNKEY_ROOT_KEY: stringType().optional(),
|
|
34507
|
-
UNKEY_DEBUG: coerce.boolean().optional()
|
|
34508
|
-
});
|
|
34509
|
-
});
|
|
34510
|
-
|
|
34511
|
-
// src/lib/http.ts
|
|
34512
|
-
class HTTPClient {
|
|
34513
|
-
options;
|
|
34514
|
-
fetcher;
|
|
34515
|
-
requestHooks = [];
|
|
34516
|
-
requestErrorHooks = [];
|
|
34517
|
-
responseHooks = [];
|
|
34518
|
-
constructor(options = {}) {
|
|
34519
|
-
this.options = options;
|
|
34520
|
-
this.fetcher = options.fetcher || DEFAULT_FETCHER;
|
|
34521
|
-
}
|
|
34522
|
-
async request(request) {
|
|
34523
|
-
let req = request;
|
|
34524
|
-
for (const hook of this.requestHooks) {
|
|
34525
|
-
const nextRequest = await hook(req);
|
|
34526
|
-
if (nextRequest) {
|
|
34527
|
-
req = nextRequest;
|
|
34528
|
-
}
|
|
34529
|
-
}
|
|
34530
|
-
try {
|
|
34531
|
-
const res = await this.fetcher(req);
|
|
34532
|
-
for (const hook of this.responseHooks) {
|
|
34533
|
-
await hook(res, req);
|
|
34534
|
-
}
|
|
34535
|
-
return res;
|
|
34536
|
-
} catch (err) {
|
|
34537
|
-
for (const hook of this.requestErrorHooks) {
|
|
34538
|
-
await hook(err, req);
|
|
34539
|
-
}
|
|
34540
|
-
throw err;
|
|
34541
|
-
}
|
|
34542
|
-
}
|
|
34543
|
-
addHook(...args) {
|
|
34544
|
-
if (args[0] === "beforeRequest") {
|
|
34545
|
-
this.requestHooks.push(args[1]);
|
|
34546
|
-
} else if (args[0] === "requestError") {
|
|
34547
|
-
this.requestErrorHooks.push(args[1]);
|
|
34548
|
-
} else if (args[0] === "response") {
|
|
34549
|
-
this.responseHooks.push(args[1]);
|
|
34550
|
-
} else {
|
|
34551
|
-
throw new Error(`Invalid hook type: ${args[0]}`);
|
|
34552
|
-
}
|
|
34553
|
-
return this;
|
|
34554
|
-
}
|
|
34555
|
-
removeHook(...args) {
|
|
34556
|
-
let target;
|
|
34557
|
-
if (args[0] === "beforeRequest") {
|
|
34558
|
-
target = this.requestHooks;
|
|
34559
|
-
} else if (args[0] === "requestError") {
|
|
34560
|
-
target = this.requestErrorHooks;
|
|
34561
|
-
} else if (args[0] === "response") {
|
|
34562
|
-
target = this.responseHooks;
|
|
34563
|
-
} else {
|
|
34564
|
-
throw new Error(`Invalid hook type: ${args[0]}`);
|
|
34565
|
-
}
|
|
34566
|
-
const index = target.findIndex((v2) => v2 === args[1]);
|
|
34567
|
-
if (index >= 0) {
|
|
34568
|
-
target.splice(index, 1);
|
|
34569
|
-
}
|
|
34570
|
-
return this;
|
|
34571
|
-
}
|
|
34572
|
-
clone() {
|
|
34573
|
-
const child = new HTTPClient(this.options);
|
|
34574
|
-
child.requestHooks = this.requestHooks.slice();
|
|
34575
|
-
child.requestErrorHooks = this.requestErrorHooks.slice();
|
|
34576
|
-
child.responseHooks = this.responseHooks.slice();
|
|
34577
|
-
return child;
|
|
34578
|
-
}
|
|
34579
|
-
}
|
|
34580
|
-
function matchContentType(response, pattern) {
|
|
34581
|
-
if (pattern === "*") {
|
|
34582
|
-
return true;
|
|
34583
|
-
}
|
|
34584
|
-
let contentType2 = response.headers.get("content-type")?.trim() || "application/octet-stream";
|
|
34585
|
-
contentType2 = contentType2.toLowerCase();
|
|
34586
|
-
const wantParts = pattern.toLowerCase().trim().split(mediaParamSeparator);
|
|
34587
|
-
const [wantType = "", ...wantParams] = wantParts;
|
|
34588
|
-
if (wantType.split("/").length !== 2) {
|
|
34589
|
-
return false;
|
|
34590
|
-
}
|
|
34591
|
-
const gotParts = contentType2.split(mediaParamSeparator);
|
|
34592
|
-
const [gotType = "", ...gotParams] = gotParts;
|
|
34593
|
-
const [type = "", subtype = ""] = gotType.split("/");
|
|
34594
|
-
if (!type || !subtype) {
|
|
34595
|
-
return false;
|
|
34596
|
-
}
|
|
34597
|
-
if (wantType !== "*/*" && gotType !== wantType && `${type}/*` !== wantType && `*/${subtype}` !== wantType) {
|
|
34598
|
-
return false;
|
|
34599
|
-
}
|
|
34600
|
-
if (gotParams.length < wantParams.length) {
|
|
34601
|
-
return false;
|
|
34602
|
-
}
|
|
34603
|
-
const params = new Set(gotParams);
|
|
34604
|
-
for (const wantParam of wantParams) {
|
|
34605
|
-
if (!params.has(wantParam)) {
|
|
34606
|
-
return false;
|
|
34607
|
-
}
|
|
34608
|
-
}
|
|
34609
|
-
return true;
|
|
34610
|
-
}
|
|
34611
|
-
function matchStatusCode(response, codes) {
|
|
34612
|
-
const actual = `${response.status}`;
|
|
34613
|
-
const expectedCodes = Array.isArray(codes) ? codes : [codes];
|
|
34614
|
-
if (!expectedCodes.length) {
|
|
34615
|
-
return false;
|
|
34616
|
-
}
|
|
34617
|
-
return expectedCodes.some((ec) => {
|
|
34618
|
-
const code = `${ec}`;
|
|
34619
|
-
if (code === "default") {
|
|
34620
|
-
return true;
|
|
34621
|
-
}
|
|
34622
|
-
if (!codeRangeRE.test(`${code}`)) {
|
|
34623
|
-
return code === actual;
|
|
34624
|
-
}
|
|
34625
|
-
const expectFamily = code.charAt(0);
|
|
34626
|
-
if (!expectFamily) {
|
|
34627
|
-
throw new Error("Invalid status code range");
|
|
34628
|
-
}
|
|
34629
|
-
const actualFamily = actual.charAt(0);
|
|
34630
|
-
if (!actualFamily) {
|
|
34631
|
-
throw new Error(`Invalid response status code: ${actual}`);
|
|
34632
|
-
}
|
|
34633
|
-
return actualFamily === expectFamily;
|
|
34634
|
-
});
|
|
34635
|
-
}
|
|
34636
|
-
function matchResponse(response, code, contentTypePattern) {
|
|
34637
|
-
return matchStatusCode(response, code) && matchContentType(response, contentTypePattern);
|
|
34638
|
-
}
|
|
34639
|
-
function isConnectionError(err) {
|
|
34640
|
-
if (typeof err !== "object" || err == null) {
|
|
34641
|
-
return false;
|
|
34642
|
-
}
|
|
34643
|
-
const isBrowserErr = err instanceof TypeError && err.message.toLowerCase().startsWith("failed to fetch");
|
|
34644
|
-
const isNodeErr = err instanceof TypeError && err.message.toLowerCase().startsWith("fetch failed");
|
|
34645
|
-
const isBunErr = "name" in err && err.name === "ConnectionError";
|
|
34646
|
-
const isGenericErr = "code" in err && typeof err.code === "string" && err.code.toLowerCase() === "econnreset";
|
|
34647
|
-
return isBrowserErr || isNodeErr || isGenericErr || isBunErr;
|
|
34648
|
-
}
|
|
34649
|
-
function isTimeoutError(err) {
|
|
34650
|
-
if (typeof err !== "object" || err == null) {
|
|
34651
|
-
return false;
|
|
34652
|
-
}
|
|
34653
|
-
const isNative = "name" in err && err.name === "TimeoutError";
|
|
34654
|
-
const isLegacyNative = "code" in err && err.code === 23;
|
|
34655
|
-
const isGenericErr = "code" in err && typeof err.code === "string" && err.code.toLowerCase() === "econnaborted";
|
|
34656
|
-
return isNative || isLegacyNative || isGenericErr;
|
|
34657
|
-
}
|
|
34658
|
-
function isAbortError(err) {
|
|
34659
|
-
if (typeof err !== "object" || err == null) {
|
|
34660
|
-
return false;
|
|
34661
|
-
}
|
|
34662
|
-
const isNative = "name" in err && err.name === "AbortError";
|
|
34663
|
-
const isLegacyNative = "code" in err && err.code === 20;
|
|
34664
|
-
const isGenericErr = "code" in err && typeof err.code === "string" && err.code.toLowerCase() === "econnaborted";
|
|
34665
|
-
return isNative || isLegacyNative || isGenericErr;
|
|
34666
|
-
}
|
|
34667
|
-
var DEFAULT_FETCHER = (input, init) => {
|
|
34668
|
-
if (init == null) {
|
|
34669
|
-
return fetch(input);
|
|
34670
|
-
} else {
|
|
34671
|
-
return fetch(input, init);
|
|
34722
|
+
envObject = dlv(globalThis, "process.env") ?? {};
|
|
34672
34723
|
}
|
|
34673
|
-
|
|
34674
|
-
|
|
34675
|
-
|
|
34676
|
-
|
|
34724
|
+
envMemo = envSchema.parse(envObject);
|
|
34725
|
+
return envMemo;
|
|
34726
|
+
}
|
|
34727
|
+
var envSchema, envMemo = undefined;
|
|
34728
|
+
var init_env = __esm(() => {
|
|
34729
|
+
init_v3();
|
|
34730
|
+
envSchema = objectType({
|
|
34731
|
+
UNKEY_ROOT_KEY: stringType().optional(),
|
|
34732
|
+
UNKEY_DEBUG: coerce.boolean().optional()
|
|
34733
|
+
});
|
|
34677
34734
|
});
|
|
34678
34735
|
|
|
34679
34736
|
// src/lib/retries.ts
|
|
@@ -36609,6 +36666,100 @@ var init_v2keysgetkeyresponsebody = __esm(() => {
|
|
|
36609
36666
|
});
|
|
36610
36667
|
});
|
|
36611
36668
|
|
|
36669
|
+
// src/models/components/v2keysmigratekeydata.ts
|
|
36670
|
+
var V2KeysMigrateKeyData$inboundSchema, V2KeysMigrateKeyData$outboundSchema;
|
|
36671
|
+
var init_v2keysmigratekeydata = __esm(() => {
|
|
36672
|
+
init_v3();
|
|
36673
|
+
init_keycreditsdata();
|
|
36674
|
+
init_ratelimitrequest();
|
|
36675
|
+
V2KeysMigrateKeyData$inboundSchema = objectType({
|
|
36676
|
+
hash: stringType(),
|
|
36677
|
+
name: stringType().optional(),
|
|
36678
|
+
externalId: stringType().optional(),
|
|
36679
|
+
meta: recordType(anyType()).optional(),
|
|
36680
|
+
roles: arrayType(stringType()).optional(),
|
|
36681
|
+
permissions: arrayType(stringType()).optional(),
|
|
36682
|
+
expires: numberType().int().optional(),
|
|
36683
|
+
enabled: booleanType().default(true),
|
|
36684
|
+
credits: KeyCreditsData$inboundSchema.optional(),
|
|
36685
|
+
ratelimits: arrayType(RatelimitRequest$inboundSchema).optional()
|
|
36686
|
+
});
|
|
36687
|
+
V2KeysMigrateKeyData$outboundSchema = objectType({
|
|
36688
|
+
hash: stringType(),
|
|
36689
|
+
name: stringType().optional(),
|
|
36690
|
+
externalId: stringType().optional(),
|
|
36691
|
+
meta: recordType(anyType()).optional(),
|
|
36692
|
+
roles: arrayType(stringType()).optional(),
|
|
36693
|
+
permissions: arrayType(stringType()).optional(),
|
|
36694
|
+
expires: numberType().int().optional(),
|
|
36695
|
+
enabled: booleanType().default(true),
|
|
36696
|
+
credits: KeyCreditsData$outboundSchema.optional(),
|
|
36697
|
+
ratelimits: arrayType(RatelimitRequest$outboundSchema).optional()
|
|
36698
|
+
});
|
|
36699
|
+
});
|
|
36700
|
+
|
|
36701
|
+
// src/models/components/v2keysmigratekeysmigration.ts
|
|
36702
|
+
var V2KeysMigrateKeysMigration$inboundSchema, V2KeysMigrateKeysMigration$outboundSchema;
|
|
36703
|
+
var init_v2keysmigratekeysmigration = __esm(() => {
|
|
36704
|
+
init_v3();
|
|
36705
|
+
V2KeysMigrateKeysMigration$inboundSchema = objectType({
|
|
36706
|
+
hash: stringType(),
|
|
36707
|
+
keyId: stringType()
|
|
36708
|
+
});
|
|
36709
|
+
V2KeysMigrateKeysMigration$outboundSchema = objectType({
|
|
36710
|
+
hash: stringType(),
|
|
36711
|
+
keyId: stringType()
|
|
36712
|
+
});
|
|
36713
|
+
});
|
|
36714
|
+
|
|
36715
|
+
// src/models/components/v2keysmigratekeysrequestbody.ts
|
|
36716
|
+
var V2KeysMigrateKeysRequestBody$inboundSchema, V2KeysMigrateKeysRequestBody$outboundSchema;
|
|
36717
|
+
var init_v2keysmigratekeysrequestbody = __esm(() => {
|
|
36718
|
+
init_v3();
|
|
36719
|
+
init_v2keysmigratekeydata();
|
|
36720
|
+
V2KeysMigrateKeysRequestBody$inboundSchema = objectType({
|
|
36721
|
+
migrationId: stringType(),
|
|
36722
|
+
apiId: stringType(),
|
|
36723
|
+
keys: arrayType(V2KeysMigrateKeyData$inboundSchema)
|
|
36724
|
+
});
|
|
36725
|
+
V2KeysMigrateKeysRequestBody$outboundSchema = objectType({
|
|
36726
|
+
migrationId: stringType(),
|
|
36727
|
+
apiId: stringType(),
|
|
36728
|
+
keys: arrayType(V2KeysMigrateKeyData$outboundSchema)
|
|
36729
|
+
});
|
|
36730
|
+
});
|
|
36731
|
+
|
|
36732
|
+
// src/models/components/v2keysmigratekeysresponsedata.ts
|
|
36733
|
+
var V2KeysMigrateKeysResponseData$inboundSchema, V2KeysMigrateKeysResponseData$outboundSchema;
|
|
36734
|
+
var init_v2keysmigratekeysresponsedata = __esm(() => {
|
|
36735
|
+
init_v3();
|
|
36736
|
+
init_v2keysmigratekeysmigration();
|
|
36737
|
+
V2KeysMigrateKeysResponseData$inboundSchema = objectType({
|
|
36738
|
+
migrated: arrayType(V2KeysMigrateKeysMigration$inboundSchema),
|
|
36739
|
+
failed: arrayType(stringType())
|
|
36740
|
+
});
|
|
36741
|
+
V2KeysMigrateKeysResponseData$outboundSchema = objectType({
|
|
36742
|
+
migrated: arrayType(V2KeysMigrateKeysMigration$outboundSchema),
|
|
36743
|
+
failed: arrayType(stringType())
|
|
36744
|
+
});
|
|
36745
|
+
});
|
|
36746
|
+
|
|
36747
|
+
// src/models/components/v2keysmigratekeysresponsebody.ts
|
|
36748
|
+
var V2KeysMigrateKeysResponseBody$inboundSchema, V2KeysMigrateKeysResponseBody$outboundSchema;
|
|
36749
|
+
var init_v2keysmigratekeysresponsebody = __esm(() => {
|
|
36750
|
+
init_v3();
|
|
36751
|
+
init_meta();
|
|
36752
|
+
init_v2keysmigratekeysresponsedata();
|
|
36753
|
+
V2KeysMigrateKeysResponseBody$inboundSchema = objectType({
|
|
36754
|
+
meta: Meta$inboundSchema,
|
|
36755
|
+
data: V2KeysMigrateKeysResponseData$inboundSchema
|
|
36756
|
+
});
|
|
36757
|
+
V2KeysMigrateKeysResponseBody$outboundSchema = objectType({
|
|
36758
|
+
meta: Meta$outboundSchema,
|
|
36759
|
+
data: V2KeysMigrateKeysResponseData$outboundSchema
|
|
36760
|
+
});
|
|
36761
|
+
});
|
|
36762
|
+
|
|
36612
36763
|
// src/models/components/v2keysremovepermissionsrequestbody.ts
|
|
36613
36764
|
var V2KeysRemovePermissionsRequestBody$inboundSchema, V2KeysRemovePermissionsRequestBody$outboundSchema;
|
|
36614
36765
|
var init_v2keysremovepermissionsrequestbody = __esm(() => {
|
|
@@ -36871,14 +37022,16 @@ var init_v2keysverifykeyrequestbody = __esm(() => {
|
|
|
36871
37022
|
tags: arrayType(stringType()).optional(),
|
|
36872
37023
|
permissions: stringType().optional(),
|
|
36873
37024
|
credits: KeysVerifyKeyCredits$inboundSchema.optional(),
|
|
36874
|
-
ratelimits: arrayType(KeysVerifyKeyRatelimit$inboundSchema).optional()
|
|
37025
|
+
ratelimits: arrayType(KeysVerifyKeyRatelimit$inboundSchema).optional(),
|
|
37026
|
+
migrationId: stringType().optional()
|
|
36875
37027
|
});
|
|
36876
37028
|
V2KeysVerifyKeyRequestBody$outboundSchema = objectType({
|
|
36877
37029
|
key: stringType(),
|
|
36878
37030
|
tags: arrayType(stringType()).optional(),
|
|
36879
37031
|
permissions: stringType().optional(),
|
|
36880
37032
|
credits: KeysVerifyKeyCredits$outboundSchema.optional(),
|
|
36881
|
-
ratelimits: arrayType(KeysVerifyKeyRatelimit$outboundSchema).optional()
|
|
37033
|
+
ratelimits: arrayType(KeysVerifyKeyRatelimit$outboundSchema).optional(),
|
|
37034
|
+
migrationId: stringType().optional()
|
|
36882
37035
|
});
|
|
36883
37036
|
});
|
|
36884
37037
|
|
|
@@ -37424,6 +37577,61 @@ var init_v2ratelimitlistoverridesresponsebody = __esm(() => {
|
|
|
37424
37577
|
});
|
|
37425
37578
|
});
|
|
37426
37579
|
|
|
37580
|
+
// src/models/components/v2ratelimitmultilimitcheck.ts
|
|
37581
|
+
var V2RatelimitMultiLimitCheck$inboundSchema, V2RatelimitMultiLimitCheck$outboundSchema;
|
|
37582
|
+
var init_v2ratelimitmultilimitcheck = __esm(() => {
|
|
37583
|
+
init_v3();
|
|
37584
|
+
V2RatelimitMultiLimitCheck$inboundSchema = objectType({
|
|
37585
|
+
namespace: stringType(),
|
|
37586
|
+
identifier: stringType(),
|
|
37587
|
+
limit: numberType().int(),
|
|
37588
|
+
remaining: numberType().int(),
|
|
37589
|
+
reset: numberType().int(),
|
|
37590
|
+
passed: booleanType(),
|
|
37591
|
+
overrideId: stringType().optional()
|
|
37592
|
+
});
|
|
37593
|
+
V2RatelimitMultiLimitCheck$outboundSchema = objectType({
|
|
37594
|
+
namespace: stringType(),
|
|
37595
|
+
identifier: stringType(),
|
|
37596
|
+
limit: numberType().int(),
|
|
37597
|
+
remaining: numberType().int(),
|
|
37598
|
+
reset: numberType().int(),
|
|
37599
|
+
passed: booleanType(),
|
|
37600
|
+
overrideId: stringType().optional()
|
|
37601
|
+
});
|
|
37602
|
+
});
|
|
37603
|
+
|
|
37604
|
+
// src/models/components/v2ratelimitmultilimitresponsedata.ts
|
|
37605
|
+
var V2RatelimitMultiLimitResponseData$inboundSchema, V2RatelimitMultiLimitResponseData$outboundSchema;
|
|
37606
|
+
var init_v2ratelimitmultilimitresponsedata = __esm(() => {
|
|
37607
|
+
init_v3();
|
|
37608
|
+
init_v2ratelimitmultilimitcheck();
|
|
37609
|
+
V2RatelimitMultiLimitResponseData$inboundSchema = objectType({
|
|
37610
|
+
passed: booleanType(),
|
|
37611
|
+
limits: arrayType(V2RatelimitMultiLimitCheck$inboundSchema)
|
|
37612
|
+
});
|
|
37613
|
+
V2RatelimitMultiLimitResponseData$outboundSchema = objectType({
|
|
37614
|
+
passed: booleanType(),
|
|
37615
|
+
limits: arrayType(V2RatelimitMultiLimitCheck$outboundSchema)
|
|
37616
|
+
});
|
|
37617
|
+
});
|
|
37618
|
+
|
|
37619
|
+
// src/models/components/v2ratelimitmultilimitresponsebody.ts
|
|
37620
|
+
var V2RatelimitMultiLimitResponseBody$inboundSchema, V2RatelimitMultiLimitResponseBody$outboundSchema;
|
|
37621
|
+
var init_v2ratelimitmultilimitresponsebody = __esm(() => {
|
|
37622
|
+
init_v3();
|
|
37623
|
+
init_meta();
|
|
37624
|
+
init_v2ratelimitmultilimitresponsedata();
|
|
37625
|
+
V2RatelimitMultiLimitResponseBody$inboundSchema = objectType({
|
|
37626
|
+
meta: Meta$inboundSchema,
|
|
37627
|
+
data: V2RatelimitMultiLimitResponseData$inboundSchema
|
|
37628
|
+
});
|
|
37629
|
+
V2RatelimitMultiLimitResponseBody$outboundSchema = objectType({
|
|
37630
|
+
meta: Meta$outboundSchema,
|
|
37631
|
+
data: V2RatelimitMultiLimitResponseData$outboundSchema
|
|
37632
|
+
});
|
|
37633
|
+
});
|
|
37634
|
+
|
|
37427
37635
|
// src/models/components/v2ratelimitsetoverriderequestbody.ts
|
|
37428
37636
|
var V2RatelimitSetOverrideRequestBody$inboundSchema, V2RatelimitSetOverrideRequestBody$outboundSchema;
|
|
37429
37637
|
var init_v2ratelimitsetoverriderequestbody = __esm(() => {
|
|
@@ -37525,6 +37733,11 @@ var init_components = __esm(() => {
|
|
|
37525
37733
|
init_v2keysdeletekeyresponsebody();
|
|
37526
37734
|
init_v2keysgetkeyrequestbody();
|
|
37527
37735
|
init_v2keysgetkeyresponsebody();
|
|
37736
|
+
init_v2keysmigratekeydata();
|
|
37737
|
+
init_v2keysmigratekeysmigration();
|
|
37738
|
+
init_v2keysmigratekeysrequestbody();
|
|
37739
|
+
init_v2keysmigratekeysresponsebody();
|
|
37740
|
+
init_v2keysmigratekeysresponsedata();
|
|
37528
37741
|
init_v2keysremovepermissionsrequestbody();
|
|
37529
37742
|
init_v2keysremovepermissionsresponsebody();
|
|
37530
37743
|
init_v2keysremoverolesrequestbody();
|
|
@@ -37573,6 +37786,9 @@ var init_components = __esm(() => {
|
|
|
37573
37786
|
init_v2ratelimitlimitresponsedata();
|
|
37574
37787
|
init_v2ratelimitlistoverridesrequestbody();
|
|
37575
37788
|
init_v2ratelimitlistoverridesresponsebody();
|
|
37789
|
+
init_v2ratelimitmultilimitcheck();
|
|
37790
|
+
init_v2ratelimitmultilimitresponsebody();
|
|
37791
|
+
init_v2ratelimitmultilimitresponsedata();
|
|
37576
37792
|
init_v2ratelimitsetoverriderequestbody();
|
|
37577
37793
|
init_v2ratelimitsetoverrideresponsebody();
|
|
37578
37794
|
init_v2ratelimitsetoverrideresponsedata();
|
|
@@ -39986,11 +40202,129 @@ Additional permission required for decrypt functionality:
|
|
|
39986
40202
|
};
|
|
39987
40203
|
});
|
|
39988
40204
|
|
|
39989
|
-
// src/funcs/
|
|
39990
|
-
function
|
|
40205
|
+
// src/funcs/keysMigrateKeys.ts
|
|
40206
|
+
function keysMigrateKeys(client, request, options) {
|
|
39991
40207
|
return new APIPromise($do16(client, request, options));
|
|
39992
40208
|
}
|
|
39993
40209
|
async function $do16(client, request, options) {
|
|
40210
|
+
const parsed = safeParse(request, (value) => V2KeysMigrateKeysRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
40211
|
+
if (!parsed.ok) {
|
|
40212
|
+
return [parsed, { status: "invalid" }];
|
|
40213
|
+
}
|
|
40214
|
+
const payload = parsed.value;
|
|
40215
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
40216
|
+
const path = pathToFunc("/v2/keys.migrateKeys")();
|
|
40217
|
+
const headers = new Headers(compactMap({
|
|
40218
|
+
"Content-Type": "application/json",
|
|
40219
|
+
Accept: "application/json"
|
|
40220
|
+
}));
|
|
40221
|
+
const secConfig = await extractSecurity(client._options.rootKey);
|
|
40222
|
+
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
40223
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
40224
|
+
const context = {
|
|
40225
|
+
options: client._options,
|
|
40226
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
40227
|
+
operationID: "migrateKeys",
|
|
40228
|
+
oAuth2Scopes: null,
|
|
40229
|
+
resolvedSecurity: requestSecurity,
|
|
40230
|
+
securitySource: client._options.rootKey,
|
|
40231
|
+
retryConfig: options?.retries || client._options.retryConfig || {
|
|
40232
|
+
strategy: "backoff",
|
|
40233
|
+
backoff: {
|
|
40234
|
+
initialInterval: 50,
|
|
40235
|
+
maxInterval: 1000,
|
|
40236
|
+
exponent: 1.5,
|
|
40237
|
+
maxElapsedTime: 1e4
|
|
40238
|
+
},
|
|
40239
|
+
retryConnectionErrors: true
|
|
40240
|
+
},
|
|
40241
|
+
retryCodes: options?.retryCodes || ["5XX"]
|
|
40242
|
+
};
|
|
40243
|
+
const requestRes = client._createRequest(context, {
|
|
40244
|
+
security: requestSecurity,
|
|
40245
|
+
method: "POST",
|
|
40246
|
+
baseURL: options?.serverURL,
|
|
40247
|
+
path,
|
|
40248
|
+
headers,
|
|
40249
|
+
body,
|
|
40250
|
+
userAgent: client._options.userAgent,
|
|
40251
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
|
|
40252
|
+
}, options);
|
|
40253
|
+
if (!requestRes.ok) {
|
|
40254
|
+
return [requestRes, { status: "invalid" }];
|
|
40255
|
+
}
|
|
40256
|
+
const req = requestRes.value;
|
|
40257
|
+
const doResult = await client._do(req, {
|
|
40258
|
+
context,
|
|
40259
|
+
errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
|
|
40260
|
+
retryConfig: context.retryConfig,
|
|
40261
|
+
retryCodes: context.retryCodes
|
|
40262
|
+
});
|
|
40263
|
+
if (!doResult.ok) {
|
|
40264
|
+
return [doResult, { status: "request-error", request: req }];
|
|
40265
|
+
}
|
|
40266
|
+
const response = doResult.value;
|
|
40267
|
+
const responseFields = {
|
|
40268
|
+
HttpMeta: { Response: response, Request: req }
|
|
40269
|
+
};
|
|
40270
|
+
const [result] = await match(json(200, V2KeysMigrateKeysResponseBody$inboundSchema), jsonErr(400, BadRequestErrorResponse$inboundSchema), jsonErr(401, UnauthorizedErrorResponse$inboundSchema), jsonErr(403, ForbiddenErrorResponse$inboundSchema), jsonErr(404, NotFoundErrorResponse$inboundSchema), jsonErr(500, InternalServerErrorResponse$inboundSchema), fail("4XX"), fail("5XX"))(response, req, { extraFields: responseFields });
|
|
40271
|
+
if (!result.ok) {
|
|
40272
|
+
return [result, { status: "complete", request: req, response }];
|
|
40273
|
+
}
|
|
40274
|
+
return [result, { status: "complete", request: req, response }];
|
|
40275
|
+
}
|
|
40276
|
+
var init_keysMigrateKeys = __esm(() => {
|
|
40277
|
+
init_encodings();
|
|
40278
|
+
init_matchers();
|
|
40279
|
+
init_primitives();
|
|
40280
|
+
init_schemas();
|
|
40281
|
+
init_security();
|
|
40282
|
+
init_url();
|
|
40283
|
+
init_components();
|
|
40284
|
+
init_errors2();
|
|
40285
|
+
init_async();
|
|
40286
|
+
});
|
|
40287
|
+
|
|
40288
|
+
// src/mcp-server/tools/keysMigrateKeys.ts
|
|
40289
|
+
var args16, tool$keysMigrateKeys;
|
|
40290
|
+
var init_keysMigrateKeys2 = __esm(() => {
|
|
40291
|
+
init_keysMigrateKeys();
|
|
40292
|
+
init_components();
|
|
40293
|
+
init_tools();
|
|
40294
|
+
args16 = {
|
|
40295
|
+
request: V2KeysMigrateKeysRequestBody$inboundSchema
|
|
40296
|
+
};
|
|
40297
|
+
tool$keysMigrateKeys = {
|
|
40298
|
+
name: "keys-migrate-keys",
|
|
40299
|
+
description: `Migrate API key(s)
|
|
40300
|
+
|
|
40301
|
+
Returns HTTP 200 even on partial success; hashes that could not be migrated are listed under \`data.failed\`.
|
|
40302
|
+
|
|
40303
|
+
**Required Permissions**
|
|
40304
|
+
Your root key must have one of the following permissions for basic key information:
|
|
40305
|
+
- \`api.*.create_key\` (to migrate keys to any API)
|
|
40306
|
+
- \`api.<api_id>.create_key\` (to migrate keys to a specific API)
|
|
40307
|
+
`,
|
|
40308
|
+
args: args16,
|
|
40309
|
+
tool: async (client, args17, ctx) => {
|
|
40310
|
+
const [result, apiCall] = await keysMigrateKeys(client, args17.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
40311
|
+
if (!result.ok) {
|
|
40312
|
+
return {
|
|
40313
|
+
content: [{ type: "text", text: result.error.message }],
|
|
40314
|
+
isError: true
|
|
40315
|
+
};
|
|
40316
|
+
}
|
|
40317
|
+
const value = result.value;
|
|
40318
|
+
return formatResult(value, apiCall);
|
|
40319
|
+
}
|
|
40320
|
+
};
|
|
40321
|
+
});
|
|
40322
|
+
|
|
40323
|
+
// src/funcs/keysRemovePermissions.ts
|
|
40324
|
+
function keysRemovePermissions(client, request, options) {
|
|
40325
|
+
return new APIPromise($do17(client, request, options));
|
|
40326
|
+
}
|
|
40327
|
+
async function $do17(client, request, options) {
|
|
39994
40328
|
const parsed = safeParse(request, (value) => V2KeysRemovePermissionsRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
39995
40329
|
if (!parsed.ok) {
|
|
39996
40330
|
return [parsed, { status: "invalid" }];
|
|
@@ -40070,12 +40404,12 @@ var init_keysRemovePermissions = __esm(() => {
|
|
|
40070
40404
|
});
|
|
40071
40405
|
|
|
40072
40406
|
// src/mcp-server/tools/keysRemovePermissions.ts
|
|
40073
|
-
var
|
|
40407
|
+
var args17, tool$keysRemovePermissions;
|
|
40074
40408
|
var init_keysRemovePermissions2 = __esm(() => {
|
|
40075
40409
|
init_keysRemovePermissions();
|
|
40076
40410
|
init_components();
|
|
40077
40411
|
init_tools();
|
|
40078
|
-
|
|
40412
|
+
args17 = {
|
|
40079
40413
|
request: V2KeysRemovePermissionsRequestBody$inboundSchema
|
|
40080
40414
|
};
|
|
40081
40415
|
tool$keysRemovePermissions = {
|
|
@@ -40098,9 +40432,9 @@ Your root key must have one of the following permissions:
|
|
|
40098
40432
|
|
|
40099
40433
|
Invalidates the key cache for immediate effect, and makes permission changes available for verification within 30 seconds across all regions.
|
|
40100
40434
|
`,
|
|
40101
|
-
args:
|
|
40102
|
-
tool: async (client,
|
|
40103
|
-
const [result, apiCall] = await keysRemovePermissions(client,
|
|
40435
|
+
args: args17,
|
|
40436
|
+
tool: async (client, args18, ctx) => {
|
|
40437
|
+
const [result, apiCall] = await keysRemovePermissions(client, args18.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
40104
40438
|
if (!result.ok) {
|
|
40105
40439
|
return {
|
|
40106
40440
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -40115,9 +40449,9 @@ Invalidates the key cache for immediate effect, and makes permission changes ava
|
|
|
40115
40449
|
|
|
40116
40450
|
// src/funcs/keysRemoveRoles.ts
|
|
40117
40451
|
function keysRemoveRoles(client, request, options) {
|
|
40118
|
-
return new APIPromise($
|
|
40452
|
+
return new APIPromise($do18(client, request, options));
|
|
40119
40453
|
}
|
|
40120
|
-
async function $
|
|
40454
|
+
async function $do18(client, request, options) {
|
|
40121
40455
|
const parsed = safeParse(request, (value) => V2KeysRemoveRolesRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
40122
40456
|
if (!parsed.ok) {
|
|
40123
40457
|
return [parsed, { status: "invalid" }];
|
|
@@ -40197,12 +40531,12 @@ var init_keysRemoveRoles = __esm(() => {
|
|
|
40197
40531
|
});
|
|
40198
40532
|
|
|
40199
40533
|
// src/mcp-server/tools/keysRemoveRoles.ts
|
|
40200
|
-
var
|
|
40534
|
+
var args18, tool$keysRemoveRoles;
|
|
40201
40535
|
var init_keysRemoveRoles2 = __esm(() => {
|
|
40202
40536
|
init_keysRemoveRoles();
|
|
40203
40537
|
init_components();
|
|
40204
40538
|
init_tools();
|
|
40205
|
-
|
|
40539
|
+
args18 = {
|
|
40206
40540
|
request: V2KeysRemoveRolesRequestBody$inboundSchema
|
|
40207
40541
|
};
|
|
40208
40542
|
tool$keysRemoveRoles = {
|
|
@@ -40225,9 +40559,9 @@ Your root key must have one of the following permissions:
|
|
|
40225
40559
|
|
|
40226
40560
|
Invalidates the key cache for immediate effect, and makes role changes available for verification within 30 seconds across all regions.
|
|
40227
40561
|
`,
|
|
40228
|
-
args:
|
|
40229
|
-
tool: async (client,
|
|
40230
|
-
const [result, apiCall] = await keysRemoveRoles(client,
|
|
40562
|
+
args: args18,
|
|
40563
|
+
tool: async (client, args19, ctx) => {
|
|
40564
|
+
const [result, apiCall] = await keysRemoveRoles(client, args19.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
40231
40565
|
if (!result.ok) {
|
|
40232
40566
|
return {
|
|
40233
40567
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -40242,9 +40576,9 @@ Invalidates the key cache for immediate effect, and makes role changes available
|
|
|
40242
40576
|
|
|
40243
40577
|
// src/funcs/keysRerollKey.ts
|
|
40244
40578
|
function keysRerollKey(client, request, options) {
|
|
40245
|
-
return new APIPromise($
|
|
40579
|
+
return new APIPromise($do19(client, request, options));
|
|
40246
40580
|
}
|
|
40247
|
-
async function $
|
|
40581
|
+
async function $do19(client, request, options) {
|
|
40248
40582
|
const parsed = safeParse(request, (value) => V2KeysRerollKeyRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
40249
40583
|
if (!parsed.ok) {
|
|
40250
40584
|
return [parsed, { status: "invalid" }];
|
|
@@ -40324,12 +40658,12 @@ var init_keysRerollKey = __esm(() => {
|
|
|
40324
40658
|
});
|
|
40325
40659
|
|
|
40326
40660
|
// src/mcp-server/tools/keysRerollKey.ts
|
|
40327
|
-
var
|
|
40661
|
+
var args19, tool$keysRerollKey;
|
|
40328
40662
|
var init_keysRerollKey2 = __esm(() => {
|
|
40329
40663
|
init_keysRerollKey();
|
|
40330
40664
|
init_components();
|
|
40331
40665
|
init_tools();
|
|
40332
|
-
|
|
40666
|
+
args19 = {
|
|
40333
40667
|
request: V2KeysRerollKeyRequestBody$inboundSchema
|
|
40334
40668
|
};
|
|
40335
40669
|
tool$keysRerollKey = {
|
|
@@ -40369,9 +40703,9 @@ Common use cases include:
|
|
|
40369
40703
|
- \`api.*.create_key\` or \`api.<api_id>.create_key\`
|
|
40370
40704
|
- \`api.*.encrypt_key\` or \`api.<api_id>.encrypt_key\` (only when the original key is recoverable)
|
|
40371
40705
|
`,
|
|
40372
|
-
args:
|
|
40373
|
-
tool: async (client,
|
|
40374
|
-
const [result, apiCall] = await keysRerollKey(client,
|
|
40706
|
+
args: args19,
|
|
40707
|
+
tool: async (client, args20, ctx) => {
|
|
40708
|
+
const [result, apiCall] = await keysRerollKey(client, args20.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
40375
40709
|
if (!result.ok) {
|
|
40376
40710
|
return {
|
|
40377
40711
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -40386,9 +40720,9 @@ Common use cases include:
|
|
|
40386
40720
|
|
|
40387
40721
|
// src/funcs/keysSetPermissions.ts
|
|
40388
40722
|
function keysSetPermissions(client, request, options) {
|
|
40389
|
-
return new APIPromise($
|
|
40723
|
+
return new APIPromise($do20(client, request, options));
|
|
40390
40724
|
}
|
|
40391
|
-
async function $
|
|
40725
|
+
async function $do20(client, request, options) {
|
|
40392
40726
|
const parsed = safeParse(request, (value) => V2KeysSetPermissionsRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
40393
40727
|
if (!parsed.ok) {
|
|
40394
40728
|
return [parsed, { status: "invalid" }];
|
|
@@ -40468,12 +40802,12 @@ var init_keysSetPermissions = __esm(() => {
|
|
|
40468
40802
|
});
|
|
40469
40803
|
|
|
40470
40804
|
// src/mcp-server/tools/keysSetPermissions.ts
|
|
40471
|
-
var
|
|
40805
|
+
var args20, tool$keysSetPermissions;
|
|
40472
40806
|
var init_keysSetPermissions2 = __esm(() => {
|
|
40473
40807
|
init_keysSetPermissions();
|
|
40474
40808
|
init_components();
|
|
40475
40809
|
init_tools();
|
|
40476
|
-
|
|
40810
|
+
args20 = {
|
|
40477
40811
|
request: V2KeysSetPermissionsRequestBody$inboundSchema
|
|
40478
40812
|
};
|
|
40479
40813
|
tool$keysSetPermissions = {
|
|
@@ -40496,9 +40830,9 @@ Your root key must have one of the following permissions:
|
|
|
40496
40830
|
|
|
40497
40831
|
Invalidates the key cache for immediate effect, and makes permission changes available for verification within 30 seconds across all regions.
|
|
40498
40832
|
`,
|
|
40499
|
-
args:
|
|
40500
|
-
tool: async (client,
|
|
40501
|
-
const [result, apiCall] = await keysSetPermissions(client,
|
|
40833
|
+
args: args20,
|
|
40834
|
+
tool: async (client, args21, ctx) => {
|
|
40835
|
+
const [result, apiCall] = await keysSetPermissions(client, args21.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
40502
40836
|
if (!result.ok) {
|
|
40503
40837
|
return {
|
|
40504
40838
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -40513,9 +40847,9 @@ Invalidates the key cache for immediate effect, and makes permission changes ava
|
|
|
40513
40847
|
|
|
40514
40848
|
// src/funcs/keysSetRoles.ts
|
|
40515
40849
|
function keysSetRoles(client, request, options) {
|
|
40516
|
-
return new APIPromise($
|
|
40850
|
+
return new APIPromise($do21(client, request, options));
|
|
40517
40851
|
}
|
|
40518
|
-
async function $
|
|
40852
|
+
async function $do21(client, request, options) {
|
|
40519
40853
|
const parsed = safeParse(request, (value) => V2KeysSetRolesRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
40520
40854
|
if (!parsed.ok) {
|
|
40521
40855
|
return [parsed, { status: "invalid" }];
|
|
@@ -40595,12 +40929,12 @@ var init_keysSetRoles = __esm(() => {
|
|
|
40595
40929
|
});
|
|
40596
40930
|
|
|
40597
40931
|
// src/mcp-server/tools/keysSetRoles.ts
|
|
40598
|
-
var
|
|
40932
|
+
var args21, tool$keysSetRoles;
|
|
40599
40933
|
var init_keysSetRoles2 = __esm(() => {
|
|
40600
40934
|
init_keysSetRoles();
|
|
40601
40935
|
init_components();
|
|
40602
40936
|
init_tools();
|
|
40603
|
-
|
|
40937
|
+
args21 = {
|
|
40604
40938
|
request: V2KeysSetRolesRequestBody$inboundSchema
|
|
40605
40939
|
};
|
|
40606
40940
|
tool$keysSetRoles = {
|
|
@@ -40623,9 +40957,9 @@ Your root key must have one of the following permissions:
|
|
|
40623
40957
|
|
|
40624
40958
|
Invalidates the key cache for immediate effect, and makes role changes available for verification within 30 seconds across all regions.
|
|
40625
40959
|
`,
|
|
40626
|
-
args:
|
|
40627
|
-
tool: async (client,
|
|
40628
|
-
const [result, apiCall] = await keysSetRoles(client,
|
|
40960
|
+
args: args21,
|
|
40961
|
+
tool: async (client, args22, ctx) => {
|
|
40962
|
+
const [result, apiCall] = await keysSetRoles(client, args22.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
40629
40963
|
if (!result.ok) {
|
|
40630
40964
|
return {
|
|
40631
40965
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -40640,9 +40974,9 @@ Invalidates the key cache for immediate effect, and makes role changes available
|
|
|
40640
40974
|
|
|
40641
40975
|
// src/funcs/keysUpdateCredits.ts
|
|
40642
40976
|
function keysUpdateCredits(client, request, options) {
|
|
40643
|
-
return new APIPromise($
|
|
40977
|
+
return new APIPromise($do22(client, request, options));
|
|
40644
40978
|
}
|
|
40645
|
-
async function $
|
|
40979
|
+
async function $do22(client, request, options) {
|
|
40646
40980
|
const parsed = safeParse(request, (value) => V2KeysUpdateCreditsRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
40647
40981
|
if (!parsed.ok) {
|
|
40648
40982
|
return [parsed, { status: "invalid" }];
|
|
@@ -40722,12 +41056,12 @@ var init_keysUpdateCredits = __esm(() => {
|
|
|
40722
41056
|
});
|
|
40723
41057
|
|
|
40724
41058
|
// src/mcp-server/tools/keysUpdateCredits.ts
|
|
40725
|
-
var
|
|
41059
|
+
var args22, tool$keysUpdateCredits;
|
|
40726
41060
|
var init_keysUpdateCredits2 = __esm(() => {
|
|
40727
41061
|
init_keysUpdateCredits();
|
|
40728
41062
|
init_components();
|
|
40729
41063
|
init_tools();
|
|
40730
|
-
|
|
41064
|
+
args22 = {
|
|
40731
41065
|
request: V2KeysUpdateCreditsRequestBody$inboundSchema
|
|
40732
41066
|
};
|
|
40733
41067
|
tool$keysUpdateCredits = {
|
|
@@ -40750,9 +41084,9 @@ Your root key must have one of the following permissions:
|
|
|
40750
41084
|
|
|
40751
41085
|
Credit updates remove the key from cache immediately. Setting credits to unlimited automatically clears any existing refill settings. Changes take effect instantly but may take up to 30 seconds to propagate to all edge regions.
|
|
40752
41086
|
`,
|
|
40753
|
-
args:
|
|
40754
|
-
tool: async (client,
|
|
40755
|
-
const [result, apiCall] = await keysUpdateCredits(client,
|
|
41087
|
+
args: args22,
|
|
41088
|
+
tool: async (client, args23, ctx) => {
|
|
41089
|
+
const [result, apiCall] = await keysUpdateCredits(client, args23.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
40756
41090
|
if (!result.ok) {
|
|
40757
41091
|
return {
|
|
40758
41092
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -40767,9 +41101,9 @@ Credit updates remove the key from cache immediately. Setting credits to unlimit
|
|
|
40767
41101
|
|
|
40768
41102
|
// src/funcs/keysUpdateKey.ts
|
|
40769
41103
|
function keysUpdateKey(client, request, options) {
|
|
40770
|
-
return new APIPromise($
|
|
41104
|
+
return new APIPromise($do23(client, request, options));
|
|
40771
41105
|
}
|
|
40772
|
-
async function $
|
|
41106
|
+
async function $do23(client, request, options) {
|
|
40773
41107
|
const parsed = safeParse(request, (value) => V2KeysUpdateKeyRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
40774
41108
|
if (!parsed.ok) {
|
|
40775
41109
|
return [parsed, { status: "invalid" }];
|
|
@@ -40849,12 +41183,12 @@ var init_keysUpdateKey = __esm(() => {
|
|
|
40849
41183
|
});
|
|
40850
41184
|
|
|
40851
41185
|
// src/mcp-server/tools/keysUpdateKey.ts
|
|
40852
|
-
var
|
|
41186
|
+
var args23, tool$keysUpdateKey;
|
|
40853
41187
|
var init_keysUpdateKey2 = __esm(() => {
|
|
40854
41188
|
init_keysUpdateKey();
|
|
40855
41189
|
init_components();
|
|
40856
41190
|
init_tools();
|
|
40857
|
-
|
|
41191
|
+
args23 = {
|
|
40858
41192
|
request: V2KeysUpdateKeyRequestBody$inboundSchema
|
|
40859
41193
|
};
|
|
40860
41194
|
tool$keysUpdateKey = {
|
|
@@ -40877,9 +41211,9 @@ Your root key must have one of the following permissions:
|
|
|
40877
41211
|
|
|
40878
41212
|
If you specify an \`externalId\` that doesn't exist, a new identity will be automatically created and linked to the key. Permission updates will auto-create any permissions that don't exist in your workspace. Changes take effect immediately but may take up to 30 seconds to propagate to all edge regions due to cache invalidation.
|
|
40879
41213
|
`,
|
|
40880
|
-
args:
|
|
40881
|
-
tool: async (client,
|
|
40882
|
-
const [result, apiCall] = await keysUpdateKey(client,
|
|
41214
|
+
args: args23,
|
|
41215
|
+
tool: async (client, args24, ctx) => {
|
|
41216
|
+
const [result, apiCall] = await keysUpdateKey(client, args24.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
40883
41217
|
if (!result.ok) {
|
|
40884
41218
|
return {
|
|
40885
41219
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -40894,9 +41228,9 @@ If you specify an \`externalId\` that doesn't exist, a new identity will be auto
|
|
|
40894
41228
|
|
|
40895
41229
|
// src/funcs/keysVerifyKey.ts
|
|
40896
41230
|
function keysVerifyKey(client, request, options) {
|
|
40897
|
-
return new APIPromise($
|
|
41231
|
+
return new APIPromise($do24(client, request, options));
|
|
40898
41232
|
}
|
|
40899
|
-
async function $
|
|
41233
|
+
async function $do24(client, request, options) {
|
|
40900
41234
|
const parsed = safeParse(request, (value) => V2KeysVerifyKeyRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
40901
41235
|
if (!parsed.ok) {
|
|
40902
41236
|
return [parsed, { status: "invalid" }];
|
|
@@ -40976,12 +41310,12 @@ var init_keysVerifyKey = __esm(() => {
|
|
|
40976
41310
|
});
|
|
40977
41311
|
|
|
40978
41312
|
// src/mcp-server/tools/keysVerifyKey.ts
|
|
40979
|
-
var
|
|
41313
|
+
var args24, tool$keysVerifyKey;
|
|
40980
41314
|
var init_keysVerifyKey2 = __esm(() => {
|
|
40981
41315
|
init_keysVerifyKey();
|
|
40982
41316
|
init_components();
|
|
40983
41317
|
init_tools();
|
|
40984
|
-
|
|
41318
|
+
args24 = {
|
|
40985
41319
|
request: V2KeysVerifyKeyRequestBody$inboundSchema
|
|
40986
41320
|
};
|
|
40987
41321
|
tool$keysVerifyKey = {
|
|
@@ -41007,9 +41341,9 @@ Your root key needs one of:
|
|
|
41007
41341
|
|
|
41008
41342
|
If you are getting a NOT_FOUND error, ensure your root key has the required verify key permissions.
|
|
41009
41343
|
`,
|
|
41010
|
-
args:
|
|
41011
|
-
tool: async (client,
|
|
41012
|
-
const [result, apiCall] = await keysVerifyKey(client,
|
|
41344
|
+
args: args24,
|
|
41345
|
+
tool: async (client, args25, ctx) => {
|
|
41346
|
+
const [result, apiCall] = await keysVerifyKey(client, args25.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
41013
41347
|
if (!result.ok) {
|
|
41014
41348
|
return {
|
|
41015
41349
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -41024,9 +41358,9 @@ If you are getting a NOT_FOUND error, ensure your root key has the required veri
|
|
|
41024
41358
|
|
|
41025
41359
|
// src/funcs/keysWhoami.ts
|
|
41026
41360
|
function keysWhoami(client, request, options) {
|
|
41027
|
-
return new APIPromise($
|
|
41361
|
+
return new APIPromise($do25(client, request, options));
|
|
41028
41362
|
}
|
|
41029
|
-
async function $
|
|
41363
|
+
async function $do25(client, request, options) {
|
|
41030
41364
|
const parsed = safeParse(request, (value) => V2KeysWhoamiRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
41031
41365
|
if (!parsed.ok) {
|
|
41032
41366
|
return [parsed, { status: "invalid" }];
|
|
@@ -41106,12 +41440,12 @@ var init_keysWhoami = __esm(() => {
|
|
|
41106
41440
|
});
|
|
41107
41441
|
|
|
41108
41442
|
// src/mcp-server/tools/keysWhoami.ts
|
|
41109
|
-
var
|
|
41443
|
+
var args25, tool$keysWhoami;
|
|
41110
41444
|
var init_keysWhoami2 = __esm(() => {
|
|
41111
41445
|
init_keysWhoami();
|
|
41112
41446
|
init_components();
|
|
41113
41447
|
init_tools();
|
|
41114
|
-
|
|
41448
|
+
args25 = {
|
|
41115
41449
|
request: V2KeysWhoamiRequestBody$inboundSchema
|
|
41116
41450
|
};
|
|
41117
41451
|
tool$keysWhoami = {
|
|
@@ -41128,9 +41462,9 @@ Your root key must have one of the following permissions for basic key informati
|
|
|
41128
41462
|
|
|
41129
41463
|
If your rootkey lacks permissions but the key exists, we may return a 404 status here to prevent leaking the existance of a key to unauthorized clients. If you believe that a key should exist, but receive a 404, please double check your root key has the correct permissions.
|
|
41130
41464
|
`,
|
|
41131
|
-
args:
|
|
41132
|
-
tool: async (client,
|
|
41133
|
-
const [result, apiCall] = await keysWhoami(client,
|
|
41465
|
+
args: args25,
|
|
41466
|
+
tool: async (client, args26, ctx) => {
|
|
41467
|
+
const [result, apiCall] = await keysWhoami(client, args26.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
41134
41468
|
if (!result.ok) {
|
|
41135
41469
|
return {
|
|
41136
41470
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -41145,9 +41479,9 @@ If your rootkey lacks permissions but the key exists, we may return a 404 status
|
|
|
41145
41479
|
|
|
41146
41480
|
// src/funcs/permissionsCreatePermission.ts
|
|
41147
41481
|
function permissionsCreatePermission(client, request, options) {
|
|
41148
|
-
return new APIPromise($
|
|
41482
|
+
return new APIPromise($do26(client, request, options));
|
|
41149
41483
|
}
|
|
41150
|
-
async function $
|
|
41484
|
+
async function $do26(client, request, options) {
|
|
41151
41485
|
const parsed = safeParse(request, (value) => V2PermissionsCreatePermissionRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
41152
41486
|
if (!parsed.ok) {
|
|
41153
41487
|
return [parsed, { status: "invalid" }];
|
|
@@ -41227,12 +41561,12 @@ var init_permissionsCreatePermission = __esm(() => {
|
|
|
41227
41561
|
});
|
|
41228
41562
|
|
|
41229
41563
|
// src/mcp-server/tools/permissionsCreatePermission.ts
|
|
41230
|
-
var
|
|
41564
|
+
var args26, tool$permissionsCreatePermission;
|
|
41231
41565
|
var init_permissionsCreatePermission2 = __esm(() => {
|
|
41232
41566
|
init_permissionsCreatePermission();
|
|
41233
41567
|
init_components();
|
|
41234
41568
|
init_tools();
|
|
41235
|
-
|
|
41569
|
+
args26 = {
|
|
41236
41570
|
request: V2PermissionsCreatePermissionRequestBody$inboundSchema
|
|
41237
41571
|
};
|
|
41238
41572
|
tool$permissionsCreatePermission = {
|
|
@@ -41250,9 +41584,9 @@ Use hierarchical naming patterns like \`documents.read\`, \`admin.users.delete\`
|
|
|
41250
41584
|
Your root key must have the following permission:
|
|
41251
41585
|
- \`rbac.*.create_permission\`
|
|
41252
41586
|
`,
|
|
41253
|
-
args:
|
|
41254
|
-
tool: async (client,
|
|
41255
|
-
const [result, apiCall] = await permissionsCreatePermission(client,
|
|
41587
|
+
args: args26,
|
|
41588
|
+
tool: async (client, args27, ctx) => {
|
|
41589
|
+
const [result, apiCall] = await permissionsCreatePermission(client, args27.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
41256
41590
|
if (!result.ok) {
|
|
41257
41591
|
return {
|
|
41258
41592
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -41267,9 +41601,9 @@ Your root key must have the following permission:
|
|
|
41267
41601
|
|
|
41268
41602
|
// src/funcs/permissionsCreateRole.ts
|
|
41269
41603
|
function permissionsCreateRole(client, request, options) {
|
|
41270
|
-
return new APIPromise($
|
|
41604
|
+
return new APIPromise($do27(client, request, options));
|
|
41271
41605
|
}
|
|
41272
|
-
async function $
|
|
41606
|
+
async function $do27(client, request, options) {
|
|
41273
41607
|
const parsed = safeParse(request, (value) => V2PermissionsCreateRoleRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
41274
41608
|
if (!parsed.ok) {
|
|
41275
41609
|
return [parsed, { status: "invalid" }];
|
|
@@ -41349,12 +41683,12 @@ var init_permissionsCreateRole = __esm(() => {
|
|
|
41349
41683
|
});
|
|
41350
41684
|
|
|
41351
41685
|
// src/mcp-server/tools/permissionsCreateRole.ts
|
|
41352
|
-
var
|
|
41686
|
+
var args27, tool$permissionsCreateRole;
|
|
41353
41687
|
var init_permissionsCreateRole2 = __esm(() => {
|
|
41354
41688
|
init_permissionsCreateRole();
|
|
41355
41689
|
init_components();
|
|
41356
41690
|
init_tools();
|
|
41357
|
-
|
|
41691
|
+
args27 = {
|
|
41358
41692
|
request: V2PermissionsCreateRoleRequestBody$inboundSchema
|
|
41359
41693
|
};
|
|
41360
41694
|
tool$permissionsCreateRole = {
|
|
@@ -41370,9 +41704,9 @@ Create a new role to group related permissions for easier management. Roles enab
|
|
|
41370
41704
|
Your root key must have the following permission:
|
|
41371
41705
|
- \`rbac.*.create_role\`
|
|
41372
41706
|
`,
|
|
41373
|
-
args:
|
|
41374
|
-
tool: async (client,
|
|
41375
|
-
const [result, apiCall] = await permissionsCreateRole(client,
|
|
41707
|
+
args: args27,
|
|
41708
|
+
tool: async (client, args28, ctx) => {
|
|
41709
|
+
const [result, apiCall] = await permissionsCreateRole(client, args28.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
41376
41710
|
if (!result.ok) {
|
|
41377
41711
|
return {
|
|
41378
41712
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -41387,9 +41721,9 @@ Your root key must have the following permission:
|
|
|
41387
41721
|
|
|
41388
41722
|
// src/funcs/permissionsDeletePermission.ts
|
|
41389
41723
|
function permissionsDeletePermission(client, request, options) {
|
|
41390
|
-
return new APIPromise($
|
|
41724
|
+
return new APIPromise($do28(client, request, options));
|
|
41391
41725
|
}
|
|
41392
|
-
async function $
|
|
41726
|
+
async function $do28(client, request, options) {
|
|
41393
41727
|
const parsed = safeParse(request, (value) => V2PermissionsDeletePermissionRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
41394
41728
|
if (!parsed.ok) {
|
|
41395
41729
|
return [parsed, { status: "invalid" }];
|
|
@@ -41469,12 +41803,12 @@ var init_permissionsDeletePermission = __esm(() => {
|
|
|
41469
41803
|
});
|
|
41470
41804
|
|
|
41471
41805
|
// src/mcp-server/tools/permissionsDeletePermission.ts
|
|
41472
|
-
var
|
|
41806
|
+
var args28, tool$permissionsDeletePermission;
|
|
41473
41807
|
var init_permissionsDeletePermission2 = __esm(() => {
|
|
41474
41808
|
init_permissionsDeletePermission();
|
|
41475
41809
|
init_components();
|
|
41476
41810
|
init_tools();
|
|
41477
|
-
|
|
41811
|
+
args28 = {
|
|
41478
41812
|
request: V2PermissionsDeletePermissionRequestBody$inboundSchema
|
|
41479
41813
|
};
|
|
41480
41814
|
tool$permissionsDeletePermission = {
|
|
@@ -41490,9 +41824,9 @@ Remove a permission from your workspace. This also removes the permission from a
|
|
|
41490
41824
|
Your root key must have the following permission:
|
|
41491
41825
|
- \`rbac.*.delete_permission\`
|
|
41492
41826
|
`,
|
|
41493
|
-
args:
|
|
41494
|
-
tool: async (client,
|
|
41495
|
-
const [result, apiCall] = await permissionsDeletePermission(client,
|
|
41827
|
+
args: args28,
|
|
41828
|
+
tool: async (client, args29, ctx) => {
|
|
41829
|
+
const [result, apiCall] = await permissionsDeletePermission(client, args29.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
41496
41830
|
if (!result.ok) {
|
|
41497
41831
|
return {
|
|
41498
41832
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -41507,9 +41841,9 @@ Your root key must have the following permission:
|
|
|
41507
41841
|
|
|
41508
41842
|
// src/funcs/permissionsDeleteRole.ts
|
|
41509
41843
|
function permissionsDeleteRole(client, request, options) {
|
|
41510
|
-
return new APIPromise($
|
|
41844
|
+
return new APIPromise($do29(client, request, options));
|
|
41511
41845
|
}
|
|
41512
|
-
async function $
|
|
41846
|
+
async function $do29(client, request, options) {
|
|
41513
41847
|
const parsed = safeParse(request, (value) => V2PermissionsDeleteRoleRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
41514
41848
|
if (!parsed.ok) {
|
|
41515
41849
|
return [parsed, { status: "invalid" }];
|
|
@@ -41589,12 +41923,12 @@ var init_permissionsDeleteRole = __esm(() => {
|
|
|
41589
41923
|
});
|
|
41590
41924
|
|
|
41591
41925
|
// src/mcp-server/tools/permissionsDeleteRole.ts
|
|
41592
|
-
var
|
|
41926
|
+
var args29, tool$permissionsDeleteRole;
|
|
41593
41927
|
var init_permissionsDeleteRole2 = __esm(() => {
|
|
41594
41928
|
init_permissionsDeleteRole();
|
|
41595
41929
|
init_components();
|
|
41596
41930
|
init_tools();
|
|
41597
|
-
|
|
41931
|
+
args29 = {
|
|
41598
41932
|
request: V2PermissionsDeleteRoleRequestBody$inboundSchema
|
|
41599
41933
|
};
|
|
41600
41934
|
tool$permissionsDeleteRole = {
|
|
@@ -41610,9 +41944,9 @@ Remove a role from your workspace. This also removes the role from all assigned
|
|
|
41610
41944
|
Your root key must have the following permission:
|
|
41611
41945
|
- \`rbac.*.delete_role\`
|
|
41612
41946
|
`,
|
|
41613
|
-
args:
|
|
41614
|
-
tool: async (client,
|
|
41615
|
-
const [result, apiCall] = await permissionsDeleteRole(client,
|
|
41947
|
+
args: args29,
|
|
41948
|
+
tool: async (client, args30, ctx) => {
|
|
41949
|
+
const [result, apiCall] = await permissionsDeleteRole(client, args30.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
41616
41950
|
if (!result.ok) {
|
|
41617
41951
|
return {
|
|
41618
41952
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -41627,9 +41961,9 @@ Your root key must have the following permission:
|
|
|
41627
41961
|
|
|
41628
41962
|
// src/funcs/permissionsGetPermission.ts
|
|
41629
41963
|
function permissionsGetPermission(client, request, options) {
|
|
41630
|
-
return new APIPromise($
|
|
41964
|
+
return new APIPromise($do30(client, request, options));
|
|
41631
41965
|
}
|
|
41632
|
-
async function $
|
|
41966
|
+
async function $do30(client, request, options) {
|
|
41633
41967
|
const parsed = safeParse(request, (value) => V2PermissionsGetPermissionRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
41634
41968
|
if (!parsed.ok) {
|
|
41635
41969
|
return [parsed, { status: "invalid" }];
|
|
@@ -41709,12 +42043,12 @@ var init_permissionsGetPermission = __esm(() => {
|
|
|
41709
42043
|
});
|
|
41710
42044
|
|
|
41711
42045
|
// src/mcp-server/tools/permissionsGetPermission.ts
|
|
41712
|
-
var
|
|
42046
|
+
var args30, tool$permissionsGetPermission;
|
|
41713
42047
|
var init_permissionsGetPermission2 = __esm(() => {
|
|
41714
42048
|
init_permissionsGetPermission();
|
|
41715
42049
|
init_components();
|
|
41716
42050
|
init_tools();
|
|
41717
|
-
|
|
42051
|
+
args30 = {
|
|
41718
42052
|
request: V2PermissionsGetPermissionRequestBody$inboundSchema
|
|
41719
42053
|
};
|
|
41720
42054
|
tool$permissionsGetPermission = {
|
|
@@ -41728,9 +42062,9 @@ Retrieve details about a specific permission including its name, description, an
|
|
|
41728
42062
|
Your root key must have the following permission:
|
|
41729
42063
|
- \`rbac.*.read_permission\`
|
|
41730
42064
|
`,
|
|
41731
|
-
args:
|
|
41732
|
-
tool: async (client,
|
|
41733
|
-
const [result, apiCall] = await permissionsGetPermission(client,
|
|
42065
|
+
args: args30,
|
|
42066
|
+
tool: async (client, args31, ctx) => {
|
|
42067
|
+
const [result, apiCall] = await permissionsGetPermission(client, args31.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
41734
42068
|
if (!result.ok) {
|
|
41735
42069
|
return {
|
|
41736
42070
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -41745,9 +42079,9 @@ Your root key must have the following permission:
|
|
|
41745
42079
|
|
|
41746
42080
|
// src/funcs/permissionsGetRole.ts
|
|
41747
42081
|
function permissionsGetRole(client, request, options) {
|
|
41748
|
-
return new APIPromise($
|
|
42082
|
+
return new APIPromise($do31(client, request, options));
|
|
41749
42083
|
}
|
|
41750
|
-
async function $
|
|
42084
|
+
async function $do31(client, request, options) {
|
|
41751
42085
|
const parsed = safeParse(request, (value) => V2PermissionsGetRoleRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
41752
42086
|
if (!parsed.ok) {
|
|
41753
42087
|
return [parsed, { status: "invalid" }];
|
|
@@ -41827,12 +42161,12 @@ var init_permissionsGetRole = __esm(() => {
|
|
|
41827
42161
|
});
|
|
41828
42162
|
|
|
41829
42163
|
// src/mcp-server/tools/permissionsGetRole.ts
|
|
41830
|
-
var
|
|
42164
|
+
var args31, tool$permissionsGetRole;
|
|
41831
42165
|
var init_permissionsGetRole2 = __esm(() => {
|
|
41832
42166
|
init_permissionsGetRole();
|
|
41833
42167
|
init_components();
|
|
41834
42168
|
init_tools();
|
|
41835
|
-
|
|
42169
|
+
args31 = {
|
|
41836
42170
|
request: V2PermissionsGetRoleRequestBody$inboundSchema
|
|
41837
42171
|
};
|
|
41838
42172
|
tool$permissionsGetRole = {
|
|
@@ -41846,9 +42180,9 @@ Retrieve details about a specific role including its assigned permissions.
|
|
|
41846
42180
|
Your root key must have the following permission:
|
|
41847
42181
|
- \`rbac.*.read_role\`
|
|
41848
42182
|
`,
|
|
41849
|
-
args:
|
|
41850
|
-
tool: async (client,
|
|
41851
|
-
const [result, apiCall] = await permissionsGetRole(client,
|
|
42183
|
+
args: args31,
|
|
42184
|
+
tool: async (client, args32, ctx) => {
|
|
42185
|
+
const [result, apiCall] = await permissionsGetRole(client, args32.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
41852
42186
|
if (!result.ok) {
|
|
41853
42187
|
return {
|
|
41854
42188
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -41863,9 +42197,9 @@ Your root key must have the following permission:
|
|
|
41863
42197
|
|
|
41864
42198
|
// src/funcs/permissionsListPermissions.ts
|
|
41865
42199
|
function permissionsListPermissions(client, request, options) {
|
|
41866
|
-
return new APIPromise($
|
|
42200
|
+
return new APIPromise($do32(client, request, options));
|
|
41867
42201
|
}
|
|
41868
|
-
async function $
|
|
42202
|
+
async function $do32(client, request, options) {
|
|
41869
42203
|
const parsed = safeParse(request, (value) => V2PermissionsListPermissionsRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
41870
42204
|
if (!parsed.ok) {
|
|
41871
42205
|
return [parsed, { status: "invalid" }];
|
|
@@ -41945,12 +42279,12 @@ var init_permissionsListPermissions = __esm(() => {
|
|
|
41945
42279
|
});
|
|
41946
42280
|
|
|
41947
42281
|
// src/mcp-server/tools/permissionsListPermissions.ts
|
|
41948
|
-
var
|
|
42282
|
+
var args32, tool$permissionsListPermissions;
|
|
41949
42283
|
var init_permissionsListPermissions2 = __esm(() => {
|
|
41950
42284
|
init_permissionsListPermissions();
|
|
41951
42285
|
init_components();
|
|
41952
42286
|
init_tools();
|
|
41953
|
-
|
|
42287
|
+
args32 = {
|
|
41954
42288
|
request: V2PermissionsListPermissionsRequestBody$inboundSchema
|
|
41955
42289
|
};
|
|
41956
42290
|
tool$permissionsListPermissions = {
|
|
@@ -41965,9 +42299,9 @@ Results are paginated and sorted by their id.
|
|
|
41965
42299
|
Your root key must have the following permission:
|
|
41966
42300
|
- \`rbac.*.read_permission\`
|
|
41967
42301
|
`,
|
|
41968
|
-
args:
|
|
41969
|
-
tool: async (client,
|
|
41970
|
-
const [result, apiCall] = await permissionsListPermissions(client,
|
|
42302
|
+
args: args32,
|
|
42303
|
+
tool: async (client, args33, ctx) => {
|
|
42304
|
+
const [result, apiCall] = await permissionsListPermissions(client, args33.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
41971
42305
|
if (!result.ok) {
|
|
41972
42306
|
return {
|
|
41973
42307
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -41982,9 +42316,9 @@ Your root key must have the following permission:
|
|
|
41982
42316
|
|
|
41983
42317
|
// src/funcs/permissionsListRoles.ts
|
|
41984
42318
|
function permissionsListRoles(client, request, options) {
|
|
41985
|
-
return new APIPromise($
|
|
42319
|
+
return new APIPromise($do33(client, request, options));
|
|
41986
42320
|
}
|
|
41987
|
-
async function $
|
|
42321
|
+
async function $do33(client, request, options) {
|
|
41988
42322
|
const parsed = safeParse(request, (value) => V2PermissionsListRolesRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
41989
42323
|
if (!parsed.ok) {
|
|
41990
42324
|
return [parsed, { status: "invalid" }];
|
|
@@ -42064,12 +42398,12 @@ var init_permissionsListRoles = __esm(() => {
|
|
|
42064
42398
|
});
|
|
42065
42399
|
|
|
42066
42400
|
// src/mcp-server/tools/permissionsListRoles.ts
|
|
42067
|
-
var
|
|
42401
|
+
var args33, tool$permissionsListRoles;
|
|
42068
42402
|
var init_permissionsListRoles2 = __esm(() => {
|
|
42069
42403
|
init_permissionsListRoles();
|
|
42070
42404
|
init_components();
|
|
42071
42405
|
init_tools();
|
|
42072
|
-
|
|
42406
|
+
args33 = {
|
|
42073
42407
|
request: V2PermissionsListRolesRequestBody$inboundSchema
|
|
42074
42408
|
};
|
|
42075
42409
|
tool$permissionsListRoles = {
|
|
@@ -42084,9 +42418,9 @@ Results are paginated and sorted by their id.
|
|
|
42084
42418
|
Your root key must have the following permission:
|
|
42085
42419
|
- \`rbac.*.read_role\`
|
|
42086
42420
|
`,
|
|
42087
|
-
args:
|
|
42088
|
-
tool: async (client,
|
|
42089
|
-
const [result, apiCall] = await permissionsListRoles(client,
|
|
42421
|
+
args: args33,
|
|
42422
|
+
tool: async (client, args34, ctx) => {
|
|
42423
|
+
const [result, apiCall] = await permissionsListRoles(client, args34.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
42090
42424
|
if (!result.ok) {
|
|
42091
42425
|
return {
|
|
42092
42426
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -42101,9 +42435,9 @@ Your root key must have the following permission:
|
|
|
42101
42435
|
|
|
42102
42436
|
// src/funcs/ratelimitDeleteOverride.ts
|
|
42103
42437
|
function ratelimitDeleteOverride(client, request, options) {
|
|
42104
|
-
return new APIPromise($
|
|
42438
|
+
return new APIPromise($do34(client, request, options));
|
|
42105
42439
|
}
|
|
42106
|
-
async function $
|
|
42440
|
+
async function $do34(client, request, options) {
|
|
42107
42441
|
const parsed = safeParse(request, (value) => V2RatelimitDeleteOverrideRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
42108
42442
|
if (!parsed.ok) {
|
|
42109
42443
|
return [parsed, { status: "invalid" }];
|
|
@@ -42183,12 +42517,12 @@ var init_ratelimitDeleteOverride = __esm(() => {
|
|
|
42183
42517
|
});
|
|
42184
42518
|
|
|
42185
42519
|
// src/mcp-server/tools/ratelimitDeleteOverride.ts
|
|
42186
|
-
var
|
|
42520
|
+
var args34, tool$ratelimitDeleteOverride;
|
|
42187
42521
|
var init_ratelimitDeleteOverride2 = __esm(() => {
|
|
42188
42522
|
init_ratelimitDeleteOverride();
|
|
42189
42523
|
init_components();
|
|
42190
42524
|
init_tools();
|
|
42191
|
-
|
|
42525
|
+
args34 = {
|
|
42192
42526
|
request: V2RatelimitDeleteOverrideRequestBody$inboundSchema
|
|
42193
42527
|
};
|
|
42194
42528
|
tool$ratelimitDeleteOverride = {
|
|
@@ -42203,9 +42537,9 @@ Use this to remove temporary overrides, reset identifiers to standard limits, or
|
|
|
42203
42537
|
|
|
42204
42538
|
**Permissions:** Requires \`ratelimit.*.delete_override\` or \`ratelimit.<namespace_id>.delete_override\`
|
|
42205
42539
|
`,
|
|
42206
|
-
args:
|
|
42207
|
-
tool: async (client,
|
|
42208
|
-
const [result, apiCall] = await ratelimitDeleteOverride(client,
|
|
42540
|
+
args: args34,
|
|
42541
|
+
tool: async (client, args35, ctx) => {
|
|
42542
|
+
const [result, apiCall] = await ratelimitDeleteOverride(client, args35.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
42209
42543
|
if (!result.ok) {
|
|
42210
42544
|
return {
|
|
42211
42545
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -42220,9 +42554,9 @@ Use this to remove temporary overrides, reset identifiers to standard limits, or
|
|
|
42220
42554
|
|
|
42221
42555
|
// src/funcs/ratelimitGetOverride.ts
|
|
42222
42556
|
function ratelimitGetOverride(client, request, options) {
|
|
42223
|
-
return new APIPromise($
|
|
42557
|
+
return new APIPromise($do35(client, request, options));
|
|
42224
42558
|
}
|
|
42225
|
-
async function $
|
|
42559
|
+
async function $do35(client, request, options) {
|
|
42226
42560
|
const parsed = safeParse(request, (value) => V2RatelimitGetOverrideRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
42227
42561
|
if (!parsed.ok) {
|
|
42228
42562
|
return [parsed, { status: "invalid" }];
|
|
@@ -42302,12 +42636,12 @@ var init_ratelimitGetOverride = __esm(() => {
|
|
|
42302
42636
|
});
|
|
42303
42637
|
|
|
42304
42638
|
// src/mcp-server/tools/ratelimitGetOverride.ts
|
|
42305
|
-
var
|
|
42639
|
+
var args35, tool$ratelimitGetOverride;
|
|
42306
42640
|
var init_ratelimitGetOverride2 = __esm(() => {
|
|
42307
42641
|
init_ratelimitGetOverride();
|
|
42308
42642
|
init_components();
|
|
42309
42643
|
init_tools();
|
|
42310
|
-
|
|
42644
|
+
args35 = {
|
|
42311
42645
|
request: V2RatelimitGetOverrideRequestBody$inboundSchema
|
|
42312
42646
|
};
|
|
42313
42647
|
tool$ratelimitGetOverride = {
|
|
@@ -42322,9 +42656,9 @@ Use this to inspect override configurations, audit rate limiting policies, or de
|
|
|
42322
42656
|
|
|
42323
42657
|
**Permissions:** Requires \`ratelimit.*.read_override\` or \`ratelimit.<namespace_id>.read_override\`
|
|
42324
42658
|
`,
|
|
42325
|
-
args:
|
|
42326
|
-
tool: async (client,
|
|
42327
|
-
const [result, apiCall] = await ratelimitGetOverride(client,
|
|
42659
|
+
args: args35,
|
|
42660
|
+
tool: async (client, args36, ctx) => {
|
|
42661
|
+
const [result, apiCall] = await ratelimitGetOverride(client, args36.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
42328
42662
|
if (!result.ok) {
|
|
42329
42663
|
return {
|
|
42330
42664
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -42339,9 +42673,9 @@ Use this to inspect override configurations, audit rate limiting policies, or de
|
|
|
42339
42673
|
|
|
42340
42674
|
// src/funcs/ratelimitLimit.ts
|
|
42341
42675
|
function ratelimitLimit(client, request, options) {
|
|
42342
|
-
return new APIPromise($
|
|
42676
|
+
return new APIPromise($do36(client, request, options));
|
|
42343
42677
|
}
|
|
42344
|
-
async function $
|
|
42678
|
+
async function $do36(client, request, options) {
|
|
42345
42679
|
const parsed = safeParse(request, (value) => V2RatelimitLimitRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
42346
42680
|
if (!parsed.ok) {
|
|
42347
42681
|
return [parsed, { status: "invalid" }];
|
|
@@ -42421,12 +42755,12 @@ var init_ratelimitLimit = __esm(() => {
|
|
|
42421
42755
|
});
|
|
42422
42756
|
|
|
42423
42757
|
// src/mcp-server/tools/ratelimitLimit.ts
|
|
42424
|
-
var
|
|
42758
|
+
var args36, tool$ratelimitLimit;
|
|
42425
42759
|
var init_ratelimitLimit2 = __esm(() => {
|
|
42426
42760
|
init_ratelimitLimit();
|
|
42427
42761
|
init_components();
|
|
42428
42762
|
init_tools();
|
|
42429
|
-
|
|
42763
|
+
args36 = {
|
|
42430
42764
|
request: V2RatelimitLimitRequestBody$inboundSchema
|
|
42431
42765
|
};
|
|
42432
42766
|
tool$ratelimitLimit = {
|
|
@@ -42444,14 +42778,10 @@ Use this for rate limiting beyond API keys - limit users by ID, IPs by address,
|
|
|
42444
42778
|
Your root key must have one of the following permissions:
|
|
42445
42779
|
- \`ratelimit.*.limit\` (to check limits in any namespace)
|
|
42446
42780
|
- \`ratelimit.<namespace_id>.limit\` (to check limits in a specific namespace)
|
|
42447
|
-
|
|
42448
|
-
**Side Effects**
|
|
42449
|
-
|
|
42450
|
-
Records rate limit metrics for analytics and monitoring, updates rate limit counters with sliding window algorithm, and optionally triggers override matching for custom limits.
|
|
42451
42781
|
`,
|
|
42452
|
-
args:
|
|
42453
|
-
tool: async (client,
|
|
42454
|
-
const [result, apiCall] = await ratelimitLimit(client,
|
|
42782
|
+
args: args36,
|
|
42783
|
+
tool: async (client, args37, ctx) => {
|
|
42784
|
+
const [result, apiCall] = await ratelimitLimit(client, args37.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
42455
42785
|
if (!result.ok) {
|
|
42456
42786
|
return {
|
|
42457
42787
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -42466,9 +42796,9 @@ Records rate limit metrics for analytics and monitoring, updates rate limit coun
|
|
|
42466
42796
|
|
|
42467
42797
|
// src/funcs/ratelimitListOverrides.ts
|
|
42468
42798
|
function ratelimitListOverrides(client, request, options) {
|
|
42469
|
-
return new APIPromise($
|
|
42799
|
+
return new APIPromise($do37(client, request, options));
|
|
42470
42800
|
}
|
|
42471
|
-
async function $
|
|
42801
|
+
async function $do37(client, request, options) {
|
|
42472
42802
|
const parsed = safeParse(request, (value) => V2RatelimitListOverridesRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
42473
42803
|
if (!parsed.ok) {
|
|
42474
42804
|
return [parsed, { status: "invalid" }];
|
|
@@ -42548,12 +42878,12 @@ var init_ratelimitListOverrides = __esm(() => {
|
|
|
42548
42878
|
});
|
|
42549
42879
|
|
|
42550
42880
|
// src/mcp-server/tools/ratelimitListOverrides.ts
|
|
42551
|
-
var
|
|
42881
|
+
var args37, tool$ratelimitListOverrides;
|
|
42552
42882
|
var init_ratelimitListOverrides2 = __esm(() => {
|
|
42553
42883
|
init_ratelimitListOverrides();
|
|
42554
42884
|
init_components();
|
|
42555
42885
|
init_tools();
|
|
42556
|
-
|
|
42886
|
+
args37 = {
|
|
42557
42887
|
request: V2RatelimitListOverridesRequestBody$inboundSchema
|
|
42558
42888
|
};
|
|
42559
42889
|
tool$ratelimitListOverrides = {
|
|
@@ -42568,9 +42898,134 @@ Use this to audit rate limiting policies, build admin dashboards, or manage over
|
|
|
42568
42898
|
|
|
42569
42899
|
**Permissions:** Requires \`ratelimit.*.read_override\` or \`ratelimit.<namespace_id>.read_override\`
|
|
42570
42900
|
`,
|
|
42571
|
-
args:
|
|
42572
|
-
tool: async (client,
|
|
42573
|
-
const [result, apiCall] = await ratelimitListOverrides(client,
|
|
42901
|
+
args: args37,
|
|
42902
|
+
tool: async (client, args38, ctx) => {
|
|
42903
|
+
const [result, apiCall] = await ratelimitListOverrides(client, args38.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
42904
|
+
if (!result.ok) {
|
|
42905
|
+
return {
|
|
42906
|
+
content: [{ type: "text", text: result.error.message }],
|
|
42907
|
+
isError: true
|
|
42908
|
+
};
|
|
42909
|
+
}
|
|
42910
|
+
const value = result.value;
|
|
42911
|
+
return formatResult(value, apiCall);
|
|
42912
|
+
}
|
|
42913
|
+
};
|
|
42914
|
+
});
|
|
42915
|
+
|
|
42916
|
+
// src/funcs/ratelimitMultiLimit.ts
|
|
42917
|
+
function ratelimitMultiLimit(client, request, options) {
|
|
42918
|
+
return new APIPromise($do38(client, request, options));
|
|
42919
|
+
}
|
|
42920
|
+
async function $do38(client, request, options) {
|
|
42921
|
+
const parsed = safeParse(request, (value) => arrayType(V2RatelimitLimitRequestBody$outboundSchema).parse(value), "Input validation failed");
|
|
42922
|
+
if (!parsed.ok) {
|
|
42923
|
+
return [parsed, { status: "invalid" }];
|
|
42924
|
+
}
|
|
42925
|
+
const payload = parsed.value;
|
|
42926
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
42927
|
+
const path = pathToFunc("/v2/ratelimit.multiLimit")();
|
|
42928
|
+
const headers = new Headers(compactMap({
|
|
42929
|
+
"Content-Type": "application/json",
|
|
42930
|
+
Accept: "application/json"
|
|
42931
|
+
}));
|
|
42932
|
+
const secConfig = await extractSecurity(client._options.rootKey);
|
|
42933
|
+
const securityInput = secConfig == null ? {} : { rootKey: secConfig };
|
|
42934
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
42935
|
+
const context = {
|
|
42936
|
+
options: client._options,
|
|
42937
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
42938
|
+
operationID: "ratelimit.multiLimit",
|
|
42939
|
+
oAuth2Scopes: null,
|
|
42940
|
+
resolvedSecurity: requestSecurity,
|
|
42941
|
+
securitySource: client._options.rootKey,
|
|
42942
|
+
retryConfig: options?.retries || client._options.retryConfig || {
|
|
42943
|
+
strategy: "backoff",
|
|
42944
|
+
backoff: {
|
|
42945
|
+
initialInterval: 50,
|
|
42946
|
+
maxInterval: 1000,
|
|
42947
|
+
exponent: 1.5,
|
|
42948
|
+
maxElapsedTime: 1e4
|
|
42949
|
+
},
|
|
42950
|
+
retryConnectionErrors: true
|
|
42951
|
+
},
|
|
42952
|
+
retryCodes: options?.retryCodes || ["5XX"]
|
|
42953
|
+
};
|
|
42954
|
+
const requestRes = client._createRequest(context, {
|
|
42955
|
+
security: requestSecurity,
|
|
42956
|
+
method: "POST",
|
|
42957
|
+
baseURL: options?.serverURL,
|
|
42958
|
+
path,
|
|
42959
|
+
headers,
|
|
42960
|
+
body,
|
|
42961
|
+
userAgent: client._options.userAgent,
|
|
42962
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
|
|
42963
|
+
}, options);
|
|
42964
|
+
if (!requestRes.ok) {
|
|
42965
|
+
return [requestRes, { status: "invalid" }];
|
|
42966
|
+
}
|
|
42967
|
+
const req = requestRes.value;
|
|
42968
|
+
const doResult = await client._do(req, {
|
|
42969
|
+
context,
|
|
42970
|
+
errorCodes: ["400", "401", "403", "404", "410", "4XX", "500", "5XX"],
|
|
42971
|
+
retryConfig: context.retryConfig,
|
|
42972
|
+
retryCodes: context.retryCodes
|
|
42973
|
+
});
|
|
42974
|
+
if (!doResult.ok) {
|
|
42975
|
+
return [doResult, { status: "request-error", request: req }];
|
|
42976
|
+
}
|
|
42977
|
+
const response = doResult.value;
|
|
42978
|
+
const responseFields = {
|
|
42979
|
+
HttpMeta: { Response: response, Request: req }
|
|
42980
|
+
};
|
|
42981
|
+
const [result] = await match(json(200, V2RatelimitMultiLimitResponseBody$inboundSchema), jsonErr(400, BadRequestErrorResponse$inboundSchema), jsonErr(401, UnauthorizedErrorResponse$inboundSchema), jsonErr(403, ForbiddenErrorResponse$inboundSchema), jsonErr(404, NotFoundErrorResponse$inboundSchema), jsonErr(410, GoneErrorResponse$inboundSchema), jsonErr(500, InternalServerErrorResponse$inboundSchema), fail("4XX"), fail("5XX"))(response, req, { extraFields: responseFields });
|
|
42982
|
+
if (!result.ok) {
|
|
42983
|
+
return [result, { status: "complete", request: req, response }];
|
|
42984
|
+
}
|
|
42985
|
+
return [result, { status: "complete", request: req, response }];
|
|
42986
|
+
}
|
|
42987
|
+
var init_ratelimitMultiLimit = __esm(() => {
|
|
42988
|
+
init_v3();
|
|
42989
|
+
init_encodings();
|
|
42990
|
+
init_matchers();
|
|
42991
|
+
init_primitives();
|
|
42992
|
+
init_schemas();
|
|
42993
|
+
init_security();
|
|
42994
|
+
init_url();
|
|
42995
|
+
init_components();
|
|
42996
|
+
init_errors2();
|
|
42997
|
+
init_async();
|
|
42998
|
+
});
|
|
42999
|
+
|
|
43000
|
+
// src/mcp-server/tools/ratelimitMultiLimit.ts
|
|
43001
|
+
var args38, tool$ratelimitMultiLimit;
|
|
43002
|
+
var init_ratelimitMultiLimit2 = __esm(() => {
|
|
43003
|
+
init_v3();
|
|
43004
|
+
init_ratelimitMultiLimit();
|
|
43005
|
+
init_components();
|
|
43006
|
+
init_tools();
|
|
43007
|
+
args38 = {
|
|
43008
|
+
request: arrayType(V2RatelimitLimitRequestBody$inboundSchema)
|
|
43009
|
+
};
|
|
43010
|
+
tool$ratelimitMultiLimit = {
|
|
43011
|
+
name: "ratelimit-multi-limit",
|
|
43012
|
+
description: `Apply multiple rate limit checks
|
|
43013
|
+
|
|
43014
|
+
Check and enforce multiple rate limits in a single request for any identifiers (user IDs, IP addresses, API clients, etc.).
|
|
43015
|
+
|
|
43016
|
+
Use this to efficiently check multiple rate limits at once. Each rate limit check is independent and returns its own result with a top-level \`passed\` indicator showing if all checks succeeded.
|
|
43017
|
+
|
|
43018
|
+
**Response Codes**: Rate limit checks return HTTP 200 regardless of whether limits are exceeded - check the \`passed\` field to see if all limits passed, or the \`success\` field in each individual result. 4xx responses indicate auth, namespace existence/deletion, or validation errors (e.g., 410 Gone for deleted namespaces). 5xx responses indicate server errors.
|
|
43019
|
+
|
|
43020
|
+
**Required Permissions**
|
|
43021
|
+
|
|
43022
|
+
Your root key must have one of the following permissions:
|
|
43023
|
+
- \`ratelimit.*.limit\` (to check limits in any namespace)
|
|
43024
|
+
- \`ratelimit.<namespace_id>.limit\` (to check limits in all specific namespaces being checked)
|
|
43025
|
+
`,
|
|
43026
|
+
args: args38,
|
|
43027
|
+
tool: async (client, args39, ctx) => {
|
|
43028
|
+
const [result, apiCall] = await ratelimitMultiLimit(client, args39.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
42574
43029
|
if (!result.ok) {
|
|
42575
43030
|
return {
|
|
42576
43031
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -42585,9 +43040,9 @@ Use this to audit rate limiting policies, build admin dashboards, or manage over
|
|
|
42585
43040
|
|
|
42586
43041
|
// src/funcs/ratelimitSetOverride.ts
|
|
42587
43042
|
function ratelimitSetOverride(client, request, options) {
|
|
42588
|
-
return new APIPromise($
|
|
43043
|
+
return new APIPromise($do39(client, request, options));
|
|
42589
43044
|
}
|
|
42590
|
-
async function $
|
|
43045
|
+
async function $do39(client, request, options) {
|
|
42591
43046
|
const parsed = safeParse(request, (value) => V2RatelimitSetOverrideRequestBody$outboundSchema.parse(value), "Input validation failed");
|
|
42592
43047
|
if (!parsed.ok) {
|
|
42593
43048
|
return [parsed, { status: "invalid" }];
|
|
@@ -42667,12 +43122,12 @@ var init_ratelimitSetOverride = __esm(() => {
|
|
|
42667
43122
|
});
|
|
42668
43123
|
|
|
42669
43124
|
// src/mcp-server/tools/ratelimitSetOverride.ts
|
|
42670
|
-
var
|
|
43125
|
+
var args39, tool$ratelimitSetOverride;
|
|
42671
43126
|
var init_ratelimitSetOverride2 = __esm(() => {
|
|
42672
43127
|
init_ratelimitSetOverride();
|
|
42673
43128
|
init_components();
|
|
42674
43129
|
init_tools();
|
|
42675
|
-
|
|
43130
|
+
args39 = {
|
|
42676
43131
|
request: V2RatelimitSetOverrideRequestBody$inboundSchema
|
|
42677
43132
|
};
|
|
42678
43133
|
tool$ratelimitSetOverride = {
|
|
@@ -42687,9 +43142,9 @@ Use this to create premium tiers with higher limits, apply stricter limits to sp
|
|
|
42687
43142
|
|
|
42688
43143
|
**Permissions:** Requires \`ratelimit.*.set_override\` or \`ratelimit.<namespace_id>.set_override\`
|
|
42689
43144
|
`,
|
|
42690
|
-
args:
|
|
42691
|
-
tool: async (client,
|
|
42692
|
-
const [result, apiCall] = await ratelimitSetOverride(client,
|
|
43145
|
+
args: args39,
|
|
43146
|
+
tool: async (client, args40, ctx) => {
|
|
43147
|
+
const [result, apiCall] = await ratelimitSetOverride(client, args40.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
42693
43148
|
if (!result.ok) {
|
|
42694
43149
|
return {
|
|
42695
43150
|
content: [{ type: "text", text: result.error.message }],
|
|
@@ -42706,7 +43161,7 @@ Use this to create premium tiers with higher limits, apply stricter limits to sp
|
|
|
42706
43161
|
function createMCPServer(deps) {
|
|
42707
43162
|
const server = new McpServer({
|
|
42708
43163
|
name: "Unkey",
|
|
42709
|
-
version: "2.1.
|
|
43164
|
+
version: "2.1.2"
|
|
42710
43165
|
});
|
|
42711
43166
|
const client = new UnkeyCore({
|
|
42712
43167
|
rootKey: deps.rootKey,
|
|
@@ -42735,6 +43190,7 @@ function createMCPServer(deps) {
|
|
|
42735
43190
|
tool(tool$keysCreateKey);
|
|
42736
43191
|
tool(tool$keysDeleteKey);
|
|
42737
43192
|
tool(tool$keysGetKey);
|
|
43193
|
+
tool(tool$keysMigrateKeys);
|
|
42738
43194
|
tool(tool$keysRemovePermissions);
|
|
42739
43195
|
tool(tool$keysRemoveRoles);
|
|
42740
43196
|
tool(tool$keysRerollKey);
|
|
@@ -42756,6 +43212,7 @@ function createMCPServer(deps) {
|
|
|
42756
43212
|
tool(tool$ratelimitGetOverride);
|
|
42757
43213
|
tool(tool$ratelimitLimit);
|
|
42758
43214
|
tool(tool$ratelimitListOverrides);
|
|
43215
|
+
tool(tool$ratelimitMultiLimit);
|
|
42759
43216
|
tool(tool$ratelimitSetOverride);
|
|
42760
43217
|
return server;
|
|
42761
43218
|
}
|
|
@@ -42779,6 +43236,7 @@ var init_server2 = __esm(() => {
|
|
|
42779
43236
|
init_keysCreateKey2();
|
|
42780
43237
|
init_keysDeleteKey2();
|
|
42781
43238
|
init_keysGetKey2();
|
|
43239
|
+
init_keysMigrateKeys2();
|
|
42782
43240
|
init_keysRemovePermissions2();
|
|
42783
43241
|
init_keysRemoveRoles2();
|
|
42784
43242
|
init_keysRerollKey2();
|
|
@@ -42800,6 +43258,7 @@ var init_server2 = __esm(() => {
|
|
|
42800
43258
|
init_ratelimitGetOverride2();
|
|
42801
43259
|
init_ratelimitLimit2();
|
|
42802
43260
|
init_ratelimitListOverrides2();
|
|
43261
|
+
init_ratelimitMultiLimit2();
|
|
42803
43262
|
init_ratelimitSetOverride2();
|
|
42804
43263
|
});
|
|
42805
43264
|
|
|
@@ -43996,7 +44455,7 @@ var routes = ln({
|
|
|
43996
44455
|
var app = _e(routes, {
|
|
43997
44456
|
name: "mcp",
|
|
43998
44457
|
versionInfo: {
|
|
43999
|
-
currentVersion: "2.1.
|
|
44458
|
+
currentVersion: "2.1.2"
|
|
44000
44459
|
}
|
|
44001
44460
|
});
|
|
44002
44461
|
Yt(app, process3.argv.slice(2), buildContext(process3));
|
|
@@ -44004,5 +44463,5 @@ export {
|
|
|
44004
44463
|
app
|
|
44005
44464
|
};
|
|
44006
44465
|
|
|
44007
|
-
//# debugId=
|
|
44466
|
+
//# debugId=77A6B0E086C5EA3664756E2164756E21
|
|
44008
44467
|
//# sourceMappingURL=mcp-server.js.map
|