@smartbear/mcp
Version:
MCP server for interacting SmartBear Products
1,353 lines (1,336 loc) • 197 kB
JavaScript
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Zephyr Cloud API
*
# Introduction
This is the **Zephyr Cloud** API. If you are looking for the Server API, please refer to the [documentation](https://support.smartbear.com/zephyr-scale-server/api-docs/v1/) for more information.
This API uses the OpenAPI specification. If you want to generate clients for different languages, please use the link above to download the API specification and use it with your preferred tools.
For feature requests or general support, please head to our [support site](https://support.smartbear.com/zephyr/message/).
# Authentication
The API authentication is based on JSON Web Token (JWT), which is a key for accessing the API. Authenticating using JWT requires the following steps:
* Generate a key
* Make authenticated requests
## Generate a Key
For accessing the API, you must generate an access key in Jira. To generate an access token, click on your profile picture at the page bottom left, and
choose the option “Zephyr API keys". For more information, please check out the [documentation](https://support.smartbear.com/zephyr/docs/en/rest-api/api-access-tokens-management.html).
## Accessing the API
The API is available at the following base URL:
```
https://api.zephyrscale.smartbear.com/v2
```
For example, the final URL for retrieving test cases would be:
```
https://api.zephyrscale.smartbear.com/v2/testcases
```
For EU region, the API can be accessed at the following base URL:
```
https://eu.api.zephyrscale.smartbear.com/v2
```
## Making Authenticated Requests
To authenticate subsequent API requests, you must provide a valid token in an HTTP header, which is the key generated on the previous step:
```
Authorization: Bearer {bearer_token}
```
# Representing Users
Previous API definitions used Atlassian User Keys to identify users. This parameter is deprecated because of privacy
changes. Use Atlassian Account ID instead.
Atlassian Account IDs are globally unique opaque identifiers for identifying a user. Every Atlassian Account has a
ID which is assigned when the account is created and is immutable. Account IDs contain no personally identifiable
information and are only used to retrieve user information ondemand. This API does not return any user information
other than the Account ID (with the exception of the deprecated user keys during the deprecation period).
* OpenAPI spec version: 2
*/
import * as zod from "zod";
/**
* Retrieves all test cases. Query parameters can be used to filter the results. If the user who is preforming the API call has access to more than 1000 projects, the `projectKey` query parameter is mandatory.
* @summary Get test cases
*/
export const listTestCasesQueryProjectKeyRegExp = /([A-Z][A-Z_0-9]+)/;
export const listTestCasesQueryMaxResultsDefault = 10;
export const listTestCasesQueryStartAtDefault = 0;
export const listTestCasesQueryStartAtMin = 0;
export const listTestCasesQueryStartAtMax = 1000000;
export const listTestCasesQueryParams = zod.object({
projectKey: zod
.string()
.regex(listTestCasesQueryProjectKeyRegExp)
.optional()
.describe("Jira project key filter"),
folderId: zod.number().min(1).optional().describe("Folder ID filter"),
maxResults: zod
.number()
.min(1)
.default(listTestCasesQueryMaxResultsDefault)
.describe("Specifies the maximum number of results to return in a single call. The default value is 10, and the maximum value that can be requested is 1000.\n\nNote that the server may enforce a lower limit than requested, depending on resource availability or other internal constraints. If this happens, the result set may be truncated. Always check the maxResults value in the response to confirm how many results were actually returned.\n"),
startAt: zod
.number()
.min(listTestCasesQueryStartAtMin)
.max(listTestCasesQueryStartAtMax)
.optional()
.describe("Zero-indexed starting position. Should be a multiple of maxResults."),
});
export const listTestCasesResponseStartAtMin = 0;
export const listTestCasesResponseTotalMin = 0;
export const listTestCasesResponseValuesItemKeyRegExp = /.+-T[0-9]+/;
export const listTestCasesResponseValuesItemNameRegExp = /^(?!\\s*$).+/;
export const listTestCasesResponseValuesItemEstimatedTimeMin = 0;
export const listTestCasesResponseValuesItemOwnerAccountIdRegExp = /^[-:a-zA-Z0-9]{1,128}$/;
export const listTestCasesResponse = zod
.object({
next: zod
.string()
.url()
.nullish()
.describe("URL to the next page of results, or null if there are no more results."),
startAt: zod
.number()
.min(listTestCasesResponseStartAtMin)
.describe("Indicates the index of the first item returned in the page of results."),
maxResults: zod
.number()
.min(1)
.describe("Indicates the maximum number of results in this response. Note that the server may enforce a lower limit than requested, depending on resource availability or other internal constraints."),
total: zod
.number()
.min(listTestCasesResponseTotalMin)
.optional()
.describe("Indicates the total number of items available across all pages."),
isLast: zod
.boolean()
.optional()
.describe("Indicates if this is the last page of results."),
})
.and(zod.object({
values: zod
.array(zod.object({
id: zod.number().min(1),
key: zod
.string()
.regex(listTestCasesResponseValuesItemKeyRegExp)
.describe("The test case key"),
name: zod.string().regex(listTestCasesResponseValuesItemNameRegExp),
project: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.describe("ID and link relative to Zephyr project."),
createdOn: zod
.string()
.datetime({})
.optional()
.describe("Data and time test case was created. Format: yyyy-MM-dd'T'HH:mm:ss'Z'. This field is read-only, cannot be updated.\n"),
objective: zod
.string()
.nullish()
.describe("A description of the objective."),
precondition: zod
.string()
.nullish()
.describe("Any conditions that need to be met."),
estimatedTime: zod
.number()
.min(listTestCasesResponseValuesItemEstimatedTimeMin)
.nullish()
.describe("Estimated duration in milliseconds."),
labels: zod
.array(zod.string())
.optional()
.describe("Array of labels associated to this entity."),
component: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.nullish(),
priority: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})),
status: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})),
folder: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.nullish(),
owner: zod
.object({
accountId: zod
.string()
.regex(listTestCasesResponseValuesItemOwnerAccountIdRegExp)
.nullable()
.describe("Atlassian Account ID of the Jira user."),
self: zod
.string()
.url()
.optional()
.describe("The Jira REST API endpoint to get the full representation of the Jira user."),
})
.nullish(),
testScript: zod
.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})
.optional(),
customFields: zod
.record(zod.string(), zod.unknown())
.optional()
.describe("Multi-line text fields support HTML and should denote new lines with the \\<br\\> tag.\nDates should be in the format 'yyyy-MM-dd'.\nUsers should have values of Jira User Account IDs.\n"),
links: zod
.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})
.and(zod.object({
issues: zod
.array(zod
.object({
issueId: zod
.number()
.min(1)
.describe("The Jira issue ID"),
})
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The Zephyr REST API endpoint relative to the link between the entity and the Jira issue."),
id: zod
.number()
.min(1)
.optional()
.describe("The ID that represents the link between the entity and the Jira issue."),
target: zod
.string()
.url()
.optional()
.describe("The Jira Cloud REST API endpoint to get the full representation of the issue"),
type: zod
.enum(["COVERAGE", "BLOCKS", "RELATED"])
.optional()
.describe("The link type"),
})))
.optional()
.describe("A list of Jira issues linked to this entity"),
webLinks: zod
.array(zod
.object({
description: zod
.string()
.optional()
.describe("The web link description"),
url: zod.string().url().describe("The web link URL"),
})
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The Zephyr REST API endpoint relative to the link between the entity and this web link."),
id: zod.number().min(1).optional(),
type: zod
.enum(["COVERAGE", "BLOCKS", "RELATED"])
.optional()
.describe("The link type"),
})))
.optional()
.describe("A list of web links for this entity"),
}))
.optional()
.describe("This property is ignored on updates."),
}))
.optional(),
}));
/**
* Creates a test case. Fields `priorityName` and `statusName` will be set to default values if not informed. Default values are usually “Normal” for `priorityName` and “Draft” for `statusName`. All required test case custom fields should be present in the request.
* @summary Create test case
*/
export const createTestCaseBodyProjectKeyRegExp = /([A-Z][A-Z_0-9]+)/;
export const createTestCaseBodyNameRegExp = /^(?!\\s*$).+/;
export const createTestCaseBodyEstimatedTimeMin = 0;
export const createTestCaseBodyComponentIdMin = 0;
export const createTestCaseBodyPriorityNameMax = 255;
export const createTestCaseBodyStatusNameMax = 255;
export const createTestCaseBodyOwnerIdRegExp = /^[-:a-zA-Z0-9]{1,128}$/;
export const createTestCaseBody = zod.object({
projectKey: zod
.string()
.regex(createTestCaseBodyProjectKeyRegExp)
.describe("Jira project key."),
name: zod.string().regex(createTestCaseBodyNameRegExp),
objective: zod.string().nullish().describe("A description of the objective."),
precondition: zod
.string()
.nullish()
.describe("Any conditions that need to be met."),
estimatedTime: zod
.number()
.min(createTestCaseBodyEstimatedTimeMin)
.optional()
.describe("Estimated duration in milliseconds."),
componentId: zod
.number()
.min(createTestCaseBodyComponentIdMin)
.optional()
.describe("ID of a component from Jira."),
priorityName: zod
.string()
.min(1)
.max(createTestCaseBodyPriorityNameMax)
.optional()
.describe("The priority name."),
statusName: zod
.string()
.min(1)
.max(createTestCaseBodyStatusNameMax)
.optional()
.describe("The status name."),
folderId: zod
.number()
.min(1)
.optional()
.describe("ID of a folder to place the entity within."),
ownerId: zod
.string()
.regex(createTestCaseBodyOwnerIdRegExp)
.nullish()
.describe("Atlassian Account ID of the Jira user."),
labels: zod
.array(zod.string())
.optional()
.describe("Array of labels associated to this entity."),
customFields: zod
.record(zod.string(), zod.unknown())
.optional()
.describe("Multi-line text fields support HTML and should denote new lines with the \\<br\\> tag.\nDates should be in the format 'yyyy-MM-dd'.\nUsers should have values of Jira User Account IDs.\n"),
});
/**
* Retrieves all test cases. Query parameters can be used to filter the results.
Use this endpoint for retrieving large volumes of test cases.
Results are split in different pages, of size equal to the `limit` query parameter.
To fetch the next page, use the `next` URL returned in the response.
It should have the same parameters as the original request, with the updated value for `startAtId` parameter.
Alternatively, the same request can be made with the `startAtId` parameter set to the `nextStartId` value
returned in the response.
* @summary Get test cases (NextGen)
*/
export const listTestCasesCursorPaginatedQueryProjectKeyRegExp = /([A-Z][A-Z_0-9]+)/;
export const listTestCasesCursorPaginatedQueryLimitDefault = 10;
export const listTestCasesCursorPaginatedQueryLimitMax = 1000;
export const listTestCasesCursorPaginatedQueryStartAtIdDefault = 0;
export const listTestCasesCursorPaginatedQueryStartAtIdMin = 0;
export const listTestCasesCursorPaginatedQueryParams = zod.object({
projectKey: zod
.string()
.regex(listTestCasesCursorPaginatedQueryProjectKeyRegExp)
.optional()
.describe("Jira project key filter"),
folderId: zod.number().min(1).optional().describe("Folder ID filter"),
limit: zod
.number()
.min(1)
.max(listTestCasesCursorPaginatedQueryLimitMax)
.default(listTestCasesCursorPaginatedQueryLimitDefault)
.describe("Specifies the maximum number of results to return in a single call. The default value is 10, and the maximum value that can be requested is 1000.\n\nNote that the server may enforce a lower limit than requested, depending on resource availability or other internal constraints. If this happens, the result set may be truncated. Always check the limit value in the response to confirm how many results were actually returned.\n"),
startAtId: zod
.number()
.min(listTestCasesCursorPaginatedQueryStartAtIdMin)
.optional()
.describe("Zero-indexed starting position for ID-based pagination."),
});
export const listTestCasesCursorPaginatedResponseNextStartAtIdMin = 0;
export const listTestCasesCursorPaginatedResponseLimitMin = 0;
export const listTestCasesCursorPaginatedResponseValuesItemKeyRegExp = /.+-T[0-9]+/;
export const listTestCasesCursorPaginatedResponseValuesItemNameRegExp = /^(?!\\s*$).+/;
export const listTestCasesCursorPaginatedResponseValuesItemEstimatedTimeMin = 0;
export const listTestCasesCursorPaginatedResponseValuesItemOwnerAccountIdRegExp = /^[-:a-zA-Z0-9]{1,128}$/;
export const listTestCasesCursorPaginatedResponse = zod
.object({
next: zod.string().url().nullish(),
nextStartAtId: zod
.number()
.min(listTestCasesCursorPaginatedResponseNextStartAtIdMin)
.nullable(),
limit: zod.number().min(listTestCasesCursorPaginatedResponseLimitMin),
})
.and(zod.object({
values: zod
.array(zod.object({
id: zod.number().min(1),
key: zod
.string()
.regex(listTestCasesCursorPaginatedResponseValuesItemKeyRegExp)
.describe("The test case key"),
name: zod
.string()
.regex(listTestCasesCursorPaginatedResponseValuesItemNameRegExp),
project: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.describe("ID and link relative to Zephyr project."),
createdOn: zod
.string()
.datetime({})
.optional()
.describe("Data and time test case was created. Format: yyyy-MM-dd'T'HH:mm:ss'Z'. This field is read-only, cannot be updated.\n"),
objective: zod
.string()
.nullish()
.describe("A description of the objective."),
precondition: zod
.string()
.nullish()
.describe("Any conditions that need to be met."),
estimatedTime: zod
.number()
.min(listTestCasesCursorPaginatedResponseValuesItemEstimatedTimeMin)
.nullish()
.describe("Estimated duration in milliseconds."),
labels: zod
.array(zod.string())
.optional()
.describe("Array of labels associated to this entity."),
component: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.nullish(),
priority: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})),
status: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})),
folder: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.nullish(),
owner: zod
.object({
accountId: zod
.string()
.regex(listTestCasesCursorPaginatedResponseValuesItemOwnerAccountIdRegExp)
.nullable()
.describe("Atlassian Account ID of the Jira user."),
self: zod
.string()
.url()
.optional()
.describe("The Jira REST API endpoint to get the full representation of the Jira user."),
})
.nullish(),
testScript: zod
.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})
.optional(),
customFields: zod
.record(zod.string(), zod.unknown())
.optional()
.describe("Multi-line text fields support HTML and should denote new lines with the \\<br\\> tag.\nDates should be in the format 'yyyy-MM-dd'.\nUsers should have values of Jira User Account IDs.\n"),
links: zod
.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})
.and(zod.object({
issues: zod
.array(zod
.object({
issueId: zod
.number()
.min(1)
.describe("The Jira issue ID"),
})
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The Zephyr REST API endpoint relative to the link between the entity and the Jira issue."),
id: zod
.number()
.min(1)
.optional()
.describe("The ID that represents the link between the entity and the Jira issue."),
target: zod
.string()
.url()
.optional()
.describe("The Jira Cloud REST API endpoint to get the full representation of the issue"),
type: zod
.enum(["COVERAGE", "BLOCKS", "RELATED"])
.optional()
.describe("The link type"),
})))
.optional()
.describe("A list of Jira issues linked to this entity"),
webLinks: zod
.array(zod
.object({
description: zod
.string()
.optional()
.describe("The web link description"),
url: zod.string().url().describe("The web link URL"),
})
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The Zephyr REST API endpoint relative to the link between the entity and this web link."),
id: zod.number().min(1).optional(),
type: zod
.enum(["COVERAGE", "BLOCKS", "RELATED"])
.optional()
.describe("The link type"),
})))
.optional()
.describe("A list of web links for this entity"),
}))
.optional()
.describe("This property is ignored on updates."),
}))
.optional(),
}));
/**
* Returns a test case for the given key.
* @summary Get test case
*/
export const getTestCasePathTestCaseKeyRegExp = /(.+-T[0-9]+)/;
export const getTestCaseParams = zod.object({
testCaseKey: zod
.string()
.regex(getTestCasePathTestCaseKeyRegExp)
.describe("The key of the test case. Test case keys are of the format [A-Z]+-T[0-9]+"),
});
export const getTestCaseResponseKeyRegExp = /.+-T[0-9]+/;
export const getTestCaseResponseNameRegExp = /^(?!\\s*$).+/;
export const getTestCaseResponseEstimatedTimeMin = 0;
export const getTestCaseResponseOwnerAccountIdRegExp = /^[-:a-zA-Z0-9]{1,128}$/;
export const getTestCaseResponse = zod.object({
id: zod.number().min(1),
key: zod
.string()
.regex(getTestCaseResponseKeyRegExp)
.describe("The test case key"),
name: zod.string().regex(getTestCaseResponseNameRegExp),
project: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.describe("ID and link relative to Zephyr project."),
createdOn: zod
.string()
.datetime({})
.optional()
.describe("Data and time test case was created. Format: yyyy-MM-dd'T'HH:mm:ss'Z'. This field is read-only, cannot be updated.\n"),
objective: zod.string().nullish().describe("A description of the objective."),
precondition: zod
.string()
.nullish()
.describe("Any conditions that need to be met."),
estimatedTime: zod
.number()
.min(getTestCaseResponseEstimatedTimeMin)
.nullish()
.describe("Estimated duration in milliseconds."),
labels: zod
.array(zod.string())
.optional()
.describe("Array of labels associated to this entity."),
component: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.nullish(),
priority: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})),
status: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})),
folder: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.nullish(),
owner: zod
.object({
accountId: zod
.string()
.regex(getTestCaseResponseOwnerAccountIdRegExp)
.nullable()
.describe("Atlassian Account ID of the Jira user."),
self: zod
.string()
.url()
.optional()
.describe("The Jira REST API endpoint to get the full representation of the Jira user."),
})
.nullish(),
testScript: zod
.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})
.optional(),
customFields: zod
.record(zod.string(), zod.unknown())
.optional()
.describe("Multi-line text fields support HTML and should denote new lines with the \\<br\\> tag.\nDates should be in the format 'yyyy-MM-dd'.\nUsers should have values of Jira User Account IDs.\n"),
links: zod
.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})
.and(zod.object({
issues: zod
.array(zod
.object({
issueId: zod.number().min(1).describe("The Jira issue ID"),
})
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The Zephyr REST API endpoint relative to the link between the entity and the Jira issue."),
id: zod
.number()
.min(1)
.optional()
.describe("The ID that represents the link between the entity and the Jira issue."),
target: zod
.string()
.url()
.optional()
.describe("The Jira Cloud REST API endpoint to get the full representation of the issue"),
type: zod
.enum(["COVERAGE", "BLOCKS", "RELATED"])
.optional()
.describe("The link type"),
})))
.optional()
.describe("A list of Jira issues linked to this entity"),
webLinks: zod
.array(zod
.object({
description: zod
.string()
.optional()
.describe("The web link description"),
url: zod.string().url().describe("The web link URL"),
})
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The Zephyr REST API endpoint relative to the link between the entity and this web link."),
id: zod.number().min(1).optional(),
type: zod
.enum(["COVERAGE", "BLOCKS", "RELATED"])
.optional()
.describe("The link type"),
})))
.optional()
.describe("A list of web links for this entity"),
}))
.optional()
.describe("This property is ignored on updates."),
});
/**
* Updates an existing test case. Please take into account that for each non-specified field the value will be cleared. If the project has test case custom fields, all custom fields should be present in the request. To leave any of them blank, please set them null if they are not required custom fields.
* @summary Update test case
*/
export const updateTestCasePathTestCaseKeyRegExp = /(.+-T[0-9]+)/;
export const updateTestCaseParams = zod.object({
testCaseKey: zod
.string()
.regex(updateTestCasePathTestCaseKeyRegExp)
.describe("The key of the test case. Test case keys are of the format [A-Z]+-T[0-9]+"),
});
export const updateTestCaseBodyKeyRegExp = /.+-T[0-9]+/;
export const updateTestCaseBodyNameRegExp = /^(?!\\s*$).+/;
export const updateTestCaseBodyEstimatedTimeMin = 0;
export const updateTestCaseBodyOwnerAccountIdRegExp = /^[-:a-zA-Z0-9]{1,128}$/;
export const updateTestCaseBody = zod.object({
id: zod.number().min(1),
key: zod
.string()
.regex(updateTestCaseBodyKeyRegExp)
.describe("The test case key"),
name: zod.string().regex(updateTestCaseBodyNameRegExp),
project: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.describe("ID and link relative to Zephyr project."),
createdOn: zod
.string()
.datetime({})
.optional()
.describe("Data and time test case was created. Format: yyyy-MM-dd'T'HH:mm:ss'Z'. This field is read-only, cannot be updated.\n"),
objective: zod.string().nullish().describe("A description of the objective."),
precondition: zod
.string()
.nullish()
.describe("Any conditions that need to be met."),
estimatedTime: zod
.number()
.min(updateTestCaseBodyEstimatedTimeMin)
.nullish()
.describe("Estimated duration in milliseconds."),
labels: zod
.array(zod.string())
.optional()
.describe("Array of labels associated to this entity."),
component: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.nullish(),
priority: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})),
status: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})),
folder: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.nullish(),
owner: zod
.object({
accountId: zod
.string()
.regex(updateTestCaseBodyOwnerAccountIdRegExp)
.nullable()
.describe("Atlassian Account ID of the Jira user."),
self: zod
.string()
.url()
.optional()
.describe("The Jira REST API endpoint to get the full representation of the Jira user."),
})
.nullish(),
testScript: zod
.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})
.optional(),
customFields: zod
.record(zod.string(), zod.unknown())
.optional()
.describe("Multi-line text fields support HTML and should denote new lines with the \\<br\\> tag.\nDates should be in the format 'yyyy-MM-dd'.\nUsers should have values of Jira User Account IDs.\n"),
links: zod
.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})
.and(zod.object({
issues: zod
.array(zod
.object({
issueId: zod.number().min(1).describe("The Jira issue ID"),
})
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The Zephyr REST API endpoint relative to the link between the entity and the Jira issue."),
id: zod
.number()
.min(1)
.optional()
.describe("The ID that represents the link between the entity and the Jira issue."),
target: zod
.string()
.url()
.optional()
.describe("The Jira Cloud REST API endpoint to get the full representation of the issue"),
type: zod
.enum(["COVERAGE", "BLOCKS", "RELATED"])
.optional()
.describe("The link type"),
})))
.optional()
.describe("A list of Jira issues linked to this entity"),
webLinks: zod
.array(zod
.object({
description: zod
.string()
.optional()
.describe("The web link description"),
url: zod.string().url().describe("The web link URL"),
})
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The Zephyr REST API endpoint relative to the link between the entity and this web link."),
id: zod.number().min(1).optional(),
type: zod
.enum(["COVERAGE", "BLOCKS", "RELATED"])
.optional()
.describe("The link type"),
})))
.optional()
.describe("A list of web links for this entity"),
}))
.optional()
.describe("This property is ignored on updates."),
});
/**
* Returns links for a test case with specified key.
* @summary Get links
*/
export const getTestCaseLinksPathTestCaseKeyRegExp = /(.+-T[0-9]+)/;
export const getTestCaseLinksParams = zod.object({
testCaseKey: zod
.string()
.regex(getTestCaseLinksPathTestCaseKeyRegExp)
.describe("The key of the test case. Test case keys are of the format [A-Z]+-T[0-9]+"),
});
export const getTestCaseLinksResponse = zod
.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})
.and(zod.object({
issues: zod
.array(zod
.object({
issueId: zod.number().min(1).describe("The Jira issue ID"),
})
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The Zephyr REST API endpoint relative to the link between the entity and the Jira issue."),
id: zod
.number()
.min(1)
.optional()
.describe("The ID that represents the link between the entity and the Jira issue."),
target: zod
.string()
.url()
.optional()
.describe("The Jira Cloud REST API endpoint to get the full representation of the issue"),
type: zod
.enum(["COVERAGE", "BLOCKS", "RELATED"])
.optional()
.describe("The link type"),
})))
.optional()
.describe("A list of Jira issues linked to this entity"),
webLinks: zod
.array(zod
.object({
description: zod
.string()
.optional()
.describe("The web link description"),
url: zod.string().url().describe("The web link URL"),
})
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The Zephyr REST API endpoint relative to the link between the entity and this web link."),
id: zod.number().min(1).optional(),
type: zod
.enum(["COVERAGE", "BLOCKS", "RELATED"])
.optional()
.describe("The link type"),
})))
.optional()
.describe("A list of web links for this entity"),
}))
.describe("This property is ignored on updates.");
/**
* Creates a link between a test case and a Jira issue.
* @summary Create issue link
*/
export const createTestCaseIssueLinkPathTestCaseKeyRegExp = /(.+-T[0-9]+)/;
export const createTestCaseIssueLinkParams = zod.object({
testCaseKey: zod
.string()
.regex(createTestCaseIssueLinkPathTestCaseKeyRegExp)
.describe("The key of the test case. Test case keys are of the format [A-Z]+-T[0-9]+"),
});
export const createTestCaseIssueLinkBody = zod.object({
issueId: zod.number().min(1).describe("The Jira issue ID"),
});
/**
* Creates a link between a test case and a generic URL.
* @summary Create web link
*/
export const createTestCaseWebLinkPathTestCaseKeyRegExp = /(.+-T[0-9]+)/;
export const createTestCaseWebLinkParams = zod.object({
testCaseKey: zod
.string()
.regex(createTestCaseWebLinkPathTestCaseKeyRegExp)
.describe("The key of the test case. Test case keys are of the format [A-Z]+-T[0-9]+"),
});
export const createTestCaseWebLinkBody = zod.object({
description: zod.string().optional().describe("The web link description"),
url: zod.string().url().describe("The web link URL"),
});
/**
* Returns all test case versions for a test case with specified key. Response is ordered by most recent first.
* @summary Get versions
*/
export const listTestCaseVersionsPathTestCaseKeyRegExp = /(.+-T[0-9]+)/;
export const listTestCaseVersionsParams = zod.object({
testCaseKey: zod
.string()
.regex(listTestCaseVersionsPathTestCaseKeyRegExp)
.describe("The key of the test case. Test case keys are of the format [A-Z]+-T[0-9]+"),
});
export const listTestCaseVersionsQueryMaxResultsDefault = 10;
export const listTestCaseVersionsQueryStartAtDefault = 0;
export const listTestCaseVersionsQueryStartAtMin = 0;
export const listTestCaseVersionsQueryStartAtMax = 1000000;
export const listTestCaseVersionsQueryParams = zod.object({
maxResults: zod
.number()
.min(1)
.default(listTestCaseVersionsQueryMaxResultsDefault)
.describe("Specifies the maximum number of results to return in a single call. The default value is 10, and the maximum value that can be requested is 1000.\n\nNote that the server may enforce a lower limit than requested, depending on resource availability or other internal constraints. If this happens, the result set may be truncated. Always check the maxResults value in the response to confirm how many results were actually returned.\n"),
startAt: zod
.number()
.min(listTestCaseVersionsQueryStartAtMin)
.max(listTestCaseVersionsQueryStartAtMax)
.optional()
.describe("Zero-indexed starting position. Should be a multiple of maxResults."),
});
export const listTestCaseVersionsResponseStartAtMin = 0;
export const listTestCaseVersionsResponseTotalMin = 0;
export const listTestCaseVersionsResponse = zod
.object({
next: zod
.string()
.url()
.nullish()
.describe("URL to the next page of results, or null if there are no more results."),
startAt: zod
.number()
.min(listTestCaseVersionsResponseStartAtMin)
.describe("Indicates the index of the first item returned in the page of results."),
maxResults: zod
.number()
.min(1)
.describe("Indicates the maximum number of results in this response. Note that the server may enforce a lower limit than requested, depending on resource availability or other internal constraints."),
total: zod
.number()
.min(listTestCaseVersionsResponseTotalMin)
.optional()
.describe("Indicates the total number of items available across all pages."),
isLast: zod
.boolean()
.optional()
.describe("Indicates if this is the last page of results."),
})
.and(zod.object({
values: zod
.array(zod
.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})
.and(zod.object({
id: zod.number().min(1).optional(),
})))
.optional()
.describe("A list of versions for a test case"),
}));
/**
* Retrieves a specific version of a test case.
* @summary Get version
*/
export const getTestCaseVersionPathTestCaseKeyRegExp = /(.+-T[0-9]+)/;
export const getTestCaseVersionParams = zod.object({
testCaseKey: zod
.string()
.regex(getTestCaseVersionPathTestCaseKeyRegExp)
.describe("The key of the test case. Test case keys are of the format [A-Z]+-T[0-9]+"),
version: zod.number().describe("Version of the test case to retrieve."),
});
export const getTestCaseVersionResponseKeyRegExp = /.+-T[0-9]+/;
export const getTestCaseVersionResponseNameRegExp = /^(?!\\s*$).+/;
export const getTestCaseVersionResponseEstimatedTimeMin = 0;
export const getTestCaseVersionResponseOwnerAccountIdRegExp = /^[-:a-zA-Z0-9]{1,128}$/;
export const getTestCaseVersionResponse = zod.object({
id: zod.number().min(1),
key: zod
.string()
.regex(getTestCaseVersionResponseKeyRegExp)
.describe("The test case key"),
name: zod.string().regex(getTestCaseVersionResponseNameRegExp),
project: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.describe("ID and link relative to Zephyr project."),
createdOn: zod
.string()
.datetime({})
.optional()
.describe("Data and time test case was created. Format: yyyy-MM-dd'T'HH:mm:ss'Z'. This field is read-only, cannot be updated.\n"),
objective: zod.string().nullish().describe("A description of the objective."),
precondition: zod
.string()
.nullish()
.describe("Any conditions that need to be met."),
estimatedTime: zod
.number()
.min(getTestCaseVersionResponseEstimatedTimeMin)
.nullish()
.describe("Estimated duration in milliseconds."),
labels: zod
.array(zod.string())
.optional()
.describe("Array of labels associated to this entity."),
component: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.nullish(),
priority: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})),
status: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})),
folder: zod
.object({
id: zod.number().min(1),
})
.describe("The ID of the resource")
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
}))
.nullish(),
owner: zod
.object({
accountId: zod
.string()
.regex(getTestCaseVersionResponseOwnerAccountIdRegExp)
.nullable()
.describe("Atlassian Account ID of the Jira user."),
self: zod
.string()
.url()
.optional()
.describe("The Jira REST API endpoint to get the full representation of the Jira user."),
})
.nullish(),
testScript: zod
.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})
.optional(),
customFields: zod
.record(zod.string(), zod.unknown())
.optional()
.describe("Multi-line text fields support HTML and should denote new lines with the \\<br\\> tag.\nDates should be in the format 'yyyy-MM-dd'.\nUsers should have values of Jira User Account IDs.\n"),
links: zod
.object({
self: zod
.string()
.url()
.optional()
.describe("The REST API endpoint to get more resource details."),
})
.and(zod.object({
issues: zod
.array(zod
.object({
issueId: zod.number().min(1).describe("The Jira issue ID"),
})
.and(zod.object({
self: zod
.string()
.url()
.optional()
.describe("The Zephyr REST API endpoint relative to the link between the entity and the Jira issue."),
id: zod
.number()
.min(1)
.optional()
.describe("The ID that represents the link between the entity and the Jira issue."),
target: zod
.string()
.url()
.optional()
.describe("The Jira Cloud REST API endpoint to get the full representation of the issue"),
type: zod
.enum(["COVERAGE", "BLOCKS", "RELATED"])
.optional()
.describe("The link type"),
})))
.optional()
.describe("A list of Jira issues linked to this entity"),
webLinks: zod
.array(zod
.object({
description: zod
.string()
.optional()
.describe("The web lin