@smartbear/mcp 0.42.0 → 0.43.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.
Files changed (47) hide show
  1. package/dist/bearq/api.js +16 -0
  2. package/dist/bearq/client.js +9 -1
  3. package/dist/bearq/tool/tasks/stop-task.js +6 -3
  4. package/dist/bearq/tool/workflows/get-workflow-run.js +31 -0
  5. package/dist/bearq/tool/workflows/list-workflows.js +28 -0
  6. package/dist/bearq/tool/workflows/run-workflow.js +57 -0
  7. package/dist/bearq/tool/workflows/stop-workflow-run.js +33 -0
  8. package/dist/common/transport-http.js +8 -1
  9. package/dist/package.json.js +1 -1
  10. package/dist/pactflow/client/admin-api.js +3 -8
  11. package/dist/pactflow/client/ai.js +34 -0
  12. package/dist/pactflow/client/contract-api.js +2 -0
  13. package/dist/pactflow/client/http-client.js +7 -2
  14. package/dist/pactflow/client/pacticipant-api.js +37 -0
  15. package/dist/pactflow/client/schemas/admin.js +799 -0
  16. package/dist/pactflow/client/schemas/common.js +201 -0
  17. package/dist/pactflow/client/schemas/contract.js +444 -0
  18. package/dist/pactflow/client/schemas/environment.js +94 -0
  19. package/dist/pactflow/client/schemas/output.js +55 -0
  20. package/dist/pactflow/client/schemas/pacticipant.js +290 -0
  21. package/dist/pactflow/client/schemas/webhook.js +164 -0
  22. package/dist/pactflow/client/tools.js +32 -1
  23. package/dist/pactflow/client.js +21 -3
  24. package/dist/qmetry/client/ai-agent.js +3 -0
  25. package/dist/qmetry/client/api/error-handler.js +7 -2
  26. package/dist/qmetry/client/auto-resolve.js +5 -0
  27. package/dist/qmetry/client/handlers.js +2 -1
  28. package/dist/qmetry/client/project.js +19 -1
  29. package/dist/qmetry/client/testsuite.js +207 -2
  30. package/dist/qmetry/client/tools/ai-agent-tools.js +13 -0
  31. package/dist/qmetry/client/tools/issue-tools.js +7 -3
  32. package/dist/qmetry/client/tools/project-tools.js +34 -1
  33. package/dist/qmetry/client/tools/testcase-tools.js +43 -296
  34. package/dist/qmetry/client/tools/testsuite-tools.js +49 -19
  35. package/dist/qmetry/client/udf.js +14 -2
  36. package/dist/qmetry/client.js +2 -1
  37. package/dist/qmetry/config/constants.js +1 -0
  38. package/dist/qmetry/config/rest-endpoints.js +2 -1
  39. package/dist/qmetry/types/ai-agent.js +3 -0
  40. package/dist/qmetry/types/common.js +40 -2
  41. package/dist/qmetry/types/udf.js +1 -20
  42. package/dist/swagger/client/portal-types.js +11 -5
  43. package/dist/swagger/client/registry-types.js +5 -4
  44. package/dist/swagger/client/tools.js +1 -1
  45. package/package.json +2 -2
  46. package/plugin/README.md +42 -0
  47. package/dist/pactflow/client/base.js +0 -488
