@smartbear/mcp 0.8.0 → 0.10.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 (66) hide show
  1. package/README.md +29 -4
  2. package/dist/api-hub/client/api.js +239 -10
  3. package/dist/api-hub/client/configuration.js +5 -0
  4. package/dist/api-hub/client/index.js +1 -0
  5. package/dist/api-hub/client/portal-types.js +126 -0
  6. package/dist/api-hub/client/registry-types.js +8 -0
  7. package/dist/api-hub/client/tools.js +78 -15
  8. package/dist/api-hub/client/user-management-types.js +24 -0
  9. package/dist/api-hub/client.js +34 -0
  10. package/dist/bugsnag/client/api/CurrentUser.js +12 -49
  11. package/dist/bugsnag/client/api/Error.js +29 -142
  12. package/dist/bugsnag/client/api/Project.js +52 -113
  13. package/dist/bugsnag/client/api/api.js +3743 -0
  14. package/dist/bugsnag/client/api/base.js +97 -34
  15. package/dist/bugsnag/client/api/configuration.js +26 -0
  16. package/dist/bugsnag/client/api/index.js +2 -0
  17. package/dist/bugsnag/client/filters.js +28 -0
  18. package/dist/bugsnag/client.js +104 -155
  19. package/dist/collaborator/client.js +364 -0
  20. package/dist/common/server.js +73 -23
  21. package/dist/common/types.js +6 -1
  22. package/dist/index.js +9 -1
  23. package/dist/pactflow/client/prompt-utils.js +2 -1
  24. package/dist/pactflow/client/tools.js +4 -4
  25. package/dist/pactflow/client/utils.js +5 -4
  26. package/dist/pactflow/client.js +10 -9
  27. package/dist/qmetry/client/api/client-api.js +21 -16
  28. package/dist/qmetry/client/api/error-handler.js +329 -0
  29. package/dist/qmetry/client/auto-resolve.js +96 -0
  30. package/dist/qmetry/client/handlers.js +33 -2
  31. package/dist/qmetry/client/issues.js +123 -0
  32. package/dist/qmetry/client/project.js +73 -0
  33. package/dist/qmetry/client/requirement.js +76 -0
  34. package/dist/qmetry/client/testcase.js +122 -6
  35. package/dist/qmetry/client/testsuite.js +272 -0
  36. package/dist/qmetry/client/tools/index.js +17 -0
  37. package/dist/qmetry/client/tools/issue-tools.js +545 -0
  38. package/dist/qmetry/client/tools/project-tools.js +348 -0
  39. package/dist/qmetry/client/tools/requirement-tools.js +530 -0
  40. package/dist/qmetry/client/tools/testcase-tools.js +526 -0
  41. package/dist/qmetry/client/tools/testsuite-tools.js +772 -0
  42. package/dist/qmetry/client/tools/types.js +1 -0
  43. package/dist/qmetry/client/utils.js +16 -0
  44. package/dist/qmetry/client.js +27 -17
  45. package/dist/qmetry/config/constants.js +28 -0
  46. package/dist/qmetry/config/rest-endpoints.js +30 -0
  47. package/dist/qmetry/types/common.js +599 -9
  48. package/dist/qmetry/types/issues.js +16 -0
  49. package/dist/qmetry/types/project.js +17 -0
  50. package/dist/qmetry/types/requirements.js +19 -0
  51. package/dist/qmetry/types/testcase.js +20 -0
  52. package/dist/qmetry/types/testsuite.js +44 -0
  53. package/dist/reflect/client.js +7 -6
  54. package/dist/zephyr/client.js +7 -1
  55. package/dist/zephyr/common/api-client.js +8 -0
  56. package/dist/zephyr/common/auth-service.js +1 -0
  57. package/dist/zephyr/common/rest-api-schemas.js +5173 -0
  58. package/dist/zephyr/tool/project/get-project.js +39 -0
  59. package/dist/zephyr/tool/project/get-projects.js +7 -13
  60. package/dist/zephyr/tool/test-cycle/get-test-cycles.js +72 -0
  61. package/package.json +1 -1
  62. package/dist/bugsnag/client/api/filters.js +0 -167
  63. package/dist/bugsnag/client/configuration.js +0 -10
  64. package/dist/bugsnag/client/index.js +0 -2
  65. package/dist/qmetry/client/tools.js +0 -222
  66. package/dist/zephyr/common/types.js +0 -35
