diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ec8cd11c..dd4e57872 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Jira.js changelog +### 4.0.0 + ### 3.0.5 - Dependencies updated diff --git a/src/agile/backlog.ts b/src/agile/backlog.ts index cbd1d0101..d59623203 100644 --- a/src/agile/backlog.ts +++ b/src/agile/backlog.ts @@ -1,21 +1,19 @@ import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class Backlog { constructor(private client: Client) {} /** - * Move issues to the backlog. - * + * Move issues to the backlog.\ * This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may * be moved at once. */ async moveIssuesToBacklog(parameters: Parameters.MoveIssuesToBacklog, callback: Callback): Promise; /** - * Move issues to the backlog. - * + * Move issues to the backlog.\ * This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may * be moved at once. */ @@ -36,18 +34,20 @@ export class Backlog { } /** - * Move issues to the backlog of a particular board (if they are already on that board). This operation is equivalent - * to remove future and active sprints from a given set of issues if the board has sprints If the board does not have - * sprints this will put the issues back into the backlog from the board. At most 50 issues may be moved at once. + * Move issues to the backlog of a particular board (if they are already on that board).\ + * This operation is equivalent to remove future and active sprints from a given set of issues if the board has + * sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most + * 50 issues may be moved at once. */ async moveIssuesToBacklogForBoard( parameters: Parameters.MoveIssuesToBacklogForBoard, callback: Callback, ): Promise; /** - * Move issues to the backlog of a particular board (if they are already on that board). This operation is equivalent - * to remove future and active sprints from a given set of issues if the board has sprints If the board does not have - * sprints this will put the issues back into the backlog from the board. At most 50 issues may be moved at once. + * Move issues to the backlog of a particular board (if they are already on that board).\ + * This operation is equivalent to remove future and active sprints from a given set of issues if the board has + * sprints If the board does not have sprints this will put the issues back into the backlog from the board. At most + * 50 issues may be moved at once. */ async moveIssuesToBacklogForBoard( parameters: Parameters.MoveIssuesToBacklogForBoard, @@ -62,8 +62,8 @@ export class Backlog { method: 'POST', data: { issues: parameters.issues, - rankBeforeIssue: parameters.rankBeforeIssue, rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, rankCustomFieldId: parameters.rankCustomFieldId, }, }; diff --git a/src/agile/board.ts b/src/agile/board.ts index 5c224d210..e6dbd3a39 100644 --- a/src/agile/board.ts +++ b/src/agile/board.ts @@ -1,19 +1,31 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { Paginated } from '../paginated'; import { RequestConfig } from '../requestConfig'; export class Board { constructor(private client: Client) {} - /** Returns all boards. This only includes boards that the user has permission to view. */ + /** + * Returns all boards. This only includes boards that the user has permission to view. + * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on February 15, 2024. + * + * - `read:board-scope:jira-software`, `read:project:jira` + */ async getAllBoards( parameters: Parameters.GetAllBoards | undefined, callback: Callback, ): Promise; - /** Returns all boards. This only includes boards that the user has permission to view. */ + /** + * Returns all boards. This only includes boards that the user has permission to view. + * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on February 15, 2024. + * + * - `read:board-scope:jira-software`, `read:project:jira` + */ async getAllBoards(parameters?: Parameters.GetAllBoards, callback?: never): Promise; async getAllBoards( parameters?: Parameters.GetAllBoards, @@ -34,6 +46,7 @@ export class Board { negateLocationFiltering: parameters?.negateLocationFiltering, orderBy: parameters?.orderBy, expand: parameters?.expand, + projectTypeLocation: parameters?.projectTypeLocation, filterId: parameters?.filterId, }, }; @@ -101,10 +114,10 @@ export class Board { url: '/rest/agile/1.0/board', method: 'POST', data: { - name: parameters.name, - type: parameters.type, filterId: parameters.filterId, location: parameters.location, + name: parameters.name, + type: parameters.type, }, }; @@ -465,15 +478,17 @@ export class Board { } /** - * Move issues from the backlog to the board (if they are already in the backlog of that board). This operation either - * moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) Or transitions the - * issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at once. + * Move issues from the backlog to the board (if they are already in the backlog of that board).\ + * This operation either moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) + * Or transitions the issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at + * once. */ async moveIssuesToBoard(parameters: Parameters.MoveIssuesToBoard, callback: Callback): Promise; /** - * Move issues from the backlog to the board (if they are already in the backlog of that board). This operation either - * moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) Or transitions the - * issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at once. + * Move issues from the backlog to the board (if they are already in the backlog of that board).\ + * This operation either moves an issue(s) onto a board from the backlog (by adding it to the issueList for the board) + * Or transitions the issue(s) to the first column for a kanban board with backlog. At most 50 issues may be moved at + * once. */ async moveIssuesToBoard(parameters: Parameters.MoveIssuesToBoard, callback?: never): Promise; async moveIssuesToBoard( @@ -485,8 +500,8 @@ export class Board { method: 'POST', data: { issues: parameters.issues, - rankBeforeIssue: parameters.rankBeforeIssue, rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, rankCustomFieldId: parameters.rankCustomFieldId, }, }; diff --git a/src/agile/builds.ts b/src/agile/builds.ts index 1e55fc1fa..87bdecbb5 100644 --- a/src/agile/builds.ts +++ b/src/agile/builds.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class Builds { diff --git a/src/agile/client/agileClient.ts b/src/agile/client/agileClient.ts index fc073b481..7f98f186a 100644 --- a/src/agile/client/agileClient.ts +++ b/src/agile/client/agileClient.ts @@ -5,9 +5,11 @@ import { Builds, Deployments, DevelopmentInformation, + DevopsComponents, Epic, FeatureFlags, Issue, + Operations, RemoteLinks, SecurityInformation, Sprint, @@ -19,9 +21,11 @@ export class AgileClient extends BaseClient { builds = new Builds(this); deployments = new Deployments(this); developmentInformation = new DevelopmentInformation(this); + devopsComponents = new DevopsComponents(this); epic = new Epic(this); featureFlags = new FeatureFlags(this); issue = new Issue(this); + operations = new Operations(this); remoteLinks = new RemoteLinks(this); securityInformation = new SecurityInformation(this); sprint = new Sprint(this); diff --git a/src/agile/deployments.ts b/src/agile/deployments.ts index 0ef2a5668..ef7d7a309 100644 --- a/src/agile/deployments.ts +++ b/src/agile/deployments.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class Deployments { diff --git a/src/agile/developmentInformation.ts b/src/agile/developmentInformation.ts index 84f3abd84..652263635 100644 --- a/src/agile/developmentInformation.ts +++ b/src/agile/developmentInformation.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class DevelopmentInformation { @@ -99,26 +99,24 @@ export class DevelopmentInformation { } /** - * Deletes development information entities which have all the provided properties. Entities will be deleted that - * match ALL of the properties (i.e. treated as an AND). For example if request is `DELETE + * Deletes development information entities which have all the provided properties. Repositories which have properties + * that match ALL of the properties (i.e. treated as an AND), and all their related development information (such as + * commits, branches and pull requests), will be deleted. For example if request is `DELETE * bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be - * deleted. Special property `_updateSequenceId` can be used to delete all entities with updateSequenceId less or - * equal than the value specified. In addition to the optional `_updateSequenceId`, one or more query params must be - * supplied to specify properties to delete by. Deletion is performed asynchronously: specified entities will - * eventually be removed from Jira. + * deleted. Optional param `_updateSequenceId` is no longer supported. Deletion is performed asynchronously: specified + * entities will eventually be removed from Jira. */ async deleteByProperties( parameters: Parameters.DeleteByProperties, callback: Callback, ): Promise; /** - * Deletes development information entities which have all the provided properties. Entities will be deleted that - * match ALL of the properties (i.e. treated as an AND). For example if request is `DELETE + * Deletes development information entities which have all the provided properties. Repositories which have properties + * that match ALL of the properties (i.e. treated as an AND), and all their related development information (such as + * commits, branches and pull requests), will be deleted. For example if request is `DELETE * bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be - * deleted. Special property `_updateSequenceId` can be used to delete all entities with updateSequenceId less or - * equal than the value specified. In addition to the optional `_updateSequenceId`, one or more query params must be - * supplied to specify properties to delete by. Deletion is performed asynchronously: specified entities will - * eventually be removed from Jira. + * deleted. Optional param `_updateSequenceId` is no longer supported. Deletion is performed asynchronously: specified + * entities will eventually be removed from Jira. */ async deleteByProperties(parameters: Parameters.DeleteByProperties, callback?: never): Promise; async deleteByProperties( @@ -137,9 +135,9 @@ export class DevelopmentInformation { } /** - * Checks if development information which have all the provided properties exists. For example, if request is `GET - * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one entity - * or repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be + * Checks if repositories which have all the provided properties exists. For example, if request is `GET + * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one + * repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be * used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the * optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. */ @@ -148,9 +146,9 @@ export class DevelopmentInformation { callback: Callback, ): Promise; /** - * Checks if development information which have all the provided properties exists. For example, if request is `GET - * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one entity - * or repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be + * Checks if repositories which have all the provided properties exists. For example, if request is `GET + * existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one + * repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be * used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the * optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by. */ diff --git a/src/agile/devopsComponents.ts b/src/agile/devopsComponents.ts new file mode 100644 index 000000000..b53e2e40c --- /dev/null +++ b/src/agile/devopsComponents.ts @@ -0,0 +1,189 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class DevopsComponents { + constructor(private client: Client) {} + + /** + * Update / insert DevOps Component data. + * + * Components are identified by their ID, and existing Component data for the same ID will be replaced if it exists + * and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getComponentById operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Components being submitted in one request, each is validated individually prior to + * submission. Details of which Components failed submission (if any) are available in the response object. + * + * A maximum of 1000 components can be submitted in one request. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitComponents( + parameters: Parameters.SubmitComponents, + callback: Callback, + ): Promise; + /** + * Update / insert DevOps Component data. + * + * Components are identified by their ID, and existing Component data for the same ID will be replaced if it exists + * and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getComponentById operation can be used to confirm that data has been stored successfully (if needed). + * + * In the case of multiple Components being submitted in one request, each is validated individually prior to + * submission. Details of which Components failed submission (if any) are available in the response object. + * + * A maximum of 1000 components can be submitted in one request. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitComponents( + parameters: Parameters.SubmitComponents, + callback?: never, + ): Promise; + async submitComponents( + parameters: Parameters.SubmitComponents, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/devopscomponents/1.0/bulk', + method: 'POST', + data: { + properties: parameters.properties, + components: parameters.components, + providerMetadata: parameters.providerMetadata, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Components that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitComponents operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentsByProperty( + parameters: Parameters.DeleteComponentsByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all Components that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitComponents operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentsByProperty( + parameters: Parameters.DeleteComponentsByProperty, + callback?: never, + ): Promise; + async deleteComponentsByProperty( + parameters: Parameters.DeleteComponentsByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/devopscomponents/1.0/bulkByProperties', + method: 'DELETE', + params: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Component data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getComponentById( + parameters: Parameters.GetComponentById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Component data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getComponentById( + parameters: Parameters.GetComponentById, + callback?: never, + ): Promise; + async getComponentById( + parameters: Parameters.GetComponentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/devopscomponents/1.0/${parameters.componentId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Component data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentById(parameters: Parameters.DeleteComponentById, callback: Callback): Promise; + /** + * Delete the Component data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getComponentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraDevOpsComponentProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteComponentById(parameters: Parameters.DeleteComponentById, callback?: never): Promise; + async deleteComponentById( + parameters: Parameters.DeleteComponentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/devopscomponents/1.0/${parameters.componentId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/epic.ts b/src/agile/epic.ts index 2838a8f01..67305a777 100644 --- a/src/agile/epic.ts +++ b/src/agile/epic.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class Epic { @@ -82,25 +82,6 @@ export class Epic { return this.client.sendRequest(config, callback); } - /** Returns searched epics according to provided parameters. */ - async searchEpics(parameters: Parameters.SearchEpics | undefined, callback: Callback): Promise; - /** Returns searched epics according to provided parameters. */ - async searchEpics(parameters?: Parameters.SearchEpics, callback?: never): Promise; - async searchEpics(parameters?: Parameters.SearchEpics, callback?: Callback): Promise { - const config: RequestConfig = { - url: '/rest/agile/1.0/epic/search', - method: 'GET', - params: { - maxResults: parameters?.maxResults, - excludeDone: parameters?.excludeDone, - query: parameters?.query, - projectKey: parameters?.projectKey, - }, - }; - - return this.client.sendRequest(config, callback); - } - /** * Returns the epic for a given epic ID. This epic will only be returned if the user has permission to view it. * **Note:** This operation does not work for epics in next-gen projects. @@ -143,10 +124,10 @@ export class Epic { url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}`, method: 'POST', data: { - name: parameters.name, - summary: parameters.summary, color: parameters.color, done: parameters.done, + name: parameters.name, + summary: parameters.summary, }, }; @@ -240,8 +221,8 @@ export class Epic { url: `/rest/agile/1.0/epic/${parameters.epicIdOrKey}/rank`, method: 'PUT', data: { - rankBeforeEpic: parameters.rankBeforeEpic, rankAfterEpic: parameters.rankAfterEpic, + rankBeforeEpic: parameters.rankBeforeEpic, rankCustomFieldId: parameters.rankCustomFieldId, }, }; diff --git a/src/agile/featureFlags.ts b/src/agile/featureFlags.ts index cec77ba7d..4b5494c6f 100644 --- a/src/agile/featureFlags.ts +++ b/src/agile/featureFlags.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class FeatureFlags { @@ -110,7 +110,7 @@ export class FeatureFlags { url: '/rest/featureflags/0.1/bulkByProperties', method: 'DELETE', params: { - _updateSequenceId: parameters?.updateSequenceId, + _updateSequenceId: parameters.updateSequenceId, }, }; diff --git a/src/agile/index.ts b/src/agile/index.ts index 998d88ae3..435eec895 100644 --- a/src/agile/index.ts +++ b/src/agile/index.ts @@ -3,9 +3,11 @@ export * from './board'; export * from './builds'; export * from './deployments'; export * from './developmentInformation'; +export * from './devopsComponents'; export * from './epic'; export * from './featureFlags'; export * from './issue'; +export * from './operations'; export * from './remoteLinks'; export * from './securityInformation'; export * from './sprint'; diff --git a/src/agile/issue.ts b/src/agile/issue.ts index ddea844da..15e224d42 100644 --- a/src/agile/issue.ts +++ b/src/agile/issue.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class Issue { @@ -15,7 +15,7 @@ export class Issue { * * If rankCustomFieldId is not defined, the default rank field will be used. */ - async rankIssues(parameters: Parameters.RankIssues | undefined, callback: Callback): Promise; + async rankIssues(parameters: Parameters.RankIssues, callback: Callback): Promise; /** * Moves (ranks) issues before or after a given issue. At most 50 issues may be ranked at once. * @@ -24,16 +24,16 @@ export class Issue { * * If rankCustomFieldId is not defined, the default rank field will be used. */ - async rankIssues(parameters?: Parameters.RankIssues, callback?: never): Promise; - async rankIssues(parameters?: Parameters.RankIssues, callback?: Callback): Promise { + async rankIssues(parameters: Parameters.RankIssues, callback?: never): Promise; + async rankIssues(parameters: Parameters.RankIssues, callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/agile/1.0/issue/rank', method: 'PUT', data: { - issues: parameters?.issues, - rankBeforeIssue: parameters?.rankBeforeIssue, - rankAfterIssue: parameters?.rankAfterIssue, - rankCustomFieldId: parameters?.rankCustomFieldId, + issues: parameters.issues, + rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, + rankCustomFieldId: parameters.rankCustomFieldId, }, }; diff --git a/src/agile/models/avatarUrls.ts b/src/agile/models/avatarUrls.ts index 6fcacf202..cda993d7f 100644 --- a/src/agile/models/avatarUrls.ts +++ b/src/agile/models/avatarUrls.ts @@ -1,4 +1,3 @@ -/** Details about the avatars for an item. */ export interface AvatarUrls { /** The URL of the item's 16x16 pixel avatar. */ '16x16'?: string; diff --git a/src/agile/models/board.ts b/src/agile/models/board.ts index a7d91c6d7..0ebb1a923 100644 --- a/src/agile/models/board.ts +++ b/src/agile/models/board.ts @@ -1,59 +1,59 @@ /** Details about a board. */ export interface Board { - /** The ID of the board. */ - id?: number; - /** The URL of the board. */ - self?: string; - /** The name of the board. */ - name?: string; - /** The type the board. */ - type?: string; /** The users and groups who own the board. */ admins?: { - users?: { - /** The URL of the user. */ + groups?: { + name?: string; self?: string; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; + }[]; + users?: { /** * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, * _5b10ac8d82e05b22cc7d4ef5_. */ accountId?: string; + /** Whether the user is active. */ + active?: boolean; avatarUrls?: { + /** The URL of the user's 16x16 pixel avatar. */ + '16x16'?: string; /** The URL of the user's 24x24 pixel avatar. */ '24x24'?: string; /** The URL of the user's 32x32 pixel avatar. */ '32x32'?: string; /** The URL of the user's 48x48 pixel avatar. */ '48x48'?: string; - /** The URL of the user's 16x16 pixel avatar. */ - '16x16'?: string; }; - }[]; - groups?: { - name?: string; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The URL of the user. */ self?: string; }[]; }; + /** Whether the board can be edited. */ + canEdit?: boolean; + /** Whether the board is selected as a favorite. */ + favourite?: boolean; + /** The ID of the board. */ + id?: number; + /** Whether the board is private. */ + isPrivate?: boolean; /** The container that the board is located in. */ location?: { - projectId?: number; - userId?: number; - userAccountId?: string; + avatarURI?: string; displayName?: string; - projectName?: string; + name?: string; + projectId?: number; projectKey?: string; + projectName?: string; projectTypeKey?: string; - avatarURI?: string; - name?: string; + userAccountId?: string; + userId?: number; }; - /** Whether the board can be edited. */ - canEdit?: boolean; - /** Whether the board is private. */ - isPrivate?: boolean; - /** Whether the board is selected as a favorite. */ - favourite?: boolean; + /** The name of the board. */ + name?: string; + /** The URL of the board. */ + self?: string; + /** The type the board. */ + type?: string; } diff --git a/src/agile/models/createBoard.ts b/src/agile/models/createBoard.ts index c0f01da7a..06ceba0fa 100644 --- a/src/agile/models/createBoard.ts +++ b/src/agile/models/createBoard.ts @@ -1,59 +1,59 @@ /** Details about a board. */ export interface CreateBoard { - /** The ID of the board. */ - id: number; - /** The URL of the board. */ - self?: string; - /** The name of the board. */ - name?: string; - /** The type the board. */ - type?: string; /** The users and groups who own the board. */ admins?: { - users?: { - /** The URL of the user. */ + groups?: { + name?: string; self?: string; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; + }[]; + users?: { /** * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, * _5b10ac8d82e05b22cc7d4ef5_. */ accountId?: string; + /** Whether the user is active. */ + active?: boolean; avatarUrls?: { + /** The URL of the user's 16x16 pixel avatar. */ + '16x16'?: string; /** The URL of the user's 24x24 pixel avatar. */ '24x24'?: string; /** The URL of the user's 32x32 pixel avatar. */ '32x32'?: string; /** The URL of the user's 48x48 pixel avatar. */ '48x48'?: string; - /** The URL of the user's 16x16 pixel avatar. */ - '16x16'?: string; }; - }[]; - groups?: { - name?: string; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The URL of the user. */ self?: string; }[]; }; + /** Whether the board can be edited. */ + canEdit?: boolean; + /** Whether the board is selected as a favorite. */ + favourite?: boolean; + /** The ID of the board. */ + id?: number; + /** Whether the board is private. */ + isPrivate?: boolean; /** The container that the board is located in. */ location?: { - projectId?: number; - userId?: number; - userAccountId?: string; + avatarURI?: string; displayName?: string; - projectName?: string; + name?: string; + projectId?: number; projectKey?: string; + projectName?: string; projectTypeKey?: string; - avatarURI?: string; - name?: string; + userAccountId?: string; + userId?: number; }; - /** Whether the board can be edited. */ - canEdit?: boolean; - /** Whether the board is private. */ - isPrivate?: boolean; - /** Whether the board is selected as a favorite. */ - favourite?: boolean; + /** The name of the board. */ + name?: string; + /** The URL of the board. */ + self?: string; + /** The type the board. */ + type?: string; } diff --git a/src/agile/models/getAllBoards.ts b/src/agile/models/getAllBoards.ts index 88ae94b38..0b49271ec 100644 --- a/src/agile/models/getAllBoards.ts +++ b/src/agile/models/getAllBoards.ts @@ -1,9 +1,9 @@ import { Board } from './board'; export interface GetAllBoards { + isLast?: boolean; maxResults?: number; startAt?: number; total?: number; - isLast?: boolean; values: Board[]; } diff --git a/src/agile/models/getAllQuickFilters.ts b/src/agile/models/getAllQuickFilters.ts index 96eb9f5d1..f7cdb23ea 100644 --- a/src/agile/models/getAllQuickFilters.ts +++ b/src/agile/models/getAllQuickFilters.ts @@ -1,14 +1,14 @@ export interface GetAllQuickFilters { - maxResults?: number; - startAt?: number; - total?: number; - isLast?: boolean; - values?: { - id?: number; + isLast: boolean; + maxResults: number; + startAt: number; + total: number; + values: { boardId?: number; - name?: string; - jql?: string; description?: string; + id?: number; + jql?: string; + name?: string; position?: number; }[]; } diff --git a/src/agile/models/getBoard.ts b/src/agile/models/getBoard.ts index 97fcc7a68..e53bd87b6 100644 --- a/src/agile/models/getBoard.ts +++ b/src/agile/models/getBoard.ts @@ -1,59 +1,52 @@ +import { AvatarUrls } from './avatarUrls'; + /** Details about a board. */ export interface GetBoard { - /** The ID of the board. */ - id?: number; - /** The URL of the board. */ - self?: string; - /** The name of the board. */ - name?: string; - /** The type the board. */ - type?: string; /** The users and groups who own the board. */ admins?: { - users?: { - /** The URL of the user. */ + groups?: { + name?: string; self?: string; - /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ - displayName?: string; - /** Whether the user is active. */ - active?: boolean; + }[]; + users?: { /** * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, * _5b10ac8d82e05b22cc7d4ef5_. */ accountId?: string; - avatarUrls?: { - /** The URL of the user's 24x24 pixel avatar. */ - '24x24'?: string; - /** The URL of the user's 32x32 pixel avatar. */ - '32x32'?: string; - /** The URL of the user's 48x48 pixel avatar. */ - '48x48'?: string; - /** The URL of the user's 16x16 pixel avatar. */ - '16x16'?: string; - }; - }[]; - groups?: { - name?: string; + /** Whether the user is active. */ + active?: boolean; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The URL of the user. */ self?: string; }[]; }; + /** Whether the board can be edited. */ + canEdit?: boolean; + /** Whether the board is selected as a favorite. */ + favourite?: boolean; + /** The ID of the board. */ + id?: number; + /** Whether the board is private. */ + isPrivate?: boolean; /** The container that the board is located in. */ location?: { - projectId?: number; - userId?: number; - userAccountId?: string; + avatarURI?: string; displayName?: string; - projectName?: string; + name?: string; + projectId?: number; projectKey?: string; + projectName?: string; projectTypeKey?: string; - avatarURI?: string; - name?: string; + userAccountId?: string; + userId?: number; }; - /** Whether the board can be edited. */ - canEdit?: boolean; - /** Whether the board is private. */ - isPrivate?: boolean; - /** Whether the board is selected as a favorite. */ - favourite?: boolean; + /** The name of the board. */ + name?: string; + /** The URL of the board. */ + self?: string; + /** The type the board. */ + type?: string; } diff --git a/src/agile/models/getBoardByFilterId.ts b/src/agile/models/getBoardByFilterId.ts index 49f5242da..980ba768d 100644 --- a/src/agile/models/getBoardByFilterId.ts +++ b/src/agile/models/getBoardByFilterId.ts @@ -1,11 +1,11 @@ export interface GetBoardByFilterId { - maxResults?: number; - startAt?: number; - total?: number; - isLast?: boolean; - values?: { + isLast: boolean; + maxResults: number; + startAt: number; + total: number; + values: { id?: number; - self?: string; name?: string; + self?: string; }[]; } diff --git a/src/agile/models/getBuildByKey.ts b/src/agile/models/getBuildByKey.ts index cb886e760..c22eae5bd 100644 --- a/src/agile/models/getBuildByKey.ts +++ b/src/agile/models/getBuildByKey.ts @@ -5,7 +5,7 @@ export interface GetBuildByKey { * * Placeholder to support potential schema changes in the future. */ - schemaVersion?: string; + schemaVersion?: '1.0' | string; /** * An ID that relates a sequence of builds. Depending on your use case this might be a project ID, pipeline ID, plan * key etc. - whatever logical unit you use to group a sequence of builds. @@ -58,7 +58,7 @@ export interface GetBuildByKey { * - `cancelled` - The build has been cancelled or stopped. * - `unknown` - The build is in an unknown state. */ - state: string; + state: 'pending' | 'in_progress' | 'successful' | 'failed' | 'cancelled' | 'unknown' | string; /** The last-updated timestamp to present to the user as a summary of the state of the build. */ lastUpdated: string; /** @@ -101,7 +101,7 @@ export interface GetBuildByKey { /** The name of the ref the build ran on */ name: string; /** - * An identifer for the ref. + * An identifier for the ref. * * In most cases this should be the URL of the tag/branch etc. in the SCM provider. * diff --git a/src/agile/models/getComponentById.ts b/src/agile/models/getComponentById.ts new file mode 100644 index 000000000..bbf18cf66 --- /dev/null +++ b/src/agile/models/getComponentById.ts @@ -0,0 +1,59 @@ +/** Data related to a specific component in a specific workspace that is affected by incidents.* */ +export interface GetComponentById { + /** + * The DevOpsComponentData schema version used for this devops component data. + * + * Placeholder to support potential schema changes in the future. + */ + schemaVersion: '1.0' | string; + /** The identifier for the DevOps Component. Must be unique for a given Provider. */ + id: string; + /** + * An ID used to apply an ordering to updates for this DevOps Component in the case of out-of-order receipt of update + * requests. + * + * This can be any monotonically increasing number. A suggested implementation is to use epoch millis from the + * Provider system, but other alternatives are valid (e.g. a Provider could store a counter against each DevOps + * Component and increment that on each update to Jira). + * + * Updates for a DevOps Component that are received with an updateSqeuenceId lower than what is currently stored will + * be ignored. + */ + updateSequenceNumber: number; + /** The human-readable name for the DevOps Component. Will be shown in the UI. */ + name: string; + /** The human-readable name for the Provider that owns this DevOps Component. Will be shown in the UI. */ + providerName?: string; + /** A description of the DevOps Component in Markdown format. Will be shown in the UI. */ + description: string; + /** + * A URL users can use to link to a summary view of this devops component, if appropriate. + * + * This could be any location that makes sense in the Provider system (e.g. if the summary information comes from a + * specific project, it might make sense to link the user to the component in that project). + */ + url: string; + /** A URL to display a logo representing this devops component, if available. */ + avatarUrl: string; + /** The tier of the component. Will be shown in the UI. */ + tier: 'Tier 1' | 'Tier 2' | 'Tier 3' | 'Tier 4' | string; + /** The type of the component. Will be shown in the UI. */ + componentType: + | 'Service' + | 'Application' + | 'Library' + | 'Capability' + | 'Cloud resource' + | 'Data pipeline' + | 'Machine learning model' + | 'UI element' + | 'Website' + | 'Other' + | string; + /** + * The last-updated timestamp to present to the user the last time the DevOps Component was updated. + * + * Expected format is an RFC3339 formatted string. + */ + lastUpdated: string; +} diff --git a/src/agile/models/getConfiguration.ts b/src/agile/models/getConfiguration.ts index 689a9aaa3..d9c84a376 100644 --- a/src/agile/models/getConfiguration.ts +++ b/src/agile/models/getConfiguration.ts @@ -1,39 +1,39 @@ export interface GetConfiguration { - id?: number; - name?: string; - type?: string; - self?: string; - location?: { - type?: string; - projectKeyOrId?: string; - }; - filter?: { - id?: string; - self?: string; - }; - subQuery?: { - query?: string; - }; columnConfig?: { columns?: { + max?: number; + min?: number; name?: string; statuses?: { id?: string; self?: string; }[]; - min?: number; - max?: number; }[]; constraintType?: string; }; estimation?: { - type?: string; field?: { - fieldId?: string; displayName?: string; + fieldId?: string; }; + type?: string; + }; + filter?: { + id?: string; + self?: string; + }; + id?: number; + location?: { + projectKeyOrId?: string; + type?: 'project' | 'user' | string; }; + name?: string; ranking?: { rankCustomFieldId?: number; }; + self?: string; + subQuery?: { + query?: string; + }; + type?: string; } diff --git a/src/agile/models/getDeploymentByKey.ts b/src/agile/models/getDeploymentByKey.ts index 34097b386..318669bbb 100644 --- a/src/agile/models/getDeploymentByKey.ts +++ b/src/agile/models/getDeploymentByKey.ts @@ -32,8 +32,10 @@ export interface GetDeploymentByKey { * information etc. for the deployment. */ label?: string; + /** The duration of the deployment (in seconds). */ + duration?: number; /** The state of the deployment */ - state: string; + state: 'unknown' | 'pending' | 'in_progress' | 'cancelled' | 'failed' | 'rolled_back' | 'successful' | string; /** * This object models the Continuous Delivery (CD) Pipeline concept, an automated process (usually comprised of * multiple stages) @@ -55,7 +57,7 @@ export interface GetDeploymentByKey { /** The name of the environment to present to the user. */ displayName: string; /** The type of the environment. */ - type: string; + type: 'unmapped' | 'development' | 'testing' | 'staging' | 'production' | string; }; /** A list of commands to be actioned for this Deployment */ commands?: { @@ -67,5 +69,5 @@ export interface GetDeploymentByKey { * * Placeholder to support potential schema changes in the future. */ - schemaVersion?: string; + schemaVersion?: '1.0' | string; } diff --git a/src/agile/models/getDeploymentGatingStatusByKey.ts b/src/agile/models/getDeploymentGatingStatusByKey.ts index 9032c0d17..90dce6465 100644 --- a/src/agile/models/getDeploymentGatingStatusByKey.ts +++ b/src/agile/models/getDeploymentGatingStatusByKey.ts @@ -9,10 +9,10 @@ export interface GetDeploymentGatingStatusByKey { /** Time the deployment gating status was updated. */ updatedTimestamp?: string; /** The gating status */ - gatingStatus?: string; + gatingStatus?: 'allowed' | 'prevented' | 'awaiting' | 'invalid' | string; details?: { /** The type of the gating status details. */ - type: string; + type: 'issue' | string; /** An issue key that references an issue in Jira. */ issueKey: string; /** diff --git a/src/agile/models/getFeatureFlagById.ts b/src/agile/models/getFeatureFlagById.ts index 7142e418e..a2e667ae0 100644 --- a/src/agile/models/getFeatureFlagById.ts +++ b/src/agile/models/getFeatureFlagById.ts @@ -5,7 +5,7 @@ export interface GetFeatureFlagById { * * Placeholder to support potential schema changes in the future. */ - schemaVersion?: string; + schemaVersion?: '1.0' | string; /** The identifier for the Feature Flag. Must be unique for a given Provider. */ id: string; /** @@ -119,7 +119,7 @@ export interface GetFeatureFlagById { /** The name of the environment. */ name: string; /** The 'type' or 'category' of environment this environment belongs to. */ - type?: string; + type?: 'development' | 'testing' | 'staging' | 'production' | string; }; /** Status information about a single Feature Flag. */ status: { diff --git a/src/agile/models/getFeaturesForBoard.ts b/src/agile/models/getFeaturesForBoard.ts index d1f86cc62..cd56e08e9 100644 --- a/src/agile/models/getFeaturesForBoard.ts +++ b/src/agile/models/getFeaturesForBoard.ts @@ -1,21 +1,41 @@ export interface GetFeaturesForBoard { features?: { - boardFeature?: string; + boardFeature?: + | 'SIMPLE_ROADMAP' + | 'BACKLOG' + | 'SPRINTS' + | 'CALENDAR' + | 'DEVTOOLS' + | 'REPORTS' + | 'ESTIMATION' + | 'PAGES' + | 'CODE' + | 'SECURITY' + | 'REQUESTS' + | 'INCIDENTS' + | 'RELEASES' + | 'DEPLOYMENTS' + | 'ISSUE_NAVIGATOR' + | 'ON_CALL_SCHEDULE' + | 'BOARD' + | 'GOALS' + | 'LIST_VIEW' + | string; boardId?: number; - state?: string; - localisedName?: string; - localisedDescription?: string; - learnMoreLink?: string; + featureId?: string; + featureType?: 'BASIC' | 'ESTIMATION' | string; imageUri?: string; - featureType?: string; + learnMoreArticleId?: string; + learnMoreLink?: string; + localisedDescription?: string; localisedGroup?: string; + localisedName?: string; permissibleEstimationTypes?: { - value?: string; - localisedName?: string; localisedDescription?: string; + localisedName?: string; + value?: 'STORY_POINTS' | 'ORIGINAL_ESTIMATE' | string; }[]; - featureId?: string; - learnMoreArticleId?: string; + state?: 'ENABLED' | 'DISABLED' | 'COMING_SOON' | string; toggleLocked?: boolean; }[]; } diff --git a/src/agile/models/getIncidentById.ts b/src/agile/models/getIncidentById.ts new file mode 100644 index 000000000..09963f749 --- /dev/null +++ b/src/agile/models/getIncidentById.ts @@ -0,0 +1,72 @@ +/** + * Data related to a specific incident in a specific container that the incident is present in. Must specify at least + * one association to a component.* + */ +export interface GetIncidentById { + /** + * The IncidentData schema version used for this incident data. + * + * Placeholder to support potential schema changes in the future. + */ + schemaVersion: '1.0' | string; + /** The identifier for the Incident. Must be unique for a given Provider. */ + id: string; + /** + * An ID used to apply an ordering to updates for this Incident in the case of out-of-order receipt of update + * requests. + * + * This can be any monotonically increasing number. A suggested implementation is to use epoch millis from the + * Provider system, but other alternatives are valid (e.g. a Provider could store a counter against each Incident and + * increment that on each update to Jira). + * + * Updates for a Incident that are received with an updateSqeuenceId lower than what is currently stored will be + * ignored. + */ + updateSequenceNumber: number; + /** The IDs of the Components impacted by this Incident. Must be unique for a given Provider. */ + affectedComponents: string[]; + /** + * The human-readable summary for the Incident. Will be shown in the UI. + * + * If not provided, will use the ID for display. + */ + summary: string; + /** A description of the issue in Markdown format. Will be shown in the UI and used when creating Jira Issues. */ + description: string; + /** + * A URL users can use to link to a summary view of this incident, if appropriate. + * + * This could be any location that makes sense in the Provider system (e.g. if the summary information comes from a + * specific project, it might make sense to link the user to the incident in that project). + */ + url: string; + /** + * The timestamp to present to the user that shows when the Incident was raised. + * + * Expected format is an RFC3339 formatted string. + */ + createdDate: string; + /** + * The last-updated timestamp to present to the user the last time the Incident was updated. + * + * Expected format is an RFC3339 formatted string. + */ + lastUpdated: string; + /** + * Severity information for a single Incident. + * + * This is the severity information that will be presented to the user on e.g. the Jira Incidents screen. + */ + severity?: { + /** The severity level of the Incident with P1 being the highest and P5 being the lowest */ + level: 'P1' | 'P2' | 'P3' | 'P4' | 'P5' | 'unknown' | string; + }; + /** The current status of the Incident. */ + status: 'open' | 'resolved' | 'unknown' | string; + /** The IDs of the Jira issues related to this Incident. Must be unique for a given Provider. */ + associations?: { + /** The type of the association being made */ + associationType?: 'issueIdOrKeys' | 'serviceIdOrKeys' | 'ati:cloud:compass:event-source' | string; + values?: string[]; + }[]; +} diff --git a/src/agile/models/getLinkedWorkspaceById.ts b/src/agile/models/getLinkedWorkspaceById.ts new file mode 100644 index 000000000..eb9eaf146 --- /dev/null +++ b/src/agile/models/getLinkedWorkspaceById.ts @@ -0,0 +1,7 @@ +/** The Security Workspace information stored for the given ID. */ +export interface GetLinkedWorkspaceById { + /** The Security Workspace ID */ + workspaceId: string; + /** Latest date and time that the Security Workspace was updated in Jira. */ + updatedAt: string; +} diff --git a/src/agile/models/getLinkedWorkspaces.ts b/src/agile/models/getLinkedWorkspaces.ts new file mode 100644 index 000000000..c127cd2da --- /dev/null +++ b/src/agile/models/getLinkedWorkspaces.ts @@ -0,0 +1,5 @@ +/** The payload of linked Security Workspace IDs. */ +export interface GetLinkedWorkspaces { + /** The IDs of Security Workspaces that are linked to this Jira site. */ + workspaceIds: string[]; +} diff --git a/src/agile/models/getQuickFilter.ts b/src/agile/models/getQuickFilter.ts index 9e9cdb903..f48dad99e 100644 --- a/src/agile/models/getQuickFilter.ts +++ b/src/agile/models/getQuickFilter.ts @@ -1,8 +1,8 @@ export interface GetQuickFilter { - id?: number; boardId?: number; - name?: string; - jql?: string; description?: string; + id?: number; + jql?: string; + name?: string; position?: number; } diff --git a/src/agile/models/getRemoteLinkById.ts b/src/agile/models/getRemoteLinkById.ts index b33cf3de6..6f0e6f80d 100644 --- a/src/agile/models/getRemoteLinkById.ts +++ b/src/agile/models/getRemoteLinkById.ts @@ -1,11 +1,11 @@ -/** Data related to a single Remote Link. */ +/** Data related to a single Remote Link.* */ export interface GetRemoteLinkById { /** * The schema version used for this data. * * Placeholder to support potential schema changes in the future. */ - schemaVersion?: string; + schemaVersion?: '1.0' | string; /** The identifier for the Remote Link. Must be unique for a given Provider. */ id: string; /** @@ -31,7 +31,17 @@ export interface GetRemoteLinkById { * The type of the Remote Link. The current supported types are 'document', 'alert', 'test', 'security', 'logFile', * 'prototype', 'coverage', 'bugReport' and 'other' */ - type: string; + type: + | 'document' + | 'alert' + | 'test' + | 'security' + | 'logFile' + | 'prototype' + | 'coverage' + | 'bugReport' + | 'other' + | string; /** * An optional description to attach to this Remote Link. * @@ -49,7 +59,7 @@ export interface GetRemoteLinkById { * they correspond to are equivalent to atlaskit's [Lozenge](https://atlaskit.atlassian.com/packages/core/lozenge) * component. */ - appearance: string; + appearance: 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'prototype' | 'success' | string; /** * The human-readable description for the Remote Link status. * diff --git a/src/agile/models/getRepository.ts b/src/agile/models/getRepository.ts index bdfcc0442..c1678061b 100644 --- a/src/agile/models/getRepository.ts +++ b/src/agile/models/getRepository.ts @@ -31,7 +31,7 @@ export interface GetRepository { */ updateSequenceId: number; /** The set of flags for this commit */ - flags?: string[]; + flags?: ('MERGE_COMMIT' | string)[]; /** * The commit message. Max length is 1024 characters. If anything longer is supplied, it will be truncated down to * 1024 characters. @@ -56,7 +56,7 @@ export interface GetRepository { /** The URL of this file. Max length is 2000 characters. */ url: string; /** The operation performed on this file */ - changeType: string; + changeType: 'ADDED' | 'COPIED' | 'DELETED' | 'MODIFIED' | 'MOVED' | 'UNKNOWN' | string; /** Number of lines added to the file */ linesAdded: number; /** Number of lines removed from the file */ @@ -110,7 +110,7 @@ export interface GetRepository { */ updateSequenceId: number; /** The set of flags for this commit */ - flags?: string[]; + flags?: ('MERGE_COMMIT' | string)[]; /** * The commit message. Max length is 1024 characters. If anything longer is supplied, it will be truncated down to * 1024 characters. @@ -135,7 +135,7 @@ export interface GetRepository { /** The URL of this file. Max length is 2000 characters. */ url: string; /** The operation performed on this file */ - changeType: string; + changeType: 'ADDED' | 'COPIED' | 'DELETED' | 'MODIFIED' | 'MOVED' | 'UNKNOWN' | string; /** Number of lines added to the file */ linesAdded: number; /** Number of lines removed from the file */ @@ -176,7 +176,7 @@ export interface GetRepository { * The status of the pull request. In the case of concurrent updates, priority is given in the order OPEN, MERGED, * DECLINED, UNKNOWN */ - status: string; + status: 'OPEN' | 'MERGED' | 'DECLINED' | 'UNKNOWN' | string; /** Title of the pull request. Max length is 1024 characters. */ title: string; /** Describes the author of a particular entity */ @@ -202,7 +202,7 @@ export interface GetRepository { /** The list of reviewers of this pull request */ reviewers?: { /** The approval status of this reviewer, default is UNAPPROVED. */ - approvalStatus?: string; + approvalStatus?: 'APPROVED' | 'UNAPPROVED' | string; /** The email address of this reviewer. Max length is 254 characters. */ email?: string; /** The Atlassian Account ID (AAID) of this reviewer. Max length is 128 characters. */ diff --git a/src/agile/models/getReviewById.ts b/src/agile/models/getReviewById.ts new file mode 100644 index 000000000..1e1af90b2 --- /dev/null +++ b/src/agile/models/getReviewById.ts @@ -0,0 +1,59 @@ +/** Data related to a specific post-incident review. Must specify at least one association to an incident.* */ +export interface GetReviewById { + /** + * The PostIncidentReviewData schema version used for this post-incident review data. + * + * Placeholder to support potential schema changes in the future. + */ + schemaVersion: '1.0' | string; + /** The identifier for the Review. Must be unique for a given Provider. */ + id: string; + /** + * An ID used to apply an ordering to updates for this Review in the case of out-of-order receipt of update requests. + * + * This can be any monotonically increasing number. A suggested implementation is to use epoch millis from the + * Provider system, but other alternatives are valid (e.g. a Provider could store a counter against each Review and + * increment that on each update to Jira). + * + * Updates for a Review that are received with an updateSqeuenceId lower than what is currently stored will be + * ignored. + */ + updateSequenceNumber: number; + /** The IDs of the Incidents covered by this Review. Must be unique for a given Provider. */ + reviews: string[]; + /** + * The human-readable summary for the Post-Incident Review. Will be shown in the UI. + * + * If not provided, will use the ID for display. + */ + summary: string; + /** A description of the review in Markdown format. Will be shown in the UI and used when creating Jira Issues. */ + description: string; + /** + * A URL users can use to link to a summary view of this review, if appropriate. + * + * This could be any location that makes sense in the Provider system (e.g. if the summary information comes from a + * specific project, it might make sense to link the user to the review in that project). + */ + url: string; + /** + * The timestamp to present to the user that shows when the Review was raised. + * + * Expected format is an RFC3339 formatted string. + */ + createdDate: string; + /** + * The last-updated timestamp to present to the user the last time the Review was updated. + * + * Expected format is an RFC3339 formatted string. + */ + lastUpdated: string; + /** The current status of the Post-Incident Review. */ + status: 'in progress' | 'outstanding actions' | 'completed' | 'unknown' | string; + /** The IDs of the Jira issues related to this Incident. Must be unique for a given Provider. */ + associations?: { + /** The type of the association being made */ + associationType?: 'issueIdOrKeys' | 'serviceIdOrKeys' | 'ati:cloud:compass:event-source' | string; + values?: string[]; + }[]; +} diff --git a/src/agile/models/getVulnerabilityById.ts b/src/agile/models/getVulnerabilityById.ts new file mode 100644 index 000000000..0dfcf13ab --- /dev/null +++ b/src/agile/models/getVulnerabilityById.ts @@ -0,0 +1,115 @@ +/** + * Data related to a specific vulnerability in a specific workspace that the vulnerability is present in. Must specify + * at least one association.* + */ +export interface GetVulnerabilityById { + /** + * The VulnerabilityData schema version used for this vulnerability data. + * + * Placeholder to support potential schema changes in the future. + */ + schemaVersion: '1.0' | string; + /** The identifier for the Vulnerability. Must be unique for a given Provider. */ + id: string; + /** + * An ID used to apply an ordering to updates for this Vulnerability in the case of out-of-order receipt of update + * requests. + * + * This can be any monotonically increasing number. A suggested implementation is to use epoch millis from the + * Provider system, but other alternatives are valid (e.g. a Provider could store a counter against each Vulnerability + * and increment that on each update to Jira). + * + * Updates for a Vulnerability that are received with an updateSequenceId lower than what is currently stored will be + * ignored. + */ + updateSequenceNumber: number; + /** + * The identifier of the Container where this Vulnerability was found. Must be unique for a given Provider. This must + * follow this regex pattern: `[a-zA-Z0-9\\-_.~@:{}=]+(/[a-zA-Z0-9\\-_.~@:{}=]+)*` + */ + containerId: string; + /** + * The human-readable name for the Vulnerability. Will be shown in the UI. + * + * If not provided, will use the ID for display. + */ + displayName: string; + /** + * A description of the issue in markdown format that will be shown in the UI and used when creating Jira Issues. HTML + * tags are not supported in the markdown format. For creating a new line `\n` can be used. Read more about the + * accepted markdown transformations + * [here](https://atlaskit.atlassian.com/packages/editor/editor-markdown-transformer). + */ + description: string; + /** + * A URL users can use to link to a summary view of this vulnerability, if appropriate. + * + * This could be any location that makes sense in the Provider system (e.g. if the summary information comes from a + * specific project, it might make sense to link the user to the vulnerability in that project). + */ + url: string; + /** The type of Vulnerability detected. */ + type: 'sca' | 'sast' | 'dast' | 'unknown' | string; + /** + * The timestamp to present to the user that shows when the Vulnerability was introduced. + * + * Expected format is an RFC3339 formatted string. + */ + introducedDate: string; + /** + * The last-updated timestamp to present to the user the last time the Vulnerability was updated. + * + * Expected format is an RFC3339 formatted string. + */ + lastUpdated: string; + /** + * Severity information for a single Vulnerability. + * + * This is the severity information that will be presented to the user on e.g. the Jira Security screen. + */ + severity: { + /** The severity level of the Vulnerability. */ + level: 'critical' | 'high' | 'medium' | 'low' | 'unknown' | string; + }; + /** The identifying information for the Vulnerability. */ + identifiers?: { + /** The display name of the Vulnerability identified. */ + displayName: string; + /** A URL users can use to link to the definition of the Vulnerability identified. */ + url: string; + }[]; + /** The current status of the Vulnerability. */ + status: 'open' | 'closed' | 'ignored' | 'unknown' | string; + /** Extra information (optional). This data will be shown in the security feature under the vulnerability displayName. */ + additionalInfo?: { + /** The content of the additionalInfo. */ + content: string; + /** Optional URL linking to the information */ + url?: string; + }; + /** + * The associations (e.g. Jira issue) to add in addition to the currently stored associations of the Security + * Vulnerability. + */ + addAssociations?: {}[]; + /** The associations (e.g. Jira issue) to remove from currently stored associations of the Security Vulnerability. */ + removeAssociations?: {}[]; + /** + * An ISO-8601 Date-time string representing the last time the provider updated associations on this entity. + * + * Expected format is an RFC3339 formatted string. + */ + associationsLastUpdated?: string; + /** + * A sequence number to compare when writing entity associations to the database. + * + * This can be any monotonically increasing number. A highly recommended implementation is to use epoch millis. + * + * This is an optional field. If it is not provided it will default to being equal to the corresponding entity's + * `updateSequenceNumber`. + * + * Associations are written following a LastWriteWins strategy, association that are received with an + * associationsUpdateSequenceNumber lower than what is currently stored will be ignored. + */ + associationsUpdateSequenceNumber?: number; +} diff --git a/src/agile/models/getWorkspaces.ts b/src/agile/models/getWorkspaces.ts new file mode 100644 index 000000000..d4c603734 --- /dev/null +++ b/src/agile/models/getWorkspaces.ts @@ -0,0 +1,5 @@ +/** The payload of Operations Workspace Ids. */ +export interface GetWorkspaces { + /** The IDs of Operations Workspaces that are available to this Jira site. */ + workspaceIds: string[]; +} diff --git a/src/agile/models/index.ts b/src/agile/models/index.ts index ce8d4fcae..2ced13b5d 100644 --- a/src/agile/models/index.ts +++ b/src/agile/models/index.ts @@ -10,15 +10,22 @@ export * from './getAllQuickFilters'; export * from './getBoard'; export * from './getBoardByFilterId'; export * from './getBuildByKey'; +export * from './getComponentById'; export * from './getConfiguration'; export * from './getDeploymentByKey'; export * from './getDeploymentGatingStatusByKey'; export * from './getFeatureFlagById'; export * from './getFeaturesForBoard'; +export * from './getIncidentById'; +export * from './getLinkedWorkspaceById'; +export * from './getLinkedWorkspaces'; export * from './getQuickFilter'; export * from './getRemoteLinkById'; export * from './getReportsForBoard'; export * from './getRepository'; +export * from './getReviewById'; +export * from './getVulnerabilityById'; +export * from './getWorkspaces'; export * from './group'; export * from './issue'; export * from './issueTransition'; @@ -28,6 +35,7 @@ export * from './linkedSecurityWorkspaceIds'; export * from './linkedWorkspace'; export * from './linkGroup'; export * from './operations'; +export * from './scope'; export * from './progress'; export * from './project'; export * from './projects'; @@ -37,10 +45,13 @@ export * from './status'; export * from './statusCategory'; export * from './storeDevelopmentInformation'; export * from './submitBuilds'; +export * from './submitComponents'; export * from './submitDeployments'; +export * from './submitEntity'; export * from './submitFeatureFlags'; +export * from './submitOperationsWorkspaces'; export * from './submitRemoteLinks'; -export * from './submittedVulnerabilitiesResult'; +export * from './submitVulnerabilities'; export * from './toggleFeatures'; export * from './user'; export * from './version'; diff --git a/src/agile/models/issue.ts b/src/agile/models/issue.ts index 88498d6f5..dbb296af8 100644 --- a/src/agile/models/issue.ts +++ b/src/agile/models/issue.ts @@ -1,94 +1,15 @@ -import { Fields } from './fields'; import { Operations } from './operations'; +import { Fields } from './fields'; +import { Scope } from './scope'; +import { StatusCategory } from './statusCategory'; +import { AvatarUrls } from './avatarUrls'; /** Details about an issue. */ export interface Issue { - /** Expand options that include additional issue details in the response. */ - expand?: string; - /** The ID of the issue. */ - id?: string; - /** The URL of the issue details. */ - self?: string; - /** The key of the issue. */ - key?: string; - /** The rendered value of each field present on the issue. */ - renderedFields?: {}; - /** Details of the issue properties identified in the request. */ - properties?: {}; - /** The ID and name of each field present on the issue. */ - names?: {}; - /** The schema describing each field present on the issue. */ - schema?: {}; - /** The transitions that can be performed on the issue. */ - transitions?: { - /** The ID of the issue transition. Required when specifying a transition to undertake. */ - id?: string; - /** The name of the issue transition. */ - name?: string; - /** A status. */ - to?: { - /** The URL of the status. */ - self?: string; - statusColor?: string; - /** The description of the status. */ - description?: string; - /** The URL of the icon used to represent the status. */ - iconUrl?: string; - /** The name of the status. */ - name?: string; - /** The ID of the status. */ - id?: string; - /** A status category. */ - statusCategory?: { - /** The URL of the status category. */ - self?: string; - /** The ID of the status category. */ - id?: number; - /** The key of the status category. */ - key?: string; - /** The name of the color used to represent the status category. */ - colorName?: string; - /** The name of the status category. */ - name?: string; - }; - }; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: {}; - /** Expand options that include additional transition details in the response. */ - expand?: string; - looped?: boolean; - }[]; - operations?: Operations; - /** A list of editable field details. */ - editmeta?: { - /** A list of editable field details. */ - fields?: any; - }; /** A page of changelogs. */ changelog?: { - /** The index of the first item returned on the page. */ - startAt?: number; - /** The maximum number of results that could be on the page. */ - maxResults?: number; - /** The number of results on the page. */ - total?: number; /** The list of changelogs. */ histories?: { - /** The ID of the changelog. */ - id?: string; /** * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions: * @@ -100,132 +21,196 @@ export interface Issue { * parameters have fallback values. */ author?: { - /** The URL of the user. */ - self?: string; /** * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, * _5b10ac8d82e05b22cc7d4ef5_. */ accountId?: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress?: string; - /** Details about the avatars for an item. */ - avatarUrls?: { - /** The URL of the item's 16x16 pixel avatar. */ - '16x16'?: string; - /** The URL of the item's 24x24 pixel avatar. */ - '24x24'?: string; - /** The URL of the item's 32x32 pixel avatar. */ - '32x32'?: string; - /** The URL of the item's 48x48 pixel avatar. */ - '48x48'?: string; - }; - /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ - displayName?: string; + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' + * (application user) or 'customer' (Jira Service Desk customer user) + */ + accountType?: string; /** Whether the user is active. */ active?: boolean; + avatarUrls?: AvatarUrls; + /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ + displayName?: string; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress?: string; + /** The URL of the user. */ + self?: string; /** * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned * as null. */ timeZone?: string; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' - * (application user) or 'customer' (Jira Service Desk customer user) - */ - accountType?: string; }; /** The date on which the change took place. */ created?: string; - /** The list of items changed. */ - items?: { - /** The name of the field changed. */ - field?: string; - /** The type of the field changed. */ - fieldtype?: string; - /** The ID of the field changed. */ - fieldId?: string; - /** The details of the original value. */ - from?: string; - /** The details of the original value as a string. */ - fromString?: string; - /** The details of the new value. */ - to?: string; - /** The details of the new value as a string. */ - toString?: string; - }[]; /** Details of issue history metadata. */ historyMetadata?: { - /** The type of the history record. */ - type?: string; - /** The description of the history record. */ - description?: string; - /** The description key of the history record. */ - descriptionKey?: string; /** The activity described in the history record. */ activityDescription?: string; /** The key of the activity described in the history record. */ activityDescriptionKey?: string; - /** The description of the email address associated the history record. */ - emailDescription?: string; - /** The description key of the email address associated the history record. */ - emailDescriptionKey?: string; /** Details of user or system associated with a issue history metadata item. */ actor?: { - /** The ID of the user or system associated with a history record. */ - id?: string; + /** The URL to an avatar for the user or system associated with a history record. */ + avatarUrl?: string; /** The display name of the user or system associated with a history record. */ displayName?: string; /** The key of the display name of the user or system associated with a history record. */ displayNameKey?: string; + /** The ID of the user or system associated with a history record. */ + id?: string; /** The type of the user or system associated with a history record. */ type?: string; - /** The URL to an avatar for the user or system associated with a history record. */ - avatarUrl?: string; /** The URL of the user or system associated with a history record. */ url?: string; }; /** Details of user or system associated with a issue history metadata item. */ - generator?: { - /** The ID of the user or system associated with a history record. */ - id?: string; + cause?: { + /** The URL to an avatar for the user or system associated with a history record. */ + avatarUrl?: string; /** The display name of the user or system associated with a history record. */ displayName?: string; /** The key of the display name of the user or system associated with a history record. */ displayNameKey?: string; + /** The ID of the user or system associated with a history record. */ + id?: string; /** The type of the user or system associated with a history record. */ type?: string; - /** The URL to an avatar for the user or system associated with a history record. */ - avatarUrl?: string; /** The URL of the user or system associated with a history record. */ url?: string; }; + /** The description of the history record. */ + description?: string; + /** The description key of the history record. */ + descriptionKey?: string; + /** The description of the email address associated the history record. */ + emailDescription?: string; + /** The description key of the email address associated the history record. */ + emailDescriptionKey?: string; + /** Additional arbitrary information about the history record. */ + extraData?: {}; /** Details of user or system associated with a issue history metadata item. */ - cause?: { - /** The ID of the user or system associated with a history record. */ - id?: string; + generator?: { + /** The URL to an avatar for the user or system associated with a history record. */ + avatarUrl?: string; /** The display name of the user or system associated with a history record. */ displayName?: string; /** The key of the display name of the user or system associated with a history record. */ displayNameKey?: string; + /** The ID of the user or system associated with a history record. */ + id?: string; /** The type of the user or system associated with a history record. */ type?: string; - /** The URL to an avatar for the user or system associated with a history record. */ - avatarUrl?: string; /** The URL of the user or system associated with a history record. */ url?: string; }; - /** Additional arbitrary information about the history record. */ - extraData?: {}; + /** The type of the history record. */ + type?: string; }; + /** The ID of the changelog. */ + id?: string; + /** The list of items changed. */ + items?: { + /** The name of the field changed. */ + field?: string; + /** The ID of the field changed. */ + fieldId?: string; + /** The type of the field changed. */ + fieldtype?: string; + /** The details of the original value. */ + from?: string; + /** The details of the original value as a string. */ + fromString?: string; + /** The details of the new value. */ + to?: string; + /** The details of the new value as a string. */ + toString?: string; + }[]; }[]; + /** The maximum number of results that could be on the page. */ + maxResults?: number; + /** The index of the first item returned on the page. */ + startAt?: number; + /** The number of results on the page. */ + total?: number; }; - /** The versions of each field on the issue. */ - versionedRepresentations?: {}; + /** A list of editable field details. */ + editmeta?: { + fields?: {}; + }; + /** Expand options that include additional issue details in the response. */ + expand?: string; + fields?: Fields; fieldsToInclude?: { - included?: string[]; actuallyIncluded?: string[]; excluded?: string[]; + included?: string[]; }; - fields?: Fields; + /** The ID of the issue. */ + id?: string; + /** The key of the issue. */ + key?: string; + /** The ID and name of each field present on the issue. */ + names?: {}; + operations?: Operations; + /** Details of the issue properties identified in the request. */ + properties?: {}; + /** The rendered value of each field present on the issue. */ + renderedFields?: {}; + /** The schema describing each field present on the issue. */ + schema?: {}; + /** The URL of the issue details. */ + self?: string; + /** The transitions that can be performed on the issue. */ + transitions?: { + /** Expand options that include additional transition details in the response. */ + expand?: string; + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields?: {}; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; + /** The ID of the issue transition. Required when specifying a transition to undertake. */ + id?: string; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + looped?: boolean; + /** The name of the issue transition. */ + name?: string; + /** A status. */ + to?: { + /** The description of the status. */ + description?: string; + /** The URL of the icon used to represent the status. */ + iconUrl?: string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; + /** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ + scope?: Scope; + /** The URL of the status. */ + self?: string; + /** A status category. */ + statusCategory?: StatusCategory; + }; + }[]; + /** The versions of each field on the issue. */ + versionedRepresentations?: {}; } diff --git a/src/agile/models/issueTransition.ts b/src/agile/models/issueTransition.ts index 8f645db08..bb35bb723 100644 --- a/src/agile/models/issueTransition.ts +++ b/src/agile/models/issueTransition.ts @@ -1,51 +1,58 @@ +import { Scope } from './scope'; + /** Details of an issue transition. */ export interface IssueTransition { + /** Expand options that include additional transition details in the response. */ + expand?: string; + /** + * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and + * `update` in a transition request. + */ + fields?: {}; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; /** The ID of the issue transition. Required when specifying a transition to undertake. */ id?: string; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + looped?: boolean; /** The name of the issue transition. */ name?: string; /** A status. */ to?: { - /** The URL of the status. */ - self?: string; /** The description of the status. */ description?: string; /** The URL of the icon used to represent the status. */ iconUrl?: string; - /** The name of the status. */ - name?: string; /** The ID of the status. */ id?: string; + /** The name of the status. */ + name?: string; + /** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ + scope?: Scope; + /** The URL of the status. */ + self?: string; /** A status category. */ statusCategory?: { - /** The URL of the status category. */ - self?: string; + /** The name of the color used to represent the status category. */ + colorName?: string; /** The ID of the status category. */ id?: number; /** The key of the status category. */ key?: string; - /** The name of the color used to represent the status category. */ - colorName?: string; /** The name of the status category. */ name?: string; + /** The URL of the status category. */ + self: string; }; }; - /** Whether there is a screen associated with the issue transition. */ - hasScreen?: boolean; - /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ - isGlobal?: boolean; - /** Whether this is the initial issue transition for the workflow. */ - isInitial?: boolean; - /** Whether the transition is available to be performed. */ - isAvailable?: boolean; - /** Whether the issue has to meet criteria before the issue transition is applied. */ - isConditional?: boolean; - /** - * Details of the fields associated with the issue transition screen. Use this information to populate `fields` and - * `update` in a transition request. - */ - fields?: {}; - /** Expand options that include additional transition details in the response. */ - expand?: string; - looped?: boolean; } diff --git a/src/agile/models/jsonType.ts b/src/agile/models/jsonType.ts index 2b50ec5e1..2ab70a13f 100644 --- a/src/agile/models/jsonType.ts +++ b/src/agile/models/jsonType.ts @@ -1,15 +1,15 @@ /** The schema of a field. */ export interface JsonType { - /** The data type of the field. */ - type: string; - /** When the data type is an array, the name of the field items within the array. */ - items?: string; - /** If the field is a system field, the name of the field. */ - system?: string; + /** If the field is a custom field, the configuration of the field. */ + configuration?: {}; /** If the field is a custom field, the URI of the field. */ custom?: string; /** If the field is a custom field, the custom ID of the field. */ customId?: number; - /** If the field is a custom field, the configuration of the field. */ - configuration?: {}; + /** When the data type is an array, the name of the field items within the array. */ + items?: string; + /** If the field is a system field, the name of the field. */ + system?: string; + /** The data type of the field. */ + type: string; } diff --git a/src/agile/models/linkGroup.ts b/src/agile/models/linkGroup.ts index cd6b15c95..8d7f1f19e 100644 --- a/src/agile/models/linkGroup.ts +++ b/src/agile/models/linkGroup.ts @@ -1,26 +1,26 @@ /** Details a link group, which defines issue operations. */ export interface LinkGroup { - id?: string; - styleClass?: string; + groups?: LinkGroup[]; /** Details about the operations available in this version. */ header?: { - id?: string; - styleClass?: string; + href?: string; iconClass?: string; + id?: string; label?: string; + styleClass?: string; title?: string; - href?: string; weight?: number; }; - weight?: number; + id?: string; links?: { - id?: string; - styleClass?: string; + href?: string; iconClass?: string; + id?: string; label?: string; + styleClass?: string; title?: string; - href?: string; weight?: number; }[]; - groups?: LinkGroup[]; + styleClass?: string; + weight?: number; } diff --git a/src/agile/models/project.ts b/src/agile/models/project.ts index e834b7c43..f39fb048d 100644 --- a/src/agile/models/project.ts +++ b/src/agile/models/project.ts @@ -2,22 +2,32 @@ import { AvatarUrls } from './avatarUrls'; /** Details about a project. */ export interface Project { - /** The URL of the project details. */ - self: string; + avatarUrls: AvatarUrls; /** The ID of the project. */ id: string; /** The key of the project. */ key: string; /** The name of the project. */ name: string; + /** A project category. */ + projectCategory: { + /** The name of the project category. */ + description?: string; + /** The ID of the project category. */ + id: string; + /** The description of the project category. */ + name: string; + /** The URL of the project category. */ + self: string; + }; /** * The [project * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the * project. */ - projectTypeKey: string; - /** Whether the project is simplified. */ + projectTypeKey: 'software' | 'service_desk' | 'business' | string; + /** The URL of the project details. */ + self: string; + /** Whether or not the project is simplified. */ simplified: boolean; - /** The avatar URLs of the project. */ - avatarUrls: AvatarUrls; } diff --git a/src/agile/models/scope.ts b/src/agile/models/scope.ts new file mode 100644 index 000000000..a99ccf76d --- /dev/null +++ b/src/agile/models/scope.ts @@ -0,0 +1,48 @@ +/** + * The projects the item is associated with. Indicated for items associated with [next-gen + * projects](https://confluence.atlassian.com/x/loMyO). + */ +export interface Scope { + /** Details about a project. */ + project?: { + avatarUrls?: { + /** The URL of the item's 16x16 pixel avatar. */ + '16x16'?: string; + /** The URL of the item's 24x24 pixel avatar. */ + '24x24'?: string; + /** The URL of the item's 32x32 pixel avatar. */ + '32x32'?: string; + /** The URL of the item's 48x48 pixel avatar. */ + '48x48'?: string; + }; + /** The ID of the project. */ + id?: string; + /** The key of the project. */ + key?: string; + /** The name of the project. */ + name?: string; + /** A project category. */ + projectCategory?: { + /** The name of the project category. */ + description?: string; + /** The ID of the project category. */ + id?: string; + /** The description of the project category. */ + name?: string; + /** The URL of the project category. */ + self?: string; + }; + /** + * The [project + * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the + * project. + */ + projectTypeKey?: 'software' | 'service_desk' | 'business' | string; + /** The URL of the project details. */ + self?: string; + /** Whether or not the project is simplified. */ + simplified?: boolean; + }; + /** The type of scope. */ + type?: 'PROJECT' | 'TEMPLATE' | string; +} diff --git a/src/agile/models/searchResults.ts b/src/agile/models/searchResults.ts index 985bb2b51..015ea5b3d 100644 --- a/src/agile/models/searchResults.ts +++ b/src/agile/models/searchResults.ts @@ -4,18 +4,18 @@ import { Issue } from './issue'; export interface SearchResults { /** Expand options that include additional search result details in the response. */ expand?: string; - /** The index of the first item returned on the page. */ - startAt: number; - /** The maximum number of results that could be on the page. */ - maxResults: number; - /** The number of results on the page. */ - total: number; /** The list of issues found by the search. */ issues: Issue[]; - /** Any warnings related to the JQL query. */ - warningMessages?: string[]; + /** The maximum number of results that could be on the page. */ + maxResults: number; /** The ID and name of each field in the search results. */ names?: {}; /** The schema describing the field types in the search results. */ schema?: {}; + /** The index of the first item returned on the page. */ + startAt: number; + /** The number of results on the page. */ + total: number; + /** Any warnings related to the JQL query. */ + warningMessages?: string[]; } diff --git a/src/agile/models/statusCategory.ts b/src/agile/models/statusCategory.ts index 68d40e3a4..c00f2328f 100644 --- a/src/agile/models/statusCategory.ts +++ b/src/agile/models/statusCategory.ts @@ -1,12 +1,13 @@ +/** A status category. */ export interface StatusCategory { - /** The URL of the status category. */ - self: string; + /** The name of the color used to represent the status category. */ + colorName: string; /** The ID of the status category. */ id: number; /** The key of the status category. */ key: string; - /** The name of the color used to represent the status category. */ - colorName: string; /** The name of the status category. */ name: string; + /** The URL of the status category. */ + self: string; } diff --git a/src/agile/models/submitComponents.ts b/src/agile/models/submitComponents.ts new file mode 100644 index 000000000..69bee0d8e --- /dev/null +++ b/src/agile/models/submitComponents.ts @@ -0,0 +1,29 @@ +/** The result of a successful submitDevopsComponents request.* */ +export interface SubmitComponents { + /** + * The IDs of Components that have been accepted for submission. + * + * A Component may be rejected if it was only associated with unknown project keys. + * + * Note that a Component that isn't updated due to it's updateSequenceNumber being out of order is not considered a + * failed submission. + */ + acceptedComponents?: string[]; + /** + * Details of Components that have not been accepted for submission, usually due to a problem with the request data. + * + * The object (if present) will be keyed by Component ID and include any errors associated with that Component that + * have prevented it being submitted. + */ + failedComponents?: {}; + /** + * Project keys that are not known on this Jira instance (if any). + * + * These may be invalid keys (e.g. `UTF` is sometimes incorrectly identified as a Jira project key), or they may be + * for projects that no longer exist. + * + * If a Component has been associated with project keys other than those in this array it will still be stored against + * those valid keys. If a Component was only associated with project keys deemed to be invalid it won't be persisted. + */ + unknownProjectKeys?: string[]; +} diff --git a/src/agile/models/submitEntity.ts b/src/agile/models/submitEntity.ts new file mode 100644 index 000000000..206e465f3 --- /dev/null +++ b/src/agile/models/submitEntity.ts @@ -0,0 +1,29 @@ +/** The result of a successful submitIncidents request.* */ +export interface SubmitEntity { + /** + * The IDs of Incidents that have been accepted for submission. + * + * A Incident may be rejected if it was only associated with unknown project keys. + * + * Note that a Incident that isn't updated due to it's updateSequenceNumber being out of order is not considered a + * failed submission. + */ + acceptedIncidents?: string[]; + /** + * Details of Incidents that have not been accepted for submission, usually due to a problem with the request data. + * + * The object (if present) will be keyed by Incident ID and include any errors associated with that Incident that have + * prevented it being submitted. + */ + failedIncidents?: {}; + /** + * Project keys that are not known on this Jira instance (if any). + * + * These may be invalid keys (e.g. `UTF` is sometimes incorrectly identified as a Jira project key), or they may be + * for projects that no longer exist. + * + * If a Incident has been associated with project keys other than those in this array it will still be stored against + * those valid keys. If a Incident was only associated with project keys deemed to be invalid it won't be persisted. + */ + unknownProjectKeys?: string[]; +} diff --git a/src/agile/models/submitOperationsWorkspaces.ts b/src/agile/models/submitOperationsWorkspaces.ts new file mode 100644 index 000000000..822c737b0 --- /dev/null +++ b/src/agile/models/submitOperationsWorkspaces.ts @@ -0,0 +1,5 @@ +/** The result of a successful submitOperationsWorkspaces request.* */ +export interface SubmitOperationsWorkspaces { + /** The IDs of Operations Workspaces that have been linked to the Jira site in this request. */ + acceptedWorkspaceIds?: string[]; +} diff --git a/src/agile/models/submitRemoteLinks.ts b/src/agile/models/submitRemoteLinks.ts index 8184fd4bd..ec203f74a 100644 --- a/src/agile/models/submitRemoteLinks.ts +++ b/src/agile/models/submitRemoteLinks.ts @@ -1,4 +1,4 @@ -/** The result of a successful `submitRemoteLinks` request. */ +/** The result of a successful `submitRemoteLinks` request.* */ export interface SubmitRemoteLinks { /** * The IDs of Remote Links that have been accepted for submission. diff --git a/src/agile/models/submitVulnerabilities.ts b/src/agile/models/submitVulnerabilities.ts new file mode 100644 index 000000000..4f401d89e --- /dev/null +++ b/src/agile/models/submitVulnerabilities.ts @@ -0,0 +1,28 @@ +/** The result of a successful submitVulnerabilities request.* */ +export interface SubmitVulnerabilities { + /** + * The IDs of Vulnerabilities that have been accepted for submission. + * + * A Vulnerability may be rejected if it was only associated with unknown project keys. + * + * Note that a Vulnerability that isn't updated due to it's updateSequenceNumber being out of order is not considered + * a failed submission. + */ + acceptedVulnerabilities?: string[]; + /** + * Details of Vulnerabilities that have not been accepted for submission, usually due to a problem with the request + * data. + * + * The object (if present) will be keyed by Vulnerability ID and include any errors associated with that Vulnerability + * that have prevented it being submitted. + */ + failedVulnerabilities?: {}; + /** + * Associations (e.g. Service IDs) that are not known on this Jira instance (if any). + * + * If a Vulnerability has been associated with any other association other than those in this array it will still be + * stored against those valid associations. If a Vulnerability was only associated with the associations in this + * array, it is deemed to be invalid and it won't be persisted. + */ + unknownAssociations?: {}[]; +} diff --git a/src/agile/models/toggleFeatures.ts b/src/agile/models/toggleFeatures.ts index ae231fffc..f2476d46c 100644 --- a/src/agile/models/toggleFeatures.ts +++ b/src/agile/models/toggleFeatures.ts @@ -1,21 +1,41 @@ export interface ToggleFeatures { features?: { - boardFeature?: string; + boardFeature?: + | 'SIMPLE_ROADMAP' + | 'BACKLOG' + | 'SPRINTS' + | 'CALENDAR' + | 'DEVTOOLS' + | 'REPORTS' + | 'ESTIMATION' + | 'PAGES' + | 'CODE' + | 'SECURITY' + | 'REQUESTS' + | 'INCIDENTS' + | 'RELEASES' + | 'DEPLOYMENTS' + | 'ISSUE_NAVIGATOR' + | 'ON_CALL_SCHEDULE' + | 'BOARD' + | 'GOALS' + | 'LIST_VIEW' + | string; boardId?: number; - state?: string; - localisedName?: string; - localisedDescription?: string; - learnMoreLink?: string; + featureId?: string; + featureType?: 'BASIC' | 'ESTIMATION' | string; imageUri?: string; - featureType?: string; + learnMoreArticleId?: string; + learnMoreLink?: string; + localisedDescription?: string; localisedGroup?: string; + localisedName?: string; permissibleEstimationTypes?: { - value?: string; - localisedName?: string; localisedDescription?: string; + localisedName?: string; + value?: 'STORY_POINTS' | 'ORIGINAL_ESTIMATE' | string; }[]; - featureId?: string; - learnMoreArticleId?: string; + state?: 'ENABLED' | 'DISABLED' | 'COMING_SOON' | string; toggleLocked?: boolean; }[]; } diff --git a/src/agile/models/user.ts b/src/agile/models/user.ts index 28fea25b8..4aa52b385 100644 --- a/src/agile/models/user.ts +++ b/src/agile/models/user.ts @@ -10,16 +10,18 @@ * fallback values. */ export interface User { - /** The URL of the user. */ - self: string; /** * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, * _5b10ac8d82e05b22cc7d4ef5_. */ accountId: string; - /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ - emailAddress: string | null; - /** Details about the avatars for an item. */ + /** + * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application + * user) or 'customer' (Jira Service Desk customer user) + */ + accountType: string; + /** Whether the user is active. */ + active: boolean; avatarUrls: { /** The URL of the item's 16x16 pixel avatar. */ '16x16'?: string; @@ -32,16 +34,13 @@ export interface User { }; /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ displayName: string; - /** Whether the user is active. */ - active: boolean; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress: string; + /** The URL of the user. */ + self: string; /** * The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as * null. */ timeZone: string | null; - /** - * The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application - * user) or 'customer' (Jira Service Desk customer user) - */ - accountType: string; } diff --git a/src/agile/operations.ts b/src/agile/operations.ts new file mode 100644 index 000000000..989e08fe1 --- /dev/null +++ b/src/agile/operations.ts @@ -0,0 +1,357 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class Operations { + constructor(private client: Client) {} + + /** + * Insert Operations Workspace IDs to establish a relationship between them and the Jira site the app is installed in. + * If a relationship between the Workspace ID and Jira already exists then the workspace ID will be ignored and Jira + * will process the rest of the entries. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitOperationsWorkspaces( + parameters: Parameters.SubmitOperationsWorkspaces, + callback: Callback, + ): Promise; + /** + * Insert Operations Workspace IDs to establish a relationship between them and the Jira site the app is installed in. + * If a relationship between the Workspace ID and Jira already exists then the workspace ID will be ignored and Jira + * will process the rest of the entries. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitOperationsWorkspaces( + parameters: Parameters.SubmitOperationsWorkspaces, + callback?: never, + ): Promise; + async submitOperationsWorkspaces( + parameters: Parameters.SubmitOperationsWorkspaces, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/linkedWorkspaces/bulk', + method: 'POST', + data: { + workspaceIds: parameters.workspaceIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Operations Workspaces that match the given request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 + */ + async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback: Callback): Promise; + /** + * Bulk delete all Operations Workspaces that match the given request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 + */ + async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback?: never): Promise; + async deleteWorkspaces(parameters: Parameters.DeleteWorkspaces, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/linkedWorkspaces/bulk', + method: 'DELETE', + params: { + workspaceIds: parameters.workspaceIds.join(','), + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the either all Operations Workspace IDs associated with the Jira site or a specific Operations Workspace + * ID for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * E.g. GET /workspace?workspaceId=111-222-333 + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getWorkspaces( + parameters: Parameters.GetWorkspaces, + callback: Callback, + ): Promise; + /** + * Retrieve the either all Operations Workspace IDs associated with the Jira site or a specific Operations Workspace + * ID for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * E.g. GET /workspace?workspaceId=111-222-333 + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getWorkspaces(parameters: Parameters.GetWorkspaces, callback?: never): Promise; + async getWorkspaces( + parameters: Parameters.GetWorkspaces, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/linkedWorkspaces', + method: 'GET', + params: { + workspaceId: parameters.workspaceId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update / insert Incident or Review data. + * + * Incidents and reviews are identified by their ID, and existing Incident and Review data for the same ID will be + * replaced if it exists and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getIncidentById or getReviewById operation can be used to confirm that data has been stored successfully (if + * needed). + * + * In the case of multiple Incidents and Reviews being submitted in one request, each is validated individually prior + * to submission. Details of which entities failed submission (if any) are available in the response object. + * + * A maximum of 1000 incidents can be submitted in one request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitEntity( + parameters: Parameters.SubmitEntity, + callback: Callback, + ): Promise; + /** + * Update / insert Incident or Review data. + * + * Incidents and reviews are identified by their ID, and existing Incident and Review data for the same ID will be + * replaced if it exists and the updateSequenceNumber of existing data is less than the incoming data. + * + * Submissions are performed asynchronously. Submitted data will eventually be available in Jira; most updates are + * available within a short period of time, but may take some time during peak load and/or maintenance times. The + * getIncidentById or getReviewById operation can be used to confirm that data has been stored successfully (if + * needed). + * + * In the case of multiple Incidents and Reviews being submitted in one request, each is validated individually prior + * to submission. Details of which entities failed submission (if any) are available in the response object. + * + * A maximum of 1000 incidents can be submitted in one request. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'WRITE' scope for Connect apps. + */ + async submitEntity(parameters: Parameters.SubmitEntity, callback?: never): Promise; + async submitEntity( + parameters: Parameters.SubmitEntity, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/bulk', + method: 'POST', + data: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Bulk delete all Entries that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitEntity operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteEntityByProperty( + parameters: Parameters.DeleteEntityByProperty, + callback: Callback, + ): Promise; + /** + * Bulk delete all Entries that match the given request. + * + * One or more query params must be supplied to specify Properties to delete by. If more than one Property is + * provided, data will be deleted that matches ALL of the Properties (e.g. treated as an AND). See the documentation + * for the submitEntity operation for more details. + * + * E.g. DELETE /bulkByProperties?accountId=account-123&createdBy=user-456 + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteEntityByProperty( + parameters: Parameters.DeleteEntityByProperty, + callback?: never, + ): Promise; + async deleteEntityByProperty( + parameters: Parameters.DeleteEntityByProperty, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/operations/1.0/bulkByProperties', + method: 'DELETE', + params: parameters, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Incident data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getIncidentById( + parameters: Parameters.GetIncidentById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Incident data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getIncidentById( + parameters: Parameters.GetIncidentById, + callback?: never, + ): Promise; + async getIncidentById( + parameters: Parameters.GetIncidentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/incidents/${parameters.incidentId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Incident data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteIncidentById(parameters: Parameters.DeleteIncidentById, callback: Callback): Promise; + /** + * Delete the Incident data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getIncidentById operation can be used to confirm that data has been + * deleted successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteIncidentById(parameters: Parameters.DeleteIncidentById, callback?: never): Promise; + async deleteIncidentById( + parameters: Parameters.DeleteIncidentById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/incidents/${parameters.incidentId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Retrieve the currently stored Review data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getReviewById( + parameters: Parameters.GetReviewById, + callback: Callback, + ): Promise; + /** + * Retrieve the currently stored Review data for the given ID. + * + * The result will be what is currently stored, ignoring any pending updates or deletes. + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'READ' scope for Connect apps. + */ + async getReviewById(parameters: Parameters.GetReviewById, callback?: never): Promise; + async getReviewById( + parameters: Parameters.GetReviewById, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/post-incident-reviews/${parameters.reviewId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Delete the Review data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getReviewById operation can be used to confirm that data has been deleted + * successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteReviewById(parameters: Parameters.DeleteReviewById, callback: Callback): Promise; + /** + * Delete the Review data currently stored for the given ID. + * + * Deletion is performed asynchronously. The getReviewById operation can be used to confirm that data has been deleted + * successfully (if needed). + * + * Only Connect apps that define the `jiraOperationsInfoProvider` module can access this resource. This resource + * requires the 'DELETE' scope for Connect apps. + */ + async deleteReviewById(parameters: Parameters.DeleteReviewById, callback?: never): Promise; + async deleteReviewById(parameters: Parameters.DeleteReviewById, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/operations/1.0/post-incident-reviews/${parameters.reviewId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/agile/parameters/deleteComponentById.ts b/src/agile/parameters/deleteComponentById.ts new file mode 100644 index 000000000..15a660635 --- /dev/null +++ b/src/agile/parameters/deleteComponentById.ts @@ -0,0 +1,4 @@ +export interface DeleteComponentById { + /** The ID of the Component to delete. */ + componentId: string; +} diff --git a/src/agile/parameters/deleteComponentsByProperty.ts b/src/agile/parameters/deleteComponentsByProperty.ts new file mode 100644 index 000000000..e71511976 --- /dev/null +++ b/src/agile/parameters/deleteComponentsByProperty.ts @@ -0,0 +1,5 @@ +export interface DeleteComponentsByProperty { + accountId?: string; + createdBy?: string; + [key: string]: any; +} diff --git a/src/agile/parameters/deleteEntityByProperty.ts b/src/agile/parameters/deleteEntityByProperty.ts new file mode 100644 index 000000000..dd57022b1 --- /dev/null +++ b/src/agile/parameters/deleteEntityByProperty.ts @@ -0,0 +1,5 @@ +export interface DeleteEntityByProperty { + accountId?: string; + createdBy?: string; + [key: string]: any; +} diff --git a/src/agile/parameters/deleteIncidentById.ts b/src/agile/parameters/deleteIncidentById.ts new file mode 100644 index 000000000..6de2b2e0c --- /dev/null +++ b/src/agile/parameters/deleteIncidentById.ts @@ -0,0 +1,4 @@ +export interface DeleteIncidentById { + /** The ID of the Incident to delete. */ + incidentId: string; +} diff --git a/src/agile/parameters/deleteReviewById.ts b/src/agile/parameters/deleteReviewById.ts new file mode 100644 index 000000000..82e9fd329 --- /dev/null +++ b/src/agile/parameters/deleteReviewById.ts @@ -0,0 +1,4 @@ +export interface DeleteReviewById { + /** The ID of the Review to delete. */ + reviewId: string; +} diff --git a/src/agile/parameters/deleteWorkspaces.ts b/src/agile/parameters/deleteWorkspaces.ts new file mode 100644 index 000000000..58b4e4bb1 --- /dev/null +++ b/src/agile/parameters/deleteWorkspaces.ts @@ -0,0 +1,3 @@ +export interface DeleteWorkspaces { + workspaceIds: string[]; +} diff --git a/src/agile/parameters/getAllBoards.ts b/src/agile/parameters/getAllBoards.ts index c3c386f68..250ab880a 100644 --- a/src/agile/parameters/getAllBoards.ts +++ b/src/agile/parameters/getAllBoards.ts @@ -30,4 +30,9 @@ export interface GetAllBoards { expand?: string; /** Filters results to boards that are relevant to a filter. Not supported for next-gen boards. */ filterId?: number; + /** + * Filters results to boards that are relevant to a project types. Support Jira Software, Jira Service Management. + * Valid values: software, service_desk. By default software. + */ + projectTypeLocation?: string[]; } diff --git a/src/agile/parameters/getComponentById.ts b/src/agile/parameters/getComponentById.ts new file mode 100644 index 000000000..d03ea8601 --- /dev/null +++ b/src/agile/parameters/getComponentById.ts @@ -0,0 +1,4 @@ +export interface GetComponentById { + /** The ID of the Component to fetch. */ + componentId: string; +} diff --git a/src/agile/parameters/getIncidentById.ts b/src/agile/parameters/getIncidentById.ts new file mode 100644 index 000000000..45586630e --- /dev/null +++ b/src/agile/parameters/getIncidentById.ts @@ -0,0 +1,4 @@ +export interface GetIncidentById { + /** The ID of the Incident to fetch. */ + incidentId: string; +} diff --git a/src/agile/parameters/getReviewById.ts b/src/agile/parameters/getReviewById.ts new file mode 100644 index 000000000..4480a55e5 --- /dev/null +++ b/src/agile/parameters/getReviewById.ts @@ -0,0 +1,4 @@ +export interface GetReviewById { + /** The ID of the Review to fetch. */ + reviewId: string; +} diff --git a/src/agile/parameters/getWorkspaces.ts b/src/agile/parameters/getWorkspaces.ts new file mode 100644 index 000000000..fe5e3b30e --- /dev/null +++ b/src/agile/parameters/getWorkspaces.ts @@ -0,0 +1,3 @@ +export interface GetWorkspaces { + workspaceId: string; +} diff --git a/src/agile/parameters/index.ts b/src/agile/parameters/index.ts index f7a9ac6ac..060a11018 100644 --- a/src/agile/parameters/index.ts +++ b/src/agile/parameters/index.ts @@ -80,3 +80,16 @@ export * from './submitWorkspaces'; export * from './swapSprint'; export * from './toggleFeatures'; export * from './updateSprint'; +export * from './getIncidentById'; +export * from './deleteIncidentById'; +export * from './deleteReviewById'; +export * from './getReviewById'; +export * from './deleteEntityByProperty'; +export * from './submitEntity'; +export * from './getWorkspaces'; +export * from './deleteWorkspaces'; +export * from './submitOperationsWorkspaces'; +export * from './submitComponents'; +export * from './deleteComponentById'; +export * from './deleteComponentsByProperty'; +export * from './getComponentById'; diff --git a/src/agile/parameters/submitComponents.ts b/src/agile/parameters/submitComponents.ts new file mode 100644 index 000000000..0af35f644 --- /dev/null +++ b/src/agile/parameters/submitComponents.ts @@ -0,0 +1,78 @@ +export interface SubmitComponents { + /** + * Properties assigned to incidents/components/review data that can then be used for delete / query operations. + * + * Examples might be an account or user ID that can then be used to clean up data if an account is removed from the + * Provider system. + * + * Properties are supplied as key/value pairs, and a maximum of 5 properties can be supplied, keys cannot contain ':' + * or start with '_'. + */ + properties?: {}; + components: { + /** + * The DevOpsComponentData schema version used for this devops component data. + * + * Placeholder to support potential schema changes in the future. + */ + schemaVersion: '1.0' | string; + /** The identifier for the DevOps Component. Must be unique for a given Provider. */ + id: string; + /** + * An ID used to apply an ordering to updates for this DevOps Component in the case of out-of-order receipt of + * update requests. + * + * This can be any monotonically increasing number. A suggested implementation is to use epoch millis from the + * Provider system, but other alternatives are valid (e.g. a Provider could store a counter against each DevOps + * Component and increment that on each update to Jira). + * + * Updates for a DevOps Component that are received with an updateSequenceId lower than what is currently stored + * will be ignored. + */ + updateSequenceNumber: number; + /** The human-readable name for the DevOps Component. Will be shown in the UI. */ + name: string; + /** The human-readable name for the Provider that owns this DevOps Component. Will be shown in the UI. */ + providerName?: string; + /** A description of the DevOps Component in Markdown format. Will be shown in the UI. */ + description: string; + /** + * A URL users can use to link to a summary view of this devops component, if appropriate. + * + * This could be any location that makes sense in the Provider system (e.g. if the summary information comes from a + * specific project, it might make sense to link the user to the component in that project). + */ + url: string; + /** A URL to display a logo representing this devops component, if available. */ + avatarUrl: string; + /** The tier of the component. Will be shown in the UI. */ + tier: 'Tier 1' | 'Tier 2' | 'Tier 3' | 'Tier 4' | string; + /** The type of the component. Will be shown in the UI. */ + componentType: + | 'Service' + | 'Application' + | 'Library' + | 'Capability' + | 'Cloud resource' + | 'Data pipeline' + | 'Machine learning model' + | 'UI element' + | 'Website' + | 'Other' + | string; + /** + * The last-updated timestamp to present to the user the last time the DevOps Component was updated. + * + * Expected format is an RFC3339 formatted string. + */ + lastUpdated: string; + }[]; + /** + * Information about the provider. This is useful for auditing, logging, debugging, and other internal uses. It is not + * considered private information. Hence, it may not contain personally identifiable information. + */ + providerMetadata?: { + /** An optional name of the source of the incidents. */ + product?: string; + }; +} diff --git a/src/agile/parameters/submitEntity.ts b/src/agile/parameters/submitEntity.ts new file mode 100644 index 000000000..12ce1f2d0 --- /dev/null +++ b/src/agile/parameters/submitEntity.ts @@ -0,0 +1,21 @@ +export interface SubmitEntity { + /** + * Properties assigned to incidents/components/review data that can then be used for delete / query operations. + * + * Examples might be an account or user ID that can then be used to clean up data if an account is removed from the + * Provider system. + * + * Properties are supplied as key/value pairs, and a maximum of 5 properties can be supplied, keys cannot contain ':' + * or start with '_'. + */ + properties?: {}; + /** + * Information about the provider. This is useful for auditing, logging, debugging, and other internal uses. It is not + * considered private information. Hence, it may not contain personally identifiable information. + */ + providerMetadata?: { + /** An optional name of the source of the incidents. */ + product?: string; + }; + [key: string]: any; +} diff --git a/src/agile/parameters/submitOperationsWorkspaces.ts b/src/agile/parameters/submitOperationsWorkspaces.ts new file mode 100644 index 000000000..fe885a29d --- /dev/null +++ b/src/agile/parameters/submitOperationsWorkspaces.ts @@ -0,0 +1,4 @@ +export interface SubmitOperationsWorkspaces { + /** The IDs of Operations Workspaces that are available to this Jira site. */ + workspaceIds?: string[]; +} diff --git a/src/agile/remoteLinks.ts b/src/agile/remoteLinks.ts index 0da91b972..498162611 100644 --- a/src/agile/remoteLinks.ts +++ b/src/agile/remoteLinks.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class RemoteLinks { diff --git a/src/agile/securityInformation.ts b/src/agile/securityInformation.ts index 06893fbfb..36ca396a8 100644 --- a/src/agile/securityInformation.ts +++ b/src/agile/securityInformation.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class SecurityInformation { @@ -42,6 +42,8 @@ export class SecurityInformation { * * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 */ async deleteLinkedWorkspaces( parameters: Parameters.DeleteLinkedWorkspaces, @@ -52,6 +54,8 @@ export class SecurityInformation { * * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'DELETE' scope for Connect apps. + * + * E.g. DELETE /bulk?workspaceIds=111-222-333,444-555-666 */ async deleteLinkedWorkspaces(parameters: Parameters.DeleteLinkedWorkspaces, callback?: never): Promise; async deleteLinkedWorkspaces( @@ -77,7 +81,7 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'READ' scope for Connect apps. */ - async getLinkedWorkspaces(callback: Callback): Promise; + async getLinkedWorkspaces(callback: Callback): Promise; /** * Retrieve all Security Workspaces linked with the Jira site. * @@ -86,8 +90,8 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'READ' scope for Connect apps. */ - async getLinkedWorkspaces(callback?: never): Promise; - async getLinkedWorkspaces(callback?: Callback): Promise { + async getLinkedWorkspaces(callback?: never): Promise; + async getLinkedWorkspaces(callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/security/1.0/linkedWorkspaces', method: 'GET', @@ -104,7 +108,7 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'READ' scope for Connect apps. */ - async getLinkedWorkspaceById( + async getLinkedWorkspaceById( parameters: Parameters.GetLinkedWorkspaceById, callback: Callback, ): Promise; @@ -116,11 +120,11 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'READ' scope for Connect apps. */ - async getLinkedWorkspaceById( + async getLinkedWorkspaceById( parameters: Parameters.GetLinkedWorkspaceById, callback?: never, ): Promise; - async getLinkedWorkspaceById( + async getLinkedWorkspaceById( parameters: Parameters.GetLinkedWorkspaceById, callback?: Callback, ): Promise { @@ -150,7 +154,7 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'WRITE' scope for Connect apps. */ - async submitVulnerabilities( + async submitVulnerabilities( parameters: Parameters.SubmitVulnerabilities, callback: Callback, ): Promise; @@ -172,11 +176,11 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'WRITE' scope for Connect apps. */ - async submitVulnerabilities( + async submitVulnerabilities( parameters: Parameters.SubmitVulnerabilities, callback?: never, ): Promise; - async submitVulnerabilities( + async submitVulnerabilities( parameters: Parameters.SubmitVulnerabilities, callback?: Callback, ): Promise { @@ -184,6 +188,7 @@ export class SecurityInformation { url: '/rest/security/1.0/bulk', method: 'POST', data: { + operationType: parameters.operationType, properties: parameters.properties, vulnerabilities: parameters.vulnerabilities, providerMetadata: parameters.providerMetadata, @@ -252,7 +257,7 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'READ' scope for Connect apps. */ - async getVulnerabilityById( + async getVulnerabilityById( parameters: Parameters.GetVulnerabilityById, callback: Callback, ): Promise; @@ -264,11 +269,11 @@ export class SecurityInformation { * Only Connect apps that define the `jiraSecurityInfoProvider` module can access this resource. This resource * requires the 'READ' scope for Connect apps. */ - async getVulnerabilityById( + async getVulnerabilityById( parameters: Parameters.GetVulnerabilityById, callback?: never, ): Promise; - async getVulnerabilityById( + async getVulnerabilityById( parameters: Parameters.GetVulnerabilityById, callback?: Callback, ): Promise { diff --git a/src/agile/sprint.ts b/src/agile/sprint.ts index fc00cba68..83ea97225 100644 --- a/src/agile/sprint.ts +++ b/src/agile/sprint.ts @@ -1,7 +1,7 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class Sprint { @@ -29,11 +29,11 @@ export class Sprint { url: '/rest/agile/1.0/sprint', method: 'POST', data: { - name: parameters.name, - startDate: parameters.startDate, endDate: parameters.endDate, - originBoardId: parameters.originBoardId, goal: parameters.goal, + name: parameters.name, + originBoardId: parameters.originBoardId, + startDate: parameters.startDate, }, }; @@ -65,7 +65,7 @@ export class Sprint { * * Notes: * - * - Sprints that are in a closed state cannot be updated. + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and * have a startDate and endDate set. * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' @@ -83,7 +83,7 @@ export class Sprint { * * Notes: * - * - Sprints that are in a closed state cannot be updated. + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and * have a startDate and endDate set. * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' @@ -103,16 +103,16 @@ export class Sprint { url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, method: 'POST', data: { - id: parameters.id, - self: parameters.self, - state: parameters.state, - name: parameters.name, - startDate: parameters.startDate, - endDate: parameters.endDate, completeDate: parameters.completeDate, createdDate: parameters.createdDate, - originBoardId: parameters.originBoardId, + endDate: parameters.endDate, goal: parameters.goal, + id: parameters.id, + name: parameters.name, + originBoardId: parameters.originBoardId, + self: parameters.self, + startDate: parameters.startDate, + state: parameters.state, }, }; @@ -125,7 +125,7 @@ export class Sprint { * * Notes: * - * - Sprints that are in a closed state cannot be updated. + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and * have a startDate and endDate set. * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' @@ -140,7 +140,7 @@ export class Sprint { * * Notes: * - * - Sprints that are in a closed state cannot be updated. + * - For closed sprints, only the name and goal can be updated; changes to other fields will be ignored. * - A sprint can be started by updating the state to 'active'. This requires the sprint to be in the 'future' state and * have a startDate and endDate set. * - A sprint can be completed by updating the state to 'closed'. This action requires the sprint to be in the 'active' @@ -157,16 +157,16 @@ export class Sprint { url: `/rest/agile/1.0/sprint/${parameters.sprintId}`, method: 'PUT', data: { - id: parameters.id, - self: parameters.self, - state: parameters.state, - name: parameters.name, - startDate: parameters.startDate, - endDate: parameters.endDate, completeDate: parameters.completeDate, createdDate: parameters.createdDate, - originBoardId: parameters.originBoardId, + endDate: parameters.endDate, goal: parameters.goal, + id: parameters.id, + name: parameters.name, + originBoardId: parameters.originBoardId, + self: parameters.self, + startDate: parameters.startDate, + state: parameters.state, }, }; @@ -247,8 +247,8 @@ export class Sprint { method: 'POST', data: { issues: parameters.issues, - rankBeforeIssue: parameters.rankBeforeIssue, rankAfterIssue: parameters.rankAfterIssue, + rankBeforeIssue: parameters.rankBeforeIssue, rankCustomFieldId: parameters.rankCustomFieldId, }, };