@smartbear/mcp 0.32.0 → 0.34.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/common/client-registry.js +19 -7
- 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/swagger/client/api.js +18 -13
- package/dist/swagger/client/functional-testing-api.js +25 -0
- package/dist/swagger/client/functional-testing-tools.js +12 -2
- package/dist/swagger/client/functional-testing-types.js +29 -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 +7 -4
- package/dist/zephyr/client.js +3 -1
- package/dist/zephyr/common/rest-api-schemas.js +2876 -522
- package/dist/zephyr/common/utils.js +58 -14
- package/dist/zephyr/tool/test-case/update-test-case.js +37 -21
- package/dist/zephyr/tool/test-cycle/update-test-cycle.js +41 -25
- package/dist/zephyr/tool/test-plan/get-test-plans.js +65 -0
- package/package.json +1 -1
package/dist/common/cache.js
CHANGED
|
@@ -19,13 +19,14 @@ class CacheService {
|
|
|
19
19
|
return this.cache.get(key);
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Set a value in the cache
|
|
22
|
+
* Set a value in the cache, optionally overriding the default TTL
|
|
23
|
+
* (in seconds) for this key only.
|
|
23
24
|
*/
|
|
24
|
-
set(key, value) {
|
|
25
|
+
set(key, value, ttl) {
|
|
25
26
|
if (!this.enabled || !this.cache) {
|
|
26
27
|
return false;
|
|
27
28
|
}
|
|
28
|
-
return this.cache.set(key, value);
|
|
29
|
+
return ttl !== void 0 ? this.cache.set(key, value, ttl) : this.cache.set(key, value);
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* Delete a value from the cache
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { ZodURL } from "zod";
|
|
2
2
|
import { fullyUnwrapZodType, isOptionalType } from "./zod-utils.js";
|
|
3
|
+
function cloneClient(entry) {
|
|
4
|
+
const withClone = entry;
|
|
5
|
+
if (typeof withClone.clone === "function") {
|
|
6
|
+
return withClone.clone();
|
|
7
|
+
}
|
|
8
|
+
const ctor = entry.constructor;
|
|
9
|
+
if (ctor && ctor !== Object && typeof ctor === "function") {
|
|
10
|
+
return new ctor();
|
|
11
|
+
}
|
|
12
|
+
return entry;
|
|
13
|
+
}
|
|
3
14
|
class ClientRegistry {
|
|
4
15
|
entries = [];
|
|
5
16
|
enabledClients;
|
|
@@ -92,19 +103,20 @@ class ClientRegistry {
|
|
|
92
103
|
async configure(server, getConfigValue, ignoreMissingRequiredConfigs = false) {
|
|
93
104
|
let configuredCount = 0;
|
|
94
105
|
entryLoop: for (const entry of this.getAll()) {
|
|
106
|
+
const client = cloneClient(entry);
|
|
95
107
|
const config = {};
|
|
96
|
-
for (const configKey of Object.keys(
|
|
97
|
-
const value = getConfigValue(
|
|
108
|
+
for (const configKey of Object.keys(client.config.shape)) {
|
|
109
|
+
const value = getConfigValue(client, configKey);
|
|
98
110
|
if (value !== null) {
|
|
99
|
-
this.validateAllowedEndpoint(
|
|
111
|
+
this.validateAllowedEndpoint(client.config.shape[configKey], value);
|
|
100
112
|
config[configKey] = value;
|
|
101
|
-
} else if (!ignoreMissingRequiredConfigs && !isOptionalType(
|
|
113
|
+
} else if (!ignoreMissingRequiredConfigs && !isOptionalType(client.config.shape[configKey])) {
|
|
102
114
|
continue entryLoop;
|
|
103
115
|
}
|
|
104
116
|
}
|
|
105
|
-
await
|
|
106
|
-
if (
|
|
107
|
-
await server.addClient(
|
|
117
|
+
await client.configure(server, config);
|
|
118
|
+
if (client.isConfigured()) {
|
|
119
|
+
await server.addClient(client);
|
|
108
120
|
configuredCount++;
|
|
109
121
|
}
|
|
110
122
|
}
|
package/dist/package.json.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
const PaginationSchema = z.object({
|
|
3
|
+
pageNumber: z.number().default(1).optional().describe("Page number"),
|
|
4
|
+
pageSize: z.number().default(5).optional().describe("Results per page")
|
|
5
|
+
});
|
|
2
6
|
const CanIDeploySchema = z.object({
|
|
3
7
|
pacticipant: z.string().describe(
|
|
4
8
|
"The name of the pacticipant (application/service) being evaluated for deployment"
|
|
@@ -43,13 +47,13 @@ const GetPacticipantSchema = z.object({
|
|
|
43
47
|
const ListBranchesSchema = z.object({
|
|
44
48
|
pacticipantName: z.string().describe("Name of the pacticipant"),
|
|
45
49
|
q: z.string().optional().describe("Filter branches by name"),
|
|
46
|
-
pageNumber: z.number().optional().describe("Page number
|
|
47
|
-
pageSize: z.number().optional().describe("Results per page
|
|
50
|
+
pageNumber: z.number().default(1).optional().describe("Page number"),
|
|
51
|
+
pageSize: z.number().default(5).optional().describe("Results per page")
|
|
48
52
|
});
|
|
49
53
|
const ListVersionsSchema = z.object({
|
|
50
54
|
pacticipantName: z.string().describe("Name of the pacticipant"),
|
|
51
|
-
pageNumber: z.number().optional().describe("Page number"),
|
|
52
|
-
pageSize: z.number().optional().describe("Results per page")
|
|
55
|
+
pageNumber: z.number().default(1).optional().describe("Page number"),
|
|
56
|
+
pageSize: z.number().default(5).optional().describe("Results per page")
|
|
53
57
|
});
|
|
54
58
|
const GetVersionSchema = z.object({
|
|
55
59
|
pacticipantName: z.string().describe("Name of the pacticipant"),
|
|
@@ -74,7 +78,7 @@ const RecordDeploymentSchema = z.object({
|
|
|
74
78
|
});
|
|
75
79
|
const GetCurrentlyDeployedSchema = z.object({
|
|
76
80
|
environmentId: z.string().describe("UUID of the environment")
|
|
77
|
-
});
|
|
81
|
+
}).extend(PaginationSchema.shape);
|
|
78
82
|
const RecordReleaseSchema = z.object({
|
|
79
83
|
pacticipantName: z.string().describe("Name of the pacticipant that was released"),
|
|
80
84
|
versionNumber: z.string().describe("Version number that was released"),
|
|
@@ -82,7 +86,7 @@ const RecordReleaseSchema = z.object({
|
|
|
82
86
|
});
|
|
83
87
|
const GetCurrentlySupportedSchema = z.object({
|
|
84
88
|
environmentId: z.string().describe("UUID of the environment")
|
|
85
|
-
});
|
|
89
|
+
}).extend(PaginationSchema.shape);
|
|
86
90
|
const PublishConsumerContractsSchema = z.object({
|
|
87
91
|
pacticipantName: z.string().min(1).describe("Name of the consumer application"),
|
|
88
92
|
pacticipantVersionNumber: z.string().min(1).describe("Version number of the consumer"),
|
|
@@ -153,7 +157,7 @@ const GetLabelSchema = z.object({
|
|
|
153
157
|
});
|
|
154
158
|
const LabelByNameSchema = z.object({
|
|
155
159
|
labelName: z.string().describe("Label name to filter by")
|
|
156
|
-
});
|
|
160
|
+
}).extend(PaginationSchema.shape);
|
|
157
161
|
const UpdatePacticipantSchema = z.object({
|
|
158
162
|
pacticipantName: z.string().describe("Name of the pacticipant to update"),
|
|
159
163
|
displayName: z.string().optional().describe("Human-readable display name"),
|
|
@@ -170,24 +174,24 @@ const UpdateVersionSchema = z.object({
|
|
|
170
174
|
const GetBranchVersionsSchema = z.object({
|
|
171
175
|
pacticipantName: z.string().describe("Name of the pacticipant"),
|
|
172
176
|
branchName: z.string().describe("Name of the branch"),
|
|
173
|
-
pageNumber: z.number().optional().describe("Page number"),
|
|
174
|
-
pageSize: z.number().optional().describe("Results per page")
|
|
177
|
+
pageNumber: z.number().default(1).optional().describe("Page number"),
|
|
178
|
+
pageSize: z.number().default(5).optional().describe("Results per page")
|
|
175
179
|
});
|
|
176
180
|
const GetVersionDeployedSchema = z.object({
|
|
177
181
|
pacticipantName: z.string().describe("Name of the pacticipant"),
|
|
178
182
|
versionNumber: z.string().describe("Version number"),
|
|
179
183
|
environmentId: z.string().describe("UUID of the environment")
|
|
180
|
-
});
|
|
184
|
+
}).extend(PaginationSchema.shape);
|
|
181
185
|
const GetBiDirectionalProviderVersionSchema = z.object({
|
|
182
186
|
providerName: z.string().describe("Name of the provider"),
|
|
183
187
|
providerVersionNumber: z.string().describe("Provider version number")
|
|
184
|
-
});
|
|
188
|
+
}).extend(PaginationSchema.shape);
|
|
185
189
|
const GetBiDirectionalConsumerProviderVersionSchema = z.object({
|
|
186
190
|
providerName: z.string().describe("Name of the provider"),
|
|
187
191
|
providerVersionNumber: z.string().describe("Provider version number"),
|
|
188
192
|
consumerName: z.string().describe("Name of the consumer"),
|
|
189
193
|
consumerVersionNumber: z.string().describe("Consumer version number")
|
|
190
|
-
});
|
|
194
|
+
}).extend(PaginationSchema.shape);
|
|
191
195
|
const CreateEnvironmentSchema = z.object({
|
|
192
196
|
name: z.string().min(1).describe("Unique name for the environment (e.g. 'production', 'staging')"),
|
|
193
197
|
production: z.boolean().describe("Whether this is a production environment"),
|
|
@@ -226,7 +230,7 @@ const ManageLabelSchema = z.object({
|
|
|
226
230
|
});
|
|
227
231
|
const GetIntegrationsByTeamSchema = z.object({
|
|
228
232
|
teamId: z.string().describe("UUID of the team")
|
|
229
|
-
});
|
|
233
|
+
}).extend(PaginationSchema.shape);
|
|
230
234
|
const DeleteIntegrationSchema = z.object({
|
|
231
235
|
providerName: z.string().describe("Name of the provider"),
|
|
232
236
|
consumerName: z.string().describe("Name of the consumer")
|
|
@@ -294,15 +298,15 @@ const AuditSchema = z.object({
|
|
|
294
298
|
from: z.string().optional().describe(
|
|
295
299
|
"Start result set from this audit event UUID (keyset pagination)"
|
|
296
300
|
),
|
|
297
|
-
pageNumber: z.number().int().min(1).optional().describe("Page number"),
|
|
298
|
-
pageSize: z.number().int().min(1).max(100).optional().describe("Results per page (max 100)")
|
|
301
|
+
pageNumber: z.number().int().min(1).default(1).optional().describe("Page number"),
|
|
302
|
+
pageSize: z.number().int().min(1).max(100).default(5).optional().describe("Results per page (max 100)")
|
|
299
303
|
});
|
|
300
304
|
const ListAdminUsersSchema = z.object({
|
|
301
305
|
active: z.boolean().optional().describe("Filter by active/inactive status"),
|
|
302
306
|
q: z.string().optional().describe("Filter by name or email"),
|
|
303
307
|
userType: z.number().min(0).max(1).optional().describe("0 = regular users, 1 = system accounts"),
|
|
304
|
-
page: z.number().optional().describe("Page number"),
|
|
305
|
-
size: z.number().optional().describe("Results per page")
|
|
308
|
+
page: z.number().default(1).optional().describe("Page number"),
|
|
309
|
+
size: z.number().default(5).optional().describe("Results per page")
|
|
306
310
|
});
|
|
307
311
|
const AdminUserIdSchema = z.object({
|
|
308
312
|
userId: z.string().describe("UUID of the user")
|
|
@@ -341,12 +345,15 @@ const UserRoleSchema = z.object({
|
|
|
341
345
|
});
|
|
342
346
|
const ListAdminTeamsSchema = z.object({
|
|
343
347
|
q: z.string().optional().describe("Filter teams by name"),
|
|
344
|
-
page: z.number().optional().describe("Page number"),
|
|
345
|
-
size: z.number().optional().describe("Results per page")
|
|
348
|
+
page: z.number().default(1).optional().describe("Page number"),
|
|
349
|
+
size: z.number().default(5).optional().describe("Results per page")
|
|
346
350
|
});
|
|
347
351
|
const AdminTeamIdSchema = z.object({
|
|
348
352
|
teamId: z.string().describe("UUID of the team")
|
|
349
353
|
});
|
|
354
|
+
const ListTeamUsersSchema = AdminTeamIdSchema.extend(
|
|
355
|
+
PaginationSchema.shape
|
|
356
|
+
);
|
|
350
357
|
const CreateTeamSchema = z.object({
|
|
351
358
|
name: z.string().min(1).describe("Name of the team"),
|
|
352
359
|
administratorUuids: z.array(z.string().uuid()).optional().describe("UUIDs of team administrators"),
|
|
@@ -407,10 +414,10 @@ const CreateSystemAccountSchema = z.object({
|
|
|
407
414
|
});
|
|
408
415
|
const GetSystemAccountTokensSchema = z.object({
|
|
409
416
|
accountId: z.string().describe("UUID of the system account")
|
|
410
|
-
});
|
|
417
|
+
}).extend(PaginationSchema.shape);
|
|
411
418
|
const GetPacticipantNetworkSchema = z.object({
|
|
412
419
|
pacticipantName: z.string().describe("Name of the pacticipant to get network for")
|
|
413
|
-
});
|
|
420
|
+
}).extend(PaginationSchema.shape);
|
|
414
421
|
export {
|
|
415
422
|
AdminRoleIdSchema,
|
|
416
423
|
AdminTeamIdSchema,
|
|
@@ -449,9 +456,11 @@ export {
|
|
|
449
456
|
ListAdminTeamsSchema,
|
|
450
457
|
ListAdminUsersSchema,
|
|
451
458
|
ListBranchesSchema,
|
|
459
|
+
ListTeamUsersSchema,
|
|
452
460
|
ListVersionsSchema,
|
|
453
461
|
ManageLabelSchema,
|
|
454
462
|
MatrixSchema,
|
|
463
|
+
PaginationSchema,
|
|
455
464
|
PatchTeamUsersSchema,
|
|
456
465
|
PublishConsumerContractsSchema,
|
|
457
466
|
PublishProviderContractSchema,
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { randomBytes, scryptSync, createHmac } from "node:crypto";
|
|
2
|
+
const PAGINATION_CACHE_TTL_SECONDS = 30;
|
|
3
|
+
const CACHE_KEY_SECRET = randomBytes(32);
|
|
4
|
+
function stableStringify(value) {
|
|
5
|
+
if (value === null || typeof value !== "object") {
|
|
6
|
+
return JSON.stringify(value);
|
|
7
|
+
}
|
|
8
|
+
if (Array.isArray(value)) {
|
|
9
|
+
return `[${value.map(stableStringify).join(",")}]`;
|
|
10
|
+
}
|
|
11
|
+
const record = value;
|
|
12
|
+
const keys = Object.keys(record).sort();
|
|
13
|
+
const entries = keys.map(
|
|
14
|
+
(key) => `${JSON.stringify(key)}:${stableStringify(record[key])}`
|
|
15
|
+
);
|
|
16
|
+
return `{${entries.join(",")}}`;
|
|
17
|
+
}
|
|
18
|
+
function buildCacheKey(handlerName, keyParams, baseUrl, authToken) {
|
|
19
|
+
const tokenKey = scryptSync(authToken ?? "", CACHE_KEY_SECRET, 32, {
|
|
20
|
+
N: 1024
|
|
21
|
+
});
|
|
22
|
+
const raw = `${handlerName}|${stableStringify(keyParams)}|${baseUrl}`;
|
|
23
|
+
return createHmac("sha256", tokenKey).update(raw).digest("hex");
|
|
24
|
+
}
|
|
25
|
+
function buildMeta(totalItems, pageNumber, pageSize) {
|
|
26
|
+
return {
|
|
27
|
+
pageNumber,
|
|
28
|
+
pageSize,
|
|
29
|
+
totalItems,
|
|
30
|
+
totalPages: Math.max(1, Math.ceil(totalItems / pageSize))
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function slice(items, pageNumber, pageSize) {
|
|
34
|
+
const start = (pageNumber - 1) * pageSize;
|
|
35
|
+
return items.slice(start, start + pageSize);
|
|
36
|
+
}
|
|
37
|
+
function findArrayContainer(obj) {
|
|
38
|
+
if (!obj || typeof obj !== "object") return null;
|
|
39
|
+
const embedded = obj._embedded;
|
|
40
|
+
if (embedded && typeof embedded === "object" && !Array.isArray(embedded)) {
|
|
41
|
+
for (const [key, value] of Object.entries(embedded)) {
|
|
42
|
+
if (Array.isArray(value)) {
|
|
43
|
+
return { container: embedded, key };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
48
|
+
if (key === "_links" || key === "_actions" || key === "_embedded") continue;
|
|
49
|
+
if (Array.isArray(value)) {
|
|
50
|
+
return { container: obj, key };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
function paginateRawResponse(raw, pageNumber, pageSize) {
|
|
56
|
+
if (Array.isArray(raw)) {
|
|
57
|
+
return {
|
|
58
|
+
items: slice(raw, pageNumber, pageSize),
|
|
59
|
+
pagination: buildMeta(raw.length, pageNumber, pageSize)
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const found = findArrayContainer(raw);
|
|
63
|
+
if (!found) {
|
|
64
|
+
const totalItems = raw == null ? 0 : 1;
|
|
65
|
+
if (pageNumber <= 1) {
|
|
66
|
+
return { ...raw, pagination: buildMeta(totalItems, 1, pageSize) };
|
|
67
|
+
}
|
|
68
|
+
return { pagination: buildMeta(totalItems, pageNumber, pageSize) };
|
|
69
|
+
}
|
|
70
|
+
const { container, key } = found;
|
|
71
|
+
const fullArray = container[key];
|
|
72
|
+
const page = slice(fullArray, pageNumber, pageSize);
|
|
73
|
+
const meta = buildMeta(fullArray.length, pageNumber, pageSize);
|
|
74
|
+
if (container === raw) {
|
|
75
|
+
return { ...raw, [key]: page, pagination: meta };
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
...raw,
|
|
79
|
+
_embedded: { ...raw._embedded, [key]: page },
|
|
80
|
+
pagination: meta
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
async function withPagination(fn, handlerName, args, context) {
|
|
84
|
+
const { pageNumber = 1, pageSize = 5, ...rest } = args ?? {};
|
|
85
|
+
const cacheKey = buildCacheKey(
|
|
86
|
+
handlerName,
|
|
87
|
+
rest,
|
|
88
|
+
context.baseUrl,
|
|
89
|
+
context.authToken
|
|
90
|
+
);
|
|
91
|
+
let raw = context.cache.get(cacheKey);
|
|
92
|
+
if (raw === void 0) {
|
|
93
|
+
raw = await fn(rest);
|
|
94
|
+
context.cache.set(cacheKey, raw, PAGINATION_CACHE_TTL_SECONDS);
|
|
95
|
+
}
|
|
96
|
+
return paginateRawResponse(raw, pageNumber, pageSize);
|
|
97
|
+
}
|
|
98
|
+
export {
|
|
99
|
+
PAGINATION_CACHE_TTL_SECONDS,
|
|
100
|
+
buildCacheKey,
|
|
101
|
+
paginateRawResponse,
|
|
102
|
+
withPagination
|
|
103
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { GenerationInputSchema, RefineInputSchema } from "./ai.js";
|
|
3
|
-
import { CanIDeploySchema, MatrixSchema, GetPacticipantSchema, ListBranchesSchema, ListVersionsSchema, GetVersionSchema, GetLatestVersionSchema, GetEnvironmentSchema, RecordDeploymentSchema, GetCurrentlyDeployedSchema, RecordReleaseSchema, GetCurrentlySupportedSchema, PublishConsumerContractsSchema, PublishProviderContractSchema, GetPactsForVerificationSchema, GetBiDirectionalProviderVersionSchema, GetBiDirectionalConsumerProviderVersionSchema, GetPacticipantNetworkSchema, GetLabelSchema, LabelByNameSchema, UpdatePacticipantSchema, UpdateVersionSchema, GetBranchVersionsSchema, GetVersionDeployedSchema, CreateEnvironmentSchema, UpdateEnvironmentSchema, CreatePacticipantSchema, DeletePacticipantSchema, GetBranchSchema, DeleteBranchSchema, ManageLabelSchema, GetIntegrationsByTeamSchema, DeleteIntegrationSchema, WebhookIdSchema, CreateWebhookSchema, UpdateWebhookSchema, SecretIdSchema, CreateSecretSchema, UpdateSecretSchema, RegenerateTokenSchema, AuditSchema, ListAdminUsersSchema, AdminUserIdSchema, CreateAdminUserSchema, UpdateAdminUserSchema, InviteUsersSchema, SetUserRolesSchema, UserRoleSchema, ListAdminTeamsSchema, AdminTeamIdSchema, CreateTeamSchema, UpdateTeamSchema, TeamUserIdSchema, SetTeamUsersSchema, PatchTeamUsersSchema, AdminRoleIdSchema, CreateRoleSchema, UpdateRoleSchema, CreateSystemAccountSchema, GetSystemAccountTokensSchema } from "./base.js";
|
|
3
|
+
import { CanIDeploySchema, MatrixSchema, GetPacticipantSchema, ListBranchesSchema, ListVersionsSchema, GetVersionSchema, GetLatestVersionSchema, PaginationSchema, GetEnvironmentSchema, RecordDeploymentSchema, GetCurrentlyDeployedSchema, RecordReleaseSchema, GetCurrentlySupportedSchema, PublishConsumerContractsSchema, PublishProviderContractSchema, GetPactsForVerificationSchema, GetBiDirectionalProviderVersionSchema, GetBiDirectionalConsumerProviderVersionSchema, GetPacticipantNetworkSchema, GetLabelSchema, LabelByNameSchema, UpdatePacticipantSchema, UpdateVersionSchema, GetBranchVersionsSchema, GetVersionDeployedSchema, CreateEnvironmentSchema, UpdateEnvironmentSchema, CreatePacticipantSchema, DeletePacticipantSchema, GetBranchSchema, DeleteBranchSchema, ManageLabelSchema, GetIntegrationsByTeamSchema, DeleteIntegrationSchema, WebhookIdSchema, CreateWebhookSchema, UpdateWebhookSchema, SecretIdSchema, CreateSecretSchema, UpdateSecretSchema, RegenerateTokenSchema, AuditSchema, ListAdminUsersSchema, AdminUserIdSchema, CreateAdminUserSchema, UpdateAdminUserSchema, InviteUsersSchema, SetUserRolesSchema, UserRoleSchema, ListAdminTeamsSchema, AdminTeamIdSchema, CreateTeamSchema, UpdateTeamSchema, ListTeamUsersSchema, TeamUserIdSchema, SetTeamUsersSchema, PatchTeamUsersSchema, AdminRoleIdSchema, CreateRoleSchema, UpdateRoleSchema, CreateSystemAccountSchema, GetSystemAccountTokensSchema } from "./base.js";
|
|
4
4
|
const TOOLS = [
|
|
5
5
|
{
|
|
6
6
|
title: "Generate Pact Tests",
|
|
@@ -39,14 +39,17 @@ const TOOLS = [
|
|
|
39
39
|
summary: "Retrieve the states of a specific provider",
|
|
40
40
|
purpose: "A provider state in Pact defines the specific preconditions that must be met on the provider side before a consumer-provider interaction can be tested. It sets up the provider in the right context—such as ensuring a particular user or record exists—so that the provider can return the response the consumer expects. This makes contract tests reliable, repeatable, and isolated by injecting or configuring the necessary data and conditions directly into the provider before each test runs.",
|
|
41
41
|
inputSchema: z.object({
|
|
42
|
-
provider: z.string().describe("name of the provider to retrieve states for")
|
|
42
|
+
provider: z.string().describe("name of the provider to retrieve states for"),
|
|
43
|
+
pageNumber: z.number().default(1).optional().describe("Page number"),
|
|
44
|
+
pageSize: z.number().default(5).optional().describe("Results per page")
|
|
43
45
|
}),
|
|
44
46
|
handler: "getProviderStates",
|
|
45
47
|
readOnly: true,
|
|
46
48
|
destructive: false,
|
|
47
49
|
idempotent: true,
|
|
48
50
|
openWorld: false,
|
|
49
|
-
clients: ["pactflow", "pact_broker"]
|
|
51
|
+
clients: ["pactflow", "pact_broker"],
|
|
52
|
+
paginated: true
|
|
50
53
|
},
|
|
51
54
|
{
|
|
52
55
|
title: "Can I Deploy",
|
|
@@ -133,8 +136,8 @@ const TOOLS = [
|
|
|
133
136
|
summary: "Retrieve all pacticipants (applications/services) registered in the Pact Broker or PactFlow workspace.",
|
|
134
137
|
purpose: "Get an overview of all registered services and their metadata. Use this to discover what applications are participating in contract testing, check their main branches, and find repository URLs.",
|
|
135
138
|
inputSchema: z.object({
|
|
136
|
-
pageNumber: z.number().optional().describe("Page number
|
|
137
|
-
pageSize: z.number().optional().describe("Number of results per page")
|
|
139
|
+
pageNumber: z.number().default(1).optional().describe("Page number"),
|
|
140
|
+
pageSize: z.number().default(5).optional().describe("Number of results per page")
|
|
138
141
|
}),
|
|
139
142
|
handler: "listPacticipants",
|
|
140
143
|
readOnly: true,
|
|
@@ -213,13 +216,14 @@ const TOOLS = [
|
|
|
213
216
|
toolset: "Environments and Deployments",
|
|
214
217
|
summary: "Retrieve all environments configured in the Pact Broker or PactFlow workspace.",
|
|
215
218
|
purpose: "Get the list of deployment environments (e.g. development, staging, production) so you can use their UUIDs in record-deployment and can-i-deploy operations.",
|
|
216
|
-
inputSchema:
|
|
219
|
+
inputSchema: PaginationSchema,
|
|
217
220
|
handler: "listEnvironments",
|
|
218
221
|
readOnly: true,
|
|
219
222
|
destructive: false,
|
|
220
223
|
idempotent: true,
|
|
221
224
|
openWorld: false,
|
|
222
|
-
clients: ["pactflow", "pact_broker"]
|
|
225
|
+
clients: ["pactflow", "pact_broker"],
|
|
226
|
+
paginated: true
|
|
223
227
|
},
|
|
224
228
|
{
|
|
225
229
|
title: "Get Environment",
|
|
@@ -258,7 +262,8 @@ const TOOLS = [
|
|
|
258
262
|
destructive: false,
|
|
259
263
|
idempotent: true,
|
|
260
264
|
openWorld: false,
|
|
261
|
-
clients: ["pactflow", "pact_broker"]
|
|
265
|
+
clients: ["pactflow", "pact_broker"],
|
|
266
|
+
paginated: true
|
|
262
267
|
},
|
|
263
268
|
{
|
|
264
269
|
title: "Record Release",
|
|
@@ -284,7 +289,8 @@ const TOOLS = [
|
|
|
284
289
|
destructive: false,
|
|
285
290
|
idempotent: true,
|
|
286
291
|
openWorld: false,
|
|
287
|
-
clients: ["pactflow", "pact_broker"]
|
|
292
|
+
clients: ["pactflow", "pact_broker"],
|
|
293
|
+
paginated: true
|
|
288
294
|
},
|
|
289
295
|
{
|
|
290
296
|
title: "Publish Consumer Contracts",
|
|
@@ -336,7 +342,8 @@ const TOOLS = [
|
|
|
336
342
|
destructive: false,
|
|
337
343
|
idempotent: true,
|
|
338
344
|
openWorld: false,
|
|
339
|
-
clients: ["pactflow"]
|
|
345
|
+
clients: ["pactflow"],
|
|
346
|
+
paginated: true
|
|
340
347
|
},
|
|
341
348
|
{
|
|
342
349
|
title: "Get BDCT Provider Contract Verification Results",
|
|
@@ -349,7 +356,8 @@ const TOOLS = [
|
|
|
349
356
|
destructive: false,
|
|
350
357
|
idempotent: true,
|
|
351
358
|
openWorld: false,
|
|
352
|
-
clients: ["pactflow"]
|
|
359
|
+
clients: ["pactflow"],
|
|
360
|
+
paginated: true
|
|
353
361
|
},
|
|
354
362
|
{
|
|
355
363
|
title: "Get BDCT Consumer Contracts",
|
|
@@ -362,7 +370,8 @@ const TOOLS = [
|
|
|
362
370
|
destructive: false,
|
|
363
371
|
idempotent: true,
|
|
364
372
|
openWorld: false,
|
|
365
|
-
clients: ["pactflow"]
|
|
373
|
+
clients: ["pactflow"],
|
|
374
|
+
paginated: true
|
|
366
375
|
},
|
|
367
376
|
{
|
|
368
377
|
title: "Get BDCT Consumer Contract Verification Results",
|
|
@@ -375,7 +384,8 @@ const TOOLS = [
|
|
|
375
384
|
destructive: false,
|
|
376
385
|
idempotent: true,
|
|
377
386
|
openWorld: false,
|
|
378
|
-
clients: ["pactflow"]
|
|
387
|
+
clients: ["pactflow"],
|
|
388
|
+
paginated: true
|
|
379
389
|
},
|
|
380
390
|
{
|
|
381
391
|
title: "Get BDCT Cross-Contract Verification Results",
|
|
@@ -388,7 +398,8 @@ const TOOLS = [
|
|
|
388
398
|
destructive: false,
|
|
389
399
|
idempotent: true,
|
|
390
400
|
openWorld: false,
|
|
391
|
-
clients: ["pactflow"]
|
|
401
|
+
clients: ["pactflow"],
|
|
402
|
+
paginated: true
|
|
392
403
|
},
|
|
393
404
|
{
|
|
394
405
|
title: "Get BDCT Consumer by Consumer Version",
|
|
@@ -401,7 +412,8 @@ const TOOLS = [
|
|
|
401
412
|
destructive: false,
|
|
402
413
|
idempotent: true,
|
|
403
414
|
openWorld: false,
|
|
404
|
-
clients: ["pactflow"]
|
|
415
|
+
clients: ["pactflow"],
|
|
416
|
+
paginated: true
|
|
405
417
|
},
|
|
406
418
|
{
|
|
407
419
|
title: "Get BDCT Provider by Consumer Version",
|
|
@@ -414,7 +426,8 @@ const TOOLS = [
|
|
|
414
426
|
destructive: false,
|
|
415
427
|
idempotent: true,
|
|
416
428
|
openWorld: false,
|
|
417
|
-
clients: ["pactflow"]
|
|
429
|
+
clients: ["pactflow"],
|
|
430
|
+
paginated: true
|
|
418
431
|
},
|
|
419
432
|
{
|
|
420
433
|
title: "Get BDCT Provider Check Results by Consumer",
|
|
@@ -427,7 +440,8 @@ const TOOLS = [
|
|
|
427
440
|
destructive: false,
|
|
428
441
|
idempotent: true,
|
|
429
442
|
openWorld: false,
|
|
430
|
-
clients: ["pactflow"]
|
|
443
|
+
clients: ["pactflow"],
|
|
444
|
+
paginated: true
|
|
431
445
|
},
|
|
432
446
|
{
|
|
433
447
|
title: "Get BDCT Consumer Pact Test Results by Consumer",
|
|
@@ -440,7 +454,8 @@ const TOOLS = [
|
|
|
440
454
|
destructive: false,
|
|
441
455
|
idempotent: true,
|
|
442
456
|
openWorld: false,
|
|
443
|
-
clients: ["pactflow"]
|
|
457
|
+
clients: ["pactflow"],
|
|
458
|
+
paginated: true
|
|
444
459
|
},
|
|
445
460
|
{
|
|
446
461
|
title: "Get BDCT X-Contract Test Results by Consumer",
|
|
@@ -453,20 +468,22 @@ const TOOLS = [
|
|
|
453
468
|
destructive: false,
|
|
454
469
|
idempotent: true,
|
|
455
470
|
openWorld: false,
|
|
456
|
-
clients: ["pactflow"]
|
|
471
|
+
clients: ["pactflow"],
|
|
472
|
+
paginated: true
|
|
457
473
|
},
|
|
458
474
|
{
|
|
459
475
|
title: "List Integrations",
|
|
460
476
|
toolset: "Integrations and Network",
|
|
461
477
|
summary: "Retrieve all consumer-provider integrations registered in the workspace.",
|
|
462
478
|
purpose: "Get a high-level view of all the consumer-provider pairings that have pacts published. An integration is automatically created when a consumer publishes a pact for a provider.",
|
|
463
|
-
inputSchema:
|
|
479
|
+
inputSchema: PaginationSchema,
|
|
464
480
|
handler: "listIntegrations",
|
|
465
481
|
readOnly: true,
|
|
466
482
|
destructive: false,
|
|
467
483
|
idempotent: true,
|
|
468
484
|
openWorld: false,
|
|
469
|
-
clients: ["pactflow", "pact_broker"]
|
|
485
|
+
clients: ["pactflow", "pact_broker"],
|
|
486
|
+
paginated: true
|
|
470
487
|
},
|
|
471
488
|
{
|
|
472
489
|
title: "Get Pacticipant Network",
|
|
@@ -479,7 +496,8 @@ const TOOLS = [
|
|
|
479
496
|
destructive: false,
|
|
480
497
|
idempotent: true,
|
|
481
498
|
openWorld: false,
|
|
482
|
-
clients: ["pactflow", "pact_broker"]
|
|
499
|
+
clients: ["pactflow", "pact_broker"],
|
|
500
|
+
paginated: true
|
|
483
501
|
},
|
|
484
502
|
{
|
|
485
503
|
title: "List Labels",
|
|
@@ -487,8 +505,8 @@ const TOOLS = [
|
|
|
487
505
|
summary: "Retrieve all labels used across the workspace.",
|
|
488
506
|
purpose: "Get a list of every label that has been applied to any pacticipant. Labels are used to categorise services and enable label-based queries.",
|
|
489
507
|
inputSchema: z.object({
|
|
490
|
-
pageNumber: z.number().optional().describe("Page number"),
|
|
491
|
-
pageSize: z.number().optional().describe("Results per page")
|
|
508
|
+
pageNumber: z.number().default(1).optional().describe("Page number"),
|
|
509
|
+
pageSize: z.number().default(5).optional().describe("Results per page")
|
|
492
510
|
}),
|
|
493
511
|
handler: "listLabels",
|
|
494
512
|
readOnly: true,
|
|
@@ -521,7 +539,8 @@ const TOOLS = [
|
|
|
521
539
|
destructive: false,
|
|
522
540
|
idempotent: true,
|
|
523
541
|
openWorld: false,
|
|
524
|
-
clients: ["pactflow", "pact_broker"]
|
|
542
|
+
clients: ["pactflow", "pact_broker"],
|
|
543
|
+
paginated: true
|
|
525
544
|
},
|
|
526
545
|
{
|
|
527
546
|
title: "Update Pacticipant",
|
|
@@ -586,7 +605,8 @@ const TOOLS = [
|
|
|
586
605
|
destructive: false,
|
|
587
606
|
idempotent: true,
|
|
588
607
|
openWorld: false,
|
|
589
|
-
clients: ["pactflow", "pact_broker"]
|
|
608
|
+
clients: ["pactflow", "pact_broker"],
|
|
609
|
+
paginated: true
|
|
590
610
|
},
|
|
591
611
|
{
|
|
592
612
|
title: "Get Released Versions for Version",
|
|
@@ -599,7 +619,8 @@ const TOOLS = [
|
|
|
599
619
|
destructive: false,
|
|
600
620
|
idempotent: true,
|
|
601
621
|
openWorld: false,
|
|
602
|
-
clients: ["pactflow", "pact_broker"]
|
|
622
|
+
clients: ["pactflow", "pact_broker"],
|
|
623
|
+
paginated: true
|
|
603
624
|
},
|
|
604
625
|
{
|
|
605
626
|
title: "Create Environment",
|
|
@@ -729,7 +750,8 @@ const TOOLS = [
|
|
|
729
750
|
destructive: false,
|
|
730
751
|
idempotent: true,
|
|
731
752
|
openWorld: false,
|
|
732
|
-
clients: ["pactflow"]
|
|
753
|
+
clients: ["pactflow"],
|
|
754
|
+
paginated: true
|
|
733
755
|
},
|
|
734
756
|
{
|
|
735
757
|
title: "Delete Integration",
|
|
@@ -762,13 +784,14 @@ const TOOLS = [
|
|
|
762
784
|
toolset: "Webhooks",
|
|
763
785
|
summary: "Retrieve all webhooks configured in the workspace.",
|
|
764
786
|
purpose: "Get an overview of all webhook triggers, their target URLs, and enabled/disabled status.",
|
|
765
|
-
inputSchema:
|
|
787
|
+
inputSchema: PaginationSchema,
|
|
766
788
|
handler: "listWebhooks",
|
|
767
789
|
readOnly: true,
|
|
768
790
|
destructive: false,
|
|
769
791
|
idempotent: true,
|
|
770
792
|
openWorld: false,
|
|
771
|
-
clients: ["pactflow", "pact_broker"]
|
|
793
|
+
clients: ["pactflow", "pact_broker"],
|
|
794
|
+
paginated: true
|
|
772
795
|
},
|
|
773
796
|
{
|
|
774
797
|
title: "Get Webhook",
|
|
@@ -853,13 +876,14 @@ const TOOLS = [
|
|
|
853
876
|
toolset: "Secrets",
|
|
854
877
|
summary: "Retrieve all secrets stored in the workspace.",
|
|
855
878
|
purpose: "Get an overview of all configured secrets. Note: secret values are never returned — only metadata.",
|
|
856
|
-
inputSchema:
|
|
879
|
+
inputSchema: PaginationSchema,
|
|
857
880
|
handler: "listSecrets",
|
|
858
881
|
readOnly: true,
|
|
859
882
|
destructive: false,
|
|
860
883
|
idempotent: true,
|
|
861
884
|
openWorld: false,
|
|
862
|
-
clients: ["pactflow"]
|
|
885
|
+
clients: ["pactflow"],
|
|
886
|
+
paginated: true
|
|
863
887
|
},
|
|
864
888
|
{
|
|
865
889
|
title: "Get Secret",
|
|
@@ -931,13 +955,14 @@ const TOOLS = [
|
|
|
931
955
|
toolset: "User, Tokens and Preferences",
|
|
932
956
|
summary: "Retrieve API tokens for the current user.",
|
|
933
957
|
purpose: "List the read-only and read-write API tokens for the authenticated user.",
|
|
934
|
-
inputSchema:
|
|
958
|
+
inputSchema: PaginationSchema,
|
|
935
959
|
handler: "listTokens",
|
|
936
960
|
readOnly: true,
|
|
937
961
|
destructive: false,
|
|
938
962
|
idempotent: true,
|
|
939
963
|
openWorld: false,
|
|
940
|
-
clients: ["pactflow"]
|
|
964
|
+
clients: ["pactflow"],
|
|
965
|
+
paginated: true
|
|
941
966
|
},
|
|
942
967
|
{
|
|
943
968
|
title: "Regenerate API Token",
|
|
@@ -1184,13 +1209,14 @@ const TOOLS = [
|
|
|
1184
1209
|
toolset: "Admin",
|
|
1185
1210
|
summary: "List all users in a specific team (admin).",
|
|
1186
1211
|
purpose: "Retrieve all user members of a team.",
|
|
1187
|
-
inputSchema:
|
|
1212
|
+
inputSchema: ListTeamUsersSchema,
|
|
1188
1213
|
handler: "listTeamUsers",
|
|
1189
1214
|
readOnly: true,
|
|
1190
1215
|
destructive: false,
|
|
1191
1216
|
idempotent: true,
|
|
1192
1217
|
openWorld: false,
|
|
1193
|
-
clients: ["pactflow"]
|
|
1218
|
+
clients: ["pactflow"],
|
|
1219
|
+
paginated: true
|
|
1194
1220
|
},
|
|
1195
1221
|
{
|
|
1196
1222
|
title: "Admin Get Team User",
|
|
@@ -1249,13 +1275,14 @@ const TOOLS = [
|
|
|
1249
1275
|
toolset: "Admin",
|
|
1250
1276
|
summary: "List all roles defined in the workspace (admin).",
|
|
1251
1277
|
purpose: "Get an overview of all role definitions and their associated permissions.",
|
|
1252
|
-
inputSchema:
|
|
1278
|
+
inputSchema: PaginationSchema,
|
|
1253
1279
|
handler: "listAdminRoles",
|
|
1254
1280
|
readOnly: true,
|
|
1255
1281
|
destructive: false,
|
|
1256
1282
|
idempotent: true,
|
|
1257
1283
|
openWorld: false,
|
|
1258
|
-
clients: ["pactflow"]
|
|
1284
|
+
clients: ["pactflow"],
|
|
1285
|
+
paginated: true
|
|
1259
1286
|
},
|
|
1260
1287
|
{
|
|
1261
1288
|
title: "Admin Get Role",
|
|
@@ -1327,13 +1354,14 @@ const TOOLS = [
|
|
|
1327
1354
|
toolset: "Admin",
|
|
1328
1355
|
summary: "List all available permission scopes (admin).",
|
|
1329
1356
|
purpose: "Retrieve all permission scopes that can be assigned to roles.",
|
|
1330
|
-
inputSchema:
|
|
1357
|
+
inputSchema: PaginationSchema,
|
|
1331
1358
|
handler: "listAdminPermissions",
|
|
1332
1359
|
readOnly: true,
|
|
1333
1360
|
destructive: false,
|
|
1334
1361
|
idempotent: true,
|
|
1335
1362
|
openWorld: false,
|
|
1336
|
-
clients: ["pactflow"]
|
|
1363
|
+
clients: ["pactflow"],
|
|
1364
|
+
paginated: true
|
|
1337
1365
|
},
|
|
1338
1366
|
{
|
|
1339
1367
|
title: "Admin Create System Account",
|
|
@@ -1359,7 +1387,8 @@ const TOOLS = [
|
|
|
1359
1387
|
destructive: false,
|
|
1360
1388
|
idempotent: true,
|
|
1361
1389
|
openWorld: false,
|
|
1362
|
-
clients: ["pactflow"]
|
|
1390
|
+
clients: ["pactflow"],
|
|
1391
|
+
paginated: true
|
|
1363
1392
|
}
|
|
1364
1393
|
];
|
|
1365
1394
|
export {
|