@smartbear/mcp 0.33.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/cache.js +4 -3
- package/dist/package.json.js +1 -1
- package/dist/pactflow/client/base.js +30 -21
- package/dist/pactflow/client/pagination.js +103 -0
- package/dist/pactflow/client/tools.js +70 -41
- package/dist/pactflow/client.js +15 -1
- package/dist/qmetry/client/ai-agent.js +106 -0
- package/dist/qmetry/client/api/client-api.js +8 -2
- package/dist/qmetry/client/handlers.js +5 -1
- package/dist/qmetry/client/tools/ai-agent-tools.js +120 -0
- package/dist/qmetry/client/tools/index.js +4 -1
- package/dist/qmetry/client.js +19 -2
- package/dist/qmetry/config/constants.js +5 -2
- package/dist/qmetry/config/rest-endpoints.js +5 -0
- package/dist/qmetry/types/ai-agent.js +38 -0
- package/dist/qmetry/types/common.js +9 -0
- package/dist/swagger/client/api.js +18 -13
- package/dist/swagger/client/functional-testing-api.js +16 -0
- package/dist/swagger/client/functional-testing-tools.js +12 -2
- package/dist/swagger/client/functional-testing-types.js +42 -0
- package/dist/swagger/client/portal-types.js +1 -1
- package/dist/swagger/client/portal-utils.js +24 -16
- package/dist/swagger/client/registry-types.js +2 -1
- package/dist/swagger/client/tool-constants.js +2 -2
- package/dist/swagger/client/tools.js +5 -3
- package/dist/swagger/client.js +3 -0
- package/package.json +1 -1
|
@@ -3,21 +3,29 @@ const SUBDOMAIN_MIN_LENGTH = 3;
|
|
|
3
3
|
const SUBDOMAIN_MAX_LENGTH = 20;
|
|
4
4
|
const PORTAL_NAME_MIN_LENGTH = 3;
|
|
5
5
|
const PORTAL_NAME_MAX_LENGTH = 40;
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (
|
|
12
|
-
|
|
6
|
+
function convertToValidSubdomain(value = "", rng = Math.random) {
|
|
7
|
+
let converted = value.toLowerCase().replace(/[^a-z0-9-]+/g, "").split("-").filter(Boolean).join("-");
|
|
8
|
+
while (converted.length < SUBDOMAIN_MIN_LENGTH) {
|
|
9
|
+
converted = `${converted}${Math.floor(rng() * 10)}`;
|
|
10
|
+
}
|
|
11
|
+
if (converted.length > SUBDOMAIN_MAX_LENGTH) {
|
|
12
|
+
converted = converted.slice(0, SUBDOMAIN_MAX_LENGTH);
|
|
13
|
+
if (converted.endsWith("-")) {
|
|
14
|
+
converted = converted.slice(0, -1);
|
|
15
|
+
}
|
|
13
16
|
}
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
return converted;
|
|
18
|
+
}
|
|
19
|
+
function appendRandomSuffix(base, rng = Math.random) {
|
|
20
|
+
const randomChars = `-${rng().toString(36).substring(2, 5).padEnd(3, "0")}`;
|
|
21
|
+
const baseSlug = base.slice(0, SUBDOMAIN_MAX_LENGTH - randomChars.length).replace(/-+$/, "");
|
|
22
|
+
return `${baseSlug}${randomChars}`;
|
|
16
23
|
}
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
function buildSubdomainCandidate(organizationName, rng = Math.random) {
|
|
25
|
+
return appendRandomSuffix(
|
|
26
|
+
convertToValidSubdomain(organizationName, rng),
|
|
27
|
+
rng
|
|
28
|
+
);
|
|
21
29
|
}
|
|
22
30
|
function buildPortalName(organizationName) {
|
|
23
31
|
const trimmed = organizationName?.trim();
|
|
@@ -41,10 +49,10 @@ export {
|
|
|
41
49
|
PORTAL_NAME_MIN_LENGTH,
|
|
42
50
|
SUBDOMAIN_MAX_LENGTH,
|
|
43
51
|
SUBDOMAIN_MIN_LENGTH,
|
|
52
|
+
appendRandomSuffix,
|
|
44
53
|
buildPortalName,
|
|
45
54
|
buildSubdomainCandidate,
|
|
46
|
-
|
|
55
|
+
convertToValidSubdomain,
|
|
47
56
|
isConflictError,
|
|
48
|
-
isOrganizationPortalConflict
|
|
49
|
-
slugify
|
|
57
|
+
isOrganizationPortalConflict
|
|
50
58
|
};
|
|
@@ -104,7 +104,8 @@ const StandardizeOutputSchema = z.looseObject({
|
|
|
104
104
|
message: z.string().optional(),
|
|
105
105
|
errorsFound: z.number().optional(),
|
|
106
106
|
fixedDefinition: z.string().optional(),
|
|
107
|
-
savedVersion: z.string().optional()
|
|
107
|
+
savedVersion: z.string().optional(),
|
|
108
|
+
url: z.string().optional()
|
|
108
109
|
});
|
|
109
110
|
const ApiDefinitionOutputSchema = z.object({
|
|
110
111
|
definition: z.string()
|
|
@@ -5,12 +5,12 @@ const READ_ONLY = {
|
|
|
5
5
|
};
|
|
6
6
|
const WRITE = {
|
|
7
7
|
readOnly: false,
|
|
8
|
-
openWorld:
|
|
8
|
+
openWorld: false,
|
|
9
9
|
destructive: false
|
|
10
10
|
};
|
|
11
11
|
const WRITE_DESTRUCTIVE = {
|
|
12
12
|
readOnly: false,
|
|
13
|
-
openWorld:
|
|
13
|
+
openWorld: false,
|
|
14
14
|
destructive: true
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
@@ -235,16 +235,18 @@ const TOOLS = [
|
|
|
235
235
|
inputSchema: CreateApiFromPromptParamsSchema,
|
|
236
236
|
outputSchema: CreateApiFromPromptOutputSchema,
|
|
237
237
|
handler: "createApiFromPrompt",
|
|
238
|
-
...WRITE_DESTRUCTIVE
|
|
238
|
+
...WRITE_DESTRUCTIVE,
|
|
239
|
+
openWorld: true
|
|
239
240
|
},
|
|
240
241
|
{
|
|
241
242
|
title: "Standardize API",
|
|
242
243
|
toolset: "Registry API",
|
|
243
|
-
summary: "Standardize and fix an API definition using AI to ensure compliance with governance policies. Scans the API definition for standardization errors and automatically fixes them using SmartBear AI. Optionally provide 'newVersion' (e.g. patch bump '1.0.0' → '1.0.1') to save the fixed definition as a new version — omitting it will overwrite the current version. Returns the number of errors found
|
|
244
|
+
summary: "Standardize and fix an API definition using AI to ensure compliance with governance policies. Scans the API definition for standardization errors and automatically fixes them using SmartBear AI. Optionally provide 'newVersion' (e.g. patch bump '1.0.0' → '1.0.1') to save the fixed definition as a new version — omitting it will overwrite the current version. Returns the number of errors found, the fixed definition, and a URL to view the standardized API. Use this tool when users ask to standardize, fix, govern, or ensure governance compliance of APIs.",
|
|
244
245
|
inputSchema: StandardizeApiParamsSchema,
|
|
245
246
|
outputSchema: StandardizeOutputSchema,
|
|
246
247
|
handler: "standardizeApi",
|
|
247
|
-
...WRITE_DESTRUCTIVE
|
|
248
|
+
...WRITE_DESTRUCTIVE,
|
|
249
|
+
openWorld: true
|
|
248
250
|
},
|
|
249
251
|
...FUNCTIONAL_TESTING_TOOLS
|
|
250
252
|
];
|
package/dist/swagger/client.js
CHANGED
|
@@ -213,6 +213,9 @@ class SwaggerClient {
|
|
|
213
213
|
async listFunctionalTestingSuites() {
|
|
214
214
|
return this.withFunctionalTesting((ftApi) => ftApi.listSuites());
|
|
215
215
|
}
|
|
216
|
+
async createFunctionalTestingSuite(args) {
|
|
217
|
+
return this.withFunctionalTesting((ftApi) => ftApi.createSuite(args));
|
|
218
|
+
}
|
|
216
219
|
async getFunctionalTestingTestHistory(args) {
|
|
217
220
|
return this.withFunctionalTesting((ftApi) => ftApi.getTestHistory(args));
|
|
218
221
|
}
|