Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions src/api/Releases/Comments.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { BaseResource } from "../BaseResource";
import { Configuration } from "../../Configuration";
import {
ReleaseComment,
CreateReleaseComment,
UpdateReleaseComment,
ListReleaseCommentsParams,
} from "../../models/ReleaseComment";
import { PaginatedResponse } from "../../models/common";

/**
* Release Comments API resource
* Handles comments on a specific release.
*/
export class Comments extends BaseResource {
constructor(config: Configuration) {
super(config);
}

/**
* Create a comment on a release
*/
async create(
workspaceSlug: string,
releaseId: string,
createReleaseComment: CreateReleaseComment
): Promise<ReleaseComment> {
return this.post<ReleaseComment>(
`/workspaces/${workspaceSlug}/releases/${releaseId}/comments/`,
createReleaseComment
);
}

/**
* Retrieve a release comment by ID
*/
async retrieve(workspaceSlug: string, releaseId: string, commentId: string): Promise<ReleaseComment> {
return this.get<ReleaseComment>(`/workspaces/${workspaceSlug}/releases/${releaseId}/comments/${commentId}/`);
}

/**
* Update a release comment
*/
async update(
workspaceSlug: string,
releaseId: string,
commentId: string,
updateReleaseComment: UpdateReleaseComment
): Promise<ReleaseComment> {
return this.patch<ReleaseComment>(
`/workspaces/${workspaceSlug}/releases/${releaseId}/comments/${commentId}/`,
updateReleaseComment
);
}

/**
* Delete a release comment
*/
async delete(workspaceSlug: string, releaseId: string, commentId: string): Promise<void> {
return this.httpDelete(`/workspaces/${workspaceSlug}/releases/${releaseId}/comments/${commentId}/`);
}

/**
* List comments on a release
*/
async list(
workspaceSlug: string,
releaseId: string,
params?: ListReleaseCommentsParams
): Promise<PaginatedResponse<ReleaseComment>> {
return this.get<PaginatedResponse<ReleaseComment>>(
`/workspaces/${workspaceSlug}/releases/${releaseId}/comments/`,
params
);
}
}
98 changes: 98 additions & 0 deletions src/api/Releases/Labels.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import { BaseResource } from "../BaseResource";
import { Configuration } from "../../Configuration";
import {
ReleaseLabel,
CreateReleaseLabel,
UpdateReleaseLabel,
ListReleaseLabelsParams,
} from "../../models/ReleaseLabel";
import { PaginatedResponse } from "../../models/common";
import { AddReleaseLabelsRequest, RemoveReleaseLabelsRequest } from "../../models/Release";

/**
* Release Labels API resource
* Handles workspace-level release label CRUD and the label relationships on a release.
*/
export class Labels extends BaseResource {
constructor(config: Configuration) {
super(config);
}

/**
* Create a new release label
*/
async create(workspaceSlug: string, createReleaseLabel: CreateReleaseLabel): Promise<ReleaseLabel> {
return this.post<ReleaseLabel>(`/workspaces/${workspaceSlug}/releases/labels/`, createReleaseLabel);
}

/**
* Retrieve a release label by ID
*/
async retrieve(workspaceSlug: string, releaseLabelId: string): Promise<ReleaseLabel> {
return this.get<ReleaseLabel>(`/workspaces/${workspaceSlug}/releases/labels/${releaseLabelId}/`);
}

/**
* Update a release label
*/
async update(
workspaceSlug: string,
releaseLabelId: string,
updateReleaseLabel: UpdateReleaseLabel
): Promise<ReleaseLabel> {
return this.patch<ReleaseLabel>(
`/workspaces/${workspaceSlug}/releases/labels/${releaseLabelId}/`,
updateReleaseLabel
);
}

/**
* Delete a release label
*/
async delete(workspaceSlug: string, releaseLabelId: string): Promise<void> {
return this.httpDelete(`/workspaces/${workspaceSlug}/releases/labels/${releaseLabelId}/`);
}

/**
* List release labels with optional filtering
*/
async list(workspaceSlug: string, params?: ListReleaseLabelsParams): Promise<PaginatedResponse<ReleaseLabel>> {
return this.get<PaginatedResponse<ReleaseLabel>>(`/workspaces/${workspaceSlug}/releases/labels/`, params);
}

/**
* Add labels to a release
*/
async addLabels(
workspaceSlug: string,
releaseId: string,
addLabels: AddReleaseLabelsRequest
): Promise<ReleaseLabel[]> {
return this.post<ReleaseLabel[]>(`/workspaces/${workspaceSlug}/releases/${releaseId}/labels/`, addLabels);
}

/**
* Remove labels from a release
*/
async removeLabels(
workspaceSlug: string,
releaseId: string,
removeLabels: RemoveReleaseLabelsRequest
): Promise<void> {
return this.httpDelete(`/workspaces/${workspaceSlug}/releases/${releaseId}/labels/`, removeLabels);
}

/**
* Get labels associated with a release
*/
async listLabels(
workspaceSlug: string,
releaseId: string,
params?: ListReleaseLabelsParams
): Promise<PaginatedResponse<ReleaseLabel>> {
return this.get<PaginatedResponse<ReleaseLabel>>(
`/workspaces/${workspaceSlug}/releases/${releaseId}/labels/`,
params
);
}
}
64 changes: 64 additions & 0 deletions src/api/Releases/Links.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { BaseResource } from "../BaseResource";
import { Configuration } from "../../Configuration";
import { ReleaseLink, CreateReleaseLink, UpdateReleaseLink, ListReleaseLinksParams } from "../../models/ReleaseLink";
import { PaginatedResponse } from "../../models/common";