@@ -0,0 +1,201 @@
1
+ import { z } from "zod";
2
+ function named(id, schema) {
3
+ try {
4
+ return schema.meta({ id });
5
+ } catch {
6
+ return schema;
7
+ }
8
+ }
9
+ const EmbeddedLinkOutputSchema = named(
10
+ "EmbeddedLink",
11
+ z.looseObject({
12
+ href: z.string().optional(),
13
+ name: z.string().optional(),
14
+ templated: z.boolean().optional(),
15
+ title: z.string().optional()
16
+ })
17
+ );
18
+ const EmbeddedBranchVersionOutputSchema = named(
19
+ "EmbeddedBranchVersion",
20
+ z.looseObject({
21
+ name: z.string().optional(),
22
+ latest: z.boolean().optional(),
23
+ _links: z.looseObject({
24
+ self: EmbeddedLinkOutputSchema.optional()
25
+ }).optional()
26
+ })
27
+ );
28
+ const EmbeddedEnvironmentOutputSchema = named(
29
+ "EmbeddedEnvironment",
30
+ z.looseObject({
31
+ displayName: z.string().optional(),
32
+ name: z.string().optional(),
33
+ production: z.boolean().optional(),
34
+ uuid: z.string().optional(),
35
+ createdAt: z.string().optional(),
36
+ updatedAt: z.string().optional(),
37
+ _links: z.looseObject({
38
+ self: EmbeddedLinkOutputSchema.optional()
39
+ }).optional()
40
+ })
41
+ );
42
+ const PageOutputSchema = named(
43
+ "Page",
44
+ z.looseObject({
45
+ number: z.number().optional(),
46
+ size: z.number().optional(),
47
+ totalElements: z.number().optional(),
48
+ totalPages: z.number().optional()
49
+ })
50
+ );
51
+ const EmbeddedTeamOutputSchema = named(
52
+ "EmbeddedTeam",
53
+ z.looseObject({
54
+ isDefault: z.boolean().optional(),
55
+ name: z.string().optional(),
56
+ uuid: z.string().optional(),
57
+ _links: z.looseObject({
58
+ self: EmbeddedLinkOutputSchema.optional()
59
+ }).optional()
60
+ })
61
+ );
62
+ const EmbeddedNamedOutputSchema = named(
63
+ "EmbeddedNamed",
64
+ z.looseObject({
65
+ name: z.string().optional(),
66
+ _links: z.looseObject({
67
+ self: EmbeddedLinkOutputSchema.optional()
68
+ }).optional()
69
+ })
70
+ );
71
+ const ContactOutputSchema = named(
72
+ "Contact",
73
+ z.looseObject({
74
+ name: z.string().optional(),
75
+ details: z.looseObject({}).optional()
76
+ })
77
+ );
78
+ const EnvironmentOutputSchema = named(
79
+ "Environment",
80
+ z.looseObject({
81
+ createdAt: z.string().optional(),
82
+ displayName: z.string().optional(),
83
+ isDefault: z.boolean().optional(),
84
+ name: z.string().optional(),
85
+ production: z.boolean().optional(),
86
+ updatedAt: z.string().optional(),
87
+ uuid: z.string().optional(),
88
+ contacts: z.array(ContactOutputSchema).optional(),
89
+ teamUuids: z.array(z.string()).optional(),
90
+ _embedded: z.looseObject({
91
+ teams: z.array(EmbeddedTeamOutputSchema).optional()
92
+ }).optional(),
93
+ _links: z.looseObject({
94
+ self: EmbeddedLinkOutputSchema.optional(),
95
+ "pb:currently-deployed-deployed-versions": EmbeddedLinkOutputSchema.optional(),
96
+ "pb:currently-supported-released-versions": EmbeddedLinkOutputSchema.optional(),
97
+ "pb:environments": EmbeddedLinkOutputSchema.optional()
98
+ }).optional()
99
+ })
100
+ );
101
+ const EmbeddedVersionOutputSchema = named(
102
+ "EmbeddedVersion",
103
+ z.looseObject({
104
+ number: z.string().optional(),
105
+ _links: z.looseObject({
106
+ self: EmbeddedLinkOutputSchema.optional()
107
+ }).optional()
108
+ })
109
+ );
110
+ const EmbeddedDeployedVersionOutputSchema = named(
111
+ "EmbeddedDeployedVersion",
112
+ z.looseObject({
113
+ uuid: z.string().optional(),
114
+ target: z.string().optional(),
115
+ createdAt: z.string().optional(),
116
+ currentlyDeployed: z.boolean().optional(),
117
+ applicationInstance: z.string().optional(),
118
+ _links: z.looseObject({
119
+ self: EmbeddedLinkOutputSchema.optional()
120
+ }).optional(),
121
+ _embedded: z.looseObject({
122
+ environment: EnvironmentOutputSchema.optional(),
123
+ pacticipant: EmbeddedNamedOutputSchema.optional(),
124
+ version: EmbeddedVersionOutputSchema.optional()
125
+ }).optional()
126
+ })
127
+ );
128
+ const EmbeddedReleasedVersionOutputSchema = named(
129
+ "EmbeddedReleasedVersion",
130
+ z.looseObject({
131
+ uuid: z.string().optional(),
132
+ createdAt: z.string().optional(),
133
+ currentlySupported: z.boolean().optional(),
134
+ _links: z.looseObject({
135
+ self: EmbeddedLinkOutputSchema.optional()
136
+ }).optional(),
137
+ _embedded: z.looseObject({
138
+ environment: EnvironmentOutputSchema.optional(),
139
+ pacticipant: EmbeddedNamedOutputSchema.optional(),
140
+ version: EmbeddedVersionOutputSchema.optional()
141
+ }).optional()
142
+ })
143
+ );
144
+ const ActionOutputSchema = named(
145
+ "Action",
146
+ z.looseObject({
147
+ name: z.string().optional(),
148
+ title: z.string().optional(),
149
+ method: z.string().optional(),
150
+ href: z.string().optional()
151
+ })
152
+ );
153
+ const EmptyOutputSchema = z.object({
154
+ success: z.literal(true).describe("The operation completed; the API returns no body.")
155
+ });
156
+ const PaginationSchema = z.object({
157
+ pageNumber: z.number().default(1).optional().describe("Page number"),
158
+ pageSize: z.number().default(5).optional().describe("Results per page")
159
+ });
160
+ const PaginationOutputSchema = z.object({
161
+ pageNumber: z.number(),
162
+ pageSize: z.number(),
163
+ totalItems: z.number(),
164
+ totalPages: z.number()
165
+ });
166
+ const PacticipantVersionWithoutLinksOutputSchema = named(
167
+ "PacticipantVersionWithoutLinks",
168
+ z.looseObject({
169
+ createdAt: z.string().optional(),
170
+ number: z.string().optional(),
171
+ buildUrl: z.string().describe(
172
+ "Setting the buildUrl in the version resource is deprecated as it is now set when publishing consumer and provider contracts using the /contracts/publish and /provider-contracts/provider/{provider_name}/publish endpoints."
173
+ ).optional(),
174
+ updatedAt: z.string().optional(),
175
+ _embedded: z.looseObject({
176
+ branchVersions: z.array(EmbeddedBranchVersionOutputSchema).optional(),
177
+ tags: z.array(EmbeddedNamedOutputSchema).optional(),
178
+ deployedVersions: z.array(EmbeddedDeployedVersionOutputSchema).optional(),
179
+ releasedVersions: z.array(EmbeddedReleasedVersionOutputSchema).optional()
180
+ }).optional()
181
+ })
182
+ );
183
+ export {
184
+ ActionOutputSchema,
185
+ ContactOutputSchema,
186
+ EmbeddedBranchVersionOutputSchema,
187
+ EmbeddedDeployedVersionOutputSchema,
188
+ EmbeddedEnvironmentOutputSchema,
189
+ EmbeddedLinkOutputSchema,
190
+ EmbeddedNamedOutputSchema,
191
+ EmbeddedReleasedVersionOutputSchema,
192
+ EmbeddedTeamOutputSchema,
193
+ EmbeddedVersionOutputSchema,
194
+ EmptyOutputSchema,
195
+ EnvironmentOutputSchema,
196
+ PacticipantVersionWithoutLinksOutputSchema,
197
+ PageOutputSchema,
198
+ PaginationOutputSchema,
199
+ PaginationSchema,
200
+ named
201
+ };
@@ -0,0 +1,444 @@
1
+ import { z } from "zod";
2
+ import { PaginationSchema, EmptyOutputSchema, EmbeddedLinkOutputSchema, PageOutputSchema, EmbeddedVersionOutputSchema, EmbeddedNamedOutputSchema, named, PacticipantVersionWithoutLinksOutputSchema, ActionOutputSchema, EmbeddedEnvironmentOutputSchema, EmbeddedBranchVersionOutputSchema } from "./common.js";
3
+ const MatrixPacticipantVersionOutputSchema = named(
4
+ "MatrixPacticipantVersion",
5
+ z.looseObject({
6
+ branch: z.unknown().describe("Use branchVersions").optional(),
7
+ branches: z.array(EmbeddedBranchVersionOutputSchema).describe("Use branchVersions").optional(),
8
+ branchVersions: z.array(EmbeddedBranchVersionOutputSchema).optional(),
9
+ environments: z.array(EmbeddedEnvironmentOutputSchema).optional(),
10
+ _links: z.looseObject({
11
+ self: EmbeddedLinkOutputSchema.optional()
12
+ }).optional(),
13
+ number: z.string().optional(),
14
+ tags: z.array(
15
+ z.looseObject({
16
+ latest: z.boolean().optional(),
17
+ name: z.string().optional(),
18
+ _links: z.looseObject({
19
+ self: EmbeddedLinkOutputSchema.optional()
20
+ }).optional()
21
+ })
22
+ ).optional()
23
+ })
24
+ );
25
+ const MatrixPacticipantOutputSchema = named(
26
+ "MatrixPacticipant",
27
+ z.looseObject({
28
+ name: z.unknown().optional(),
29
+ version: MatrixPacticipantVersionOutputSchema.nullable().optional(),
30
+ _links: z.looseObject({
31
+ self: EmbeddedLinkOutputSchema.optional()
32
+ }).optional()
33
+ })
34
+ );
35
+ const NoticeOutputSchema = named(
36
+ "Notice",
37
+ z.looseObject({
38
+ text: z.string().optional(),
39
+ type: z.union([
40
+ z.literal("info"),
41
+ z.literal("debug"),
42
+ z.literal("warning"),
43
+ z.literal("prompt"),
44
+ z.literal("success"),
45
+ z.literal("error")
46
+ ]).optional()
47
+ })
48
+ );
49
+ const MatrixOutputSchema = z.looseObject({
50
+ matrix: z.array(
51
+ z.looseObject({
52
+ consumer: MatrixPacticipantOutputSchema.optional(),
53
+ pact: z.looseObject({
54
+ createdAt: z.string().optional(),
55
+ _links: z.looseObject({
56
+ self: EmbeddedLinkOutputSchema.optional(),
57
+ "pfi:ui": EmbeddedLinkOutputSchema.optional()
58
+ }).optional()
59
+ }).optional(),
60
+ provider: MatrixPacticipantOutputSchema.optional(),
61
+ verificationResult: z.looseObject({
62
+ success: z.boolean().optional(),
63
+ verifiedAt: z.string().optional(),
64
+ _links: z.looseObject({
65
+ self: EmbeddedLinkOutputSchema.optional(),
66
+ "pfi:ui": EmbeddedLinkOutputSchema.optional()
67
+ }).optional()
68
+ }).nullable().optional()
69
+ })
70
+ ).optional(),
71
+ notices: z.array(NoticeOutputSchema).optional(),
72
+ summary: z.looseObject({
73
+ deployable: z.boolean().nullable().describe(
74
+ "The property that indicates whether or not the pacticipant version is safe to deploy."
75
+ ).optional(),
76
+ failed: z.number().optional(),
77
+ reason: z.string().optional(),
78
+ success: z.number().optional(),
79
+ unknown: z.number().optional()
80
+ }).optional()
81
+ });
82
+ const PublishedConsumerContractOutputSchema = z.looseObject({
83
+ notices: z.array(NoticeOutputSchema).optional(),
84
+ _embedded: z.looseObject({
85
+ pacticipant: EmbeddedNamedOutputSchema.optional(),
86
+ version: EmbeddedVersionOutputSchema.optional()
87
+ }).optional(),
88
+ _links: z.looseObject({
89
+ "pb:pacticipant": EmbeddedLinkOutputSchema.optional(),
90
+ "pb:pacticipant-version": EmbeddedLinkOutputSchema.optional(),
91
+ "pb:pacticipant-version-tags": z.array(EmbeddedLinkOutputSchema).optional(),
92
+ "pb:contracts": z.array(EmbeddedLinkOutputSchema).optional()
93
+ }).optional()
94
+ });
95
+ const PublishedProviderContractOutputSchema = z.looseObject({
96
+ notices: z.array(NoticeOutputSchema).optional(),
97
+ _embedded: z.looseObject({
98
+ pacticipant: EmbeddedNamedOutputSchema.optional(),
99
+ version: EmbeddedVersionOutputSchema.optional()
100
+ }).optional(),
101
+ _links: z.looseObject({
102
+ "pf:provider-contract": EmbeddedLinkOutputSchema.optional(),
103
+ "pb:pacticipant": EmbeddedLinkOutputSchema.optional(),
104
+ "pb:pacticipant-version": EmbeddedLinkOutputSchema.optional(),
105
+ "pb:pacticipant-version-tags": z.array(EmbeddedLinkOutputSchema).optional(),
106
+ "pb:branch-version": EmbeddedLinkOutputSchema.optional()
107
+ }).optional()
108
+ });
109
+ const VerifiablePactOutputSchema = named(
110
+ "VerifiablePact",
111
+ z.looseObject({
112
+ shortDescription: z.string().optional(),
113
+ verificationProperties: z.looseObject({
114
+ pending: z.boolean().optional(),
115
+ notices: z.array(
116
+ z.looseObject({
117
+ when: z.string().optional(),
118
+ text: z.string().optional()
119
+ })
120
+ ).optional(),
121
+ wip: z.boolean().optional()
122
+ }).optional(),
123
+ _links: z.looseObject({
124
+ self: EmbeddedLinkOutputSchema.optional()
125
+ }).optional()
126
+ })
127
+ );
128
+ const VerifiablePactsOutputSchema = z.looseObject({
129
+ _embedded: z.looseObject({
130
+ pacts: z.array(VerifiablePactOutputSchema).optional()
131
+ }).optional(),
132
+ _links: z.looseObject({
133
+ self: EmbeddedLinkOutputSchema.optional()
134
+ }).optional()
135
+ });
136
+ const ProviderContractVerificationResultsInProviderContractOutputSchema = named(
137
+ "ProviderContractVerificationResultsInProviderContract",
138
+ z.looseObject({
139
+ success: z.boolean().optional(),
140
+ content: z.string().optional(),
141
+ contentType: z.string().optional(),
142
+ verifier: z.string().optional()
143
+ })
144
+ );
145
+ const VerificationSuccessOutputSchema = named(
146
+ "VerificationSuccess",
147
+ z.looseObject({
148
+ success: z.boolean().optional()
149
+ })
150
+ );
151
+ const ProviderContractOutputSchema = named(
152
+ "ProviderContract",
153
+ z.looseObject({
154
+ content: z.string().optional(),
155
+ contentType: z.string().optional(),
156
+ contractType: z.string().optional(),
157
+ createdAt: z.string().optional()
158
+ })
159
+ );
160
+ const bdctResult = (embedded) => z.looseObject({
161
+ verificationStatus: z.string().optional(),
162
+ _actions: z.array(ActionOutputSchema).optional(),
163
+ _embedded: z.looseObject({
164
+ consumerVersion: PacticipantVersionWithoutLinksOutputSchema.optional(),
165
+ providerVersion: PacticipantVersionWithoutLinksOutputSchema.optional(),
166
+ ...embedded
167
+ }).optional(),
168
+ _links: z.looseObject({}).optional()
169
+ });
170
+ const CrossContractVerificationResultsInConsumerContractOutputSchema = named(
171
+ "CrossContractVerificationResultsInConsumerContract",
172
+ z.looseObject({
173
+ success: z.boolean().optional(),
174
+ results: z.looseObject({}).optional(),
175
+ verificationDate: z.string().optional(),
176
+ verifier: z.string().optional(),
177
+ verifierVersion: z.string().optional()
178
+ })
179
+ );
180
+ const ConsumerContractOutputSchema = named(
181
+ "ConsumerContract",
182
+ z.looseObject({
183
+ content: z.string().optional()
184
+ })
185
+ );
186
+ const providerEmbedded = {
187
+ crossContractVerificationResults: VerificationSuccessOutputSchema.optional(),
188
+ providerContractVerificationResults: ProviderContractVerificationResultsInProviderContractOutputSchema.optional(),
189
+ consumerContractVerificationResults: VerificationSuccessOutputSchema.optional()
190
+ };
191
+ const consumerEmbedded = {
192
+ crossContractVerificationResults: CrossContractVerificationResultsInConsumerContractOutputSchema.optional(),
193
+ providerContractVerificationResults: VerificationSuccessOutputSchema.optional(),
194
+ consumerContractVerificationResults: VerificationSuccessOutputSchema.optional()
195
+ };
196
+ const BiDirectionalProviderContractOutputSchema = bdctResult({
197
+ ...providerEmbedded,
198
+ providerContract: ProviderContractOutputSchema.optional()
199
+ });
200
+ const BiDirectionalProviderContractVerificationResultsOutputSchema = bdctResult(providerEmbedded);
201
+ const BiDirectionalConsumerContractOutputSchema = bdctResult({
202
+ ...consumerEmbedded,
203
+ consumerContract: ConsumerContractOutputSchema.optional()
204
+ });
205
+ const BiDirectionalConsumerContractVerificationResultsOutputSchema = bdctResult({
206
+ ...consumerEmbedded,
207
+ crossContractVerificationResults: VerificationSuccessOutputSchema.optional()
208
+ });
209
+ const BiDirectionalCrossContractVerificationResultsOutputSchema = bdctResult(consumerEmbedded);
210
+ const IntegrationOutputSchema = named(
211
+ "Integration",
212
+ z.looseObject({
213
+ consumer: z.looseObject({
214
+ name: z.string().optional()
215
+ }).optional(),
216
+ provider: z.looseObject({
217
+ name: z.string().optional()
218
+ }).optional(),
219
+ verificationModes: z.array(z.union([z.literal("comparison"), z.literal("replay")])).optional(),
220
+ _links: z.looseObject({
221
+ "pb:dashboard": EmbeddedLinkOutputSchema.optional(),
222
+ "pb:matrix": EmbeddedLinkOutputSchema.optional(),
223
+ "pb:group": EmbeddedLinkOutputSchema.optional(),
224
+ "pb:delete_integration": EmbeddedLinkOutputSchema.optional()
225
+ }).optional()
226
+ })
227
+ );
228
+ const IntegrationsOutputSchema = z.looseObject({
229
+ page: PageOutputSchema.optional(),
230
+ _embedded: z.looseObject({
231
+ integrations: z.array(IntegrationOutputSchema).optional()
232
+ }).optional(),
233
+ _links: z.looseObject({
234
+ self: EmbeddedLinkOutputSchema.optional()
235
+ }).optional()
236
+ });
237
+ const pacticipantIntegrationsOutputSchema = z.looseObject({
238
+ integrations: z.array(
239
+ z.looseObject({
240
+ consumer: z.looseObject({
241
+ name: z.string().optional()
242
+ }).optional(),
243
+ provider: z.looseObject({
244
+ name: z.string().optional()
245
+ }).optional()
246
+ })
247
+ ).optional(),
248
+ _links: z.looseObject({
249
+ self: EmbeddedLinkOutputSchema.optional()
250
+ }).optional()
251
+ });
252
+ const ProviderStatesOutputSchema = z.looseObject({
253
+ providerStates: z.array(
254
+ z.looseObject({
255
+ name: z.string(),
256
+ params: z.record(z.string(), z.unknown()).nullable().optional(),
257
+ consumers: z.array(z.string())
258
+ })
259
+ )
260
+ });
261
+ const CanIDeploySchema = z.object({
262
+ pacticipant: z.string().describe(
263
+ "The name of the pacticipant (application/service) being evaluated for deployment"
264
+ ),
265
+ version: z.string().describe(
266
+ "The version of the pacticipant that you want to check if it's safe to deploy"
267
+ ),
268
+ environment: z.string().describe(
269
+ "The target environment where the pacticipant version will be deployed (e.g., 'production', 'staging', 'test')"
270
+ )
271
+ });
272
+ const MatrixSchema = z.object({
273
+ latestby: z.string().optional().describe(
274
+ "This property removes the rows for the overridden pacts/verifications from the results. The options are cvp (show only the latest row for each consumer version and provider) and cvpv (show only the latest row each consumer version and provider version). For a can-i-deploy query with one selector, it should be set to cvp. For a can-i-deploy query with two selectors, it should be set to cvpv."
275
+ ),
276
+ limit: z.number().min(1).max(1e3).default(100).optional().describe(
277
+ "The limit on the number of results to return (1-1000, default: 100)"
278
+ ),
279
+ q: z.array(
280
+ z.object({
281
+ pacticipant: z.string().describe("Name of the pacticipant (application)"),
282
+ version: z.string().optional().describe("Version number"),
283
+ branch: z.string().optional().describe("Name of the pacticipant version branch"),
284
+ environment: z.string().optional().describe(
285
+ "The name of the environment that the pacticipant version is deployed to"
286
+ ),
287
+ latest: z.boolean().optional().describe(
288
+ "Used in conjunction with other properties to indicate whether the selector is describing the latest version from a branch/with a tag/for a pacticipant, or all of them. Note that when used with tags, the 'latest' is calculated using the creation date of the pacticipant version, NOT the creation date of the tag."
289
+ ),
290
+ tag: z.string().optional().describe(
291
+ "The name of the pacticipant version tag (superseded by branch and environments)"
292
+ ),
293
+ mainBranch: z.boolean().optional().describe(
294
+ "Whether or not the version(s) described are from the main branch of the pacticipant, as set in the mainBranch property of the pacticipant resource."
295
+ )
296
+ })
297
+ ).min(1).max(2)
298
+ });
299
+ const PublishConsumerContractsSchema = z.object({
300
+ pacticipantName: z.string().min(1).describe("Name of the consumer application"),
301
+ pacticipantVersionNumber: z.string().min(1).describe("Version number of the consumer"),
302
+ contracts: z.array(
303
+ z.object({
304
+ consumerName: z.string().describe("Consumer application name"),
305
+ providerName: z.string().describe("Provider application name"),
306
+ content: z.string().describe("Base64-encoded Pact JSON content"),
307
+ contentType: z.literal("application/json").describe("Content type (must be 'application/json')"),
308
+ specification: z.literal("pact").describe("Specification type (must be 'pact')")
309
+ })
310
+ ).describe("Contracts to publish"),
311
+ tags: z.array(z.string()).optional().describe("Version tags (e.g. 'main', 'staging')"),
312
+ branch: z.string().optional().describe("Branch name of the consumer"),
313
+ buildUrl: z.string().optional().describe("URL of the CI build that produced these contracts")
314
+ });
315
+ const PublishProviderContractSchema = z.object({
316
+ providerName: z.string().describe("Name of the provider application"),
317
+ pacticipantVersionNumber: z.string().min(1).describe("Version number of the provider"),
318
+ contract: z.object({
319
+ content: z.string().describe("Base64-encoded OpenAPI or AsyncAPI specification content"),
320
+ contentType: z.enum(["application/json", "application/yaml", "application/yml"]).describe("Content type of the spec"),
321
+ specification: z.enum(["oas", "asyncapi"]).describe(
322
+ "Specification type: 'oas' for OpenAPI or 'asyncapi' for AsyncAPI"
323
+ ),
324
+ selfVerificationResults: z.object({
325
+ success: z.boolean().describe("Whether self-verification passed"),
326
+ content: z.string().optional().describe("Verification results content (e.g. test output)"),
327
+ contentType: z.string().optional().describe("Content type of the verification results"),
328
+ verifier: z.string().describe(
329
+ "Name of the tool used for verification (e.g. 'dredd', 'schemathesis')"
330
+ ),
331
+ verifierVersion: z.string().optional().describe("Version of the verification tool"),
332
+ format: z.string().optional().describe("Format of the verification results")
333
+ }).describe(
334
+ "Results of self-verifying the provider against its own contract"
335
+ )
336
+ }).describe(
337
+ "Provider contract (OpenAPI or AsyncAPI spec) and verification details"
338
+ ),
339
+ tags: z.array(z.string()).optional().describe("Version tags"),
340
+ branch: z.string().optional().describe("Branch name of the provider"),
341
+ buildUrl: z.string().optional().describe("URL of the CI build")
342
+ });
343
+ const GetPactsForVerificationSchema = z.object({
344
+ providerName: z.string().describe("Name of the provider to get pacts for"),
345
+ consumerVersionSelectors: z.array(
346
+ z.object({
347
+ branch: z.string().optional().describe("Consumer branch name"),
348
+ consumer: z.string().optional().describe("Consumer name"),
349
+ deployed: z.boolean().optional().describe("Include versions that are currently deployed"),
350
+ deployedOrReleased: z.boolean().optional().describe("Include versions that are currently deployed or released"),
351
+ environment: z.string().optional().describe("Environment name"),
352
+ fallbackBranch: z.string().optional().describe("Fallback branch if primary branch doesn't exist"),
353
+ latest: z.boolean().optional().describe("Select only the latest version"),
354
+ mainBranch: z.boolean().optional().describe("Select versions from the consumer's main branch"),
355
+ matchingBranch: z.boolean().optional().describe(
356
+ "Select versions from the branch that matches the provider branch"
357
+ ),
358
+ released: z.boolean().optional().describe("Include versions that are currently released"),
359
+ tag: z.string().optional().describe("Tag name (legacy, prefer branch)")
360
+ })
361
+ ).optional().describe("Selectors specifying which consumer versions to include"),
362
+ includePendingStatus: z.boolean().optional().describe("Include the pending status in the results"),
363
+ includeWipPactsSince: z.string().optional().describe("Include WIP pacts published since this date (ISO 8601)"),
364
+ providerVersionBranch: z.string().optional().describe("Branch of the provider version being verified"),
365
+ providerVersionTags: z.array(z.string()).optional().describe("Tags for the provider version being verified")
366
+ });
367
+ const GetBiDirectionalProviderVersionSchema = z.object({
368
+ providerName: z.string().describe("Name of the provider"),
369
+ providerVersionNumber: z.string().describe("Provider version number")
370
+ }).extend(PaginationSchema.shape);
371
+ const GetBiDirectionalConsumerProviderVersionSchema = z.object({
372
+ providerName: z.string().describe("Name of the provider"),
373
+ providerVersionNumber: z.string().describe("Provider version number"),
374
+ consumerName: z.string().describe("Name of the consumer"),
375
+ consumerVersionNumber: z.string().describe("Consumer version number")
376
+ }).extend(PaginationSchema.shape);
377
+ const GetIntegrationsByTeamSchema = z.object({
378
+ teamId: z.string().describe("UUID of the team")
379
+ }).extend(PaginationSchema.shape);
380
+ const DeleteIntegrationSchema = z.object({
381
+ providerName: z.string().describe("Name of the provider"),
382
+ consumerName: z.string().describe("Name of the consumer")
383
+ });
384
+ const GetPacticipantNetworkSchema = z.object({
385
+ pacticipantName: z.string().describe("Name of the pacticipant to get network for")
386
+ }).extend(PaginationSchema.shape);
387
+ const CONTRACT_OUTPUT_SCHEMAS = {
388
+ canIDeploy: MatrixOutputSchema,
389
+ getMatrix: MatrixOutputSchema,
390
+ publishContracts: PublishedConsumerContractOutputSchema,
391
+ publishProviderContract: PublishedProviderContractOutputSchema,
392
+ getPactsForVerification: VerifiablePactsOutputSchema,
393
+ getBiDirectionalProviderContract: BiDirectionalProviderContractOutputSchema,
394
+ getBiDirectionalProviderContractVerificationResults: BiDirectionalProviderContractVerificationResultsOutputSchema,
395
+ getBiDirectionalConsumerContract: BiDirectionalConsumerContractOutputSchema,
396
+ getBiDirectionalConsumerContractVerificationResults: BiDirectionalConsumerContractVerificationResultsOutputSchema,
397
+ getBiDirectionalCrossContractVerificationResults: BiDirectionalCrossContractVerificationResultsOutputSchema,
398
+ getBiDirectionalConsumerContractByConsumer: BiDirectionalConsumerContractOutputSchema,
399
+ getBiDirectionalProviderContractByConsumer: BiDirectionalProviderContractOutputSchema,
400
+ getBiDirectionalProviderContractVerificationResultsByConsumer: BiDirectionalProviderContractVerificationResultsOutputSchema,
401
+ getBiDirectionalConsumerContractVerificationResultsByConsumer: BiDirectionalConsumerContractVerificationResultsOutputSchema,
402
+ getBiDirectionalCrossContractVerificationResultsByConsumer: BiDirectionalCrossContractVerificationResultsOutputSchema,
403
+ listIntegrations: IntegrationsOutputSchema,
404
+ getPacticipantNetwork: pacticipantIntegrationsOutputSchema,
405
+ getIntegrationsByTeam: IntegrationsOutputSchema,
406
+ getProviderStates: ProviderStatesOutputSchema,
407
+ deleteIntegration: EmptyOutputSchema,
408
+ deleteAllIntegrations: EmptyOutputSchema
409
+ };
410
+ export {
411
+ BiDirectionalConsumerContractOutputSchema,
412
+ BiDirectionalConsumerContractVerificationResultsOutputSchema,
413
+ BiDirectionalCrossContractVerificationResultsOutputSchema,
414
+ BiDirectionalProviderContractOutputSchema,
415
+ BiDirectionalProviderContractVerificationResultsOutputSchema,
416
+ CONTRACT_OUTPUT_SCHEMAS,
417
+ CanIDeploySchema,
418
+ ConsumerContractOutputSchema,
419
+ CrossContractVerificationResultsInConsumerContractOutputSchema,
420
+ DeleteIntegrationSchema,
421
+ GetBiDirectionalConsumerProviderVersionSchema,
422
+ GetBiDirectionalProviderVersionSchema,
423
+ GetIntegrationsByTeamSchema,
424
+ GetPacticipantNetworkSchema,
425
+ GetPactsForVerificationSchema,
426
+ IntegrationOutputSchema,
427
+ IntegrationsOutputSchema,
428
+ MatrixOutputSchema,
429
+ MatrixPacticipantOutputSchema,
430
+ MatrixPacticipantVersionOutputSchema,
431
+ MatrixSchema,
432
+ NoticeOutputSchema,
433
+ ProviderContractOutputSchema,
434
+ ProviderContractVerificationResultsInProviderContractOutputSchema,
435
+ ProviderStatesOutputSchema,
436
+ PublishConsumerContractsSchema,
437
+ PublishProviderContractSchema,
438
+ PublishedConsumerContractOutputSchema,
439
+ PublishedProviderContractOutputSchema,
440
+ VerifiablePactOutputSchema,
441
+ VerifiablePactsOutputSchema,
442
+ VerificationSuccessOutputSchema,
443
+ pacticipantIntegrationsOutputSchema
444
+ };