@rbaileysr/zephyr-managed-api 1.2.9 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -19
- package/dist/README.md +114 -19
- package/dist/groups/All.d.ts.map +1 -1
- package/dist/groups/Automation.d.ts +4 -4
- package/dist/groups/Automation.js +4 -4
- package/dist/groups/Environment.d.ts +4 -4
- package/dist/groups/Environment.js +4 -4
- package/dist/groups/Folder.d.ts +3 -3
- package/dist/groups/Folder.js +3 -3
- package/dist/groups/IssueLink.d.ts +4 -4
- package/dist/groups/IssueLink.js +4 -4
- package/dist/groups/Link.d.ts +1 -1
- package/dist/groups/Link.js +1 -1
- package/dist/groups/Priority.d.ts +4 -4
- package/dist/groups/Priority.js +4 -4
- package/dist/groups/Private/PrivateConfig.d.ts +35 -0
- package/dist/groups/Private/PrivateConfig.d.ts.map +1 -0
- package/dist/groups/Private/PrivateConfig.js +17 -0
- package/dist/groups/Private/PrivateDataSets.d.ts +67 -0
- package/dist/groups/Private/PrivateDataSets.d.ts.map +1 -0
- package/dist/groups/Private/PrivateDataSets.js +192 -0
- package/dist/groups/Private/PrivateIterations.d.ts +46 -0
- package/dist/groups/Private/PrivateIterations.d.ts.map +1 -0
- package/dist/groups/Private/PrivateIterations.js +127 -0
- package/dist/groups/Private/PrivateLabels.d.ts +46 -0
- package/dist/groups/Private/PrivateLabels.d.ts.map +1 -0
- package/dist/groups/Private/PrivateLabels.js +127 -0
- package/dist/groups/Private.d.ts +3 -3
- package/dist/groups/Private.d.ts.map +1 -1
- package/dist/groups/Private.js +2 -2
- package/dist/groups/Project.d.ts +2 -2
- package/dist/groups/Project.js +2 -2
- package/dist/groups/Status.d.ts +4 -4
- package/dist/groups/Status.js +4 -4
- package/dist/groups/TestCase.d.ts +14 -14
- package/dist/groups/TestCase.js +14 -14
- package/dist/groups/TestCycle.d.ts +7 -7
- package/dist/groups/TestCycle.js +7 -7
- package/dist/groups/TestExecution.d.ts +10 -10
- package/dist/groups/TestExecution.js +10 -10
- package/dist/groups/TestPlan.d.ts +6 -6
- package/dist/groups/TestPlan.js +6 -6
- package/dist/package.json +1 -1
- package/dist/types.d.ts +136 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/groups/Link.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare class LinkGroup {
|
|
|
19
19
|
* @param options.linkId - The link ID to delete
|
|
20
20
|
* @returns Promise that resolves when deletion is complete (or if link doesn't exist)
|
|
21
21
|
*
|
|
22
|
-
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/
|
|
22
|
+
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Links/operation/deleteLink Official API Documentation}
|
|
23
23
|
*/
|
|
24
24
|
deleteLink(options: DeleteLinkOptions): Promise<void>;
|
|
25
25
|
}
|
package/dist/groups/Link.js
CHANGED
|
@@ -15,7 +15,7 @@ export class LinkGroup {
|
|
|
15
15
|
* @param options.linkId - The link ID to delete
|
|
16
16
|
* @returns Promise that resolves when deletion is complete (or if link doesn't exist)
|
|
17
17
|
*
|
|
18
|
-
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/
|
|
18
|
+
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Links/operation/deleteLink Official API Documentation}
|
|
19
19
|
*/
|
|
20
20
|
async deleteLink(options) {
|
|
21
21
|
const response = await this.api.fetch(`/links/${options.linkId}`, {
|
|
@@ -21,7 +21,7 @@ export declare class PriorityGroup {
|
|
|
21
21
|
* @param options.startAt - Zero-indexed starting position (must be multiple of maxResults)
|
|
22
22
|
* @returns Paginated list of priorities with metadata (total, isLast, etc.)
|
|
23
23
|
*
|
|
24
|
-
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/
|
|
24
|
+
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/listPriorities Official API Documentation}
|
|
25
25
|
*/
|
|
26
26
|
listPriorities(options: ListPrioritiesOptions): Promise<PriorityList>;
|
|
27
27
|
/**
|
|
@@ -33,7 +33,7 @@ export declare class PriorityGroup {
|
|
|
33
33
|
* @param options.priorityId - The priority ID
|
|
34
34
|
* @returns Priority object with all fields
|
|
35
35
|
*
|
|
36
|
-
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/
|
|
36
|
+
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/getPriority Official API Documentation}
|
|
37
37
|
*/
|
|
38
38
|
getPriority(options: GetPriorityOptions): Promise<Priority>;
|
|
39
39
|
/**
|
|
@@ -52,7 +52,7 @@ export declare class PriorityGroup {
|
|
|
52
52
|
* @param request.body.color - Priority color (optional)
|
|
53
53
|
* @returns Created priority object
|
|
54
54
|
*
|
|
55
|
-
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/
|
|
55
|
+
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/createPriority Official API Documentation}
|
|
56
56
|
*/
|
|
57
57
|
createPriority(request: CreatePriorityRequest): Promise<Priority>;
|
|
58
58
|
/**
|
|
@@ -73,7 +73,7 @@ export declare class PriorityGroup {
|
|
|
73
73
|
* @param request.body.color - Priority color (optional)
|
|
74
74
|
* @returns Updated priority object
|
|
75
75
|
*
|
|
76
|
-
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/
|
|
76
|
+
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/updatePriority Official API Documentation}
|
|
77
77
|
*/
|
|
78
78
|
updatePriority(request: UpdatePriorityRequest): Promise<Priority>;
|
|
79
79
|
}
|
package/dist/groups/Priority.js
CHANGED
|
@@ -17,7 +17,7 @@ export class PriorityGroup {
|
|
|
17
17
|
* @param options.startAt - Zero-indexed starting position (must be multiple of maxResults)
|
|
18
18
|
* @returns Paginated list of priorities with metadata (total, isLast, etc.)
|
|
19
19
|
*
|
|
20
|
-
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/
|
|
20
|
+
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/listPriorities Official API Documentation}
|
|
21
21
|
*/
|
|
22
22
|
async listPriorities(options) {
|
|
23
23
|
const queryString = buildQueryString(options);
|
|
@@ -33,7 +33,7 @@ export class PriorityGroup {
|
|
|
33
33
|
* @param options.priorityId - The priority ID
|
|
34
34
|
* @returns Priority object with all fields
|
|
35
35
|
*
|
|
36
|
-
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/
|
|
36
|
+
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/getPriority Official API Documentation}
|
|
37
37
|
*/
|
|
38
38
|
async getPriority(options) {
|
|
39
39
|
const response = await this.api.fetch(`/priorities/${options.priorityId}`);
|
|
@@ -55,7 +55,7 @@ export class PriorityGroup {
|
|
|
55
55
|
* @param request.body.color - Priority color (optional)
|
|
56
56
|
* @returns Created priority object
|
|
57
57
|
*
|
|
58
|
-
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/
|
|
58
|
+
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/createPriority Official API Documentation}
|
|
59
59
|
*/
|
|
60
60
|
async createPriority(request) {
|
|
61
61
|
const response = await this.api.fetch('/priorities', {
|
|
@@ -83,7 +83,7 @@ export class PriorityGroup {
|
|
|
83
83
|
* @param request.body.color - Priority color (optional)
|
|
84
84
|
* @returns Updated priority object
|
|
85
85
|
*
|
|
86
|
-
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/
|
|
86
|
+
* @see {@link https://support.smartbear.com/zephyr-scale-cloud/api-docs/#tag/Priorities/operation/updatePriority Official API Documentation}
|
|
87
87
|
*/
|
|
88
88
|
async updatePriority(request) {
|
|
89
89
|
const response = await this.api.fetch(`/priorities/${request.priorityId}`, {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright Adaptavist 2025 (c) All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Private API Config sub-group
|
|
6
|
+
* Handles configuration-related operations: Custom Fields, Labels, Iterations, and DataSets
|
|
7
|
+
*
|
|
8
|
+
* ⚠️ WARNING: These methods use private APIs that are not officially supported.
|
|
9
|
+
*/
|
|
10
|
+
import type { ZephyrApiConnection } from '../../index';
|
|
11
|
+
import { PrivateBase } from './PrivateBase';
|
|
12
|
+
import { PrivateCustomFields } from './PrivateCustomFields';
|
|
13
|
+
import { PrivateLabels } from './PrivateLabels';
|
|
14
|
+
import { PrivateIterations } from './PrivateIterations';
|
|
15
|
+
import { PrivateDataSets } from './PrivateDataSets';
|
|
16
|
+
export declare class PrivateConfig extends PrivateBase {
|
|
17
|
+
/**
|
|
18
|
+
* CustomFields sub-group - Create and get custom fields
|
|
19
|
+
*/
|
|
20
|
+
readonly CustomFields: PrivateCustomFields;
|
|
21
|
+
/**
|
|
22
|
+
* Labels sub-group - Create and get labels
|
|
23
|
+
*/
|
|
24
|
+
readonly Labels: PrivateLabels;
|
|
25
|
+
/**
|
|
26
|
+
* Iterations sub-group - Create and get iterations
|
|
27
|
+
*/
|
|
28
|
+
readonly Iterations: PrivateIterations;
|
|
29
|
+
/**
|
|
30
|
+
* DataSets sub-group - Create, get, and update data sets
|
|
31
|
+
*/
|
|
32
|
+
readonly DataSets: PrivateDataSets;
|
|
33
|
+
constructor(apiConnection?: ZephyrApiConnection);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=PrivateConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrivateConfig.d.ts","sourceRoot":"","sources":["../../../groups/Private/PrivateConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,qBAAa,aAAc,SAAQ,WAAW;IAC7C;;OAEG;IACH,SAAgB,YAAY,EAAE,mBAAmB,CAAC;IAElD;;OAEG;IACH,SAAgB,MAAM,EAAE,aAAa,CAAC;IAEtC;;OAEG;IACH,SAAgB,UAAU,EAAE,iBAAiB,CAAC;IAE9C;;OAEG;IACH,SAAgB,QAAQ,EAAE,eAAe,CAAC;gBAE9B,aAAa,CAAC,EAAE,mBAAmB;CAO/C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright Adaptavist 2025 (c) All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
import { PrivateBase } from './PrivateBase';
|
|
5
|
+
import { PrivateCustomFields } from './PrivateCustomFields';
|
|
6
|
+
import { PrivateLabels } from './PrivateLabels';
|
|
7
|
+
import { PrivateIterations } from './PrivateIterations';
|
|
8
|
+
import { PrivateDataSets } from './PrivateDataSets';
|
|
9
|
+
export class PrivateConfig extends PrivateBase {
|
|
10
|
+
constructor(apiConnection) {
|
|
11
|
+
super(apiConnection);
|
|
12
|
+
this.CustomFields = new PrivateCustomFields(apiConnection);
|
|
13
|
+
this.Labels = new PrivateLabels(apiConnection);
|
|
14
|
+
this.Iterations = new PrivateIterations(apiConnection);
|
|
15
|
+
this.DataSets = new PrivateDataSets(apiConnection);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright Adaptavist 2025 (c) All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Private API DataSets sub-group
|
|
6
|
+
* Handles data set creation, retrieval, and updating
|
|
7
|
+
*
|
|
8
|
+
* ⚠️ WARNING: These methods use private APIs that are not officially supported.
|
|
9
|
+
*/
|
|
10
|
+
import type { PrivateApiCredentials, CreateDataSetRequest, CreateDataSetResponse, UpdateDataSetRequest, UpdateDataSetResponse, GetDataSetsRequest, PrivateDataSet } from '../../types';
|
|
11
|
+
import { PrivateBase } from './PrivateBase';
|
|
12
|
+
import type { ZephyrApiConnection } from '../../index';
|
|
13
|
+
export declare class PrivateDataSets extends PrivateBase {
|
|
14
|
+
constructor(apiConnection?: ZephyrApiConnection);
|
|
15
|
+
/**
|
|
16
|
+
* Get all data sets for a project using private API
|
|
17
|
+
*
|
|
18
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
19
|
+
* The endpoint may change or be removed at any time without notice.
|
|
20
|
+
*
|
|
21
|
+
* @param credentials - Private API credentials
|
|
22
|
+
* @param request - Get data sets request
|
|
23
|
+
* @returns Array of data sets
|
|
24
|
+
* @throws {BadRequestError} If the request is invalid
|
|
25
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
26
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
27
|
+
* @throws {ServerError} If the server returns an error
|
|
28
|
+
*/
|
|
29
|
+
getDataSets(credentials: PrivateApiCredentials, request: GetDataSetsRequest): Promise<PrivateDataSet[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Create a data set using private API
|
|
32
|
+
*
|
|
33
|
+
* Note: Data sets are created empty. Use updateDataSet to add items/options.
|
|
34
|
+
*
|
|
35
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
36
|
+
* The endpoint may change or be removed at any time without notice.
|
|
37
|
+
*
|
|
38
|
+
* @param credentials - Private API credentials
|
|
39
|
+
* @param request - Create data set request
|
|
40
|
+
* @returns Created data set response
|
|
41
|
+
* @throws {BadRequestError} If the request is invalid
|
|
42
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
43
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
44
|
+
* @throws {ServerError} If the server returns an error
|
|
45
|
+
*/
|
|
46
|
+
createDataSet(credentials: PrivateApiCredentials, request: CreateDataSetRequest): Promise<CreateDataSetResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Update a data set using private API
|
|
49
|
+
*
|
|
50
|
+
* Use this method to add items/options to an existing data set.
|
|
51
|
+
* The request should include all existing items plus any new items to add.
|
|
52
|
+
*
|
|
53
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
54
|
+
* The endpoint may change or be removed at any time without notice.
|
|
55
|
+
*
|
|
56
|
+
* @param credentials - Private API credentials
|
|
57
|
+
* @param dataSetId - Data set ID
|
|
58
|
+
* @param request - Update data set request
|
|
59
|
+
* @returns Updated data set response
|
|
60
|
+
* @throws {BadRequestError} If the request is invalid
|
|
61
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
62
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
63
|
+
* @throws {ServerError} If the server returns an error
|
|
64
|
+
*/
|
|
65
|
+
updateDataSet(credentials: PrivateApiCredentials, dataSetId: number, request: UpdateDataSetRequest): Promise<UpdateDataSetResponse>;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=PrivateDataSets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrivateDataSets.d.ts","sourceRoot":"","sources":["../../../groups/Private/PrivateDataSets.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AAEH,OAAO,KAAK,EACX,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAS5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,qBAAa,eAAgB,SAAQ,WAAW;gBACnC,aAAa,CAAC,EAAE,mBAAmB;IAI/C;;;;;;;;;;;;;OAaG;IACG,WAAW,CAAC,WAAW,EAAE,qBAAqB,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAsD7G;;;;;;;;;;;;;;;OAeG;IACG,aAAa,CAClB,WAAW,EAAE,qBAAqB,EAClC,OAAO,EAAE,oBAAoB,GAC3B,OAAO,CAAC,qBAAqB,CAAC;IAuDjC;;;;;;;;;;;;;;;;;OAiBG;IACG,aAAa,CAClB,WAAW,EAAE,qBAAqB,EAClC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,oBAAoB,GAC3B,OAAO,CAAC,qBAAqB,CAAC;CAsDjC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright Adaptavist 2025 (c) All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
import { PrivateBase } from './PrivateBase';
|
|
5
|
+
import { BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, ServerError, UnexpectedError, } from '../../utils';
|
|
6
|
+
export class PrivateDataSets extends PrivateBase {
|
|
7
|
+
constructor(apiConnection) {
|
|
8
|
+
super(apiConnection);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Get all data sets for a project using private API
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
14
|
+
* The endpoint may change or be removed at any time without notice.
|
|
15
|
+
*
|
|
16
|
+
* @param credentials - Private API credentials
|
|
17
|
+
* @param request - Get data sets request
|
|
18
|
+
* @returns Array of data sets
|
|
19
|
+
* @throws {BadRequestError} If the request is invalid
|
|
20
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
21
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
22
|
+
* @throws {ServerError} If the server returns an error
|
|
23
|
+
*/
|
|
24
|
+
async getDataSets(credentials, request) {
|
|
25
|
+
// Get Context JWT
|
|
26
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
27
|
+
const url = `${this.privateApiBaseUrl}/dataset?projectId=${request.projectId}`;
|
|
28
|
+
const headers = {
|
|
29
|
+
accept: 'application/json',
|
|
30
|
+
authorization: `JWT ${contextJwt}`,
|
|
31
|
+
'jira-project-id': String(request.projectId),
|
|
32
|
+
};
|
|
33
|
+
try {
|
|
34
|
+
const response = await fetch(url, {
|
|
35
|
+
method: 'GET',
|
|
36
|
+
headers,
|
|
37
|
+
});
|
|
38
|
+
if (!response.ok) {
|
|
39
|
+
if (response.status === 400) {
|
|
40
|
+
const errorText = await response.text().catch(() => 'Bad Request');
|
|
41
|
+
throw new BadRequestError(`Failed to get data sets: ${errorText}`, response.statusText);
|
|
42
|
+
}
|
|
43
|
+
if (response.status === 401) {
|
|
44
|
+
throw new UnauthorizedError('Authentication failed. Please check your credentials.');
|
|
45
|
+
}
|
|
46
|
+
if (response.status === 403) {
|
|
47
|
+
throw new ForbiddenError('You do not have permission to get data sets in this project.');
|
|
48
|
+
}
|
|
49
|
+
if (response.status === 404) {
|
|
50
|
+
throw new NotFoundError('Project not found.');
|
|
51
|
+
}
|
|
52
|
+
throw new ServerError(`Failed to get data sets. Status: ${response.status}`, response.status, response.statusText);
|
|
53
|
+
}
|
|
54
|
+
const dataSets = await response.json();
|
|
55
|
+
return dataSets;
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
if (error instanceof BadRequestError ||
|
|
59
|
+
error instanceof UnauthorizedError ||
|
|
60
|
+
error instanceof ForbiddenError ||
|
|
61
|
+
error instanceof NotFoundError ||
|
|
62
|
+
error instanceof ServerError) {
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
throw new UnexpectedError('Failed to get data sets due to an unexpected error', error);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create a data set using private API
|
|
70
|
+
*
|
|
71
|
+
* Note: Data sets are created empty. Use updateDataSet to add items/options.
|
|
72
|
+
*
|
|
73
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
74
|
+
* The endpoint may change or be removed at any time without notice.
|
|
75
|
+
*
|
|
76
|
+
* @param credentials - Private API credentials
|
|
77
|
+
* @param request - Create data set request
|
|
78
|
+
* @returns Created data set response
|
|
79
|
+
* @throws {BadRequestError} If the request is invalid
|
|
80
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
81
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
82
|
+
* @throws {ServerError} If the server returns an error
|
|
83
|
+
*/
|
|
84
|
+
async createDataSet(credentials, request) {
|
|
85
|
+
// Get Context JWT
|
|
86
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
87
|
+
const url = `${this.privateApiBaseUrl}/dataset`;
|
|
88
|
+
const headers = {
|
|
89
|
+
'Content-Type': 'application/json',
|
|
90
|
+
authorization: `JWT ${contextJwt}`,
|
|
91
|
+
'jira-project-id': String(request.projectId),
|
|
92
|
+
};
|
|
93
|
+
try {
|
|
94
|
+
const response = await fetch(url, {
|
|
95
|
+
method: 'POST',
|
|
96
|
+
headers,
|
|
97
|
+
body: JSON.stringify(request),
|
|
98
|
+
});
|
|
99
|
+
if (!response.ok) {
|
|
100
|
+
if (response.status === 400) {
|
|
101
|
+
const errorText = await response.text().catch(() => 'Bad Request');
|
|
102
|
+
throw new BadRequestError(`Failed to create data set: ${errorText}`, response.statusText);
|
|
103
|
+
}
|
|
104
|
+
if (response.status === 401) {
|
|
105
|
+
throw new UnauthorizedError('Authentication failed. Please check your credentials.');
|
|
106
|
+
}
|
|
107
|
+
if (response.status === 403) {
|
|
108
|
+
throw new ForbiddenError('You do not have permission to create data sets in this project.');
|
|
109
|
+
}
|
|
110
|
+
if (response.status === 404) {
|
|
111
|
+
throw new NotFoundError('Project not found.');
|
|
112
|
+
}
|
|
113
|
+
throw new ServerError(`Failed to create data set. Status: ${response.status}`, response.status, response.statusText);
|
|
114
|
+
}
|
|
115
|
+
const result = await response.json();
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
if (error instanceof BadRequestError ||
|
|
120
|
+
error instanceof UnauthorizedError ||
|
|
121
|
+
error instanceof ForbiddenError ||
|
|
122
|
+
error instanceof NotFoundError ||
|
|
123
|
+
error instanceof ServerError) {
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
throw new UnexpectedError('Failed to create data set due to an unexpected error', error);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Update a data set using private API
|
|
131
|
+
*
|
|
132
|
+
* Use this method to add items/options to an existing data set.
|
|
133
|
+
* The request should include all existing items plus any new items to add.
|
|
134
|
+
*
|
|
135
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
136
|
+
* The endpoint may change or be removed at any time without notice.
|
|
137
|
+
*
|
|
138
|
+
* @param credentials - Private API credentials
|
|
139
|
+
* @param dataSetId - Data set ID
|
|
140
|
+
* @param request - Update data set request
|
|
141
|
+
* @returns Updated data set response
|
|
142
|
+
* @throws {BadRequestError} If the request is invalid
|
|
143
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
144
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
145
|
+
* @throws {ServerError} If the server returns an error
|
|
146
|
+
*/
|
|
147
|
+
async updateDataSet(credentials, dataSetId, request) {
|
|
148
|
+
// Get Context JWT
|
|
149
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
150
|
+
const url = `${this.privateApiBaseUrl}/dataset/${dataSetId}`;
|
|
151
|
+
const headers = {
|
|
152
|
+
'Content-Type': 'application/json',
|
|
153
|
+
authorization: `JWT ${contextJwt}`,
|
|
154
|
+
'jira-project-id': String(request.projectId),
|
|
155
|
+
};
|
|
156
|
+
try {
|
|
157
|
+
const response = await fetch(url, {
|
|
158
|
+
method: 'PUT',
|
|
159
|
+
headers,
|
|
160
|
+
body: JSON.stringify(request),
|
|
161
|
+
});
|
|
162
|
+
if (!response.ok) {
|
|
163
|
+
if (response.status === 400) {
|
|
164
|
+
const errorText = await response.text().catch(() => 'Bad Request');
|
|
165
|
+
throw new BadRequestError(`Failed to update data set: ${errorText}`, response.statusText);
|
|
166
|
+
}
|
|
167
|
+
if (response.status === 401) {
|
|
168
|
+
throw new UnauthorizedError('Authentication failed. Please check your credentials.');
|
|
169
|
+
}
|
|
170
|
+
if (response.status === 403) {
|
|
171
|
+
throw new ForbiddenError('You do not have permission to update data sets in this project.');
|
|
172
|
+
}
|
|
173
|
+
if (response.status === 404) {
|
|
174
|
+
throw new NotFoundError('Data set not found.');
|
|
175
|
+
}
|
|
176
|
+
throw new ServerError(`Failed to update data set. Status: ${response.status}`, response.status, response.statusText);
|
|
177
|
+
}
|
|
178
|
+
const result = await response.json();
|
|
179
|
+
return result;
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
if (error instanceof BadRequestError ||
|
|
183
|
+
error instanceof UnauthorizedError ||
|
|
184
|
+
error instanceof ForbiddenError ||
|
|
185
|
+
error instanceof NotFoundError ||
|
|
186
|
+
error instanceof ServerError) {
|
|
187
|
+
throw error;
|
|
188
|
+
}
|
|
189
|
+
throw new UnexpectedError('Failed to update data set due to an unexpected error', error);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright Adaptavist 2025 (c) All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Private API Iterations sub-group
|
|
6
|
+
* Handles iteration creation and retrieval
|
|
7
|
+
*
|
|
8
|
+
* ⚠️ WARNING: These methods use private APIs that are not officially supported.
|
|
9
|
+
*/
|
|
10
|
+
import type { PrivateApiCredentials, CreateIterationRequest, CreateIterationResponse, GetIterationsRequest, PrivateIteration } from '../../types';
|
|
11
|
+
import { PrivateBase } from './PrivateBase';
|
|
12
|
+
import type { ZephyrApiConnection } from '../../index';
|
|
13
|
+
export declare class PrivateIterations extends PrivateBase {
|
|
14
|
+
constructor(apiConnection?: ZephyrApiConnection);
|
|
15
|
+
/**
|
|
16
|
+
* Get all iterations for a project using private API
|
|
17
|
+
*
|
|
18
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
19
|
+
* The endpoint may change or be removed at any time without notice.
|
|
20
|
+
*
|
|
21
|
+
* @param credentials - Private API credentials
|
|
22
|
+
* @param request - Get iterations request
|
|
23
|
+
* @returns Array of iterations
|
|
24
|
+
* @throws {BadRequestError} If the request is invalid
|
|
25
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
26
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
27
|
+
* @throws {ServerError} If the server returns an error
|
|
28
|
+
*/
|
|
29
|
+
getIterations(credentials: PrivateApiCredentials, request: GetIterationsRequest): Promise<PrivateIteration[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Create an iteration using private API
|
|
32
|
+
*
|
|
33
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
34
|
+
* The endpoint may change or be removed at any time without notice.
|
|
35
|
+
*
|
|
36
|
+
* @param credentials - Private API credentials
|
|
37
|
+
* @param request - Create iteration request
|
|
38
|
+
* @returns Created iteration response with ID
|
|
39
|
+
* @throws {BadRequestError} If the request is invalid
|
|
40
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
41
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
42
|
+
* @throws {ServerError} If the server returns an error
|
|
43
|
+
*/
|
|
44
|
+
createIteration(credentials: PrivateApiCredentials, request: CreateIterationRequest): Promise<CreateIterationResponse>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=PrivateIterations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrivateIterations.d.ts","sourceRoot":"","sources":["../../../groups/Private/PrivateIterations.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AAEH,OAAO,KAAK,EACX,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAS5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,qBAAa,iBAAkB,SAAQ,WAAW;gBACrC,aAAa,CAAC,EAAE,mBAAmB;IAI/C;;;;;;;;;;;;;OAaG;IACG,aAAa,CAAC,WAAW,EAAE,qBAAqB,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAsDnH;;;;;;;;;;;;;OAaG;IACG,eAAe,CACpB,WAAW,EAAE,qBAAqB,EAClC,OAAO,EAAE,sBAAsB,GAC7B,OAAO,CAAC,uBAAuB,CAAC;CAsDnC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright Adaptavist 2025 (c) All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
import { PrivateBase } from './PrivateBase';
|
|
5
|
+
import { BadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, ServerError, UnexpectedError, } from '../../utils';
|
|
6
|
+
export class PrivateIterations extends PrivateBase {
|
|
7
|
+
constructor(apiConnection) {
|
|
8
|
+
super(apiConnection);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Get all iterations for a project using private API
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
14
|
+
* The endpoint may change or be removed at any time without notice.
|
|
15
|
+
*
|
|
16
|
+
* @param credentials - Private API credentials
|
|
17
|
+
* @param request - Get iterations request
|
|
18
|
+
* @returns Array of iterations
|
|
19
|
+
* @throws {BadRequestError} If the request is invalid
|
|
20
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
21
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
22
|
+
* @throws {ServerError} If the server returns an error
|
|
23
|
+
*/
|
|
24
|
+
async getIterations(credentials, request) {
|
|
25
|
+
// Get Context JWT
|
|
26
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
27
|
+
const url = `${this.privateApiBaseUrl}/iteration?projectId=${request.projectId}`;
|
|
28
|
+
const headers = {
|
|
29
|
+
accept: 'application/json',
|
|
30
|
+
authorization: `JWT ${contextJwt}`,
|
|
31
|
+
'jira-project-id': String(request.projectId),
|
|
32
|
+
};
|
|
33
|
+
try {
|
|
34
|
+
const response = await fetch(url, {
|
|
35
|
+
method: 'GET',
|
|
36
|
+
headers,
|
|
37
|
+
});
|
|
38
|
+
if (!response.ok) {
|
|
39
|
+
if (response.status === 400) {
|
|
40
|
+
const errorText = await response.text().catch(() => 'Bad Request');
|
|
41
|
+
throw new BadRequestError(`Failed to get iterations: ${errorText}`, response.statusText);
|
|
42
|
+
}
|
|
43
|
+
if (response.status === 401) {
|
|
44
|
+
throw new UnauthorizedError('Authentication failed. Please check your credentials.');
|
|
45
|
+
}
|
|
46
|
+
if (response.status === 403) {
|
|
47
|
+
throw new ForbiddenError('You do not have permission to get iterations in this project.');
|
|
48
|
+
}
|
|
49
|
+
if (response.status === 404) {
|
|
50
|
+
throw new NotFoundError('Project not found.');
|
|
51
|
+
}
|
|
52
|
+
throw new ServerError(`Failed to get iterations. Status: ${response.status}`, response.status, response.statusText);
|
|
53
|
+
}
|
|
54
|
+
const iterations = await response.json();
|
|
55
|
+
return iterations;
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
if (error instanceof BadRequestError ||
|
|
59
|
+
error instanceof UnauthorizedError ||
|
|
60
|
+
error instanceof ForbiddenError ||
|
|
61
|
+
error instanceof NotFoundError ||
|
|
62
|
+
error instanceof ServerError) {
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
throw new UnexpectedError('Failed to get iterations due to an unexpected error', error);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create an iteration using private API
|
|
70
|
+
*
|
|
71
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
72
|
+
* The endpoint may change or be removed at any time without notice.
|
|
73
|
+
*
|
|
74
|
+
* @param credentials - Private API credentials
|
|
75
|
+
* @param request - Create iteration request
|
|
76
|
+
* @returns Created iteration response with ID
|
|
77
|
+
* @throws {BadRequestError} If the request is invalid
|
|
78
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
79
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
80
|
+
* @throws {ServerError} If the server returns an error
|
|
81
|
+
*/
|
|
82
|
+
async createIteration(credentials, request) {
|
|
83
|
+
// Get Context JWT
|
|
84
|
+
const contextJwt = await this.getContextJwt(credentials);
|
|
85
|
+
const url = `${this.privateApiBaseUrl}/iteration`;
|
|
86
|
+
const headers = {
|
|
87
|
+
'Content-Type': 'application/json',
|
|
88
|
+
authorization: `JWT ${contextJwt}`,
|
|
89
|
+
'jira-project-id': String(request.projectId),
|
|
90
|
+
};
|
|
91
|
+
try {
|
|
92
|
+
const response = await fetch(url, {
|
|
93
|
+
method: 'POST',
|
|
94
|
+
headers,
|
|
95
|
+
body: JSON.stringify(request),
|
|
96
|
+
});
|
|
97
|
+
if (!response.ok) {
|
|
98
|
+
if (response.status === 400) {
|
|
99
|
+
const errorText = await response.text().catch(() => 'Bad Request');
|
|
100
|
+
throw new BadRequestError(`Failed to create iteration: ${errorText}`, response.statusText);
|
|
101
|
+
}
|
|
102
|
+
if (response.status === 401) {
|
|
103
|
+
throw new UnauthorizedError('Authentication failed. Please check your credentials.');
|
|
104
|
+
}
|
|
105
|
+
if (response.status === 403) {
|
|
106
|
+
throw new ForbiddenError('You do not have permission to create iterations in this project.');
|
|
107
|
+
}
|
|
108
|
+
if (response.status === 404) {
|
|
109
|
+
throw new NotFoundError('Project not found.');
|
|
110
|
+
}
|
|
111
|
+
throw new ServerError(`Failed to create iteration. Status: ${response.status}`, response.status, response.statusText);
|
|
112
|
+
}
|
|
113
|
+
const result = await response.json();
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
if (error instanceof BadRequestError ||
|
|
118
|
+
error instanceof UnauthorizedError ||
|
|
119
|
+
error instanceof ForbiddenError ||
|
|
120
|
+
error instanceof NotFoundError ||
|
|
121
|
+
error instanceof ServerError) {
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
throw new UnexpectedError('Failed to create iteration due to an unexpected error', error);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright Adaptavist 2025 (c) All rights reserved
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Private API Labels sub-group
|
|
6
|
+
* Handles label creation and retrieval
|
|
7
|
+
*
|
|
8
|
+
* ⚠️ WARNING: These methods use private APIs that are not officially supported.
|
|
9
|
+
*/
|
|
10
|
+
import type { PrivateApiCredentials, CreateLabelRequest, GetLabelsRequest, PrivateLabel } from '../../types';
|
|
11
|
+
import { PrivateBase } from './PrivateBase';
|
|
12
|
+
import type { ZephyrApiConnection } from '../../index';
|
|
13
|
+
export declare class PrivateLabels extends PrivateBase {
|
|
14
|
+
constructor(apiConnection?: ZephyrApiConnection);
|
|
15
|
+
/**
|
|
16
|
+
* Get all labels for a project using private API
|
|
17
|
+
*
|
|
18
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
19
|
+
* The endpoint may change or be removed at any time without notice.
|
|
20
|
+
*
|
|
21
|
+
* @param credentials - Private API credentials
|
|
22
|
+
* @param request - Get labels request
|
|
23
|
+
* @returns Array of labels
|
|
24
|
+
* @throws {BadRequestError} If the request is invalid
|
|
25
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
26
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
27
|
+
* @throws {ServerError} If the server returns an error
|
|
28
|
+
*/
|
|
29
|
+
getLabels(credentials: PrivateApiCredentials, request: GetLabelsRequest): Promise<PrivateLabel[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Create a label using private API
|
|
32
|
+
*
|
|
33
|
+
* ⚠️ WARNING: This uses a private Zephyr API endpoint that is not officially supported.
|
|
34
|
+
* The endpoint may change or be removed at any time without notice.
|
|
35
|
+
*
|
|
36
|
+
* @param credentials - Private API credentials
|
|
37
|
+
* @param request - Create label request
|
|
38
|
+
* @returns Empty response (no content)
|
|
39
|
+
* @throws {BadRequestError} If the request is invalid
|
|
40
|
+
* @throws {UnauthorizedError} If authentication fails
|
|
41
|
+
* @throws {ForbiddenError} If the user doesn't have permission
|
|
42
|
+
* @throws {ServerError} If the server returns an error
|
|
43
|
+
*/
|
|
44
|
+
createLabel(credentials: PrivateApiCredentials, request: CreateLabelRequest): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=PrivateLabels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrivateLabels.d.ts","sourceRoot":"","sources":["../../../groups/Private/PrivateLabels.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AAEH,OAAO,KAAK,EACX,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAS5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,qBAAa,aAAc,SAAQ,WAAW;gBACjC,aAAa,CAAC,EAAE,mBAAmB;IAI/C;;;;;;;;;;;;;OAaG;IACG,SAAS,CAAC,WAAW,EAAE,qBAAqB,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAsDvG;;;;;;;;;;;;;OAaG;IACG,WAAW,CAAC,WAAW,EAAE,qBAAqB,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAsDjG"}
|