/**
* Release Links API resource
* Handles external links attached to a specific release.
*/
export class Links extends BaseResource {
constructor(config: Configuration) {
super(config);
}

/**
* Create a link on a release
*/
async create(workspaceSlug: string, releaseId: string, createReleaseLink: CreateReleaseLink): Promise<ReleaseLink> {
return this.post<ReleaseLink>(`/workspaces/${workspaceSlug}/releases/${releaseId}/links/`, createReleaseLink);
}

/**
* Retrieve a release link by ID
*/
async retrieve(workspaceSlug: string, releaseId: string, linkId: string): Promise<ReleaseLink> {
return this.get<ReleaseLink>(`/workspaces/${workspaceSlug}/releases/${releaseId}/links/${linkId}/`);
}

/**
* Update a release link
*/
async update(
workspaceSlug: string,
releaseId: string,
linkId: string,
updateReleaseLink: UpdateReleaseLink
): Promise<ReleaseLink> {
return this.patch<ReleaseLink>(
`/workspaces/${workspaceSlug}/releases/${releaseId}/links/${linkId}/`,
updateReleaseLink
);
}

/**
* Delete a release link
*/
async delete(workspaceSlug: string, releaseId: string, linkId: string): Promise<void> {
return this.httpDelete(`/workspaces/${workspaceSlug}/releases/${releaseId}/links/${linkId}/`);
}

/**
* List links on a release
*/
async list(
workspaceSlug: string,
releaseId: string,
params?: ListReleaseLinksParams
): Promise<PaginatedResponse<ReleaseLink>> {
return this.get<PaginatedResponse<ReleaseLink>>(
`/workspaces/${workspaceSlug}/releases/${releaseId}/links/`,
params
);
}
}
49 changes: 49 additions & 0 deletions src/api/Releases/Tags.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { BaseResource } from "../BaseResource";
import { Configuration } from "../../Configuration";
import { ReleaseTag, CreateReleaseTag, UpdateReleaseTag, ListReleaseTagsParams } from "../../models/ReleaseTag";
import { PaginatedResponse } from "../../models/common";

/**
* Release Tags API resource
* Handles workspace-level release tag (version identifier) CRUD.
*/
export class Tags extends BaseResource {
constructor(config: Configuration) {
super(config);
}

/**
* Create a new release tag
*/
async create(workspaceSlug: string, createReleaseTag: CreateReleaseTag): Promise<ReleaseTag> {
return this.post<ReleaseTag>(`/workspaces/${workspaceSlug}/releases/tags/`, createReleaseTag);
}

/**
* Retrieve a release tag by ID
*/
async retrieve(workspaceSlug: string, releaseTagId: string): Promise<ReleaseTag> {
return this.get<ReleaseTag>(`/workspaces/${workspaceSlug}/releases/tags/${releaseTagId}/`);
}

/**
* Update a release tag
*/
async update(workspaceSlug: string, releaseTagId: string, updateReleaseTag: UpdateReleaseTag): Promise<ReleaseTag> {
return this.patch<ReleaseTag>(`/workspaces/${workspaceSlug}/releases/tags/${releaseTagId}/`, updateReleaseTag);
}

/**
* Delete a release tag
*/
async delete(workspaceSlug: string, releaseTagId: string): Promise<void> {
return this.httpDelete(`/workspaces/${workspaceSlug}/releases/tags/${releaseTagId}/`);
}

/**
* List release tags with optional filtering
*/
async list(workspaceSlug: string, params?: ListReleaseTagsParams): Promise<PaginatedResponse<ReleaseTag>> {
return this.get<PaginatedResponse<ReleaseTag>>(`/workspaces/${workspaceSlug}/releases/tags/`, params);
}
}
59 changes: 59 additions & 0 deletions src/api/Releases/WorkItems.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { BaseResource } from "../BaseResource";
import { Configuration } from "../../Configuration";
import {
ReleaseWorkItem,
AddReleaseWorkItemsRequest,
RemoveReleaseWorkItemsRequest,
AddReleaseWorkItemsResponse,
} from "../../models/Release";
import { PaginatedResponse } from "../../models/common";

/**
* Release Work Items API resource
* Handles the work item relationships on a release. Work items can be pulled in
* from multiple projects across the workspace.
*/
export class WorkItems extends BaseResource {
constructor(config: Configuration) {
super(config);
}

/**
* List work items in a release
*/
async list(
workspaceSlug: string,
releaseId: string,
params?: { per_page?: number; cursor?: string; [key: string]: any }
): Promise<PaginatedResponse<ReleaseWorkItem>> {
return this.get<PaginatedResponse<ReleaseWorkItem>>(
`/workspaces/${workspaceSlug}/releases/${releaseId}/work-items/`,
params
);
}

/**
* Add work items to a release
*/
async add(
workspaceSlug: string,
releaseId: string,
addWorkItems: AddReleaseWorkItemsRequest
): Promise<AddReleaseWorkItemsResponse> {
return this.post<AddReleaseWorkItemsResponse>(
`/workspaces/${workspaceSlug}/releases/${releaseId}/work-items/`,
addWorkItems
);
}

/**
* Remove work items from a release
*/
async remove(
workspaceSlug: string,
releaseId: string,
removeWorkItems: RemoveReleaseWorkItemsRequest
): Promise<void> {
return this.httpDelete(`/workspaces/${workspaceSlug}/releases/${releaseId}/work-items/`, removeWorkItems);
}
}
Loading