@@ -8,6 +8,9 @@ export const DEFAULT_PAGINATION = {
8
8
  export const DEFAULT_FILTER = {
9
9
  filter: "[]",
10
10
  };
11
+ export const DEFAULT_SORT = {
12
+ sort: '[{"property":"name","direction":"ASC"}]',
13
+ };
11
14
  export const DEFAULT_FOLDER_OPTIONS = {
12
15
  scope: "project",
13
16
  showRootOnly: false,
@@ -52,7 +55,7 @@ export const CommonFields = {
52
55
  .default(10),
53
56
  tcID: z
54
57
  .number()
55
- .describe("Test Case numeric ID (required for fetching specific test case details). " +
58
+ .describe("Test Case numeric ID. " +
56
59
  "This is the internal numeric identifier, not the entity key like 'MAC-TC-1684'. " +
57
60
  "You can get this ID from test case search results or by using filters."),
58
61
  id: z
@@ -62,34 +65,136 @@ export const CommonFields = {
62
65
  "You can get this ID from test case search results."),
63
66
  version: z
64
67
  .number()
65
- .describe("Test Case version number (required for fetching specific test case version details). " +
68
+ .describe("Test Case version number. " +
69
+ "This is the internal numeric identifier for the version."),
70
+ tcVersionID: z
71
+ .number()
72
+ .describe("Test Case version number. " +
66
73
  "This is the internal numeric identifier for the version."),
67
74
  versionOptional: z
68
75
  .number()
69
76
  .optional()
70
77
  .describe("Test Case version number (optional, defaults to 1). " +
71
78
  "This is the internal numeric identifier for the version."),
72
- viewId: z
79
+ rqID: z
80
+ .number()
81
+ .describe("Requirement numeric ID (required for fetching specific requirement details). " +
82
+ "This is the internal numeric identifier, not the entity key like 'MAC-RQ-730'. " +
83
+ "You can get this ID from requirement search results or by using filters."),
84
+ rqVersion: z
85
+ .number()
86
+ .describe("Requirement version number (required for fetching specific requirement version details). " +
87
+ "This is the internal numeric identifier for the version."),
88
+ tcViewId: z
73
89
  .number()
74
90
  .describe("ViewId for test cases - SYSTEM AUTOMATICALLY RESOLVES THIS. " +
75
91
  "Leave empty unless you have a specific viewId. " +
76
92
  "System will fetch project info using the projectKey and extract latestViews.TC.viewId automatically. " +
77
93
  "Manual viewId only needed if you want to override the automatic resolution."),
78
- folderPath: z
94
+ rqViewId: z
95
+ .number()
96
+ .describe("ViewId for requirements - SYSTEM AUTOMATICALLY RESOLVES THIS. " +
97
+ "Leave empty unless you have a specific viewId. " +
98
+ "System will fetch project info using the projectKey and extract latestViews.RQ.viewId automatically. " +
99
+ "Manual viewId only needed if you want to override the automatic resolution."),
100
+ rqFolderPath: z
101
+ .string()
102
+ .optional()
103
+ .describe("Folder path for requirements - SYSTEM AUTOMATICALLY SETS TO ROOT. " +
104
+ 'Leave empty unless you want specific folder. System will automatically use empty string "" (root directory). ' +
105
+ 'Only specify if user wants specific folder like "Automation/Regression".')
106
+ .default(""),
107
+ tcFolderPath: z
79
108
  .string()
80
109
  .optional()
81
110
  .describe("Folder path for test cases - SYSTEM AUTOMATICALLY SETS TO ROOT. " +
82
- 'Leave empty unless you want specific folder. System will automatically use "" (root directory). ' +
111
+ 'Leave empty unless you want specific folder. System will automatically use empty string "" (root directory). ' +
112
+ 'Only specify if user wants specific folder like "Automation/Regression".')
113
+ .default(""),
114
+ tsFolderPath: z
115
+ .string()
116
+ .optional()
117
+ .describe("Folder path for test suites - SYSTEM AUTOMATICALLY SETS TO ROOT. " +
118
+ 'Leave empty unless you want specific folder. System will automatically use empty string "" (root directory). ' +
83
119
  'Only specify if user wants specific folder like "Automation/Regression".')
84
120
  .default(""),
85
121
  folderID: z
86
122
  .number()
87
123
  .optional()
88
- .describe("Folder ID for test cases - unique identifier for the folder containing test cases"),
124
+ .describe("Folder ID - unique numeric identifier for the specific folder. " +
125
+ "Use this to target a specific folder within the project hierarchy. " +
126
+ "Applies to any entity type (test cases, requirements, test suites, etc.)."),
127
+ tsFolderID: z
128
+ .number()
129
+ .describe("Test Suite folder ID (required for fetching test suites). " +
130
+ "This is the numeric identifier for the test suite folder. " +
131
+ "IMPORTANT: Get from project info response → rootFolders.TS.id (e.g., 113557 for MAC project). " +
132
+ "Use FETCH_PROJECT_INFO tool first to get this ID if not provided by user. " +
133
+ "For root folder: use rootFolders.TS.id, for sub-folders: use specific folder IDs."),
134
+ tsID: z
135
+ .number()
136
+ .describe("Test Suite numeric ID (required for fetching test cases linked to test suite). " +
137
+ "This is the internal numeric identifier, not the entity key. " +
138
+ "NOTE: To get the tsID - Call API 'Testsuite/Fetch Testsuite' " +
139
+ "From the response, get value of following attribute -> data[<index>].id"),
140
+ gridName: z
141
+ .string()
142
+ .optional()
143
+ .describe("Grid Name to be displayed (default 'TESTEXECUTIONLIST')"),
144
+ teViewId: z
145
+ .number()
146
+ .optional()
147
+ .describe("ViewId for test execution - SYSTEM AUTOMATICALLY RESOLVES THIS. " +
148
+ "Leave empty unless you have a specific viewId. " +
149
+ "System will fetch project info using the projectKey and extract latestViews.TE.viewId automatically. " +
150
+ "Manual viewId only needed if you want to override the automatic resolution."),
151
+ tsfeViewId: z
152
+ .number()
153
+ .describe("ViewId for test suite folders - SYSTEM AUTOMATICALLY RESOLVES THIS. " +
154
+ "Leave empty unless you have a specific viewId. " +
155
+ "System will fetch project info using the projectKey and extract latestViews.TSFS.viewId automatically. " +
156
+ "Manual viewId only needed if you want to override the automatic resolution."),
157
+ tsViewId: z
158
+ .number()
159
+ .describe("ViewId for test suites - SYSTEM AUTOMATICALLY RESOLVES THIS. " +
160
+ "Leave empty unless you have a specific viewId. " +
161
+ "System will fetch project info using the projectKey and extract latestViews.TS.viewId automatically. " +
162
+ "Manual viewId only needed if you want to override the automatic resolution."),
163
+ tsrunID: z
164
+ .string()
165
+ .describe("Test Suite Run ID (required for fetching test case runs). " +
166
+ "This is the string identifier for the test suite run execution. " +
167
+ "NOTE: To get the tsrunID - Call API 'Execution/Fetch Executions' " +
168
+ "From the response, get value of following attribute -> data[<index>].tsRunID"),
169
+ showTcWithDefects: z
170
+ .boolean()
171
+ .optional()
172
+ .describe("Show test case runs with linked defects")
173
+ .default(false),
174
+ entityId: z
175
+ .number()
176
+ .describe("Id of Test case run (required for fetching linked issues). " +
177
+ "This is the internal numeric identifier for the test case run execution. " +
178
+ "NOTE: To get the entityId - Call API 'Execution/Fetch Testcase Run ID' " +
179
+ "From the response, get value of following attribute -> data[<index>].tcRunID"),
180
+ getLinked: z
181
+ .boolean()
182
+ .optional()
183
+ .describe("True to get only those issues that are linked with this Test case Run, " +
184
+ "False to get those issues which are not linked with this Test case Run. " +
185
+ "Default value true (get linked issues).")
186
+ .default(true),
187
+ istcrFlag: z
188
+ .boolean()
189
+ .optional()
190
+ .describe("Set True for test case run operations")
191
+ .default(true),
89
192
  scope: z
90
193
  .string()
91
194
  .optional()
92
- .describe("Scope of the test cases (default 'project')")
195
+ .describe("Scope of the operation - defines the context for data retrieval. " +
196
+ "Common values: 'project' (default), 'folder', 'release', 'cycle'. " +
197
+ "Applies to any entity type being fetched or operated upon.")
93
198
  .default("project"),
94
199
  filter: z
95
200
  .string()
@@ -109,6 +214,11 @@ export const CommonFields = {
109
214
  .boolean()
110
215
  .optional()
111
216
  .describe("Whether to include sub-entities."),
217
+ getColumns: z
218
+ .boolean()
219
+ .optional()
220
+ .describe("Whether to get column information in response.")
221
+ .default(true),
112
222
  hideEmptyFolders: z
113
223
  .boolean()
114
224
  .optional()
@@ -125,15 +235,128 @@ export const CommonFields = {
125
235
  .string()
126
236
  .optional()
127
237
  .describe("Folder sort order (ASC or DESC)"),
238
+ showArchive: z
239
+ .boolean()
240
+ .optional()
241
+ .describe("Whether to include archived records in the results. " +
242
+ "When true, returns both active and archived items. " +
243
+ "When false, returns only active (non-archived) items. " +
244
+ "Applies to any entity type being fetched (test cases, requirements, releases, cycles, builds, platforms, etc.)."),
128
245
  };
246
+ export const ProjectListArgsSchema = z.object({
247
+ projectKey: CommonFields.projectKeyOptional,
248
+ baseUrl: CommonFields.baseUrl,
249
+ params: z.object({
250
+ showArchive: z
251
+ .boolean()
252
+ .optional()
253
+ .describe("Whether to include archived records in the results. " +
254
+ "When true, returns both active and archived items. " +
255
+ "When false, returns only active (non-archived) items. ")
256
+ .default(false),
257
+ }),
258
+ start: CommonFields.start,
259
+ page: CommonFields.page,
260
+ limit: CommonFields.limit,
261
+ filter: CommonFields.filter,
262
+ });
129
263
  export const ProjectArgsSchema = z.object({
130
264
  projectKey: CommonFields.projectKey,
131
265
  });
266
+ export const ReleasesCyclesArgsSchema = z.object({
267
+ projectKey: CommonFields.projectKeyOptional,
268
+ showArchive: CommonFields.showArchive,
269
+ });
270
+ export const BuildArgsSchema = z.object({
271
+ projectKey: CommonFields.projectKeyOptional,
272
+ baseUrl: CommonFields.baseUrl,
273
+ start: CommonFields.start,
274
+ page: CommonFields.page,
275
+ limit: CommonFields.limit,
276
+ filter: CommonFields.filter,
277
+ });
278
+ export const PlatformArgsSchema = z.object({
279
+ projectKey: CommonFields.projectKeyOptional,
280
+ baseUrl: CommonFields.baseUrl,
281
+ start: CommonFields.start,
282
+ page: CommonFields.page,
283
+ limit: CommonFields.limit,
284
+ sort: z
285
+ .string()
286
+ .optional()
287
+ .describe('Sort criteria as JSON string (default \'[{"property":"platformID","direction":"DESC"}]\')')
288
+ .default('[{"property":"platformID","direction":"DESC"}]'),
289
+ filter: CommonFields.filter,
290
+ });
291
+ export const CreateTestCaseStepSchema = z.object({
292
+ orderId: z.number(),
293
+ description: z.string(),
294
+ inputData: z.string().optional(),
295
+ expectedOutcome: z.string().optional(),
296
+ UDF: z.record(z.string()).optional(),
297
+ });
298
+ export const UpdateTestCaseRemoveStepSchema = z.object({
299
+ tcID: z.number(),
300
+ projectID: z.number(),
301
+ tcStepID: z.number(),
302
+ tcVersionID: z.number(),
303
+ tcVersion: z.number(),
304
+ tcsAttCount: z.number(),
305
+ orderId: z.number(),
306
+ description: z.string(),
307
+ inputData: z.string().optional(),
308
+ expectedOutcome: z.string().optional(),
309
+ UDF: z.record(z.string()).optional(),
310
+ tcsIsShared: z.boolean(),
311
+ tcsIsParameterized: z.boolean(),
312
+ });
313
+ export const CreateTestCaseArgsSchema = z.object({
314
+ tcFolderID: z.string(),
315
+ steps: z.array(CreateTestCaseStepSchema).optional(),
316
+ name: z.string(),
317
+ priority: z.number().optional(),
318
+ component: z.array(z.number()).optional(),
319
+ testcaseOwner: z.number().optional(),
320
+ testCaseState: z.number().optional(),
321
+ testCaseType: z.number().optional(),
322
+ estimatedTime: z.number().optional(),
323
+ testingType: z.number().optional(),
324
+ description: z.string().optional(),
325
+ associateRelCyc: z.boolean().optional(),
326
+ releaseCycleMapping: z
327
+ .array(z.object({
328
+ release: z.number(),
329
+ cycle: z.array(z.number()),
330
+ version: z.number().optional(),
331
+ }))
332
+ .optional(),
333
+ });
334
+ export const UpdateTestCaseArgsSchema = z.object({
335
+ projectKey: CommonFields.projectKeyOptional,
336
+ baseUrl: CommonFields.baseUrl,
337
+ tcID: CommonFields.tcID,
338
+ tcVersionID: CommonFields.tcVersionID,
339
+ withVersion: z.boolean().optional(),
340
+ notrunall: z.boolean().optional(),
341
+ isStepUpdated: z.boolean().optional(),
342
+ steps: z.array(CreateTestCaseStepSchema).optional(),
343
+ removeSteps: z.array(UpdateTestCaseRemoveStepSchema).optional(),
344
+ name: z.string().optional(),
345
+ priority: z.number().optional(),
346
+ component: z.array(z.number()).optional(),
347
+ owner: z.number().optional(),
348
+ testCaseState: z.number().optional(),
349
+ testCaseType: z.number().optional(),
350
+ executionMinutes: z.number().optional(),
351
+ testingType: z.number().optional(),
352
+ description: z.string().optional(),
353
+ updateOnlyMetadata: z.boolean().optional(),
354
+ });
132
355
  export const TestCaseListArgsSchema = z.object({
133
356
  projectKey: CommonFields.projectKeyOptional,
134
357
  baseUrl: CommonFields.baseUrl,
135
- viewId: CommonFields.viewId,
136
- folderPath: CommonFields.folderPath,
358
+ viewId: CommonFields.tcViewId,
359
+ folderPath: CommonFields.tcFolderPath,
137
360
  folderID: CommonFields.folderID,
138
361
  start: CommonFields.start,
139
362
  page: CommonFields.page,
@@ -172,3 +395,370 @@ export const TestCaseStepsArgsSchema = z.object({
172
395
  page: CommonFields.page,
173
396
  limit: CommonFields.limit,
174
397
  });
398
+ export const TestCaseExecutionsArgsSchema = z.object({
399
+ projectKey: CommonFields.projectKeyOptional,
400
+ baseUrl: CommonFields.baseUrl,
401
+ tcid: CommonFields.tcID,
402
+ tcversion: CommonFields.versionOptional,
403
+ start: CommonFields.start,
404
+ page: CommonFields.page,
405
+ limit: CommonFields.limit,
406
+ scope: CommonFields.scope,
407
+ filter: CommonFields.filter,
408
+ });
409
+ export const RequirementListArgsSchema = z.object({
410
+ projectKey: CommonFields.projectKeyOptional,
411
+ baseUrl: CommonFields.baseUrl,
412
+ viewId: CommonFields.rqViewId,
413
+ folderPath: CommonFields.rqFolderPath,
414
+ start: CommonFields.start,
415
+ page: CommonFields.page,
416
+ limit: CommonFields.limit,
417
+ scope: CommonFields.scope,
418
+ getSubEntities: CommonFields.getSubEntities,
419
+ hideEmptyFolders: CommonFields.hideEmptyFolders,
420
+ folderSortColumn: CommonFields.folderSortColumn,
421
+ folderSortOrder: CommonFields.folderSortOrder,
422
+ isJiraFilter: z
423
+ .boolean()
424
+ .optional()
425
+ .describe("'false' if using qmetry filter")
426
+ .default(false),
427
+ filterType: z
428
+ .enum(["QMETRY", "JIRA"])
429
+ .optional()
430
+ .describe("Pass 'QMETRY' or 'JIRA'")
431
+ .default("QMETRY"),
432
+ filter: CommonFields.filter,
433
+ udfFilter: CommonFields.udfFilter,
434
+ sort: z
435
+ .string()
436
+ .optional()
437
+ .describe("Sort Records - refer json schema, Possible property - name, entityKey, associatedVersion, priorityAlias, createdDate, createdByAlias, updatedDate, updatedByAlias, requirementStateAlias, linkedTcCount, linkedDfCount, attachmentCount, createdSystem, owner")
438
+ .default('[{"property":"name","direction":"ASC"}]'),
439
+ });
440
+ export const RequirementDetailsArgsSchema = z.object({
441
+ projectKey: CommonFields.projectKeyOptional,
442
+ baseUrl: CommonFields.baseUrl,
443
+ id: CommonFields.rqID,
444
+ version: CommonFields.rqVersion,
445
+ });
446
+ export const RequirementsLinkedToTestCaseArgsSchema = z.object({
447
+ projectKey: CommonFields.projectKeyOptional,
448
+ baseUrl: CommonFields.baseUrl,
449
+ tcID: CommonFields.tcID,
450
+ getLinked: z
451
+ .boolean()
452
+ .optional()
453
+ .describe("True to get only requirements that are linked with this test case, " +
454
+ "false to get requirements which are not linked with this test case. " +
455
+ "Defaults to true (get linked requirements).")
456
+ .default(true),
457
+ start: CommonFields.start,
458
+ page: CommonFields.page,
459
+ limit: CommonFields.limit,
460
+ rqFolderPath: CommonFields.rqFolderPath,
461
+ filter: CommonFields.filter,
462
+ });
463
+ export const LinkRequirementToTestCaseArgsSchema = z.object({
464
+ tcID: z.string().describe("EntityKey of Testcase (e.g. 'COD-TC-29')"),
465
+ tcVersionId: CommonFields.tcVersionID,
466
+ rqVersionIds: z
467
+ .string()
468
+ .describe("Comma-separated values of versionId of the Requirement (e.g. '236124,236125')"),
469
+ });
470
+ export const TestCasesLinkedToRequirementArgsSchema = z.object({
471
+ projectKey: CommonFields.projectKeyOptional,
472
+ baseUrl: CommonFields.baseUrl,
473
+ rqID: CommonFields.rqID,
474
+ getLinked: z
475
+ .boolean()
476
+ .optional()
477
+ .describe("True to get only test cases that are linked with this requirement, " +
478
+ "false to get test cases which are not linked with this requirement. " +
479
+ "Defaults to true (get linked test cases).")
480
+ .default(true),
481
+ showEntityWithReleaseCycle: z
482
+ .boolean()
483
+ .optional()
484
+ .describe("True to list only test cases which have given release and cycle, " +
485
+ "false for all test cases regardless of release/cycle association. " +
486
+ "Defaults to false (show all).")
487
+ .default(false),
488
+ start: CommonFields.start,
489
+ page: CommonFields.page,
490
+ limit: CommonFields.limit,
491
+ tcFolderPath: z
492
+ .string()
493
+ .optional()
494
+ .describe("Folder path to get test cases under specific folder. " +
495
+ 'Use empty string "" for root folder or specify path like "/Sample Template".')
496
+ .default(""),
497
+ releaseID: z
498
+ .string()
499
+ .optional()
500
+ .describe("Filter test cases by release ID. " +
501
+ "Use string representation of release ID (e.g., '7138'). " +
502
+ "Get release IDs from FETCH_RELEASES_AND_CYCLES tool."),
503
+ cycleID: z
504
+ .string()
505
+ .optional()
506
+ .describe("Filter test cases by cycle ID. " +
507
+ "Use string representation of cycle ID (e.g., '13382'). " +
508
+ "Get cycle IDs from FETCH_RELEASES_AND_CYCLES tool."),
509
+ filter: CommonFields.filter,
510
+ getSubEntities: z
511
+ .boolean()
512
+ .optional()
513
+ .describe("Allow filter of sub-entities for requirement.")
514
+ .default(true),
515
+ getColumns: z
516
+ .boolean()
517
+ .optional()
518
+ .describe("True to get column information in response.")
519
+ .default(true),
520
+ });
521
+ export const CreateTestSuiteArgsSchema = z.object({
522
+ parentFolderId: z.string(),
523
+ name: z.string(),
524
+ isAutomatedFlag: z.boolean().optional(),
525
+ description: z.string().optional(),
526
+ testsuiteOwner: z.number().optional(),
527
+ testSuiteState: z.number().optional(),
528
+ associateRelCyc: z.boolean().optional(),
529
+ releaseCycleMapping: z
530
+ .array(z.object({
531
+ buildID: z.number(),
532
+ releaseId: z.number(),
533
+ }))
534
+ .optional(),
535
+ });
536
+ export const UpdateTestSuiteArgsSchema = z.object({
537
+ id: z.number().describe("Id of Test Suite to be updated (required)"),
538
+ TsFolderID: z
539
+ .number()
540
+ .describe("Folder ID where Test Suite resides (required)"),
541
+ entityKey: z
542
+ .string()
543
+ .describe("Entity Key of Test Suite to be updated (required)"),
544
+ name: z.string().optional().describe("Name of the Test Suite"),
545
+ description: z.string().optional().describe("Description of the Test Suite"),
546
+ testsuiteOwner: z.number().optional().describe("Owner ID of the Test Suite"),
547
+ testSuiteState: z.number().optional().describe("State of the Test Suite"),
548
+ });
549
+ export const TestSuiteListArgsSchema = z.object({
550
+ projectKey: CommonFields.projectKeyOptional,
551
+ baseUrl: CommonFields.baseUrl,
552
+ viewId: CommonFields.tsViewId,
553
+ folderPath: CommonFields.tsFolderPath,
554
+ start: CommonFields.start,
555
+ page: CommonFields.page,
556
+ limit: CommonFields.limit,
557
+ scope: CommonFields.scope,
558
+ getSubEntities: CommonFields.getSubEntities,
559
+ filter: CommonFields.filter,
560
+ udfFilter: CommonFields.udfFilter,
561
+ sort: z
562
+ .string()
563
+ .optional()
564
+ .describe("Sort Records - refer json schema, Possible property - entityKey, name, testsuiteStatus, linkedPlatformCount, linkedTcCount, createdDate, createdByAlias, updatedDate, updatedByAlias, attachmentCount, owner, remExecutionTime, totalExecutionTime")
565
+ .default('[{"property":"name","direction":"ASC"}]'),
566
+ });
567
+ export const TestSuitesForTestCaseArgsSchema = z.object({
568
+ projectKey: CommonFields.projectKeyOptional,
569
+ baseUrl: CommonFields.baseUrl,
570
+ tsFolderID: CommonFields.tsFolderID,
571
+ viewId: CommonFields.tsfeViewId.optional(),
572
+ start: CommonFields.start,
573
+ page: CommonFields.page,
574
+ limit: CommonFields.limit,
575
+ getColumns: CommonFields.getColumns,
576
+ filter: CommonFields.filter,
577
+ });
578
+ export const LinkTestCasesToTestSuiteArgsSchema = z
579
+ .object({
580
+ tsID: z.number().describe("Id of Test Suite (required)"),
581
+ tcvdIDs: z
582
+ .array(z.number())
583
+ .describe("Array of Test Case Version IDs (required if fromReqs is false)"),
584
+ fromReqs: z
585
+ .boolean()
586
+ .optional()
587
+ .describe("Link TestCases from Requirements (optional, default false)"),
588
+ })
589
+ .strip();
590
+ export const RequirementsLinkedTestCasesToTestSuiteArgsSchema = z
591
+ .object({
592
+ tsID: z.number().describe("Id of Test Suite (required)"),
593
+ tcvdIDs: z
594
+ .array(z.number())
595
+ .describe("Array of Test Case Version IDs (required if fromReqs is true)"),
596
+ fromReqs: z
597
+ .boolean()
598
+ .optional()
599
+ .describe("Link TestCases from Requirements (optional, default true)"),
600
+ })
601
+ .strip();
602
+ export const IssuesLinkedToTestCaseArgsSchema = z.object({
603
+ projectKey: CommonFields.projectKeyOptional,
604
+ baseUrl: CommonFields.baseUrl,
605
+ tcID: CommonFields.tcID,
606
+ getLinked: CommonFields.getLinked.optional().default(true),
607
+ start: CommonFields.start,
608
+ page: CommonFields.page,
609
+ limit: CommonFields.limit,
610
+ filter: CommonFields.filter,
611
+ });
612
+ export const TestCasesByTestSuiteArgsSchema = z.object({
613
+ projectKey: CommonFields.projectKeyOptional,
614
+ baseUrl: CommonFields.baseUrl,
615
+ tsID: CommonFields.tsID,
616
+ getLinked: CommonFields.getLinked.optional().default(true),
617
+ start: CommonFields.start,
618
+ page: CommonFields.page,
619
+ limit: CommonFields.limit,
620
+ filter: CommonFields.filter,
621
+ });
622
+ export const ExecutionsByTestSuiteArgsSchema = z.object({
623
+ projectKey: CommonFields.projectKeyOptional,
624
+ baseUrl: CommonFields.baseUrl,
625
+ tsID: CommonFields.tsID, // API payload param - sent in request body (REQUIRED)
626
+ tsFolderID: CommonFields.tsFolderID.optional(),
627
+ gridName: CommonFields.gridName,
628
+ viewId: CommonFields.teViewId,
629
+ start: CommonFields.start,
630
+ page: CommonFields.page,
631
+ limit: CommonFields.limit,
632
+ filter: CommonFields.filter,
633
+ });
634
+ export const TestCaseRunsByTestSuiteRunArgsSchema = z.object({
635
+ projectKey: CommonFields.projectKeyOptional,
636
+ baseUrl: CommonFields.baseUrl,
637
+ tsrunID: CommonFields.tsrunID, // API payload param - sent in request body (REQUIRED)
638
+ viewId: CommonFields.teViewId.pipe(z.number()), // API payload param - sent in request body (REQUIRED)
639
+ start: CommonFields.start,
640
+ page: CommonFields.page,
641
+ limit: CommonFields.limit,
642
+ });
643
+ export const LinkedIssuesByTestCaseRunArgsSchema = z.object({
644
+ projectKey: CommonFields.projectKeyOptional,
645
+ baseUrl: CommonFields.baseUrl,
646
+ entityId: CommonFields.entityId, // API payload param - sent in request body (REQUIRED)
647
+ getLinked: CommonFields.getLinked,
648
+ getColumns: CommonFields.getColumns,
649
+ istcrFlag: CommonFields.istcrFlag,
650
+ start: CommonFields.start,
651
+ page: CommonFields.page,
652
+ limit: CommonFields.limit,
653
+ filter: CommonFields.filter,
654
+ });
655
+ export const CreateIssueArgsSchema = z.object({
656
+ projectKey: CommonFields.projectKeyOptional,
657
+ baseUrl: CommonFields.baseUrl,
658
+ issueType: z.number().describe("Issue type ID (e.g. Bug, Enhancement, etc.)"),
659
+ issuePriority: z
660
+ .number()
661
+ .describe("Issue priority ID (e.g. High, Medium, Low, etc.)"),
662
+ summary: z.string().describe("Summary or title of the defect/issue"),
663
+ description: z
664
+ .string()
665
+ .optional()
666
+ .describe("Detailed description of the defect/issue"),
667
+ sync_with: z
668
+ .string()
669
+ .optional()
670
+ .describe("External system to sync with (e.g. JIRA, QMetry, etc.)"),
671
+ issueOwner: z.number().optional().describe("Owner/user ID for the issue"),
672
+ component: z
673
+ .array(z.number())
674
+ .optional()
675
+ .describe("Component IDs associated with the issue"),
676
+ affectedRelease: z
677
+ .array(z.number())
678
+ .optional()
679
+ .describe("Release IDs affected by this issue"),
680
+ affectedCycles: z
681
+ .array(z.number())
682
+ .optional()
683
+ .describe("Cycle IDs affected by this issue"),
684
+ tcRunID: z
685
+ .number()
686
+ .optional()
687
+ .describe("Test Case Run ID to link this defect/issue to a test execution (optional)"),
688
+ });
689
+ export const UpdateIssueArgsSchema = z.object({
690
+ DefectId: z.number().describe("ID of the defect/issue to be updated"),
691
+ entityKey: z
692
+ .string()
693
+ .optional()
694
+ .describe("Entity Key of the defect/issue to be updated"),
695
+ issueType: z
696
+ .number()
697
+ .optional()
698
+ .describe("Issue type ID (e.g. Bug, Enhancement, etc.)"),
699
+ issuePriority: z
700
+ .number()
701
+ .optional()
702
+ .describe("Issue priority ID (e.g. High, Medium, Low, etc.)"),
703
+ summary: z
704
+ .string()
705
+ .optional()
706
+ .describe("Summary or title of the defect/issue"),
707
+ description: z
708
+ .string()
709
+ .optional()
710
+ .describe("Detailed description of the defect/issue"),
711
+ issueOwner: z.number().optional().describe("Owner/user ID for the issue"),
712
+ affectedRelease: z
713
+ .number()
714
+ .optional()
715
+ .describe("Release IDs affected by this issue"),
716
+ affectedCycles: z
717
+ .number()
718
+ .optional()
719
+ .describe("Cycle IDs affected by this issue"),
720
+ });
721
+ export const IssuesListArgsSchema = z.object({
722
+ projectKey: CommonFields.projectKeyOptional,
723
+ baseUrl: CommonFields.baseUrl,
724
+ viewId: z
725
+ .number()
726
+ .describe("ViewId for issues - SYSTEM AUTOMATICALLY RESOLVES THIS. " +
727
+ "Leave empty unless you have a specific viewId. " +
728
+ "System will fetch project info using the projectKey and extract latestViews.IS.viewId automatically. " +
729
+ "Manual viewId only needed if you want to override the automatic resolution."),
730
+ start: CommonFields.start,
731
+ page: CommonFields.page,
732
+ limit: CommonFields.limit,
733
+ filter: CommonFields.filter,
734
+ isJiraIntegrated: z
735
+ .boolean()
736
+ .optional()
737
+ .describe("Send true if current project is Integrated with Jira")
738
+ .default(false),
739
+ sort: z
740
+ .string()
741
+ .optional()
742
+ .describe("Sort Records - refer json schema, Possible property - entityKey, name, typeAlias, stateAlias, createdDate, createdByAlias, updatedDate, updatedByAlias, priorityAlias, createdSystem, linkedTcrCount, linkedRqCount, dfOwner, attachmentCount, environmentText")
743
+ .default('[{"property":"name","direction":"ASC"}]'),
744
+ });
745
+ // Export for Link Issues to Testcase Run tool
746
+ export const LinkIssuesToTestcaseRunArgsSchema = z.object({
747
+ projectKey: CommonFields.projectKeyOptional,
748
+ baseUrl: CommonFields.baseUrl,
749
+ issueIds: z
750
+ .array(z.union([z.string(), z.number()]))
751
+ .describe("ID of issues to be linked to Testcase Run"),
752
+ tcrId: z.number().describe("ID of Testcase Run to link issues with"),
753
+ });
754
+ // Export for Link Platforms to Test Suite tool
755
+ export const LinkPlatformsToTestSuiteArgsSchema = z.object({
756
+ projectKey: CommonFields.projectKeyOptional,
757
+ baseUrl: CommonFields.baseUrl,
758
+ qmTsId: z
759
+ .number()
760
+ .describe("Id of Test Suite (required). To get the qmTsId - Call API 'Testsuite/Fetch Testsuite' From the response, get value of following attribute -> data[<index>].id"),
761
+ qmPlatformId: z
762
+ .string()
763
+ .describe("Comma-separated value of PlatformId (required). To get the qmPlatformId - Call API 'Platform/List' From the response, get value of following attribute -> data[<index>].platformID"),
764
+ });
@@ -0,0 +1,16 @@
1
+ import { DEFAULT_FILTER, DEFAULT_PAGINATION, DEFAULT_SORT, } from "./common.js";
2
+ export const DEFAULT_FETCH_ISSUES_LINKED_TO_TESTCASE_PAYLOAD = {
3
+ ...DEFAULT_PAGINATION,
4
+ ...DEFAULT_FILTER,
5
+ getLinked: true,
6
+ };
7
+ export const DEFAULT_CREATE_ISSUE_PAYLOAD = {};
8
+ export const DEFAULT_UPDATE_ISSUE_PAYLOAD = {};
9
+ export const DEFAULT_LINK_ISSUES_TO_TESTCASE_RUN_PAYLOAD = {};
10
+ export const DEFAULT_FETCH_ISSUES_PAYLOAD = {
11
+ ...DEFAULT_PAGINATION,
12
+ ...DEFAULT_FILTER,
13
+ ...DEFAULT_SORT,
14
+ udfFilter: "[]",
15
+ isJiraIntegated: false,
16
+ };