@rbaileysr/zephyr-managed-api 1.0.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 (56) hide show
  1. package/README.md +618 -0
  2. package/dist/error-strategy.d.ts +69 -0
  3. package/dist/error-strategy.d.ts.map +1 -0
  4. package/dist/error-strategy.js +125 -0
  5. package/dist/groups/All.d.ts +90 -0
  6. package/dist/groups/All.d.ts.map +1 -0
  7. package/dist/groups/All.js +236 -0
  8. package/dist/groups/Automation.d.ts +75 -0
  9. package/dist/groups/Automation.d.ts.map +1 -0
  10. package/dist/groups/Automation.js +133 -0
  11. package/dist/groups/Environment.d.ts +73 -0
  12. package/dist/groups/Environment.d.ts.map +1 -0
  13. package/dist/groups/Environment.js +93 -0
  14. package/dist/groups/Folder.d.ts +55 -0
  15. package/dist/groups/Folder.d.ts.map +1 -0
  16. package/dist/groups/Folder.js +68 -0
  17. package/dist/groups/IssueLink.d.ts +59 -0
  18. package/dist/groups/IssueLink.d.ts.map +1 -0
  19. package/dist/groups/IssueLink.js +70 -0
  20. package/dist/groups/Link.d.ts +23 -0
  21. package/dist/groups/Link.d.ts.map +1 -0
  22. package/dist/groups/Link.js +34 -0
  23. package/dist/groups/Priority.d.ts +77 -0
  24. package/dist/groups/Priority.d.ts.map +1 -0
  25. package/dist/groups/Priority.js +97 -0
  26. package/dist/groups/Project.d.ts +36 -0
  27. package/dist/groups/Project.d.ts.map +1 -0
  28. package/dist/groups/Project.js +42 -0
  29. package/dist/groups/Status.d.ts +82 -0
  30. package/dist/groups/Status.d.ts.map +1 -0
  31. package/dist/groups/Status.js +102 -0
  32. package/dist/groups/TestCase.d.ts +254 -0
  33. package/dist/groups/TestCase.d.ts.map +1 -0
  34. package/dist/groups/TestCase.js +327 -0
  35. package/dist/groups/TestCycle.d.ts +127 -0
  36. package/dist/groups/TestCycle.d.ts.map +1 -0
  37. package/dist/groups/TestCycle.js +166 -0
  38. package/dist/groups/TestExecution.d.ts +176 -0
  39. package/dist/groups/TestExecution.d.ts.map +1 -0
  40. package/dist/groups/TestExecution.js +239 -0
  41. package/dist/groups/TestPlan.d.ts +103 -0
  42. package/dist/groups/TestPlan.d.ts.map +1 -0
  43. package/dist/groups/TestPlan.js +137 -0
  44. package/dist/index.d.ts +119 -0
  45. package/dist/index.d.ts.map +1 -0
  46. package/dist/index.js +124 -0
  47. package/dist/types.d.ts +1353 -0
  48. package/dist/types.d.ts.map +1 -0
  49. package/dist/types.js +7 -0
  50. package/dist/utils-api-call.d.ts +22 -0
  51. package/dist/utils-api-call.d.ts.map +1 -0
  52. package/dist/utils-api-call.js +80 -0
  53. package/dist/utils.d.ts +144 -0
  54. package/dist/utils.d.ts.map +1 -0
  55. package/dist/utils.js +432 -0
  56. package/package.json +54 -0
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Priority API group
3
+ * Handles priority-related operations
4
+ */
5
+ import type { Priority, PriorityList, ListPrioritiesOptions, GetPriorityOptions, CreatePriorityRequest, UpdatePriorityRequest } from '../types';
6
+ import type { ZephyrApiConnection } from '../index';
7
+ export declare class PriorityGroup {
8
+ private api;
9
+ constructor(api: ZephyrApiConnection);
10
+ /**
11
+ * List all priorities
12
+ *
13
+ * Retrieves a paginated list of all priorities. Query parameters can be used to filter by project.
14
+ *
15
+ * @param options - Query parameters for filtering and pagination
16
+ * @param options.projectKey - Filter priorities by Jira project key
17
+ * @param options.maxResults - Maximum number of results to return (default: 10, max: 1000)
18
+ * @param options.startAt - Zero-indexed starting position (must be multiple of maxResults)
19
+ * @returns Paginated list of priorities with metadata (total, isLast, etc.)
20
+ *
21
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/listPriorities Official API Documentation}
22
+ */
23
+ listPriorities(options: ListPrioritiesOptions): Promise<PriorityList>;
24
+ /**
25
+ * Get a specific priority
26
+ *
27
+ * Retrieves detailed information about a specific priority by its ID.
28
+ *
29
+ * @param options - Get priority options
30
+ * @param options.priorityId - The priority ID
31
+ * @returns Priority object with all fields
32
+ *
33
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/getPriority Official API Documentation}
34
+ */
35
+ getPriority(options: GetPriorityOptions): Promise<Priority>;
36
+ /**
37
+ * Create a new priority
38
+ *
39
+ * Creates a new priority in the specified project. Required fields include projectKey, name, index, and default.
40
+ * Optional fields include description and color.
41
+ *
42
+ * @param request - Create priority request
43
+ * @param request.body - Priority data
44
+ * @param request.body.projectKey - Jira project key (required)
45
+ * @param request.body.name - Priority name (required)
46
+ * @param request.body.index - Display order index (required)
47
+ * @param request.body.default - Whether this is the default priority (required)
48
+ * @param request.body.description - Priority description (optional)
49
+ * @param request.body.color - Priority color (optional)
50
+ * @returns Created priority object
51
+ *
52
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/createPriority Official API Documentation}
53
+ */
54
+ createPriority(request: CreatePriorityRequest): Promise<Priority>;
55
+ /**
56
+ * Update a priority
57
+ *
58
+ * Updates an existing priority. For each non-specified field the value will be cleared.
59
+ * All fields from the existing priority must be included in the request.
60
+ *
61
+ * @param request - Update priority request
62
+ * @param request.priorityId - The priority ID to update
63
+ * @param request.body - Priority data to update (must include all existing fields)
64
+ * @param request.body.id - Priority ID (required)
65
+ * @param request.body.project - Project link (required)
66
+ * @param request.body.name - Priority name (required)
67
+ * @param request.body.index - Display order index (required)
68
+ * @param request.body.default - Whether this is the default priority (required)
69
+ * @param request.body.description - Priority description (optional)
70
+ * @param request.body.color - Priority color (optional)
71
+ * @returns Updated priority object
72
+ *
73
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/updatePriority Official API Documentation}
74
+ */
75
+ updatePriority(request: UpdatePriorityRequest): Promise<Priority>;
76
+ }
77
+ //# sourceMappingURL=Priority.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Priority.d.ts","sourceRoot":"","sources":["../../groups/Priority.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,QAAQ,EACR,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,qBAAa,aAAa;IACb,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,mBAAmB;IAE5C;;;;;;;;;;;;OAYG;IACG,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC;IAM3E;;;;;;;;;;OAUG;IACG,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAKjE;;;;;;;;;;;;;;;;;OAiBG;IACG,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC;IASvE;;;;;;;;;;;;;;;;;;;OAmBG;IACG,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAQvE"}
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Priority API group
3
+ * Handles priority-related operations
4
+ */
5
+ import { buildQueryString, parseResponse, buildRequestBody } from '../utils';
6
+ export class PriorityGroup {
7
+ constructor(api) {
8
+ this.api = api;
9
+ }
10
+ /**
11
+ * List all priorities
12
+ *
13
+ * Retrieves a paginated list of all priorities. Query parameters can be used to filter by project.
14
+ *
15
+ * @param options - Query parameters for filtering and pagination
16
+ * @param options.projectKey - Filter priorities by Jira project key
17
+ * @param options.maxResults - Maximum number of results to return (default: 10, max: 1000)
18
+ * @param options.startAt - Zero-indexed starting position (must be multiple of maxResults)
19
+ * @returns Paginated list of priorities with metadata (total, isLast, etc.)
20
+ *
21
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/listPriorities Official API Documentation}
22
+ */
23
+ async listPriorities(options) {
24
+ const queryString = buildQueryString(options);
25
+ const response = await this.api.fetch(`/priorities${queryString}`);
26
+ return parseResponse(response);
27
+ }
28
+ /**
29
+ * Get a specific priority
30
+ *
31
+ * Retrieves detailed information about a specific priority by its ID.
32
+ *
33
+ * @param options - Get priority options
34
+ * @param options.priorityId - The priority ID
35
+ * @returns Priority object with all fields
36
+ *
37
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/getPriority Official API Documentation}
38
+ */
39
+ async getPriority(options) {
40
+ const response = await this.api.fetch(`/priorities/${options.priorityId}`);
41
+ return parseResponse(response);
42
+ }
43
+ /**
44
+ * Create a new priority
45
+ *
46
+ * Creates a new priority in the specified project. Required fields include projectKey, name, index, and default.
47
+ * Optional fields include description and color.
48
+ *
49
+ * @param request - Create priority request
50
+ * @param request.body - Priority data
51
+ * @param request.body.projectKey - Jira project key (required)
52
+ * @param request.body.name - Priority name (required)
53
+ * @param request.body.index - Display order index (required)
54
+ * @param request.body.default - Whether this is the default priority (required)
55
+ * @param request.body.description - Priority description (optional)
56
+ * @param request.body.color - Priority color (optional)
57
+ * @returns Created priority object
58
+ *
59
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/createPriority Official API Documentation}
60
+ */
61
+ async createPriority(request) {
62
+ const response = await this.api.fetch('/priorities', {
63
+ method: 'POST',
64
+ headers: { 'Content-Type': 'application/json' },
65
+ body: buildRequestBody(request.body),
66
+ });
67
+ return parseResponse(response);
68
+ }
69
+ /**
70
+ * Update a priority
71
+ *
72
+ * Updates an existing priority. For each non-specified field the value will be cleared.
73
+ * All fields from the existing priority must be included in the request.
74
+ *
75
+ * @param request - Update priority request
76
+ * @param request.priorityId - The priority ID to update
77
+ * @param request.body - Priority data to update (must include all existing fields)
78
+ * @param request.body.id - Priority ID (required)
79
+ * @param request.body.project - Project link (required)
80
+ * @param request.body.name - Priority name (required)
81
+ * @param request.body.index - Display order index (required)
82
+ * @param request.body.default - Whether this is the default priority (required)
83
+ * @param request.body.description - Priority description (optional)
84
+ * @param request.body.color - Priority color (optional)
85
+ * @returns Updated priority object
86
+ *
87
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/updatePriority Official API Documentation}
88
+ */
89
+ async updatePriority(request) {
90
+ const response = await this.api.fetch(`/priorities/${request.priorityId}`, {
91
+ method: 'PUT',
92
+ headers: { 'Content-Type': 'application/json' },
93
+ body: buildRequestBody(request.body),
94
+ });
95
+ return parseResponse(response);
96
+ }
97
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Project API group
3
+ * Handles project-related operations (read-only)
4
+ */
5
+ import type { Project, ProjectList, ListProjectsOptions, GetProjectOptions } from '../types';
6
+ import type { ZephyrApiConnection } from '../index';
7
+ export declare class ProjectGroup {
8
+ private api;
9
+ constructor(api: ZephyrApiConnection);
10
+ /**
11
+ * List all projects
12
+ *
13
+ * Retrieves a paginated list of all projects accessible to the authenticated user.
14
+ *
15
+ * @param options - Optional query parameters for pagination
16
+ * @param options.maxResults - Maximum number of results to return (default: 10, max: 1000)
17
+ * @param options.startAt - Zero-indexed starting position (must be multiple of maxResults)
18
+ * @returns Paginated list of projects with metadata (total, isLast, etc.)
19
+ *
20
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/listProjects Official API Documentation}
21
+ */
22
+ listProjects(options?: ListProjectsOptions): Promise<ProjectList>;
23
+ /**
24
+ * Get a specific project
25
+ *
26
+ * Retrieves detailed information about a specific project by its ID or key.
27
+ *
28
+ * @param options - Get project options
29
+ * @param options.projectIdOrKey - The project ID or key
30
+ * @returns Project object with all fields
31
+ *
32
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/getProject Official API Documentation}
33
+ */
34
+ getProject(options: GetProjectOptions): Promise<Project>;
35
+ }
36
+ //# sourceMappingURL=Project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Project.d.ts","sourceRoot":"","sources":["../../groups/Project.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,qBAAa,YAAY;IACZ,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,mBAAmB;IAE5C;;;;;;;;;;;OAWG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC;IAMvE;;;;;;;;;;OAUG;IACG,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;CAI9D"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Project API group
3
+ * Handles project-related operations (read-only)
4
+ */
5
+ import { buildQueryString, parseResponse } from '../utils';
6
+ export class ProjectGroup {
7
+ constructor(api) {
8
+ this.api = api;
9
+ }
10
+ /**
11
+ * List all projects
12
+ *
13
+ * Retrieves a paginated list of all projects accessible to the authenticated user.
14
+ *
15
+ * @param options - Optional query parameters for pagination
16
+ * @param options.maxResults - Maximum number of results to return (default: 10, max: 1000)
17
+ * @param options.startAt - Zero-indexed starting position (must be multiple of maxResults)
18
+ * @returns Paginated list of projects with metadata (total, isLast, etc.)
19
+ *
20
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/listProjects Official API Documentation}
21
+ */
22
+ async listProjects(options) {
23
+ const queryString = buildQueryString(options);
24
+ const response = await this.api.fetch(`/projects${queryString}`);
25
+ return parseResponse(response);
26
+ }
27
+ /**
28
+ * Get a specific project
29
+ *
30
+ * Retrieves detailed information about a specific project by its ID or key.
31
+ *
32
+ * @param options - Get project options
33
+ * @param options.projectIdOrKey - The project ID or key
34
+ * @returns Project object with all fields
35
+ *
36
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/getProject Official API Documentation}
37
+ */
38
+ async getProject(options) {
39
+ const response = await this.api.fetch(`/projects/${options.projectIdOrKey}`);
40
+ return parseResponse(response);
41
+ }
42
+ }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Status API group
3
+ * Handles status-related operations
4
+ */
5
+ import type { Status, StatusList, ListStatusesOptions, GetStatusOptions, CreateStatusRequest, UpdateStatusRequest } from '../types';
6
+ import type { ZephyrApiConnection } from '../index';
7
+ export declare class StatusGroup {
8
+ private api;
9
+ constructor(api: ZephyrApiConnection);
10
+ /**
11
+ * List all statuses
12
+ *
13
+ * Retrieves a paginated list of all statuses. Query parameters can be used to filter by project and status type.
14
+ *
15
+ * @param options - Query parameters for filtering and pagination
16
+ * @param options.projectKey - Filter statuses by Jira project key
17
+ * @param options.statusType - Filter by status type: 'TEST_CASE', 'TEST_PLAN', 'TEST_CYCLE', or 'TEST_EXECUTION'
18
+ * @param options.maxResults - Maximum number of results to return (default: 10, max: 1000)
19
+ * @param options.startAt - Zero-indexed starting position (must be multiple of maxResults)
20
+ * @returns Paginated list of statuses with metadata (total, isLast, etc.)
21
+ *
22
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/listStatuses Official API Documentation}
23
+ */
24
+ listStatuses(options: ListStatusesOptions): Promise<StatusList>;
25
+ /**
26
+ * Get a specific status
27
+ *
28
+ * Retrieves detailed information about a specific status by its ID.
29
+ *
30
+ * @param options - Get status options
31
+ * @param options.statusId - The status ID
32
+ * @returns Status object with all fields
33
+ *
34
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/getStatus Official API Documentation}
35
+ */
36
+ getStatus(options: GetStatusOptions): Promise<Status>;
37
+ /**
38
+ * Create a new status
39
+ *
40
+ * Creates a new status in the specified project. Required fields include projectKey, name, statusType, index, default, and archived.
41
+ * Optional fields include description and color.
42
+ *
43
+ * @param request - Create status request
44
+ * @param request.body - Status data
45
+ * @param request.body.projectKey - Jira project key (required)
46
+ * @param request.body.name - Status name (required)
47
+ * @param request.body.statusType - Status type: 'TEST_CASE', 'TEST_PLAN', 'TEST_CYCLE', or 'TEST_EXECUTION' (required)
48
+ * @param request.body.index - Display order index (required)
49
+ * @param request.body.default - Whether this is the default status (required)
50
+ * @param request.body.archived - Whether this status is archived (required)
51
+ * @param request.body.description - Status description (optional)
52
+ * @param request.body.color - Status color (optional)
53
+ * @returns Created status object
54
+ *
55
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/createStatus Official API Documentation}
56
+ */
57
+ createStatus(request: CreateStatusRequest): Promise<Status>;
58
+ /**
59
+ * Update a status
60
+ *
61
+ * Updates an existing status. For each non-specified field the value will be cleared.
62
+ * All fields from the existing status must be included in the request.
63
+ *
64
+ * @param request - Update status request
65
+ * @param request.statusId - The status ID to update
66
+ * @param request.body - Status data to update (must include all existing fields)
67
+ * @param request.body.id - Status ID (required)
68
+ * @param request.body.project - Project link (required)
69
+ * @param request.body.name - Status name (required)
70
+ * @param request.body.statusType - Status type (required)
71
+ * @param request.body.index - Display order index (required)
72
+ * @param request.body.default - Whether this is the default status (required)
73
+ * @param request.body.archived - Whether this status is archived (required)
74
+ * @param request.body.description - Status description (optional)
75
+ * @param request.body.color - Status color (optional)
76
+ * @returns Updated status object
77
+ *
78
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/updateStatus Official API Documentation}
79
+ */
80
+ updateStatus(request: UpdateStatusRequest): Promise<Status>;
81
+ }
82
+ //# sourceMappingURL=Status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../groups/Status.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACX,MAAM,EACN,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,qBAAa,WAAW;IACX,OAAO,CAAC,GAAG;gBAAH,GAAG,EAAE,mBAAmB;IAE5C;;;;;;;;;;;;;OAaG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC;IAMrE;;;;;;;;;;OAUG;IACG,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;IAK3D;;;;;;;;;;;;;;;;;;;OAmBG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;IASjE;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;CAQjE"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Status API group
3
+ * Handles status-related operations
4
+ */
5
+ import { buildQueryString, parseResponse, buildRequestBody } from '../utils';
6
+ export class StatusGroup {
7
+ constructor(api) {
8
+ this.api = api;
9
+ }
10
+ /**
11
+ * List all statuses
12
+ *
13
+ * Retrieves a paginated list of all statuses. Query parameters can be used to filter by project and status type.
14
+ *
15
+ * @param options - Query parameters for filtering and pagination
16
+ * @param options.projectKey - Filter statuses by Jira project key
17
+ * @param options.statusType - Filter by status type: 'TEST_CASE', 'TEST_PLAN', 'TEST_CYCLE', or 'TEST_EXECUTION'
18
+ * @param options.maxResults - Maximum number of results to return (default: 10, max: 1000)
19
+ * @param options.startAt - Zero-indexed starting position (must be multiple of maxResults)
20
+ * @returns Paginated list of statuses with metadata (total, isLast, etc.)
21
+ *
22
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/listStatuses Official API Documentation}
23
+ */
24
+ async listStatuses(options) {
25
+ const queryString = buildQueryString(options);
26
+ const response = await this.api.fetch(`/statuses${queryString}`);
27
+ return parseResponse(response);
28
+ }
29
+ /**
30
+ * Get a specific status
31
+ *
32
+ * Retrieves detailed information about a specific status by its ID.
33
+ *
34
+ * @param options - Get status options
35
+ * @param options.statusId - The status ID
36
+ * @returns Status object with all fields
37
+ *
38
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/getStatus Official API Documentation}
39
+ */
40
+ async getStatus(options) {
41
+ const response = await this.api.fetch(`/statuses/${options.statusId}`);
42
+ return parseResponse(response);
43
+ }
44
+ /**
45
+ * Create a new status
46
+ *
47
+ * Creates a new status in the specified project. Required fields include projectKey, name, statusType, index, default, and archived.
48
+ * Optional fields include description and color.
49
+ *
50
+ * @param request - Create status request
51
+ * @param request.body - Status data
52
+ * @param request.body.projectKey - Jira project key (required)
53
+ * @param request.body.name - Status name (required)
54
+ * @param request.body.statusType - Status type: 'TEST_CASE', 'TEST_PLAN', 'TEST_CYCLE', or 'TEST_EXECUTION' (required)
55
+ * @param request.body.index - Display order index (required)
56
+ * @param request.body.default - Whether this is the default status (required)
57
+ * @param request.body.archived - Whether this status is archived (required)
58
+ * @param request.body.description - Status description (optional)
59
+ * @param request.body.color - Status color (optional)
60
+ * @returns Created status object
61
+ *
62
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/createStatus Official API Documentation}
63
+ */
64
+ async createStatus(request) {
65
+ const response = await this.api.fetch('/statuses', {
66
+ method: 'POST',
67
+ headers: { 'Content-Type': 'application/json' },
68
+ body: buildRequestBody(request.body),
69
+ });
70
+ return parseResponse(response);
71
+ }
72
+ /**
73
+ * Update a status
74
+ *
75
+ * Updates an existing status. For each non-specified field the value will be cleared.
76
+ * All fields from the existing status must be included in the request.
77
+ *
78
+ * @param request - Update status request
79
+ * @param request.statusId - The status ID to update
80
+ * @param request.body - Status data to update (must include all existing fields)
81
+ * @param request.body.id - Status ID (required)
82
+ * @param request.body.project - Project link (required)
83
+ * @param request.body.name - Status name (required)
84
+ * @param request.body.statusType - Status type (required)
85
+ * @param request.body.index - Display order index (required)
86
+ * @param request.body.default - Whether this is the default status (required)
87
+ * @param request.body.archived - Whether this status is archived (required)
88
+ * @param request.body.description - Status description (optional)
89
+ * @param request.body.color - Status color (optional)
90
+ * @returns Updated status object
91
+ *
92
+ * @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/v2/#operation/updateStatus Official API Documentation}
93
+ */
94
+ async updateStatus(request) {
95
+ const response = await this.api.fetch(`/statuses/${request.statusId}`, {
96
+ method: 'PUT',
97
+ headers: { 'Content-Type': 'application/json' },
98
+ body: buildRequestBody(request.body),
99
+ });
100
+ return parseResponse(response);
101
+ }
102
+ }