diff --git a/.eslintrc.yml b/.eslintrc.yml index e5ba51a3b2..def2ac8fa9 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -6,11 +6,13 @@ parserOptions: project: ./tsconfig.lint.json plugins: - import + - "@typescript-eslint" env: node: true browser: true rules: "@typescript-eslint/lines-between-class-members": off + "@typescript-eslint/no-unnecessary-condition": [ error, { allowConstantLoopConditions: false } ] arrow-parens: - error - as-needed diff --git a/CHANGELOG.md b/CHANGELOG.md index fc5dbd251d..7dead6677b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,169 @@ # Jira.js changelog +### 4.1.0 + +- **General Improvements:** Enhanced JSDoc documentation across the project for better clarity and developer experience. + +- **Deprecation:** Marked the `InstanceInformation.getLicense` method as deprecated. +- **Deprecation:** Marked the `Issues.getCreateIssueMeta` method as deprecated. +- **Deprecation:** Marked the `PageBeanFieldConfigurationDetails` class as deprecated. Use `Paginated` instead. +- **Deprecation:** Marked the `WorkflowUpdateResponse` and `WorkflowCreateResponse` classes as deprecated. + +- **New APIs:** Added the following classes to support additional Jira APIs: + - **`AppDataPolicies`**: Manage app access rule data policies, allowing developers to set and retrieve rules controlling app access ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-app-data-policies/#api-group-app-data-policies)). + - **`ClassificationLevels`**: Define and manage classification levels for sensitive information in Jira ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-classification-levels/#api-group-classification-levels)). + - **`IssueBulkOperations`**: Perform bulk operations on issues, such as moving multiple issues between projects or updating multiple fields in one request. For additional guidance, refer to [Bulk operation APIs: additional examples and FAQ](https://developer.atlassian.com/cloud/jira/platform/bulk-operation-additional-examples-and-faqs/) ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-bulk-operations/#api-group-issue-bulk-operations)). + - **`Plans`**: Manage advanced roadmaps plans, including creating, duplicating, updating, archiving, and trashing plans ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-plans/#api-group-plans)). + - **`PrioritySchemes`**: Create, retrieve, update, and delete issue priority schemes to standardize prioritization across projects ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-priority-schemes/#api-group-priority-schemes)). + - **`ProjectClassificationLevels`**: View and manage classification levels within individual projects to ensure compliance with organizational standards ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-classification-levels/#api-group-project-classification-levels)). + - **`ServiceRegistry`**: Access and manage attributes related to Jira Service Management’s service registry, which helps organize and maintain services ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-service-registry/#api-group-service-registry)). + - **`TeamsInPlan`**: Configure settings for Atlassian and custom teams within advanced roadmaps plans, including creating, updating, and deleting team configurations ([documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-teams-in-plan/#api-group-teams-in-plan)). + +- **Improvement:** Changed the return type of `ProjectKeyAndNameValidation.getValidProjectKey` and `ProjectKeyAndNameValidation.getValidProjectName` from `unknown` to `string` for improved type safety and usability. +- **Improvement:** Added the `approximateLastUsed` parameter to the `Filters.createFilter` method. +- **Improvement:** Added the `isSubstringMatch` parameter to the `Filters.getFiltersPaginated` method. +- **Improvement:** Updated the `IssueComments.updateComment` method to allow passing a plain string for the comment instead of requiring a specific object format. +- **Improvement:** Added the `parentId` parameter to the `IssueComments.deleteComment` method. +- **Improvement:** Added the `releasedProjectKeys` property to the `Projects.updateProject` method. +- **Improvement:** Added the `avatarId` parameter to the `IssuePriorities.createPriority` method. This parameter will replace `iconUrl` starting **March 16, 2025**. The `iconUrl` parameter is now marked as deprecated. +- **Improvement:** Added the `priorityName` and `expand` properties to the `IssuePriorities.searchPriorities` method. +- **Improvement:** Added the `avatarId` parameter to the `IssuePriorities.updatePriority` method. This parameter will replace `iconUrl` starting **March 16, 2025**. The `iconUrl` parameter is now marked as deprecated. +- **Improvement:** Added the `issueId` property to the `UserSearch.findAssignableUsers` method. +- **Improvement:** Added the optional `skipNotFoundPrecomputations` property to the `JqlFunctionsApps.updatePrecomputations` method. +- **Improvement:** Added the `failFast` parameter to the `Issues.getIssue` method. +- **Improvement:** Added the `failFast` parameter to the `IssueSearch.searchForIssuesUsingJql` method. +- **Improvement:** Added the `ari` and `metadata` parameters to the `ProjectComponents.createComponent` method. +- **Improvement:** Added the optional `componentSource` parameter to the `ProjectComponents.getProjectComponentsPaginated` method. +- **Improvement:** Added the optional `componentSource` parameter to the `ProjectComponents.getProjectComponents` method. +- **Improvement:** Added the `approvers` and `driver` parameters to the `ProjectVersions.createVersion` and `ProjectVersions.updateVersion` methods. +- **Improvement:** Replaced the `maxResults` property with `maxResult` in the `UserSearch.findUserKeysByQuery` method. +- **Improvement:** Added the `extendAdminPermissions` parameter to the following methods in the `Dashboard` class: + - `Dashboard.createDashboard` + - `Dashboard.updateDashboard` + - `Dashboard.copyDashboard` + +- **New Method:** Added the `getCustomFieldsConfigurations` method to the `IssueCustomFieldConfigurationApps` class. +- **New Method:** Added the `replaceCustomFieldOption` method to the `IssueCustomFieldOptions` class. +- **New Methods:** Added the following methods to the `WorkflowSchemes` class: + - `readWorkflowSchemes`: Retrieve workflow schemes. + - `updateSchemes`: Update workflow schemes. + - `updateWorkflowSchemeMappings`: Update workflow scheme mappings. +- **New Method:** Added the `getNotificationSchemeForProject` method to the `Projects` class. +- **New Method:** Added the `getBulkScreenTabs` method to the `ScreenTabs` class. +- **New Method:** Added the `deletePriority` method to the `IssuePriorities` class. +- **New Method:** Added the `getPrecomputationsByID` method to the `JqlFunctionsApps` class. +- **New Methods:** Added the following methods to the `Workflows` class: + - `readWorkflows`: Retrieve workflows. + - `workflowCapabilities`: Get workflow capabilities. + - `createWorkflows`: Create new workflows. + - `validateCreateWorkflows`: Validate workflow creation. + - `updateWorkflows`: Update existing workflows. + - `validateUpdateWorkflows`: Validate workflow updates. +- **New Methods:** Added the following methods to the `Issues` class: + - `getBulkChangelogs`: Retrieve changelogs for multiple issues in bulk. + - `bulkFetchIssues`: Fetch multiple issues in bulk. + - `getCreateIssueMetaIssueTypes`: Retrieve metadata for issue types when creating issues. + - `getCreateIssueMetaIssueTypeId`: Retrieve metadata for a specific issue type by ID when creating issues. + - `getIssueLimitReport`: Retrieve a report on issue limits. +- **New Methods:** Added the following methods to the `IssueSearch` class: + - `countIssues`: Count issues matching a query. + - `searchForIssuesIds`: Search for issue IDs using a query. + - `searchForIssuesUsingJqlEnhancedSearch`: Search and reconcile issues using JQL. + - `searchForIssuesUsingJqlEnhancedSearchPost`: Search and reconcile issues using JQL via POST request. +- **New Methods:** Added the following methods to the `IssueWorklogs` class: + - `bulkDeleteWorklogs`: Delete multiple worklogs in bulk. + - `bulkMoveWorklogs`: Move multiple worklogs in bulk. +- **New Method:** Added the `evaluateJiraExpressionUsingEnhancedSearch` method to the `JiraExpressions` class. +- **New Method:** Added the `findComponentsForProjects` method to the `ProjectComponents` class. +- **New Methods:** Added the following methods to the `ProjectVersions` class: + - `deleteRelatedWork`: Delete related work for a version. + - `updateRelatedWork`: Update related work for a version. + - `createRelatedWork`: Create related work for a version. + - `getRelatedWork`: Retrieve related work for a version. +- **New Method:** Added the `getProjectUsagesForWorkflowScheme` method to the `WorkflowSchemes` class. +- **New Method:** Added the `getWorkflowProjectIssueTypeUsages` method to the `Workflows` class. +- **New Methods:** Added the following methods to the `Status` class: + - `getProjectIssueTypeUsagesForStatus` + - `getProjectUsagesForStatus` + - `getWorkflowUsagesForStatus` + +- **Fix:** Updated the following methods in `Version2Client` and `Version3Client` to make the `parameters` argument mandatory (as it should have been initially): + - `IssueFieldConfigurations.createFieldConfiguration` + - `IssueFieldConfigurations.createFieldConfigurationScheme` + - `IssueLinks.linkIssues` + - `IssueTypeSchemes.createIssueTypeScheme` + - `IssueTypeSchemes.assignIssueTypeSchemeToProject` + - `IssueTypeScreenSchemes.createIssueTypeScreenScheme` + - `JQL.parseJqlQueries` + - `TimeTracking.setSharedTimeTrackingConfiguration` + - `WorkflowSchemeProjectAssociations.assignSchemeToProject` + - `IssueTypes.createIssueType` + - `IssueSearch.matchIssues` + - `IssueSearch.searchForIssuesUsingJql` + - `JiraExpressions.evaluateJiraExpression` + - `Users.setUserColumns` + - `Users.getUser` +- **Fix:** Improved the `Avatars.storeAvatar` method: + - Added the `mimeType` parameter to specify the type of the uploaded avatar. + - Updated the type of the `avatar` parameter from `any` to `Buffer | ArrayBuffer | Uint8Array | any` for better type safety. + - Set the default value of the `size` parameter to `0`. +- **Fix:** Improved the `IssueTypes.createIssueTypeAvatar` method: + - Added the `mimeType` parameter to specify the type of the uploaded avatar. + - Added the `avatar` parameter with the type `Buffer | ArrayBuffer | Uint8Array`. + - Set the default value of the `size` parameter to `0`. +- **Fix:** Improved the `ProjectAvatars.createProjectAvatar` method: + - Added the `mimeType` parameter to specify the type of the uploaded avatar. + - Updated the type of the `avatar` parameter from `any` to `Buffer | ArrayBuffer | Uint8Array | any`. + - Set the default value of the `size` parameter to `0`. + +- **Change:** Removed the `filter` parameter from the `JqlFunctionsApps.getPrecomputations` method (experimental method, not a breaking change). +- **Change:** Renamed `JiraExpressionEvaluateContextBean` to `JiraExpressionEvaluateContext`. + +- **Improvement:** Added type `string` for properties `projectId` in parameters and models: + - Model `Version` + - Parameter `GetFieldConfigurationSchemeProjectMapping` + - Parameter `GetHierarchy` + - Parameter `GetIssueTypeSchemeForProjects` + - Parameter `GetIssueTypeScreenSchemeProjectAssociations` + - Parameter `GetIssueTypesForProject` + - Parameter `GetProjectEmail` + - Parameter `GetWorkflowSchemeProjectAssociations` + - Parameter `UpdateProjectEmail` +- **Improvement:** Added type `number` for properties `projectIdOrKey` in parameters and models: + - Parameter `AddActorUsers` + - Parameter `ArchiveProject` + - Parameter `CreateProjectAvatar` + - Parameter `DeleteActor` + - Parameter `DeleteProject` + - Parameter `DeleteProjectAsynchronously` + - Parameter `DeleteProjectAvatar` + - Parameter `DeleteProjectProperty` + - Parameter `GetAllProjectAvatars` + - Parameter `GetAllStatuses` + - Parameter `GetFeaturesForProject` + - Parameter `GetProjectComponents` + - Parameter `GetProjectComponentsPaginated` + - Parameter `GetProjectProperty` + - Parameter `GetProjectPropertyKeys` + - Parameter `GetProjectRole` + - Parameter `GetProjectRoleDetails` + - Parameter `GetProjectRoles` + - Parameter `GetProjectVersions` + - Parameter `GetProjectVersionsPaginated` + - Parameter `Restore` + - Parameter `SetActors` + - Parameter `SetProjectProperty` + - Parameter `ToggleFeatureForProject` + - Parameter `UpdateProject` + - Parameter `UpdateProjectAvatar` + +--- + +- **Special thanks to Ness Li ([nessgor](https://github.com/nessgor)) for implementing the changes above. PR: [#356](https://github.com/MrRefactoring/jira.js/pull/356).** +- **Thanks to Niklas Correnz ([uncaught](https://github.com/uncaught)) for reporting the issue: [#352](https://github.com/MrRefactoring/jira.js/issues/352).** + +--- + ### 4.0.6 - **#347:** Fixed an issue with adding attachments of type `Readable` or `ReadableStream` (e.g., `fs.createReadStream`). Thanks to [Lunatic174](https://github.com/Lunatic174) for [reporting the issue](https://github.com/MrRefactoring/jira.js/issues/347). diff --git a/README.md b/README.md index 70f71e2644..7df62e90de 100644 --- a/README.md +++ b/README.md @@ -244,10 +244,12 @@ Available groups: Version 2 Cloud REST API group - [announcementBanner](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-announcement-banner/#api-group-announcement-banner) + - [appDataPolicies](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-app-data-policies/#api-group-app-data-policies) - [applicationRoles](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-application-roles/#api-group-application-roles) - [appMigration](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-app-migration/#api-group-app-migration) - [auditRecords](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-audit-records/#api-group-audit-records) - [avatars](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-avatars/#api-group-avatars) + - [classificationLevels](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-classification-levels/#api-group-classification-levels) - [dashboards](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-dashboards/#api-group-dashboards) - [filters](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-filters/#api-group-filters) - [filterSharing](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-filter-sharing/#api-group-filter-sharing) @@ -292,9 +294,12 @@ Available groups: - [myself](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-myself/#api-group-myself) - [permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-permissions/#api-group-permissions) - [permissionSchemes](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-permission-schemes/#api-group-permission-schemes) + - [plans](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-plans/#api-group-plans) + - [prioritySchemes](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-priority-schemes/#api-group-priority-schemes) - [projects](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-projects/#api-group-projects) - [projectAvatars](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-avatars/#api-group-project-avatars) - [projectCategories](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-categories/#api-group-project-categories) + - [projectClassificationLevels](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-classification-levels/#api-group-project-classification-levels) - [projectComponents](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-components/#api-group-project-components) - [projectEmail](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-email/#api-group-project-email) - [projectFeatures](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-features/#api-group-project-features) @@ -310,8 +315,10 @@ Available groups: - [screenTabFields](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screen-tab-fields/#api-group-screen-tab-fields) - [screenSchemes](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-screen-schemes/#api-group-screen-schemes) - [serverInfo](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-server-info/#api-group-server-info) + - [serviceRegistry](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-service-registry/#api-group-service-registry) - [status](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-status/#api-group-status) - [tasks](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-tasks/#api-group-tasks) + - [teamsInPlan](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-teams-in-plan/#api-group-teams-in-plan) - [timeTracking](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-time-tracking/#api-group-time-tracking) - [uiModificationsApps](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-ui-modifications--apps-/#api-group-ui-modifications--apps-) - [users](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-users/#api-group-users) @@ -333,10 +340,12 @@ Available groups: Version 3 Cloud REST API group - [announcementBanner](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-announcement-banner/#api-group-announcement-banner) + - [appDataPolicy](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-app-data-policies/#api-group-app-data-policies) - [applicationRoles](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-application-roles/#api-group-application-roles) - [appMigration](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-app-migration/#api-group-app-migration) - [auditRecords](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-audit-records/#api-group-audit-records) - [avatars](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-avatars/#api-group-avatars) + - [classificationLevels](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-classification-levels/#api-group-classification-levels) - [dashboards](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-dashboards/#api-group-dashboards) - [filters](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-filters/#api-group-filters) - [filterSharing](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-filter-sharing/#api-group-filter-sharing) @@ -345,6 +354,7 @@ Available groups: - [instanceInformation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-instance-information/#api-group-instance-information) - [issues](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-group-issues) - [issueAttachments](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-attachments/#api-group-issue-attachments) + - [issueBulkOperations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-bulk-operations/#api-group-issue-bulk-operations) - [issueComments](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comments/#api-group-issue-comments) - [issueCustomFieldConfigurationApps](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-configuration--apps-/#api-group-issue-custom-field-configuration--apps-) - [issueCommentProperties](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-comment-properties/#api-group-issue-comment-properties) @@ -382,9 +392,12 @@ Available groups: - [myself](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-myself/#api-group-myself) - [permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permissions/#api-group-permissions) - [permissionSchemes](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permission-schemes/#api-group-permission-schemes) + - [plans](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-plans/#api-group-plans) + - [prioritySchemes](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-priority-schemes/#api-group-priority-schemes) - [projects](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-group-projects) - [projectAvatars](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-avatars/#api-group-project-avatars) - [projectCategories](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-categories/#api-group-project-categories) + - [projectClassificationLevels](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-classification-levels/#api-group-project-classification-levels) - [projectComponents](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-components/#api-group-project-components) - [projectEmail](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-email/#api-group-project-email) - [projectFeatures](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-features/#api-group-project-features) @@ -400,8 +413,10 @@ Available groups: - [screenTabFields](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-tab-fields/#api-group-screen-tab-fields) - [screenSchemes](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-screen-schemes/#api-group-screen-schemes) - [serverInfo](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-server-info/#api-group-server-info) + - [serviceRegistry](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-service-registry/#api-group-service-registry) - [status](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-status/#api-group-status) - [tasks](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-group-tasks) + - [teamsInPlan](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-teams-in-plan/#api-group-teams-in-plan) - [timeTracking](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-time-tracking/#api-group-time-tracking) - [uiModificationsApps](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-ui-modifications--apps-/#api-group-ui-modifications--apps-) - [users](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-group-users) diff --git a/examples/.gitignore b/examples/.gitignore index a44f6f588b..490df5cea1 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -1,4 +1,5 @@ .idea/ node_modules/ +src/credentials.ts .DS_Store diff --git a/examples/src/credentials.ts b/examples/src/credentials.ts index cfb10bf39b..d237665ca6 100644 --- a/examples/src/credentials.ts +++ b/examples/src/credentials.ts @@ -1,6 +1,7 @@ -export const host = 'https://jira-js.atlassian.net/'; -export const email = 'mrrefactoring@yandex.ru'; -export const apiToken = 'ATATT3xFfGF0CQo3Ed8gqWxZmT2nlOEinQZJkp7hVY-ynttVtAsRwGF5JYD1vBcSu0i3RNfilR_RbksRFBxU33tsWTi7R5ontSouy0mwNqPhTazoZiVm5ah3_Emcy9g7-KB0rW7XTm5uLHeCdUW9X-Fv1jqWUHjtrOgCr4pXtcV6DmJPyBLa3Jg=582DE538'; +/* eslint-disable @typescript-eslint/no-unnecessary-condition */ +export const host = ''; +export const email = ''; +export const apiToken = ''; if (!host) { throw new Error('Please specify host'); diff --git a/package-lock.json b/package-lock.json index 73dc089150..acf7d6764b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,42 +1,42 @@ { "name": "jira.js", - "version": "4.0.6", + "version": "4.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "jira.js", - "version": "4.0.6", + "version": "4.1.0", "license": "MIT", "dependencies": { - "axios": "^1.7.9", + "axios": "^1.8.1", "formdata-node": "^6.0.3", "mime": "^4.0.6", "tslib": "^2.8.1" }, "devDependencies": { - "@types/node": "^18.19.70", - "@types/sinon": "^17.0.3", - "@typescript-eslint/eslint-plugin": "^8.19.1", - "@typescript-eslint/parser": "^8.19.1", + "@types/node": "^18.19.77", + "@types/sinon": "^17.0.4", + "@typescript-eslint/eslint-plugin": "^8.25.0", + "@typescript-eslint/parser": "^8.25.0", "dotenv": "^16.4.7", "eslint": "^8.57.1", "eslint-config-airbnb-base": "^15.0.0", - "eslint-import-resolver-typescript": "^3.7.0", + "eslint-import-resolver-typescript": "^3.8.3", "eslint-plugin-import": "^2.31.0", - "prettier": "^3.4.2", + "prettier": "^3.5.2", "prettier-plugin-jsdoc": "^1.3.2", "sinon": "^18.0.1", - "typedoc": "^0.27.6", + "typedoc": "^0.27.9", "typescript": "^5.7.3", "vite-tsconfig-paths": "^5.1.4", - "vitest": "^2.1.8" + "vitest": "^3.0.7" } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", - "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.0.tgz", + "integrity": "sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==", "cpu": [ "ppc64" ], @@ -47,13 +47,13 @@ "aix" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", - "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.0.tgz", + "integrity": "sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==", "cpu": [ "arm" ], @@ -64,13 +64,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", - "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.0.tgz", + "integrity": "sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==", "cpu": [ "arm64" ], @@ -81,13 +81,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/android-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", - "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.0.tgz", + "integrity": "sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==", "cpu": [ "x64" ], @@ -98,13 +98,13 @@ "android" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", - "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.0.tgz", + "integrity": "sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==", "cpu": [ "arm64" ], @@ -115,13 +115,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", - "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.0.tgz", + "integrity": "sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==", "cpu": [ "x64" ], @@ -132,13 +132,13 @@ "darwin" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", - "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.0.tgz", + "integrity": "sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==", "cpu": [ "arm64" ], @@ -149,13 +149,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", - "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.0.tgz", + "integrity": "sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==", "cpu": [ "x64" ], @@ -166,13 +166,13 @@ "freebsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", - "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.0.tgz", + "integrity": "sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==", "cpu": [ "arm" ], @@ -183,13 +183,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", - "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.0.tgz", + "integrity": "sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==", "cpu": [ "arm64" ], @@ -200,13 +200,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", - "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.0.tgz", + "integrity": "sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==", "cpu": [ "ia32" ], @@ -217,13 +217,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", - "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.0.tgz", + "integrity": "sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==", "cpu": [ "loong64" ], @@ -234,13 +234,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", - "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.0.tgz", + "integrity": "sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==", "cpu": [ "mips64el" ], @@ -251,13 +251,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", - "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.0.tgz", + "integrity": "sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==", "cpu": [ "ppc64" ], @@ -268,13 +268,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", - "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.0.tgz", + "integrity": "sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==", "cpu": [ "riscv64" ], @@ -285,13 +285,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", - "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.0.tgz", + "integrity": "sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==", "cpu": [ "s390x" ], @@ -302,13 +302,13 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/linux-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", - "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.0.tgz", + "integrity": "sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==", "cpu": [ "x64" ], @@ -319,13 +319,30 @@ "linux" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.0.tgz", + "integrity": "sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", - "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.0.tgz", + "integrity": "sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==", "cpu": [ "x64" ], @@ -336,13 +353,30 @@ "netbsd" ], "engines": { - "node": ">=12" + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.0.tgz", + "integrity": "sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", - "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.0.tgz", + "integrity": "sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==", "cpu": [ "x64" ], @@ -353,13 +387,13 @@ "openbsd" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", - "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.0.tgz", + "integrity": "sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==", "cpu": [ "x64" ], @@ -370,13 +404,13 @@ "sunos" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", - "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.0.tgz", + "integrity": "sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==", "cpu": [ "arm64" ], @@ -387,13 +421,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", - "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.0.tgz", + "integrity": "sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==", "cpu": [ "ia32" ], @@ -404,13 +438,13 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@esbuild/win32-x64": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", - "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.0.tgz", + "integrity": "sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==", "cpu": [ "x64" ], @@ -421,7 +455,7 @@ "win32" ], "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/@eslint-community/eslint-utils": { @@ -512,14 +546,14 @@ } }, "node_modules/@gerrit0/mini-shiki": { - "version": "1.26.1", - "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-1.26.1.tgz", - "integrity": "sha512-gHFUvv9f1fU2Piou/5Y7Sx5moYxcERbC7CXc6rkDLQTUBg5Dgg9L4u29/nHqfoQ3Y9R0h0BcOhd14uOEZIBP7Q==", + "version": "1.27.2", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-1.27.2.tgz", + "integrity": "sha512-GeWyHz8ao2gBiUW4OJnQDxXQnFgZQwwQk05t/CVVgNBN7/rK8XZ7xY6YhLVv9tH3VppWWmr9DCl3MwemB/i+Og==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/engine-oniguruma": "^1.26.1", - "@shikijs/types": "^1.26.1", + "@shikijs/engine-oniguruma": "^1.27.2", + "@shikijs/types": "^1.27.2", "@shikijs/vscode-textmate": "^10.0.1" } }, @@ -641,9 +675,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.30.1.tgz", - "integrity": "sha512-pSWY+EVt3rJ9fQ3IqlrEUtXh3cGqGtPDH1FQlNZehO2yYxCHEX1SPsz1M//NXwYfbTlcKr9WObLnJX9FsS9K1Q==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.8.tgz", + "integrity": "sha512-q217OSE8DTp8AFHuNHXo0Y86e1wtlfVrXiAlwkIvGRQv9zbc6mE3sjIVfwI8sYUyNxwOg0j/Vm1RKM04JcWLJw==", "cpu": [ "arm" ], @@ -655,9 +689,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.30.1.tgz", - "integrity": "sha512-/NA2qXxE3D/BRjOJM8wQblmArQq1YoBVJjrjoTSBS09jgUisq7bqxNHJ8kjCHeV21W/9WDGwJEWSN0KQ2mtD/w==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.8.tgz", + "integrity": "sha512-Gigjz7mNWaOL9wCggvoK3jEIUUbGul656opstjaUSGC3eT0BM7PofdAJaBfPFWWkXNVAXbaQtC99OCg4sJv70Q==", "cpu": [ "arm64" ], @@ -669,9 +703,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.30.1.tgz", - "integrity": "sha512-r7FQIXD7gB0WJ5mokTUgUWPl0eYIH0wnxqeSAhuIwvnnpjdVB8cRRClyKLQr7lgzjctkbp5KmswWszlwYln03Q==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.8.tgz", + "integrity": "sha512-02rVdZ5tgdUNRxIUrFdcMBZQoaPMrxtwSb+/hOfBdqkatYHR3lZ2A2EGyHq2sGOd0Owk80oV3snlDASC24He3Q==", "cpu": [ "arm64" ], @@ -683,9 +717,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.30.1.tgz", - "integrity": "sha512-x78BavIwSH6sqfP2xeI1hd1GpHL8J4W2BXcVM/5KYKoAD3nNsfitQhvWSw+TFtQTLZ9OmlF+FEInEHyubut2OA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.8.tgz", + "integrity": "sha512-qIP/elwR/tq/dYRx3lgwK31jkZvMiD6qUtOycLhTzCvrjbZ3LjQnEM9rNhSGpbLXVJYQ3rq39A6Re0h9tU2ynw==", "cpu": [ "x64" ], @@ -697,9 +731,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.30.1.tgz", - "integrity": "sha512-HYTlUAjbO1z8ywxsDFWADfTRfTIIy/oUlfIDmlHYmjUP2QRDTzBuWXc9O4CXM+bo9qfiCclmHk1x4ogBjOUpUQ==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.8.tgz", + "integrity": "sha512-IQNVXL9iY6NniYbTaOKdrlVP3XIqazBgJOVkddzJlqnCpRi/yAeSOa8PLcECFSQochzqApIOE1GHNu3pCz+BDA==", "cpu": [ "arm64" ], @@ -711,9 +745,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.30.1.tgz", - "integrity": "sha512-1MEdGqogQLccphhX5myCJqeGNYTNcmTyaic9S7CG3JhwuIByJ7J05vGbZxsizQthP1xpVx7kd3o31eOogfEirw==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.8.tgz", + "integrity": "sha512-TYXcHghgnCqYFiE3FT5QwXtOZqDj5GmaFNTNt3jNC+vh22dc/ukG2cG+pi75QO4kACohZzidsq7yKTKwq/Jq7Q==", "cpu": [ "x64" ], @@ -725,9 +759,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.30.1.tgz", - "integrity": "sha512-PaMRNBSqCx7K3Wc9QZkFx5+CX27WFpAMxJNiYGAXfmMIKC7jstlr32UhTgK6T07OtqR+wYlWm9IxzennjnvdJg==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.8.tgz", + "integrity": "sha512-A4iphFGNkWRd+5m3VIGuqHnG3MVnqKe7Al57u9mwgbyZ2/xF9Jio72MaY7xxh+Y87VAHmGQr73qoKL9HPbXj1g==", "cpu": [ "arm" ], @@ -739,9 +773,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.30.1.tgz", - "integrity": "sha512-B8Rcyj9AV7ZlEFqvB5BubG5iO6ANDsRKlhIxySXcF1axXYUyqwBok+XZPgIYGBgs7LDXfWfifxhw0Ik57T0Yug==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.8.tgz", + "integrity": "sha512-S0lqKLfTm5u+QTxlFiAnb2J/2dgQqRy/XvziPtDd1rKZFXHTyYLoVL58M/XFwDI01AQCDIevGLbQrMAtdyanpA==", "cpu": [ "arm" ], @@ -753,9 +787,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.30.1.tgz", - "integrity": "sha512-hqVyueGxAj3cBKrAI4aFHLV+h0Lv5VgWZs9CUGqr1z0fZtlADVV1YPOij6AhcK5An33EXaxnDLmJdQikcn5NEw==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.8.tgz", + "integrity": "sha512-jpz9YOuPiSkL4G4pqKrus0pn9aYwpImGkosRKwNi+sJSkz+WU3anZe6hi73StLOQdfXYXC7hUfsQlTnjMd3s1A==", "cpu": [ "arm64" ], @@ -767,9 +801,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.30.1.tgz", - "integrity": "sha512-i4Ab2vnvS1AE1PyOIGp2kXni69gU2DAUVt6FSXeIqUCPIR3ZlheMW3oP2JkukDfu3PsexYRbOiJrY+yVNSk9oA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.8.tgz", + "integrity": "sha512-KdSfaROOUJXgTVxJNAZ3KwkRc5nggDk+06P6lgi1HLv1hskgvxHUKZ4xtwHkVYJ1Rep4GNo+uEfycCRRxht7+Q==", "cpu": [ "arm64" ], @@ -781,9 +815,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.30.1.tgz", - "integrity": "sha512-fARcF5g296snX0oLGkVxPmysetwUk2zmHcca+e9ObOovBR++9ZPOhqFUM61UUZ2EYpXVPN1redgqVoBB34nTpQ==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.8.tgz", + "integrity": "sha512-NyF4gcxwkMFRjgXBM6g2lkT58OWztZvw5KkV2K0qqSnUEqCVcqdh2jN4gQrTn/YUpAcNKyFHfoOZEer9nwo6uQ==", "cpu": [ "loong64" ], @@ -795,9 +829,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.30.1.tgz", - "integrity": "sha512-GLrZraoO3wVT4uFXh67ElpwQY0DIygxdv0BNW9Hkm3X34wu+BkqrDrkcsIapAY+N2ATEbvak0XQ9gxZtCIA5Rw==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.8.tgz", + "integrity": "sha512-LMJc999GkhGvktHU85zNTDImZVUCJ1z/MbAJTnviiWmmjyckP5aQsHtcujMjpNdMZPT2rQEDBlJfubhs3jsMfw==", "cpu": [ "ppc64" ], @@ -809,9 +843,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.30.1.tgz", - "integrity": "sha512-0WKLaAUUHKBtll0wvOmh6yh3S0wSU9+yas923JIChfxOaaBarmb/lBKPF0w/+jTVozFnOXJeRGZ8NvOxvk/jcw==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.8.tgz", + "integrity": "sha512-xAQCAHPj8nJq1PI3z8CIZzXuXCstquz7cIOL73HHdXiRcKk8Ywwqtx2wrIy23EcTn4aZ2fLJNBB8d0tQENPCmw==", "cpu": [ "riscv64" ], @@ -823,9 +857,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.30.1.tgz", - "integrity": "sha512-GWFs97Ruxo5Bt+cvVTQkOJ6TIx0xJDD/bMAOXWJg8TCSTEK8RnFeOeiFTxKniTc4vMIaWvCplMAFBt9miGxgkA==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.8.tgz", + "integrity": "sha512-DdePVk1NDEuc3fOe3dPPTb+rjMtuFw89gw6gVWxQFAuEqqSdDKnrwzZHrUYdac7A7dXl9Q2Vflxpme15gUWQFA==", "cpu": [ "s390x" ], @@ -837,9 +871,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.30.1.tgz", - "integrity": "sha512-UtgGb7QGgXDIO+tqqJ5oZRGHsDLO8SlpE4MhqpY9Llpzi5rJMvrK6ZGhsRCST2abZdBqIBeXW6WPD5fGK5SDwg==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.8.tgz", + "integrity": "sha512-8y7ED8gjxITUltTUEJLQdgpbPh1sUQ0kMTmufRF/Ns5tI9TNMNlhWtmPKKHCU0SilX+3MJkZ0zERYYGIVBYHIA==", "cpu": [ "x64" ], @@ -851,9 +885,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.30.1.tgz", - "integrity": "sha512-V9U8Ey2UqmQsBT+xTOeMzPzwDzyXmnAoO4edZhL7INkwQcaW1Ckv3WJX3qrrp/VHaDkEWIBWhRwP47r8cdrOow==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.8.tgz", + "integrity": "sha512-SCXcP0ZpGFIe7Ge+McxY5zKxiEI5ra+GT3QRxL0pMMtxPfpyLAKleZODi1zdRHkz5/BhueUrYtYVgubqe9JBNQ==", "cpu": [ "x64" ], @@ -865,9 +899,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.30.1.tgz", - "integrity": "sha512-WabtHWiPaFF47W3PkHnjbmWawnX/aE57K47ZDT1BXTS5GgrBUEpvOzq0FI0V/UYzQJgdb8XlhVNH8/fwV8xDjw==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.8.tgz", + "integrity": "sha512-YHYsgzZgFJzTRbth4h7Or0m5O74Yda+hLin0irAIobkLQFRQd1qWmnoVfwmKm9TXIZVAD0nZ+GEb2ICicLyCnQ==", "cpu": [ "arm64" ], @@ -879,9 +913,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.30.1.tgz", - "integrity": "sha512-pxHAU+Zv39hLUTdQQHUVHf4P+0C47y/ZloorHpzs2SXMRqeAWmGghzAhfOlzFHHwjvgokdFAhC4V+6kC1lRRfw==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.8.tgz", + "integrity": "sha512-r3NRQrXkHr4uWy5TOjTpTYojR9XmF0j/RYgKCef+Ag46FWUTltm5ziticv8LdNsDMehjJ543x/+TJAek/xBA2w==", "cpu": [ "ia32" ], @@ -893,9 +927,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.30.1.tgz", - "integrity": "sha512-D6qjsXGcvhTjv0kI4fU8tUuBDF/Ueee4SVX79VfNDXZa64TfCW1Slkb6Z7O1p7vflqZjcmOVdZlqf8gvJxc6og==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.8.tgz", + "integrity": "sha512-U0FaE5O1BCpZSeE6gBl3c5ObhePQSfk9vDRToMmTkbhCOgW4jqvtS5LGyQ76L1fH8sM0keRp4uDTsbjiUyjk0g==", "cpu": [ "x64" ], @@ -914,20 +948,20 @@ "license": "MIT" }, "node_modules/@shikijs/engine-oniguruma": { - "version": "1.26.1", - "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.26.1.tgz", - "integrity": "sha512-F5XuxN1HljLuvfXv7d+mlTkV7XukC1cawdtOo+7pKgPD83CAB1Sf8uHqP3PK0u7njFH0ZhoXE1r+0JzEgAQ+kg==", + "version": "1.29.2", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-1.29.2.tgz", + "integrity": "sha512-7iiOx3SG8+g1MnlzZVDYiaeHe7Ez2Kf2HrJzdmGwkRisT7r4rak0e655AcM/tF9JG/kg5fMNYlLLKglbN7gBqA==", "dev": true, "license": "MIT", "dependencies": { - "@shikijs/types": "1.26.1", + "@shikijs/types": "1.29.2", "@shikijs/vscode-textmate": "^10.0.1" } }, "node_modules/@shikijs/types": { - "version": "1.26.1", - "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.26.1.tgz", - "integrity": "sha512-d4B00TKKAMaHuFYgRf3L0gwtvqpW4hVdVwKcZYbBfAAQXspgkbWqnFfuFl3MDH6gLbsubOcr+prcnsqah3ny7Q==", + "version": "1.29.2", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-1.29.2.tgz", + "integrity": "sha512-VJjK0eIijTZf0QSTODEXCqinjBn0joAHQ+aPSBzrv4O2d/QSbsMw+ZeSRx03kV34Hy7NzUvV/7NqfYGRLrASmw==", "dev": true, "license": "MIT", "dependencies": { @@ -936,9 +970,9 @@ } }, "node_modules/@shikijs/vscode-textmate": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.1.tgz", - "integrity": "sha512-fTIQwLF+Qhuws31iw7Ncl1R3HUDtGwIipiJ9iU+UsDUwMhegFcQKQHd51nZjb7CArq0MvON8rbgCGQYWHUKAdg==", + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", + "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", "dev": true, "license": "MIT" }, @@ -1036,16 +1070,16 @@ } }, "node_modules/@types/ms": { - "version": "0.7.34", - "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", - "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", "dev": true, "license": "MIT" }, "node_modules/@types/node": { - "version": "18.19.70", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.70.tgz", - "integrity": "sha512-RE+K0+KZoEpDUbGGctnGdkrLFwi1eYKTlIHNl2Um98mUkGsm1u2Ff6Ltd0e8DktTtC98uy7rSj+hO8t/QuLoVQ==", + "version": "18.19.77", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.77.tgz", + "integrity": "sha512-D94SwXkCv6X58yYiJziuwmvyqCfH99TfPVSS4IUGdXB8lCOehCz37JqpvMhqiY9GuI1npAo7ZUTG3EJZ01M8bg==", "dev": true, "license": "MIT", "dependencies": { @@ -1053,9 +1087,9 @@ } }, "node_modules/@types/sinon": { - "version": "17.0.3", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.3.tgz", - "integrity": "sha512-j3uovdn8ewky9kRBG19bOwaZbexJu/XjtkHyjvUgt4xfPFz18dcORIMqnYh66Fx3Powhcr85NT5+er3+oViapw==", + "version": "17.0.4", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.4.tgz", + "integrity": "sha512-RHnIrhfPO3+tJT0s7cFaXGZvsL4bbR3/k7z3P312qMS4JaS2Tk+KiwiLx1S0rQ56ERj00u1/BtdyVd0FY+Pdew==", "dev": true, "license": "MIT", "dependencies": { @@ -1077,21 +1111,21 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.19.1.tgz", - "integrity": "sha512-tJzcVyvvb9h/PB96g30MpxACd9IrunT7GF9wfA9/0TJ1LxGOJx1TdPzSbBBnNED7K9Ka8ybJsnEpiXPktolTLg==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.25.0.tgz", + "integrity": "sha512-VM7bpzAe7JO/BFf40pIT1lJqS/z1F8OaSsUB3rpFJucQA4cOSuH2RVVVkFULN+En0Djgr29/jb4EQnedUo95KA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.19.1", - "@typescript-eslint/type-utils": "8.19.1", - "@typescript-eslint/utils": "8.19.1", - "@typescript-eslint/visitor-keys": "8.19.1", + "@typescript-eslint/scope-manager": "8.25.0", + "@typescript-eslint/type-utils": "8.25.0", + "@typescript-eslint/utils": "8.25.0", + "@typescript-eslint/visitor-keys": "8.25.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", - "ts-api-utils": "^2.0.0" + "ts-api-utils": "^2.0.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1107,16 +1141,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.19.1.tgz", - "integrity": "sha512-67gbfv8rAwawjYx3fYArwldTQKoYfezNUT4D5ioWetr/xCrxXxvleo3uuiFuKfejipvq+og7mjz3b0G2bVyUCw==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.25.0.tgz", + "integrity": "sha512-4gbs64bnbSzu4FpgMiQ1A+D+urxkoJk/kqlDJ2W//5SygaEiAP2B4GoS7TEdxgwol2el03gckFV9lJ4QOMiiHg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.19.1", - "@typescript-eslint/types": "8.19.1", - "@typescript-eslint/typescript-estree": "8.19.1", - "@typescript-eslint/visitor-keys": "8.19.1", + "@typescript-eslint/scope-manager": "8.25.0", + "@typescript-eslint/types": "8.25.0", + "@typescript-eslint/typescript-estree": "8.25.0", + "@typescript-eslint/visitor-keys": "8.25.0", "debug": "^4.3.4" }, "engines": { @@ -1132,14 +1166,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.19.1.tgz", - "integrity": "sha512-60L9KIuN/xgmsINzonOcMDSB8p82h95hoBfSBtXuO4jlR1R9L1xSkmVZKgCPVfavDlXihh4ARNjXhh1gGnLC7Q==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.25.0.tgz", + "integrity": "sha512-6PPeiKIGbgStEyt4NNXa2ru5pMzQ8OYKO1hX1z53HMomrmiSB+R5FmChgQAP1ro8jMtNawz+TRQo/cSXrauTpg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.19.1", - "@typescript-eslint/visitor-keys": "8.19.1" + "@typescript-eslint/types": "8.25.0", + "@typescript-eslint/visitor-keys": "8.25.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1150,16 +1184,16 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.19.1.tgz", - "integrity": "sha512-Rp7k9lhDKBMRJB/nM9Ksp1zs4796wVNyihG9/TU9R6KCJDNkQbc2EOKjrBtLYh3396ZdpXLtr/MkaSEmNMtykw==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.25.0.tgz", + "integrity": "sha512-d77dHgHWnxmXOPJuDWO4FDWADmGQkN5+tt6SFRZz/RtCWl4pHgFl3+WdYCn16+3teG09DY6XtEpf3gGD0a186g==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.19.1", - "@typescript-eslint/utils": "8.19.1", + "@typescript-eslint/typescript-estree": "8.25.0", + "@typescript-eslint/utils": "8.25.0", "debug": "^4.3.4", - "ts-api-utils": "^2.0.0" + "ts-api-utils": "^2.0.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1174,9 +1208,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.19.1.tgz", - "integrity": "sha512-JBVHMLj7B1K1v1051ZaMMgLW4Q/jre5qGK0Ew6UgXz1Rqh+/xPzV1aW581OM00X6iOfyr1be+QyW8LOUf19BbA==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.25.0.tgz", + "integrity": "sha512-+vUe0Zb4tkNgznQwicsvLUJgZIRs6ITeWSCclX1q85pR1iOiaj+4uZJIUp//Z27QWu5Cseiw3O3AR8hVpax7Aw==", "dev": true, "license": "MIT", "engines": { @@ -1188,20 +1222,20 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.19.1.tgz", - "integrity": "sha512-jk/TZwSMJlxlNnqhy0Eod1PNEvCkpY6MXOXE/WLlblZ6ibb32i2We4uByoKPv1d0OD2xebDv4hbs3fm11SMw8Q==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.25.0.tgz", + "integrity": "sha512-ZPaiAKEZ6Blt/TPAx5Ot0EIB/yGtLI2EsGoY6F7XKklfMxYQyvtL+gT/UCqkMzO0BVFHLDlzvFqQzurYahxv9Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.19.1", - "@typescript-eslint/visitor-keys": "8.19.1", + "@typescript-eslint/types": "8.25.0", + "@typescript-eslint/visitor-keys": "8.25.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", - "ts-api-utils": "^2.0.0" + "ts-api-utils": "^2.0.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1215,16 +1249,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.19.1.tgz", - "integrity": "sha512-IxG5gLO0Ne+KaUc8iW1A+XuKLd63o4wlbI1Zp692n1xojCl/THvgIKXJXBZixTh5dd5+yTJ/VXH7GJaaw21qXA==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.25.0.tgz", + "integrity": "sha512-syqRbrEv0J1wywiLsK60XzHnQe/kRViI3zwFALrNEgnntn1l24Ra2KvOAWwWbWZ1lBZxZljPDGOq967dsl6fkA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.19.1", - "@typescript-eslint/types": "8.19.1", - "@typescript-eslint/typescript-estree": "8.19.1" + "@typescript-eslint/scope-manager": "8.25.0", + "@typescript-eslint/types": "8.25.0", + "@typescript-eslint/typescript-estree": "8.25.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1239,13 +1273,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.19.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.19.1.tgz", - "integrity": "sha512-fzmjU8CHK853V/avYZAvuVut3ZTfwN5YtMaoi+X9Y9MA9keaWNHC3zEQ9zvyX/7Hj+5JkNyK1l7TOR2hevHB6Q==", + "version": "8.25.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.25.0.tgz", + "integrity": "sha512-kCYXKAum9CecGVHGij7muybDfTS2sD3t0L4bJsEZLkyrXUImiCTq1M3LG2SRtOhiHFwMR9wAFplpT6XHYjTkwQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.19.1", + "@typescript-eslint/types": "8.25.0", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -1270,45 +1304,45 @@ } }, "node_modules/@ungap/structured-clone": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.1.tgz", - "integrity": "sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", "dev": true, "license": "ISC" }, "node_modules/@vitest/expect": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.8.tgz", - "integrity": "sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.0.7.tgz", + "integrity": "sha512-QP25f+YJhzPfHrHfYHtvRn+uvkCFCqFtW9CktfBxmB+25QqWsx7VB2As6f4GmwllHLDhXNHvqedwhvMmSnNmjw==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "2.1.8", - "@vitest/utils": "2.1.8", - "chai": "^5.1.2", - "tinyrainbow": "^1.2.0" + "@vitest/spy": "3.0.7", + "@vitest/utils": "3.0.7", + "chai": "^5.2.0", + "tinyrainbow": "^2.0.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/mocker": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.8.tgz", - "integrity": "sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.0.7.tgz", + "integrity": "sha512-qui+3BLz9Eonx4EAuR/i+QlCX6AUZ35taDQgwGkK/Tw6/WgwodSrjN1X2xf69IA/643ZX5zNKIn2svvtZDrs4w==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/spy": "2.1.8", + "@vitest/spy": "3.0.7", "estree-walker": "^3.0.3", - "magic-string": "^0.30.12" + "magic-string": "^0.30.17" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { "msw": "^2.4.9", - "vite": "^5.0.0" + "vite": "^5.0.0 || ^6.0.0" }, "peerDependenciesMeta": { "msw": { @@ -1320,51 +1354,51 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.8.tgz", - "integrity": "sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.0.7.tgz", + "integrity": "sha512-CiRY0BViD/V8uwuEzz9Yapyao+M9M008/9oMOSQydwbwb+CMokEq3XVaF3XK/VWaOK0Jm9z7ENhybg70Gtxsmg==", "dev": true, "license": "MIT", "dependencies": { - "tinyrainbow": "^1.2.0" + "tinyrainbow": "^2.0.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/runner": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.8.tgz", - "integrity": "sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.0.7.tgz", + "integrity": "sha512-WeEl38Z0S2ZcuRTeyYqaZtm4e26tq6ZFqh5y8YD9YxfWuu0OFiGFUbnxNynwLjNRHPsXyee2M9tV7YxOTPZl2g==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "2.1.8", - "pathe": "^1.1.2" + "@vitest/utils": "3.0.7", + "pathe": "^2.0.3" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/snapshot": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.8.tgz", - "integrity": "sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.0.7.tgz", + "integrity": "sha512-eqTUryJWQN0Rtf5yqCGTQWsCFOQe4eNz5Twsu21xYEcnFJtMU5XvmG0vgebhdLlrHQTSq5p8vWHJIeJQV8ovsA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.8", - "magic-string": "^0.30.12", - "pathe": "^1.1.2" + "@vitest/pretty-format": "3.0.7", + "magic-string": "^0.30.17", + "pathe": "^2.0.3" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/spy": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.8.tgz", - "integrity": "sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.0.7.tgz", + "integrity": "sha512-4T4WcsibB0B6hrKdAZTM37ekuyFZt2cGbEGd2+L0P8ov15J1/HUsUaqkXEQPNAWr4BtPPe1gI+FYfMHhEKfR8w==", "dev": true, "license": "MIT", "dependencies": { @@ -1375,15 +1409,15 @@ } }, "node_modules/@vitest/utils": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.8.tgz", - "integrity": "sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.0.7.tgz", + "integrity": "sha512-xePVpCRfooFX3rANQjwoditoXgWb1MaFbzmGuPP59MK6i13mrnDw/yEIyJudLeW6/38mCNcwCiJIGmpDPibAIg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.8", - "loupe": "^3.1.2", - "tinyrainbow": "^1.2.0" + "@vitest/pretty-format": "3.0.7", + "loupe": "^3.1.3", + "tinyrainbow": "^2.0.0" }, "funding": { "url": "https://opencollective.com/vitest" @@ -1591,6 +1625,16 @@ "node": ">=12" } }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -1614,9 +1658,9 @@ } }, "node_modules/axios": { - "version": "1.7.9", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", - "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.1.tgz", + "integrity": "sha512-NN+fvwH/kV01dYUQ3PTOZns4LWtWhOFCAhQ/pHb88WQ1hNe5V/dvFwc4VJcDL11LT9xSX0QtsR8sWUuyOuOq7g==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", @@ -1691,10 +1735,9 @@ } }, "node_modules/call-bind-apply-helpers": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", - "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", - "dev": true, + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -1732,9 +1775,9 @@ } }, "node_modules/chai": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", - "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.2.0.tgz", + "integrity": "sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==", "dev": true, "license": "MIT", "dependencies": { @@ -2069,7 +2112,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, "license": "MIT", "dependencies": { "call-bind-apply-helpers": "^1.0.1", @@ -2081,9 +2123,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.18.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz", - "integrity": "sha512-0/r0MySGYG8YqlayBZ6MuCfECmHFdJ5qyPh8s8wa5Hnm6SaFLSK1VYCbj+NKp090Nm1caZhD+QTnmxO7esYGyQ==", + "version": "5.18.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz", + "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==", "dev": true, "license": "MIT", "dependencies": { @@ -2177,7 +2219,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -2187,7 +2228,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -2201,10 +2241,9 @@ "license": "MIT" }, "node_modules/es-object-atoms": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", - "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", - "dev": true, + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", "license": "MIT", "dependencies": { "es-errors": "^1.3.0" @@ -2217,7 +2256,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", - "dev": true, "license": "MIT", "dependencies": { "es-errors": "^1.3.0", @@ -2230,13 +2268,16 @@ } }, "node_modules/es-shim-unscopables": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", - "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", "dev": true, "license": "MIT", "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" } }, "node_modules/es-to-primitive": { @@ -2258,9 +2299,9 @@ } }, "node_modules/esbuild": { - "version": "0.21.5", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", - "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.0.tgz", + "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -2268,32 +2309,34 @@ "esbuild": "bin/esbuild" }, "engines": { - "node": ">=12" + "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.21.5", - "@esbuild/android-arm": "0.21.5", - "@esbuild/android-arm64": "0.21.5", - "@esbuild/android-x64": "0.21.5", - "@esbuild/darwin-arm64": "0.21.5", - "@esbuild/darwin-x64": "0.21.5", - "@esbuild/freebsd-arm64": "0.21.5", - "@esbuild/freebsd-x64": "0.21.5", - "@esbuild/linux-arm": "0.21.5", - "@esbuild/linux-arm64": "0.21.5", - "@esbuild/linux-ia32": "0.21.5", - "@esbuild/linux-loong64": "0.21.5", - "@esbuild/linux-mips64el": "0.21.5", - "@esbuild/linux-ppc64": "0.21.5", - "@esbuild/linux-riscv64": "0.21.5", - "@esbuild/linux-s390x": "0.21.5", - "@esbuild/linux-x64": "0.21.5", - "@esbuild/netbsd-x64": "0.21.5", - "@esbuild/openbsd-x64": "0.21.5", - "@esbuild/sunos-x64": "0.21.5", - "@esbuild/win32-arm64": "0.21.5", - "@esbuild/win32-ia32": "0.21.5", - "@esbuild/win32-x64": "0.21.5" + "@esbuild/aix-ppc64": "0.25.0", + "@esbuild/android-arm": "0.25.0", + "@esbuild/android-arm64": "0.25.0", + "@esbuild/android-x64": "0.25.0", + "@esbuild/darwin-arm64": "0.25.0", + "@esbuild/darwin-x64": "0.25.0", + "@esbuild/freebsd-arm64": "0.25.0", + "@esbuild/freebsd-x64": "0.25.0", + "@esbuild/linux-arm": "0.25.0", + "@esbuild/linux-arm64": "0.25.0", + "@esbuild/linux-ia32": "0.25.0", + "@esbuild/linux-loong64": "0.25.0", + "@esbuild/linux-mips64el": "0.25.0", + "@esbuild/linux-ppc64": "0.25.0", + "@esbuild/linux-riscv64": "0.25.0", + "@esbuild/linux-s390x": "0.25.0", + "@esbuild/linux-x64": "0.25.0", + "@esbuild/netbsd-arm64": "0.25.0", + "@esbuild/netbsd-x64": "0.25.0", + "@esbuild/openbsd-arm64": "0.25.0", + "@esbuild/openbsd-x64": "0.25.0", + "@esbuild/sunos-x64": "0.25.0", + "@esbuild/win32-arm64": "0.25.0", + "@esbuild/win32-ia32": "0.25.0", + "@esbuild/win32-x64": "0.25.0" } }, "node_modules/escape-string-regexp": { @@ -2419,20 +2462,19 @@ } }, "node_modules/eslint-import-resolver-typescript": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.7.0.tgz", - "integrity": "sha512-Vrwyi8HHxY97K5ebydMtffsWAn1SCR9eol49eCd5fJS4O1WV7PaAjbcjmbfJJSMz/t4Mal212Uz/fQZrOB8mow==", + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.8.3.tgz", + "integrity": "sha512-A0bu4Ks2QqDWNpeEgTQMPTngaMhuDu4yv6xpftBMAf+1ziXnpx+eSR1WRfoPTe2BAiAjHFZ7kSNx1fvr5g5pmQ==", "dev": true, "license": "ISC", "dependencies": { "@nolyfill/is-core-module": "1.0.39", "debug": "^4.3.7", "enhanced-resolve": "^5.15.0", - "fast-glob": "^3.3.2", - "get-tsconfig": "^4.7.5", + "get-tsconfig": "^4.10.0", "is-bun-module": "^1.0.2", - "is-glob": "^4.0.3", - "stable-hash": "^0.0.4" + "stable-hash": "^0.0.4", + "tinyglobby": "^0.2.12" }, "engines": { "node": "^14.18.0 || >=16.0.0" @@ -2702,9 +2744,9 @@ } }, "node_modules/expect-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.1.0.tgz", - "integrity": "sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.2.0.tgz", + "integrity": "sha512-80F22aiJ3GLyVnS/B3HzgR6RelZVumzj9jkL0Rhz4h0xYbNW9PjlQz5h3J/SShErbXBc295vseR4/MIbVmUbeA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -2763,9 +2805,9 @@ "license": "MIT" }, "node_modules/fastq": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.18.0.tgz", - "integrity": "sha512-QKHXPW0hD8g4UET03SdOdunzSouc9N4AuHdsX8XNcTsuz+yYFILVNIX4l9yHABMhiEI9Db0JTTIpu0wB+Y1QQw==", + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", + "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", "dev": true, "license": "ISC", "dependencies": { @@ -2831,9 +2873,9 @@ } }, "node_modules/flatted": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", - "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "dev": true, "license": "ISC" }, @@ -2858,23 +2900,30 @@ } }, "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", "dev": true, "license": "MIT", "dependencies": { - "is-callable": "^1.1.3" + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/form-data": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", - "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", "mime-types": "^2.1.12" }, "engines": { @@ -2916,7 +2965,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2954,18 +3002,17 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", - "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", - "dev": true, + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "license": "MIT", "dependencies": { - "call-bind-apply-helpers": "^1.0.1", + "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", + "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", - "get-proto": "^1.0.0", + "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", @@ -2982,7 +3029,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, "license": "MIT", "dependencies": { "dunder-proto": "^1.0.1", @@ -3011,9 +3057,9 @@ } }, "node_modules/get-tsconfig": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.1.tgz", - "integrity": "sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==", + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.0.tgz", + "integrity": "sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==", "dev": true, "license": "MIT", "dependencies": { @@ -3126,7 +3172,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3205,7 +3250,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3218,7 +3262,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, "license": "MIT", "dependencies": { "has-symbols": "^1.0.3" @@ -3234,7 +3277,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, "license": "MIT", "dependencies": { "function-bind": "^1.1.2" @@ -3254,9 +3296,9 @@ } }, "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, "license": "MIT", "dependencies": { @@ -3333,12 +3375,13 @@ } }, "node_modules/is-async-function": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.0.tgz", - "integrity": "sha512-GExz9MtyhlZyXYLxzlJRj5WUCE661zhDa1Yna52CN57AJsymh+DvXXjyveSioqSRdxvUrdKdvqB1b5cVKsNpWQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", "dev": true, "license": "MIT", "dependencies": { + "async-function": "^1.0.0", "call-bound": "^1.0.3", "get-proto": "^1.0.1", "has-tostringtag": "^1.0.2", @@ -3368,13 +3411,13 @@ } }, "node_modules/is-boolean-object": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.1.tgz", - "integrity": "sha512-l9qO6eFlUETHtuihLcYOaLKByJ1f+N4kthcU9YjHy3N+B3hWv0y/2Nd0mu/7lTFnRQHTrSdXF50HQ3bl5fEnng==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", "dev": true, "license": "MIT", "dependencies": { - "call-bound": "^1.0.2", + "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" }, "engines": { @@ -3679,13 +3722,13 @@ } }, "node_modules/is-weakref": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.0.tgz", - "integrity": "sha512-SXM8Nwyys6nT5WP6pltOwKytLV7FqQ4UiibxVmW+EIosHcmCqkkjViTb5SNssDlkCiEYRP1/pdWUKVvZBmsR2Q==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", "dev": true, "license": "MIT", "dependencies": { - "call-bound": "^1.0.2" + "call-bound": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -3833,6 +3876,7 @@ "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", + "deprecated": "This package is deprecated. Use the optional chaining (?.) operator instead.", "dev": true, "license": "MIT" }, @@ -3844,9 +3888,9 @@ "license": "MIT" }, "node_modules/loupe": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", - "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.3.tgz", + "integrity": "sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==", "dev": true, "license": "MIT" }, @@ -3889,7 +3933,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.4" @@ -3952,9 +3995,9 @@ } }, "node_modules/micromark": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.1.tgz", - "integrity": "sha512-eBPdkcoCNvYcxQOAKAlceo5SNdzZWfF+FcSupREAzdAh9rRmE239CEQAiTwIgblwnoM8zzj35sZ5ZwvSEOF6Kw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", + "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", "dev": true, "funding": [ { @@ -3988,9 +4031,9 @@ } }, "node_modules/micromark-core-commonmark": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.2.tgz", - "integrity": "sha512-FKjQKbxd1cibWMM1P9N+H8TwlgGgSkWZMmfuVucLCHaYqeSvJ0hFeHsIa65pA2nYbes0f8LDHPMrd9X7Ujxg9w==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", + "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", "dev": true, "funding": [ { @@ -4358,9 +4401,9 @@ } }, "node_modules/micromark-util-subtokenize": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.3.tgz", - "integrity": "sha512-VXJJuNxYWSoYL6AJ6OQECCFGhIU2GGHMw8tahogePBrjkG8aCCas3ibkp7RnVOSTClg2is05/R7maAhF1XyQMg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", + "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", "dev": true, "funding": [ { @@ -4398,9 +4441,9 @@ "license": "MIT" }, "node_modules/micromark-util-types": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.1.tgz", - "integrity": "sha512-534m2WhVTddrcKVepwmVEVnUAmtrx9bfIjNoQHRqfnvdaHQiFytEhJoTgpWJvDEXCO5gLTQh3wYC1PgOJA4NSQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", + "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", "dev": true, "funding": [ { @@ -4548,9 +4591,9 @@ } }, "node_modules/object-inspect": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", - "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "dev": true, "license": "MIT", "engines": { @@ -4798,9 +4841,9 @@ } }, "node_modules/pathe": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", "dev": true, "license": "MIT" }, @@ -4835,9 +4878,9 @@ } }, "node_modules/possible-typed-array-names": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", - "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", "dev": true, "license": "MIT", "engines": { @@ -4845,9 +4888,9 @@ } }, "node_modules/postcss": { - "version": "8.4.49", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", - "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", + "version": "8.5.3", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz", + "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", "dev": true, "funding": [ { @@ -4865,7 +4908,7 @@ ], "license": "MIT", "dependencies": { - "nanoid": "^3.3.7", + "nanoid": "^3.3.8", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, @@ -4884,9 +4927,9 @@ } }, "node_modules/prettier": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", - "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.2.tgz", + "integrity": "sha512-lc6npv5PH7hVqozBR7lkBNOGXV9vMwROAPlumdBkX0wTbbzPu/U1hk5yL8p2pt4Xoc+2mkT8t/sow2YrV/M5qg==", "dev": true, "license": "MIT", "bin": { @@ -5050,9 +5093,9 @@ } }, "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", "dev": true, "license": "MIT", "engines": { @@ -5078,9 +5121,9 @@ } }, "node_modules/rollup": { - "version": "4.30.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.30.1.tgz", - "integrity": "sha512-mlJ4glW020fPuLi7DkM/lN97mYEZGWeqBnrljzN0gs7GLctqX3lNWxKQ7Gl712UAX+6fog/L3jh4gb7R6aVi3w==", + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.8.tgz", + "integrity": "sha512-489gTVMzAYdiZHFVA/ig/iYFllCcWFHMvUHI1rpFmkoUtRlQxqh6/yiNqnYibjMZ2b/+FUQwldG+aLsEt6bglQ==", "dev": true, "license": "MIT", "dependencies": { @@ -5094,25 +5137,25 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.30.1", - "@rollup/rollup-android-arm64": "4.30.1", - "@rollup/rollup-darwin-arm64": "4.30.1", - "@rollup/rollup-darwin-x64": "4.30.1", - "@rollup/rollup-freebsd-arm64": "4.30.1", - "@rollup/rollup-freebsd-x64": "4.30.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.30.1", - "@rollup/rollup-linux-arm-musleabihf": "4.30.1", - "@rollup/rollup-linux-arm64-gnu": "4.30.1", - "@rollup/rollup-linux-arm64-musl": "4.30.1", - "@rollup/rollup-linux-loongarch64-gnu": "4.30.1", - "@rollup/rollup-linux-powerpc64le-gnu": "4.30.1", - "@rollup/rollup-linux-riscv64-gnu": "4.30.1", - "@rollup/rollup-linux-s390x-gnu": "4.30.1", - "@rollup/rollup-linux-x64-gnu": "4.30.1", - "@rollup/rollup-linux-x64-musl": "4.30.1", - "@rollup/rollup-win32-arm64-msvc": "4.30.1", - "@rollup/rollup-win32-ia32-msvc": "4.30.1", - "@rollup/rollup-win32-x64-msvc": "4.30.1", + "@rollup/rollup-android-arm-eabi": "4.34.8", + "@rollup/rollup-android-arm64": "4.34.8", + "@rollup/rollup-darwin-arm64": "4.34.8", + "@rollup/rollup-darwin-x64": "4.34.8", + "@rollup/rollup-freebsd-arm64": "4.34.8", + "@rollup/rollup-freebsd-x64": "4.34.8", + "@rollup/rollup-linux-arm-gnueabihf": "4.34.8", + "@rollup/rollup-linux-arm-musleabihf": "4.34.8", + "@rollup/rollup-linux-arm64-gnu": "4.34.8", + "@rollup/rollup-linux-arm64-musl": "4.34.8", + "@rollup/rollup-linux-loongarch64-gnu": "4.34.8", + "@rollup/rollup-linux-powerpc64le-gnu": "4.34.8", + "@rollup/rollup-linux-riscv64-gnu": "4.34.8", + "@rollup/rollup-linux-s390x-gnu": "4.34.8", + "@rollup/rollup-linux-x64-gnu": "4.34.8", + "@rollup/rollup-linux-x64-musl": "4.34.8", + "@rollup/rollup-win32-arm64-msvc": "4.34.8", + "@rollup/rollup-win32-ia32-msvc": "4.34.8", + "@rollup/rollup-win32-x64-msvc": "4.34.8", "fsevents": "~2.3.2" } }, @@ -5196,9 +5239,9 @@ } }, "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", "dev": true, "license": "ISC", "bin": { @@ -5565,6 +5608,51 @@ "dev": true, "license": "MIT" }, + "node_modules/tinyglobby": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", + "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tinypool": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.2.tgz", @@ -5576,9 +5664,9 @@ } }, "node_modules/tinyrainbow": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", - "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", + "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", "dev": true, "license": "MIT", "engines": { @@ -5609,9 +5697,9 @@ } }, "node_modules/ts-api-utils": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.0.tgz", - "integrity": "sha512-xCt/TOAc+EOHS1XPnijD3/yzpH6qg2xppZO1YDqGoVsNXfQfzHpOdNuXwrwOU8u4ITXJyDCTyt8w5g1sZv9ynQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", + "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", "dev": true, "license": "MIT", "engines": { @@ -5622,9 +5710,9 @@ } }, "node_modules/tsconfck": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.4.tgz", - "integrity": "sha512-kdqWFGVJqe+KGYvlSO9NIaWn9jT1Ny4oKVzAJsKii5eoE9snzTJzL4+MMVOMn+fikWGFmKEylcXL710V/kIPJQ==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/tsconfck/-/tsconfck-3.1.5.tgz", + "integrity": "sha512-CLDfGgUp7XPswWnezWwsCRxNmgQjhYq3VXHM0/XIRxhVrKw0M1if9agzryh1QS3nxjCROvV+xWxoJO1YctzzWg==", "dev": true, "license": "MIT", "bin": { @@ -5776,9 +5864,9 @@ } }, "node_modules/typedoc": { - "version": "0.27.6", - "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.6.tgz", - "integrity": "sha512-oBFRoh2Px6jFx366db0lLlihcalq/JzyCVp7Vaq1yphL/tbgx2e+bkpkCgJPunaPvPwoTOXSwasfklWHm7GfAw==", + "version": "0.27.9", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.27.9.tgz", + "integrity": "sha512-/z585740YHURLl9DN2jCWe6OW7zKYm6VoQ93H0sxZ1cwHQEQrUn5BJrEnkWhfzUdyO+BLGjnKUZ9iz9hKloFDw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -5795,7 +5883,7 @@ "node": ">= 18" }, "peerDependencies": { - "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x" + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x" } }, "node_modules/typescript": { @@ -5870,21 +5958,21 @@ } }, "node_modules/vite": { - "version": "5.4.11", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", - "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.2.0.tgz", + "integrity": "sha512-7dPxoo+WsT/64rDcwoOjk76XHj+TqNTIvHKcuMQ1k4/SeHDaQt5GFAeLYzrimZrMpn/O6DtdI03WUjdxuPM0oQ==", "dev": true, "license": "MIT", "dependencies": { - "esbuild": "^0.21.3", - "postcss": "^8.4.43", - "rollup": "^4.20.0" + "esbuild": "^0.25.0", + "postcss": "^8.5.3", + "rollup": "^4.30.1" }, "bin": { "vite": "bin/vite.js" }, "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" }, "funding": { "url": "https://github.com/vitejs/vite?sponsor=1" @@ -5893,19 +5981,25 @@ "fsevents": "~2.3.3" }, "peerDependencies": { - "@types/node": "^18.0.0 || >=20.0.0", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", "sass-embedded": "*", "stylus": "*", "sugarss": "*", - "terser": "^5.4.0" + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" }, "peerDependenciesMeta": { "@types/node": { "optional": true }, + "jiti": { + "optional": true + }, "less": { "optional": true }, @@ -5926,27 +6020,33 @@ }, "terser": { "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true } } }, "node_modules/vite-node": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.8.tgz", - "integrity": "sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.0.7.tgz", + "integrity": "sha512-2fX0QwX4GkkkpULXdT1Pf4q0tC1i1lFOyseKoonavXUNlQ77KpW2XqBGGNIm/J4Ows4KxgGJzDguYVPKwG/n5A==", "dev": true, "license": "MIT", "dependencies": { "cac": "^6.7.14", - "debug": "^4.3.7", - "es-module-lexer": "^1.5.4", - "pathe": "^1.1.2", - "vite": "^5.0.0" + "debug": "^4.4.0", + "es-module-lexer": "^1.6.0", + "pathe": "^2.0.3", + "vite": "^5.0.0 || ^6.0.0" }, "bin": { "vite-node": "vite-node.mjs" }, "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" }, "funding": { "url": "https://opencollective.com/vitest" @@ -5973,47 +6073,48 @@ } }, "node_modules/vitest": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.8.tgz", - "integrity": "sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.0.7.tgz", + "integrity": "sha512-IP7gPK3LS3Fvn44x30X1dM9vtawm0aesAa2yBIZ9vQf+qB69NXC5776+Qmcr7ohUXIQuLhk7xQR0aSUIDPqavg==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/expect": "2.1.8", - "@vitest/mocker": "2.1.8", - "@vitest/pretty-format": "^2.1.8", - "@vitest/runner": "2.1.8", - "@vitest/snapshot": "2.1.8", - "@vitest/spy": "2.1.8", - "@vitest/utils": "2.1.8", - "chai": "^5.1.2", - "debug": "^4.3.7", + "@vitest/expect": "3.0.7", + "@vitest/mocker": "3.0.7", + "@vitest/pretty-format": "^3.0.7", + "@vitest/runner": "3.0.7", + "@vitest/snapshot": "3.0.7", + "@vitest/spy": "3.0.7", + "@vitest/utils": "3.0.7", + "chai": "^5.2.0", + "debug": "^4.4.0", "expect-type": "^1.1.0", - "magic-string": "^0.30.12", - "pathe": "^1.1.2", + "magic-string": "^0.30.17", + "pathe": "^2.0.3", "std-env": "^3.8.0", "tinybench": "^2.9.0", - "tinyexec": "^0.3.1", - "tinypool": "^1.0.1", - "tinyrainbow": "^1.2.0", - "vite": "^5.0.0", - "vite-node": "2.1.8", + "tinyexec": "^0.3.2", + "tinypool": "^1.0.2", + "tinyrainbow": "^2.0.0", + "vite": "^5.0.0 || ^6.0.0", + "vite-node": "3.0.7", "why-is-node-running": "^2.3.0" }, "bin": { "vitest": "vitest.mjs" }, "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { "@edge-runtime/vm": "*", - "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.1.8", - "@vitest/ui": "2.1.8", + "@types/debug": "^4.1.12", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "@vitest/browser": "3.0.7", + "@vitest/ui": "3.0.7", "happy-dom": "*", "jsdom": "*" }, @@ -6021,6 +6122,9 @@ "@edge-runtime/vm": { "optional": true }, + "@types/debug": { + "optional": true + }, "@types/node": { "optional": true }, diff --git a/package.json b/package.json index 20eaf0b90e..1033b93ce8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jira.js", - "version": "4.0.6", + "version": "4.1.0", "description": "A comprehensive JavaScript/TypeScript library designed for both Node.JS and browsers, facilitating seamless interaction with the Atlassian Jira API.", "main": "out/index.js", "types": "out/index.d.ts", @@ -35,9 +35,9 @@ "lint:fix": "npm run lint:tests -- --fix && npm run lint:examples -- --fix && npm run lint:src:agile -- --fix && npm run lint:src:clients -- --fix && npm run lint:src:services -- --fix && npm run lint:src:version2 -- --fix && npm run lint:src:version3 -- --fix && npm run lint:src:serviceDesk -- --fix && npm run lint:src:files -- --fix", "doc": "typedoc --name \"Jira.js - Jira Cloud API library\" --out docs ./src/index.ts --favicon ./assets/favicon.svg", "test": "npm run test:unit && npm run test:integration", - "test:unit": "vitest run tests/unit --maxWorkers=8 --sequence.concurrent", + "test:unit": "vitest run tests/unit --minWorkers=1 --maxWorkers=8 --sequence.concurrent", "test:integration": "vitest run tests/integration --bail=1 --no-file-parallelism --max-concurrency 1 -c vitest.config.mts --hookTimeout 100000 --testTimeout 100000", - "replace:all": "npm run replace:permissions:version2 && npm run replace:permissions:version3 && npm run replace:pagination:version2 && npm run replace:pagination:version3 && npm run replace:async:version2 && npm run replace:async:version3 && npm run replace:expansion:version2 && npm run replace:expansion:version3 && npm run replace:ordering:version2 && npm run replace:ordering:version3 && npm run replace:groupMember:version2 && npm run replace:workflowPaginated:version2 && npm run replace:attachment:serviceDesk", + "replace:all": "npm run replace:permissions:version2 && npm run replace:permissions:version3 && npm run replace:pagination:version2 && npm run replace:pagination:version3 && npm run replace:async:version2 && npm run replace:async:version3 && npm run replace:expansion:version2 && npm run replace:expansion:version3 && npm run replace:ordering:version2 && npm run replace:ordering:version3 && npm run replace:groupMember:version2 && npm run replace:workflowPaginated:version2 && npm run replace:attachment:serviceDesk && npm run replace:priority:version3 && npm run replace:projectAvatar:version3 && npm run replace:issueType:version3", "replace:permissions:version2": "grep -rl \"(#permissions)\" ./src/version2 | xargs sed -i '' 's/(#permissions)/(https:\\/\\/developer.atlassian.com\\/cloud\\/jira\\/platform\\/rest\\/v2\\/intro\\/#permissions)/g'", "replace:permissions:version3": "grep -rl \"(#permissions)\" ./src/version3 | xargs sed -i '' 's/(#permissions)/(https:\\/\\/developer.atlassian.com\\/cloud\\/jira\\/platform\\/rest\\/v3\\/intro\\/#permissions)/g'", "replace:pagination:version2": "grep -rl \"(#pagination)\" ./src/version2 | xargs sed -i '' 's/(#pagination)/(https:\\/\\/developer.atlassian.com\\/cloud\\/jira\\/platform\\/rest\\/v2\\/intro\\/#pagination)/g'", @@ -51,28 +51,31 @@ "replace:groupMember:version2": "grep -rl \"(#api-rest-api-2-group-member-get)\" ./src/version2 | xargs sed -i '' 's/(#api-rest-api-2-group-member-get)/(https:\\/\\/developer.atlassian.com\\/cloud\\/jira\\/platform\\/rest\\/v2\\/api-group-groups\\/#api-rest-api-2-group-member-get)/g'", "replace:workflowPaginated:version2": "grep -rl \"(#api-rest-api-2-workflow-search-get)\" ./src/version2 | xargs sed -i '' 's/(#api-rest-api-2-workflow-search-get)/(https:\\/\\/developer.atlassian.com\\/cloud\\/jira\\/platform\\/rest\\/v2\\/api-group-workflows\\/#api-rest-api-2-workflow-search-get)/g'", "replace:attachment:serviceDesk": "grep -rl \"(#api-request-issueIdOrKey-attachment-post)\" ./src/serviceDesk | xargs sed -i '' 's/(#api-request-issueIdOrKey-attachment-post)/(https:\\/\\/developer.atlassian.com\\/cloud\\/jira\\/service-desk\\/rest\\/api-group-servicedesk\\/#api-rest-servicedeskapi-servicedesk-servicedeskid-attachtemporaryfile-post)/g'", + "replace:priority:version3": "grep -rl \"(#api-rest-api-3-priority-id-put)\" ./src/version3 | xargs sed -i '' 's/(#api-rest-api-3-priority-id-put)/(https:\\/\\/developer.atlassian.com\\/cloud\\/jira\\/platform\\/rest\\/v3\\/api-group-issue-priorities\\/#api-rest-api-3-priority-id-put)/g'", + "replace:projectAvatar:version3": "grep -rl \"(#api-rest-api-3-project-projectIdOrKey-avatar-put)\" ./src/version3 | xargs sed -i '' 's/(#api-rest-api-3-project-projectIdOrKey-avatar-put)/(https:\\/\\/developer.atlassian.com\\/cloud\\/jira\\/platform\\/rest\\/v3\\/api-group-project-avatars\\/#api-rest-api-3-project-projectidorkey-avatar-put)/g'", + "replace:issueType:version3": "grep -rl \"(#api-rest-api-3-issuetype-id-put)\" ./src/version3 | xargs sed -i '' 's/(#api-rest-api-3-issuetype-id-put)/(https:\\/\\/developer.atlassian.com\\/cloud\\/jira\\/platform\\/rest\\/v3\\/api-group-issue-types\\/#api-rest-api-3-issuetype-id-put)/g'", "code:formatting": "npm run replace:all && npm run prettier && npm run lint:fix" }, "devDependencies": { - "@types/node": "^18.19.70", - "@types/sinon": "^17.0.3", - "@typescript-eslint/eslint-plugin": "^8.19.1", - "@typescript-eslint/parser": "^8.19.1", + "@types/node": "^18.19.77", + "@types/sinon": "^17.0.4", + "@typescript-eslint/eslint-plugin": "^8.25.0", + "@typescript-eslint/parser": "^8.25.0", "dotenv": "^16.4.7", "eslint": "^8.57.1", "eslint-config-airbnb-base": "^15.0.0", - "eslint-import-resolver-typescript": "^3.7.0", + "eslint-import-resolver-typescript": "^3.8.3", "eslint-plugin-import": "^2.31.0", - "prettier": "^3.4.2", + "prettier": "^3.5.2", "prettier-plugin-jsdoc": "^1.3.2", "sinon": "^18.0.1", - "typedoc": "^0.27.6", + "typedoc": "^0.27.9", "typescript": "^5.7.3", "vite-tsconfig-paths": "^5.1.4", - "vitest": "^2.1.8" + "vitest": "^3.0.7" }, "dependencies": { - "axios": "^1.7.9", + "axios": "^1.8.1", "formdata-node": "^6.0.3", "mime": "^4.0.6", "tslib": "^2.8.1" diff --git a/src/agile/models/index.ts b/src/agile/models/index.ts index 2ced13b5d0..5886538bdb 100644 --- a/src/agile/models/index.ts +++ b/src/agile/models/index.ts @@ -31,8 +31,6 @@ export * from './issue'; export * from './issueTransition'; export * from './issueType'; export * from './jsonType'; -export * from './linkedSecurityWorkspaceIds'; -export * from './linkedWorkspace'; export * from './linkGroup'; export * from './operations'; export * from './scope'; @@ -55,4 +53,3 @@ export * from './submitVulnerabilities'; export * from './toggleFeatures'; export * from './user'; export * from './version'; -export * from './vulnerability'; diff --git a/src/agile/models/linkedSecurityWorkspaceIds.ts b/src/agile/models/linkedSecurityWorkspaceIds.ts deleted file mode 100644 index 12c1186adc..0000000000 --- a/src/agile/models/linkedSecurityWorkspaceIds.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** The payload of linked Security Workspace IDs. */ -export interface LinkedSecurityWorkspaceIds { - /** The IDs of Security Workspaces that are linked to this Jira site. */ - workspaceIds: string[]; -} diff --git a/src/agile/models/linkedWorkspace.ts b/src/agile/models/linkedWorkspace.ts deleted file mode 100644 index 2afd230c26..0000000000 --- a/src/agile/models/linkedWorkspace.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** The Security Workspace information stored for the given ID. */ -export interface LinkedWorkspace { - /** 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/submittedVulnerabilitiesResult.ts b/src/agile/models/submittedVulnerabilitiesResult.ts deleted file mode 100644 index 2ce39bb3c9..0000000000 --- a/src/agile/models/submittedVulnerabilitiesResult.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** The result of a successful submitVulnerabilities request. */ -export interface SubmittedVulnerabilitiesResult { - /** - * 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. Issue Keys or Service IDs) that are not known on this Jira instance (if any). - * - * These may be invalid keys (e.g. `UTF-8` is sometimes incorrectly identified as a Jira issue key), or they may be - * for projects that no longer exist. - * - * 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/vulnerability.ts b/src/agile/models/vulnerability.ts deleted file mode 100644 index 73922d9e5a..0000000000 --- a/src/agile/models/vulnerability.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Data related to a specific vulnerability in a specific workspace that the vulnerability is present in. Must specify - * at least one association. - */ -export interface Vulnerability { - /** - * The VulnerabilityData schema version used for this vulnerability data. - * - * Placeholder to support potential schema changes in the future. - */ - schemaVersion: 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 updateSqeuenceId 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. */ - 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. 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 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: 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: 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: string; - /** The entities to associate the Security Vulnerability information with. */ - associations?: {}[]; -} diff --git a/src/agile/parameters/index.ts b/src/agile/parameters/index.ts index 060a110180..5c774e3678 100644 --- a/src/agile/parameters/index.ts +++ b/src/agile/parameters/index.ts @@ -67,7 +67,6 @@ export * from './partiallyUpdateSprint'; export * from './rankEpics'; export * from './rankIssues'; export * from './removeIssuesFromEpic'; -export * from './searchEpics'; export * from './setBoardProperty'; export * from './setProperty'; export * from './storeDevelopmentInformation'; diff --git a/src/agile/parameters/searchEpics.ts b/src/agile/parameters/searchEpics.ts deleted file mode 100644 index 54c7adb1d1..0000000000 --- a/src/agile/parameters/searchEpics.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface SearchEpics { - /** The maximum number of returned results. */ - maxResults?: number; - /** Flag that will exclude done epics from the results. */ - excludeDone?: boolean; - /** Text query by which the results should be filtered. */ - query?: string; - /** Key of a project by which epics will be prioritised (on the top) in the results. */ - projectKey?: string; -} diff --git a/src/clients/baseClient.ts b/src/clients/baseClient.ts index 5ade7e0b4b..6fc11d33be 100644 --- a/src/clients/baseClient.ts +++ b/src/clients/baseClient.ts @@ -140,8 +140,8 @@ export class BaseClient implements Client { code: e.code, message: e.message, data: e.response.data, - status: e.response?.status, - statusText: e.response?.statusText, + status: e.response.status, + statusText: e.response.statusText, }, e.response.status, { cause: e }, diff --git a/src/clients/httpException.ts b/src/clients/httpException.ts index 0e71522f8c..f0828e9deb 100644 --- a/src/clients/httpException.ts +++ b/src/clients/httpException.ts @@ -80,6 +80,7 @@ export class HttpException extends Error { return (response as Record).message; } + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (this.constructor) { return this.constructor.name.match(/[A-Z][a-z]+|[0-9]+/g)?.join(' ') ?? 'Error'; } diff --git a/src/paginated.ts b/src/paginated.ts index 27855a381e..b1ab943a8d 100644 --- a/src/paginated.ts +++ b/src/paginated.ts @@ -1,7 +1,12 @@ export type Paginated = { + /** The maximum number of items that could be returned. */ maxResults: number; + /** The index of the first item returned. */ startAt: number; + /** The number of items returned. */ total: number; + /** Whether this is the last page. */ isLast: boolean; + /** The list of items. */ values: T[]; }; diff --git a/src/version2/announcementBanner.ts b/src/version2/announcementBanner.ts index ee04cbf709..61cf4586b3 100644 --- a/src/version2/announcementBanner.ts +++ b/src/version2/announcementBanner.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 AnnouncementBanner { diff --git a/src/version2/appDataPolicies.ts b/src/version2/appDataPolicies.ts new file mode 100644 index 0000000000..4fe49eb9cc --- /dev/null +++ b/src/version2/appDataPolicies.ts @@ -0,0 +1,42 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class AppDataPolicies { + constructor(private client: Client) {} + /** Returns data policy for the workspace. */ + async getPolicy(callback: Callback): Promise; + /** Returns data policy for the workspace. */ + async getPolicy(callback?: never): Promise; + async getPolicy(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/data-policy', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + /** Returns data policies for the projects specified in the request. */ + async getPolicies( + parameters: Parameters.GetPolicies | undefined, + callback: Callback, + ): Promise; + /** Returns data policies for the projects specified in the request. */ + async getPolicies(parameters?: Parameters.GetPolicies, callback?: never): Promise; + async getPolicies( + parameters?: Parameters.GetPolicies, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/data-policy/project', + method: 'GET', + params: { + ids: parameters?.ids, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/appMigration.ts b/src/version2/appMigration.ts index d199d8bd9c..4d894ad020 100644 --- a/src/version2/appMigration.ts +++ b/src/version2/appMigration.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 AppMigration { @@ -12,7 +12,7 @@ export class AppMigration { * fields can be updated. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. + * Connect apps can make this request */ async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback: Callback): Promise; /** @@ -20,7 +20,7 @@ export class AppMigration { * fields can be updated. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * Connect apps can make this request. + * Connect apps can make this request */ async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback?: never): Promise; async updateIssueFields( diff --git a/src/version2/appProperties.ts b/src/version2/appProperties.ts index 75471109a2..5f1b26e071 100644 --- a/src/version2/appProperties.ts +++ b/src/version2/appProperties.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 AppProperties { @@ -11,9 +11,8 @@ export class AppProperties { * Gets all the properties of an app. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async getAddonProperties( parameters: Parameters.GetAddonProperties | string, @@ -23,9 +22,8 @@ export class AppProperties { * Gets all the properties of an app. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async getAddonProperties( parameters: Parameters.GetAddonProperties | string, @@ -49,9 +47,8 @@ export class AppProperties { * Returns the key and value of an app's property. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async getAddonProperty( parameters: Parameters.GetAddonProperty, @@ -61,9 +58,8 @@ export class AppProperties { * Returns the key and value of an app's property. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async getAddonProperty( parameters: Parameters.GetAddonProperty, @@ -88,7 +84,8 @@ export class AppProperties { * maximum length is 32768 characters. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async putAddonProperty( parameters: Parameters.PutAddonProperty, @@ -101,7 +98,8 @@ export class AppProperties { * maximum length is 32768 characters. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async putAddonProperty( parameters: Parameters.PutAddonProperty, @@ -124,14 +122,16 @@ export class AppProperties { * Deletes an app's property. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback: Callback): Promise; /** * Deletes an app's property. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback?: never): Promise; async deleteAddonProperty( @@ -149,7 +149,9 @@ export class AppProperties { /** * Sets the value of a Forge app's property. These values can be retrieved in [Jira * expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context - * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). + * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). They are also + * available in [entity property display + * conditions](/platform/forge/manifest-reference/display-conditions/entity-property-conditions/). * * For other use cases, use the [Storage * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). @@ -159,6 +161,9 @@ export class AppProperties { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only * Forge apps can make this request. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async putAppProperty( parameters: Parameters.PutAppProperty, @@ -167,7 +172,9 @@ export class AppProperties { /** * Sets the value of a Forge app's property. These values can be retrieved in [Jira * expressions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) through the `app` [context - * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). + * variable](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables). They are also + * available in [entity property display + * conditions](/platform/forge/manifest-reference/display-conditions/entity-property-conditions/). * * For other use cases, use the [Storage * API](https://developer.atlassian.com/platform/forge/runtime-reference/storage-api/). @@ -177,6 +184,9 @@ export class AppProperties { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only * Forge apps can make this request. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async putAppProperty( parameters: Parameters.PutAppProperty, @@ -186,7 +196,6 @@ export class AppProperties { parameters: Parameters.PutAppProperty, callback?: Callback, ): Promise { - // todo const config: RequestConfig = { url: `/rest/forge/1/app/properties/${parameters.propertyKey}`, method: 'PUT', @@ -201,6 +210,9 @@ export class AppProperties { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only * Forge apps can make this request. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback: Callback): Promise; /** @@ -208,6 +220,9 @@ export class AppProperties { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only * Forge apps can make this request. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback?: never): Promise; async deleteAppProperty( diff --git a/src/version2/applicationRoles.ts b/src/version2/applicationRoles.ts index 7ca79fcf85..e2b9487da8 100644 --- a/src/version2/applicationRoles.ts +++ b/src/version2/applicationRoles.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 ApplicationRoles { diff --git a/src/version2/auditRecords.ts b/src/version2/auditRecords.ts index 63a15b6768..105e06daab 100644 --- a/src/version2/auditRecords.ts +++ b/src/version2/auditRecords.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 AuditRecords { diff --git a/src/version2/avatars.ts b/src/version2/avatars.ts index 799b5fbd64..d2d6b42018 100644 --- a/src/version2/avatars.ts +++ b/src/version2/avatars.ts @@ -1,14 +1,15 @@ 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 Avatars { constructor(private client: Client) {} /** - * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. + * Returns a list of system avatar details by owner type, where the owner types are issue type, project, user or + * priority. * * This operation can be accessed anonymously. * @@ -19,7 +20,8 @@ export class Avatars { callback: Callback, ): Promise; /** - * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. + * Returns a list of system avatar details by owner type, where the owner types are issue type, project, user or + * priority. * * This operation can be accessed anonymously. * @@ -42,9 +44,8 @@ export class Avatars { return this.client.sendRequest(config, callback); } - /** - * Returns the system and custom avatars for a project or issue type. + * Returns the system and custom avatars for a project, issue type or priority. * * This operation can be accessed anonymously. * @@ -55,10 +56,11 @@ export class Avatars { * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. * - For system avatars, none. + * - For priority avatars, none. */ async getAvatars(parameters: Parameters.GetAvatars, callback: Callback): Promise; /** - * Returns the system and custom avatars for a project or issue type. + * Returns the system and custom avatars for a project, issue type or priority. * * This operation can be accessed anonymously. * @@ -69,6 +71,7 @@ export class Avatars { * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. * - For system avatars, none. + * - For priority avatars, none. */ async getAvatars(parameters: Parameters.GetAvatars, callback?: never): Promise; async getAvatars(parameters: Parameters.GetAvatars, callback?: Callback): Promise { @@ -81,13 +84,7 @@ export class Avatars { } /** - * Loads a custom avatar for a project or issue type. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * Loads a custom avatar for a project, issue type or priority. * * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of * the image. The length of the square's sides is set to the smaller of the height or width of the image. @@ -99,19 +96,14 @@ export class Avatars { * - [Update issue type](#api-rest-api-2-issuetype-id-put) to set it as the issue type's displayed avatar. * - [Set project avatar](#api-rest-api-2-project-projectIdOrKey-avatar-put) to set it as the project's displayed * avatar. + * - [Update priority](#api-rest-api-2-priority-id-put) to set it as the priority's displayed avatar. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async storeAvatar(parameters: Parameters.StoreAvatar, callback: Callback): Promise; /** - * Loads a custom avatar for a project or issue type. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * Loads a custom avatar for a project, issue type or priority. * * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of * the image. The length of the square's sides is set to the smaller of the height or width of the image. @@ -123,6 +115,7 @@ export class Avatars { * - [Update issue type](#api-rest-api-2-issuetype-id-put) to set it as the issue type's displayed avatar. * - [Set project avatar](#api-rest-api-2-project-projectIdOrKey-avatar-put) to set it as the project's displayed * avatar. + * - [Update priority](#api-rest-api-2-priority-id-put) to set it as the priority's displayed avatar. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -132,10 +125,14 @@ export class Avatars { const config: RequestConfig = { url: `/rest/api/2/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, method: 'POST', + headers: { + 'X-Atlassian-Token': 'no-check', + 'Content-Type': parameters.mimeType, + }, params: { x: parameters.x, y: parameters.y, - size: parameters.size, + size: parameters.size ?? 0, }, data: parameters.avatar, }; @@ -144,14 +141,14 @@ export class Avatars { } /** - * Deletes an avatar from a project or issue type. + * Deletes an avatar from a project, issue type or priority. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async deleteAvatar(parameters: Parameters.DeleteAvatar, callback: Callback): Promise; /** - * Deletes an avatar from a project or issue type. + * Deletes an avatar from a project, issue type or priority. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -167,7 +164,7 @@ export class Avatars { } /** - * Returns the default project or issue type avatar image. + * Returns the default project, issue type or priority avatar image. * * This operation can be accessed anonymously. * @@ -178,7 +175,7 @@ export class Avatars { callback: Callback, ): Promise; /** - * Returns the default project or issue type avatar image. + * Returns the default project, issue type or priority avatar image. * * This operation can be accessed anonymously. * @@ -199,8 +196,8 @@ export class Avatars { method: 'GET', responseType: 'arraybuffer', params: { - size: typeof parameters !== 'string' && parameters.size, - format: typeof parameters !== 'string' && parameters.format, + size: typeof parameters !== 'string' ? parameters.size : undefined, + format: typeof parameters !== 'string' ? parameters.format : undefined, }, }; @@ -215,7 +212,7 @@ export class Avatars { } /** - * Returns a project or issue type avatar image by ID. + * Returns a project, issue type or priority avatar image by ID. * * This operation can be accessed anonymously. * @@ -226,13 +223,14 @@ export class Avatars { * the project the avatar belongs to. * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. + * - For priority avatars, none. */ async getAvatarImageByID( parameters: Parameters.GetAvatarImageByID, callback: Callback, ): Promise; /** - * Returns a project or issue type avatar image by ID. + * Returns a project, issue type or priority avatar image by ID. * * This operation can be accessed anonymously. * @@ -243,6 +241,7 @@ export class Avatars { * the project the avatar belongs to. * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. + * - For priority avatars, none. */ async getAvatarImageByID( parameters: Parameters.GetAvatarImageByID, @@ -273,7 +272,7 @@ export class Avatars { } /** - * Returns the avatar image for a project or issue type. + * Returns the avatar image for a project, issue type or priority. * * This operation can be accessed anonymously. * @@ -284,13 +283,14 @@ export class Avatars { * the project the avatar belongs to. * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. + * - For priority avatars, none. */ async getAvatarImageByOwner( parameters: Parameters.GetAvatarImageByOwner, callback: Callback, ): Promise; /** - * Returns the avatar image for a project or issue type. + * Returns the avatar image for a project, issue type or priority. * * This operation can be accessed anonymously. * @@ -301,6 +301,7 @@ export class Avatars { * the project the avatar belongs to. * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. + * - For priority avatars, none. */ async getAvatarImageByOwner( parameters: Parameters.GetAvatarImageByOwner, diff --git a/src/version2/classificationLevels.ts b/src/version2/classificationLevels.ts new file mode 100644 index 0000000000..7e53a93441 --- /dev/null +++ b/src/version2/classificationLevels.ts @@ -0,0 +1,43 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class ClassificationLevels { + constructor(private client: Client) {} + + /** + * Returns all classification levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllUserDataClassificationLevels( + parameters: Parameters.GetAllUserDataClassificationLevels | undefined, + callback: Callback, + ): Promise; + /** + * Returns all classification levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + */ + async getAllUserDataClassificationLevels( + parameters?: Parameters.GetAllUserDataClassificationLevels, + callback?: never, + ): Promise; + async getAllUserDataClassificationLevels( + parameters?: Parameters.GetAllUserDataClassificationLevels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/classification-levels', + method: 'GET', + params: { + status: parameters?.status, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/client/version2Client.ts b/src/version2/client/version2Client.ts index a7413e6940..0934c399c4 100644 --- a/src/version2/client/version2Client.ts +++ b/src/version2/client/version2Client.ts @@ -1,10 +1,12 @@ import { BaseClient } from '../../clients/baseClient'; import { AnnouncementBanner } from '../announcementBanner'; +import { AppDataPolicies } from '../appDataPolicies'; import { ApplicationRoles } from '../applicationRoles'; import { AppMigration } from '../appMigration'; import { AppProperties } from '../appProperties'; import { AuditRecords } from '../auditRecords'; import { Avatars } from '../avatars'; +import { ClassificationLevels } from '../classificationLevels'; import { Dashboards } from '../dashboards'; import { DynamicModules } from '../dynamicModules'; import { Filters } from '../filters'; @@ -50,8 +52,11 @@ import { LicenseMetrics } from '../licenseMetrics'; import { Myself } from '../myself'; import { Permissions } from '../permissions'; import { PermissionSchemes } from '../permissionSchemes'; +import { Plans } from '../plans'; +import { PrioritySchemes } from '../prioritySchemes'; import { ProjectAvatars } from '../projectAvatars'; import { ProjectCategories } from '../projectCategories'; +import { ProjectClassificationLevels } from '../projectClassificationLevels'; import { ProjectComponents } from '../projectComponents'; import { ProjectEmail } from '../projectEmail'; import { ProjectFeatures } from '../projectFeatures'; @@ -68,8 +73,10 @@ import { ScreenSchemes } from '../screenSchemes'; import { ScreenTabFields } from '../screenTabFields'; import { ScreenTabs } from '../screenTabs'; import { ServerInfo } from '../serverInfo'; +import { ServiceRegistry } from '../serviceRegistry'; import { Status } from '../status'; import { Tasks } from '../tasks'; +import { TeamsInPlan } from '../teamsInPlan'; import { TimeTracking } from '../timeTracking'; import { UIModificationsApps } from '../uIModificationsApps'; import { UserProperties } from '../userProperties'; @@ -87,11 +94,13 @@ import { WorkflowTransitionRules } from '../workflowTransitionRules'; export class Version2Client extends BaseClient { announcementBanner = new AnnouncementBanner(this); + appDataPolicies = new AppDataPolicies(this); applicationRoles = new ApplicationRoles(this); appMigration = new AppMigration(this); appProperties = new AppProperties(this); auditRecords = new AuditRecords(this); avatars = new Avatars(this); + classificationLevels = new ClassificationLevels(this); dashboards = new Dashboards(this); dynamicModules = new DynamicModules(this); filters = new Filters(this); @@ -137,8 +146,11 @@ export class Version2Client extends BaseClient { myself = new Myself(this); permissions = new Permissions(this); permissionSchemes = new PermissionSchemes(this); + plans = new Plans(this); + prioritySchemes = new PrioritySchemes(this); projectAvatars = new ProjectAvatars(this); projectCategories = new ProjectCategories(this); + projectClassificationLevels = new ProjectClassificationLevels(this); projectComponents = new ProjectComponents(this); projectEmail = new ProjectEmail(this); projectFeatures = new ProjectFeatures(this); @@ -155,8 +167,10 @@ export class Version2Client extends BaseClient { screenTabFields = new ScreenTabFields(this); screenTabs = new ScreenTabs(this); serverInfo = new ServerInfo(this); + serviceRegistry = new ServiceRegistry(this); status = new Status(this); tasks = new Tasks(this); + teamsInPlan = new TeamsInPlan(this); timeTracking = new TimeTracking(this); uiModificationsApps = new UIModificationsApps(this); userProperties = new UserProperties(this); diff --git a/src/version2/dashboards.ts b/src/version2/dashboards.ts index 965ae75baf..2aa8a89593 100644 --- a/src/version2/dashboards.ts +++ b/src/version2/dashboards.ts @@ -1,9 +1,9 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; -import { paramSerializer } from '../paramSerializer'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; +import { paramSerializer } from '../paramSerializer'; export class Dashboards { constructor(private client: Client) {} @@ -71,6 +71,9 @@ export class Dashboards { const config: RequestConfig = { url: '/rest/api/2/dashboard', method: 'POST', + params: { + extendAdminPermissions: parameters.extendAdminPermissions, + }, data: { description: parameters.description, editPermissions: parameters.editPermissions, @@ -229,7 +232,7 @@ export class Dashboards { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAllGadgets( - parameters: Parameters.GetAllGadgets, + parameters: Parameters.GetAllGadgets | string, callback: Callback, ): Promise; /** @@ -247,20 +250,22 @@ export class Dashboards { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAllGadgets( - parameters: Parameters.GetAllGadgets, + parameters: Parameters.GetAllGadgets | string, callback?: never, ): Promise; async getAllGadgets( - parameters: Parameters.GetAllGadgets, + parameters: Parameters.GetAllGadgets | string, callback?: Callback, ): Promise { + const dashboardId = typeof parameters === 'string' ? parameters : parameters.dashboardId; + const config: RequestConfig = { - url: `/rest/api/2/dashboard/${parameters.dashboardId}/gadget`, + url: `/rest/api/2/dashboard/${dashboardId}/gadget`, method: 'GET', params: { - moduleKey: paramSerializer('moduleKey', parameters.moduleKey), - uri: parameters.uri, - gadgetId: paramSerializer('gadgetId', parameters.gadgetId), + moduleKey: typeof parameters !== 'string' && paramSerializer('moduleKey', parameters.moduleKey), + uri: typeof parameters !== 'string' && parameters.uri, + gadgetId: typeof parameters !== 'string' && paramSerializer('gadgetId', parameters.gadgetId), }, }; @@ -647,6 +652,9 @@ export class Dashboards { const config: RequestConfig = { url: `/rest/api/2/dashboard/${parameters.id}`, method: 'PUT', + params: { + extendAdminPermissions: parameters.extendAdminPermissions, + }, data: { description: parameters.description, editPermissions: parameters.editPermissions, @@ -714,6 +722,9 @@ export class Dashboards { const config: RequestConfig = { url: `/rest/api/2/dashboard/${parameters.id}/copy`, method: 'POST', + params: { + extendAdminPermissions: parameters.extendAdminPermissions, + }, data: { description: parameters.description, editPermissions: parameters.editPermissions, diff --git a/src/version2/dynamicModules.ts b/src/version2/dynamicModules.ts index 516e6e05bd..f5467d964c 100644 --- a/src/version2/dynamicModules.ts +++ b/src/version2/dynamicModules.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 DynamicModules { diff --git a/src/version2/filterSharing.ts b/src/version2/filterSharing.ts index 04f8ad9cc5..b20d2754e9 100644 --- a/src/version2/filterSharing.ts +++ b/src/version2/filterSharing.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 FilterSharing { diff --git a/src/version2/filters.ts b/src/version2/filters.ts index 65e0895154..755996ef56 100644 --- a/src/version2/filters.ts +++ b/src/version2/filters.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 Filters { @@ -31,10 +31,11 @@ export class Filters { url: '/rest/api/2/filter', method: 'POST', params: { - expand: parameters?.expand, - overrideSharePermissions: parameters?.overrideSharePermissions, + expand: parameters.expand, + overrideSharePermissions: parameters.overrideSharePermissions, }, data: { + approximateLastUsed: parameters.approximateLastUsed, description: parameters.description, editPermissions: parameters.editPermissions, favourite: parameters.favourite, @@ -236,6 +237,7 @@ export class Filters { maxResults: parameters?.maxResults, expand: parameters?.expand, overrideSharePermissions: parameters?.overrideSharePermissions, + isSubstringMatch: parameters?.isSubstringMatch, }, }; @@ -475,7 +477,7 @@ export class Filters { * - Filters shared with a public project. * - Filters shared with the public. */ - async resetColumns(parameters: Parameters.ResetColumns, callback: Callback): Promise; + async resetColumns(parameters: Parameters.ResetColumns | string, callback: Callback): Promise; /** * Reset the user's column configuration for the filter to the default. * @@ -489,10 +491,15 @@ export class Filters { * - Filters shared with a public project. * - Filters shared with the public. */ - async resetColumns(parameters: Parameters.ResetColumns, callback?: never): Promise; - async resetColumns(parameters: Parameters.ResetColumns, callback?: Callback): Promise { + async resetColumns(parameters: Parameters.ResetColumns | string, callback?: never): Promise; + async resetColumns( + parameters: Parameters.ResetColumns | string, + callback?: Callback, + ): Promise { + const id = typeof parameters === 'string' ? parameters : parameters.id; + const config: RequestConfig = { - url: `/rest/api/2/filter/${parameters.id}/columns`, + url: `/rest/api/2/filter/${id}/columns`, method: 'DELETE', }; diff --git a/src/version2/groupAndUserPicker.ts b/src/version2/groupAndUserPicker.ts index 0f3f7a0968..c9bc008f1e 100644 --- a/src/version2/groupAndUserPicker.ts +++ b/src/version2/groupAndUserPicker.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 GroupAndUserPicker { diff --git a/src/version2/groups.ts b/src/version2/groups.ts index 2aeba04980..ceaea29ebc 100644 --- a/src/version2/groups.ts +++ b/src/version2/groups.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 Groups { @@ -50,10 +50,10 @@ export class Groups { url: '/rest/api/2/group', method: 'DELETE', params: { - groupname: parameters?.groupname, - groupId: parameters?.groupId, - swapGroup: parameters?.swapGroup, - swapGroupId: parameters?.swapGroupId, + groupname: parameters.groupname, + groupId: parameters.groupId, + swapGroup: parameters.swapGroup, + swapGroupId: parameters.swapGroupId, }, }; @@ -106,8 +106,11 @@ export class Groups { * Note that users are ordered by username, however the username is not returned in the results due to privacy * reasons. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getUsersFromGroup( parameters: Parameters.GetUsersFromGroup, @@ -120,8 +123,11 @@ export class Groups { * Note that users are ordered by username, however the username is not returned in the results due to privacy * reasons. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either + * of: + * + * - _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getUsersFromGroup( parameters: Parameters.GetUsersFromGroup, @@ -172,8 +178,8 @@ export class Groups { groupId: parameters.groupId, }, data: { - name: parameters.name, accountId: parameters.accountId, + name: parameters.name, }, }; diff --git a/src/version2/index.ts b/src/version2/index.ts index f44c40620e..d177fc664a 100644 --- a/src/version2/index.ts +++ b/src/version2/index.ts @@ -1,13 +1,15 @@ export * from './announcementBanner'; -export * from './applicationRoles'; +export * from './appDataPolicies'; export * from './appMigration'; export * from './appProperties'; +export * from './applicationRoles'; export * from './auditRecords'; export * from './avatars'; +export * from './classificationLevels'; export * from './dashboards'; export * from './dynamicModules'; -export * from './filters'; export * from './filterSharing'; +export * from './filters'; export * from './groupAndUserPicker'; export * from './groups'; export * from './issueAttachments'; @@ -20,26 +22,26 @@ export * from './issueCustomFieldOptionsApps'; export * from './issueCustomFieldValuesApps'; export * from './issueFieldConfigurations'; export * from './issueFields'; -export * from './issueLinks'; export * from './issueLinkTypes'; +export * from './issueLinks'; export * from './issueNavigatorSettings'; export * from './issueNotificationSchemes'; export * from './issuePriorities'; export * from './issueProperties'; export * from './issueRemoteLinks'; export * from './issueResolutions'; -export * from './issues'; export * from './issueSearch'; export * from './issueSecurityLevel'; export * from './issueSecuritySchemes'; export * from './issueTypeProperties'; -export * from './issueTypes'; export * from './issueTypeSchemes'; export * from './issueTypeScreenSchemes'; +export * from './issueTypes'; export * from './issueVotes'; export * from './issueWatchers'; export * from './issueWorklogProperties'; export * from './issueWorklogs'; +export * from './issues'; export * from './jiraExpressions'; export * from './jiraSettings'; export * from './jQL'; @@ -47,10 +49,13 @@ export * from './jqlFunctionsApps'; export * from './labels'; export * from './licenseMetrics'; export * from './myself'; -export * from './permissions'; export * from './permissionSchemes'; +export * from './permissions'; +export * from './plans'; +export * from './prioritySchemes'; export * from './projectAvatars'; export * from './projectCategories'; +export * from './projectClassificationLevels'; export * from './projectComponents'; export * from './projectEmail'; export * from './projectFeatures'; @@ -59,23 +64,24 @@ export * from './projectPermissionSchemes'; export * from './projectProperties'; export * from './projectRoleActors'; export * from './projectRoles'; -export * from './projects'; export * from './projectTypes'; export * from './projectVersions'; -export * from './screens'; +export * from './projects'; export * from './screenSchemes'; export * from './screenTabFields'; export * from './screenTabs'; +export * from './screens'; export * from './serverInfo'; +export * from './serviceRegistry'; export * from './status'; export * from './tasks'; +export * from './teamsInPlan'; export * from './timeTracking'; export * from './uIModificationsApps'; export * from './userProperties'; -export * from './users'; export * from './userSearch'; +export * from './users'; export * from './webhooks'; -export * from './workflows'; export * from './workflowSchemeDrafts'; export * from './workflowSchemeProjectAssociations'; export * from './workflowSchemes'; @@ -83,7 +89,8 @@ export * from './workflowStatusCategories'; export * from './workflowStatuses'; export * from './workflowTransitionProperties'; export * from './workflowTransitionRules'; +export * from './workflows'; +export * from './client'; export * as Version2Models from './models'; export * as Version2Parameters from './parameters'; -export * from './client'; diff --git a/src/version2/issueAttachments.ts b/src/version2/issueAttachments.ts index 5295ebd494..8400766bd6 100644 --- a/src/version2/issueAttachments.ts +++ b/src/version2/issueAttachments.ts @@ -2,8 +2,8 @@ import { FormData, File } from 'formdata-node'; import type { Mime } from 'mime' with { 'resolution-mode': 'import' }; 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 IssueAttachments { diff --git a/src/version2/issueCommentProperties.ts b/src/version2/issueCommentProperties.ts index c122e8bcc9..22fb732ed9 100644 --- a/src/version2/issueCommentProperties.ts +++ b/src/version2/issueCommentProperties.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 IssueCommentProperties { diff --git a/src/version2/issueComments.ts b/src/version2/issueComments.ts index 8f45ac0ae6..f2d69e36ca 100644 --- a/src/version2/issueComments.ts +++ b/src/version2/issueComments.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 IssueComments { @@ -302,6 +302,9 @@ export class IssueComments { const config: RequestConfig = { url: `/rest/api/2/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, method: 'DELETE', + params: { + parentId: parameters.parentId, + }, }; return this.client.sendRequest(config, callback); diff --git a/src/version2/issueCustomFieldConfigurationApps.ts b/src/version2/issueCustomFieldConfigurationApps.ts index 9fd1d66810..3fa8cf8445 100644 --- a/src/version2/issueCustomFieldConfigurationApps.ts +++ b/src/version2/issueCustomFieldConfigurationApps.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 IssueCustomFieldConfigurationApps { @@ -9,7 +9,79 @@ export class IssueCustomFieldConfigurationApps { /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). + * configurations for list of custom fields of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). + * + * The result can be filtered by one of these criteria: + * + * - `id`. + * - `fieldContextId`. + * - `issueId`. + * - `projectKeyOrId` and `issueTypeId`. + * + * Otherwise, all configurations for the provided list of custom fields are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the Forge app that provided the custom field type. + */ + async getCustomFieldsConfigurations( + parameters: Parameters.GetCustomFieldsConfigurations | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * configurations for list of custom fields of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). + * + * The result can be filtered by one of these criteria: + * + * - `id`. + * - `fieldContextId`. + * - `issueId`. + * - `projectKeyOrId` and `issueTypeId`. + * + * Otherwise, all configurations for the provided list of custom fields are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the Forge app that provided the custom field type. + */ + async getCustomFieldsConfigurations( + parameters?: Parameters.GetCustomFieldsConfigurations, + callback?: never, + ): Promise; + async getCustomFieldsConfigurations( + parameters?: Parameters.GetCustomFieldsConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/app/field/context/configuration/list', + method: 'POST', + params: { + id: parameters?.id, + fieldContextId: parameters?.fieldContextId, + issueId: parameters?.issueId, + projectKeyOrId: parameters?.projectKeyOrId, + issueTypeId: parameters?.issueTypeId, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + data: { + fieldIdsOrKeys: parameters?.fieldIdsOrKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * configurations for a custom field of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). * * The result can be filtered by one of these criteria: * @@ -22,7 +94,7 @@ export class IssueCustomFieldConfigurationApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. + * for the Forge app that provided the custom field type. */ async getCustomFieldConfiguration( parameters: Parameters.GetCustomFieldConfiguration, @@ -30,7 +102,9 @@ export class IssueCustomFieldConfigurationApps { ): Promise; /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of - * configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). + * configurations for a custom field of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). * * The result can be filtered by one of these criteria: * @@ -43,7 +117,7 @@ export class IssueCustomFieldConfigurationApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. + * for the Forge app that provided the custom field type. */ async getCustomFieldConfiguration( parameters: Parameters.GetCustomFieldConfiguration, @@ -71,24 +145,26 @@ export class IssueCustomFieldConfigurationApps { } /** - * Update the configuration for contexts of a custom field created by a [Forge - * app](https://developer.atlassian.com/platform/forge/). + * Update the configuration for contexts of a custom field of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. + * for the Forge app that created the custom field type. */ async updateCustomFieldConfiguration( parameters: Parameters.UpdateCustomFieldConfiguration, callback: Callback, ): Promise; /** - * Update the configuration for contexts of a custom field created by a [Forge - * app](https://developer.atlassian.com/platform/forge/). + * Update the configuration for contexts of a custom field of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. + * for the Forge app that created the custom field type. */ async updateCustomFieldConfiguration( parameters: Parameters.UpdateCustomFieldConfiguration, diff --git a/src/version2/issueCustomFieldContexts.ts b/src/version2/issueCustomFieldContexts.ts index 21a0d25b21..2df4c199d4 100644 --- a/src/version2/issueCustomFieldContexts.ts +++ b/src/version2/issueCustomFieldContexts.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 IssueCustomFieldContexts { diff --git a/src/version2/issueCustomFieldOptions.ts b/src/version2/issueCustomFieldOptions.ts index 4f7cb8ff63..6b6c38b604 100644 --- a/src/version2/issueCustomFieldOptions.ts +++ b/src/version2/issueCustomFieldOptions.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 IssueCustomFieldOptions { @@ -249,8 +249,8 @@ export class IssueCustomFieldOptions { url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/move`, method: 'PUT', data: { - customFieldOptionIds: parameters.customFieldOptionIds, after: parameters.after, + customFieldOptionIds: parameters.customFieldOptionIds, position: parameters.position, }, }; @@ -298,4 +298,48 @@ export class IssueCustomFieldOptions { return this.client.sendRequest(config, callback); } + + /** + * Replaces the options of a custom field. + * + * Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect or Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async replaceCustomFieldOption( + parameters: Parameters.ReplaceCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Replaces the options of a custom field. + * + * Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect or Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async replaceCustomFieldOption( + parameters: Parameters.ReplaceCustomFieldOption, + callback?: never, + ): Promise; + async replaceCustomFieldOption( + parameters: Parameters.ReplaceCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/field/${parameters.fieldId}/context/${parameters.contextId}/option/${parameters.optionId}/issue`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + jql: parameters.jql, + }, + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version2/issueCustomFieldOptionsApps.ts b/src/version2/issueCustomFieldOptionsApps.ts index 60b342455e..709a5c8044 100644 --- a/src/version2/issueCustomFieldOptionsApps.ts +++ b/src/version2/issueCustomFieldOptionsApps.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 IssueCustomFieldOptionsApps { @@ -68,6 +68,8 @@ export class IssueCustomFieldOptionsApps { * used with issue field select list options created in Jira or using operations from the [Issue custom field * options](#api-group-Issue-custom-field-options) resource. * + * Each field can have a maximum of 10000 options, and each option can have a maximum of 10000 scopes. + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required * for the app providing the field. @@ -83,6 +85,8 @@ export class IssueCustomFieldOptionsApps { * used with issue field select list options created in Jira or using operations from the [Issue custom field * options](#api-group-Issue-custom-field-options) resource. * + * Each field can have a maximum of 10000 options, and each option can have a maximum of 10000 scopes. + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required * for the app providing the field. @@ -99,9 +103,9 @@ export class IssueCustomFieldOptionsApps { url: `/rest/api/2/field/${parameters.fieldKey}/option`, method: 'POST', data: { - value: parameters.value, - properties: parameters.properties, config: parameters.config, + properties: parameters.properties, + value: parameters.value, }, }; @@ -290,10 +294,10 @@ export class IssueCustomFieldOptionsApps { url: `/rest/api/2/field/${parameters.fieldKey}/option/${parameters.optionId}`, method: 'PUT', data: { + config: parameters.config, id: parameters.id, - value: parameters.value, properties: parameters.properties, - config: parameters.config, + value: parameters.value, }, }; @@ -359,7 +363,7 @@ export class IssueCustomFieldOptionsApps { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required * for the app providing the field. */ - async replaceIssueFieldOption( + async replaceIssueFieldOption( parameters: Parameters.ReplaceIssueFieldOption, callback: Callback, ): Promise; @@ -383,11 +387,11 @@ export class IssueCustomFieldOptionsApps { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required * for the app providing the field. */ - async replaceIssueFieldOption( + async replaceIssueFieldOption( parameters: Parameters.ReplaceIssueFieldOption, callback?: never, ): Promise; - async replaceIssueFieldOption( + async replaceIssueFieldOption( parameters: Parameters.ReplaceIssueFieldOption, callback?: Callback, ): Promise { diff --git a/src/version2/issueCustomFieldValuesApps.ts b/src/version2/issueCustomFieldValuesApps.ts index 5413f7d241..1692ce3215 100644 --- a/src/version2/issueCustomFieldValuesApps.ts +++ b/src/version2/issueCustomFieldValuesApps.ts @@ -1,6 +1,6 @@ import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class IssueCustomFieldValuesApps { @@ -8,10 +8,18 @@ export class IssueCustomFieldValuesApps { /** * Updates the value of one or more custom fields on one or more issues. Combinations of custom field and issue should - * be unique within the request. Custom fields can only be updated by the Forge app that created them. + * be unique within the request. + * + * Apps can only perform this operation on [custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/) and [custom + * field types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) + * declared in their own manifests. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. + * the app that owns the custom field or custom field type can update its values with this operation. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateMultipleCustomFieldValues( parameters: Parameters.UpdateMultipleCustomFieldValues, @@ -19,10 +27,18 @@ export class IssueCustomFieldValuesApps { ): Promise; /** * Updates the value of one or more custom fields on one or more issues. Combinations of custom field and issue should - * be unique within the request. Custom fields can only be updated by the Forge app that created them. + * be unique within the request. + * + * Apps can only perform this operation on [custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/) and [custom + * field types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) + * declared in their own manifests. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. + * the app that owns the custom field or custom field type can update its values with this operation. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateMultipleCustomFieldValues( parameters: Parameters.UpdateMultipleCustomFieldValues, @@ -47,22 +63,36 @@ export class IssueCustomFieldValuesApps { } /** - * Updates the value of a custom field on one or more issues. Custom fields can only be updated by the Forge app that - * created them. + * Updates the value of a custom field on one or more issues. + * + * Apps can only perform this operation on [custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/) and [custom + * field types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) + * declared in their own manifests. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. + * the app that owns the custom field or custom field type can update its values with this operation. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateCustomFieldValue( parameters: Parameters.UpdateCustomFieldValue, callback: Callback, ): Promise; /** - * Updates the value of a custom field on one or more issues. Custom fields can only be updated by the Forge app that - * created them. + * Updates the value of a custom field on one or more issues. + * + * Apps can only perform this operation on [custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/) and [custom + * field types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) + * declared in their own manifests. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. + * the app that owns the custom field or custom field type can update its values with this operation. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateCustomFieldValue(parameters: Parameters.UpdateCustomFieldValue, callback?: never): Promise; async updateCustomFieldValue( diff --git a/src/version2/issueFieldConfigurations.ts b/src/version2/issueFieldConfigurations.ts index 5ebf33d4e3..1883a46b2f 100644 --- a/src/version2/issueFieldConfigurations.ts +++ b/src/version2/issueFieldConfigurations.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 IssueFieldConfigurations { @@ -72,7 +72,7 @@ export class IssueFieldConfigurations { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createFieldConfiguration( - parameters: Parameters.CreateFieldConfiguration | undefined, + parameters: Parameters.CreateFieldConfiguration, callback: Callback, ): Promise; /** @@ -85,19 +85,19 @@ export class IssueFieldConfigurations { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createFieldConfiguration( - parameters?: Parameters.CreateFieldConfiguration, + parameters: Parameters.CreateFieldConfiguration, callback?: never, ): Promise; async createFieldConfiguration( - parameters?: Parameters.CreateFieldConfiguration, + parameters: Parameters.CreateFieldConfiguration, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/fieldconfiguration', method: 'POST', data: { - name: parameters?.name, - description: parameters?.description, + name: parameters.name, + description: parameters.description, }, }; @@ -327,7 +327,7 @@ export class IssueFieldConfigurations { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createFieldConfigurationScheme( - parameters: Parameters.CreateFieldConfigurationScheme | undefined, + parameters: Parameters.CreateFieldConfigurationScheme, callback: Callback, ): Promise; /** @@ -339,19 +339,19 @@ export class IssueFieldConfigurations { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createFieldConfigurationScheme( - parameters?: Parameters.CreateFieldConfigurationScheme, + parameters: Parameters.CreateFieldConfigurationScheme, callback?: never, ): Promise; async createFieldConfigurationScheme( - parameters?: Parameters.CreateFieldConfigurationScheme, + parameters: Parameters.CreateFieldConfigurationScheme, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/fieldconfigurationscheme', method: 'POST', data: { - name: parameters?.name, - description: parameters?.description, + name: parameters.name, + description: parameters.description, }, }; diff --git a/src/version2/issueFields.ts b/src/version2/issueFields.ts index 4873583e65..6793140698 100644 --- a/src/version2/issueFields.ts +++ b/src/version2/issueFields.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 IssueFields { @@ -76,10 +76,10 @@ export class IssueFields { url: '/rest/api/2/field', method: 'POST', data: { - name: parameters?.name, description: parameters?.description, - type: parameters?.type, + name: parameters?.name, searcherKey: parameters?.searcherKey, + type: parameters?.type, }, }; @@ -95,7 +95,7 @@ export class IssueFields { * - Fields that contain a string in the field name or description, by defining `query` * - Specific fields that contain a string in the field name or description, by defining `id` and `query` * - * Only custom fields can be queried, `type` must be set to `custom`. + * Use `type` must be set to `custom` to show custom fields only. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -113,7 +113,7 @@ export class IssueFields { * - Fields that contain a string in the field name or description, by defining `query` * - Specific fields that contain a string in the field name or description, by defining `id` and `query` * - * Only custom fields can be queried, `type` must be set to `custom`. + * Use `type` must be set to `custom` to show custom fields only. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -211,8 +211,8 @@ export class IssueFields { url: `/rest/api/2/field/${parameters.fieldId}`, method: 'PUT', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, searcherKey: parameters.searcherKey, }, }; diff --git a/src/version2/issueLinkTypes.ts b/src/version2/issueLinkTypes.ts index f9fc02a695..4293b63cff 100644 --- a/src/version2/issueLinkTypes.ts +++ b/src/version2/issueLinkTypes.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 IssueLinkTypes { diff --git a/src/version2/issueLinks.ts b/src/version2/issueLinks.ts index 651ba80273..77aae6feb0 100644 --- a/src/version2/issueLinks.ts +++ b/src/version2/issueLinks.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 IssueLinks { diff --git a/src/version2/issueNavigatorSettings.ts b/src/version2/issueNavigatorSettings.ts index 97c86cdef6..61b7e0d709 100644 --- a/src/version2/issueNavigatorSettings.ts +++ b/src/version2/issueNavigatorSettings.ts @@ -1,6 +1,6 @@ import * as Models from './models'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class IssueNavigatorSettings { diff --git a/src/version2/issueNotificationSchemes.ts b/src/version2/issueNotificationSchemes.ts index 9c75917276..e4384385dd 100644 --- a/src/version2/issueNotificationSchemes.ts +++ b/src/version2/issueNotificationSchemes.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 IssueNotificationSchemes { @@ -215,6 +215,38 @@ export class IssueNotificationSchemes { return this.client.sendRequest(config, callback); } + /** + * Adds notifications to a notification scheme. You can add up to 1000 notifications per request. + * + * _Deprecated: The notification type `EmailAddress` is no longer supported in Cloud. Refer to the + * [changelog](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1031) for more details._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addNotifications(parameters: Parameters.AddNotifications, callback: Callback): Promise; + /** + * Adds notifications to a notification scheme. You can add up to 1000 notifications per request. + * + * _Deprecated: The notification type `EmailAddress` is no longer supported in Cloud. Refer to the + * [changelog](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1031) for more details._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addNotifications(parameters: Parameters.AddNotifications, callback?: never): Promise; + async addNotifications(parameters: Parameters.AddNotifications, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/notificationscheme/${parameters.id}/notification`, + method: 'PUT', + data: { + notificationSchemeEvents: parameters.notificationSchemeEvents, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Deletes a notification scheme. * diff --git a/src/version2/issuePriorities.ts b/src/version2/issuePriorities.ts index 04f82b2efa..49a6ffb802 100644 --- a/src/version2/issuePriorities.ts +++ b/src/version2/issuePriorities.ts @@ -1,9 +1,9 @@ import * as Models from './models'; import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; -import { paramSerializer } from '../paramSerializer'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; +import { paramSerializer } from '../paramSerializer'; export class IssuePriorities { constructor(private client: Client) {} @@ -34,6 +34,9 @@ export class IssuePriorities { /** * Creates an issue priority. * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ @@ -44,6 +47,9 @@ export class IssuePriorities { /** * Creates an issue priority. * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ @@ -56,6 +62,7 @@ export class IssuePriorities { url: '/rest/api/2/priority', method: 'POST', data: { + avatarId: parameters.avatarId, description: parameters.description, iconUrl: parameters.iconUrl, name: parameters.name, @@ -117,8 +124,8 @@ export class IssuePriorities { url: '/rest/api/2/priority/move', method: 'PUT', data: { - ids: parameters.ids, after: parameters.after, + ids: parameters.ids, position: parameters.position, }, }; @@ -172,7 +179,9 @@ export class IssuePriorities { maxResults: parameters?.maxResults, id: parameters?.id, projectId: paramSerializer('projectId', parameters?.projectId), + priorityName: parameters?.priorityName, onlyDefault: parameters?.onlyDefault, + expand: parameters?.expand, }, }; @@ -213,6 +222,11 @@ export class IssuePriorities { /** * Updates an issue priority. * + * At least one request body parameter must be defined. + * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ @@ -220,6 +234,11 @@ export class IssuePriorities { /** * Updates an issue priority. * + * At least one request body parameter must be defined. + * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ @@ -229,6 +248,7 @@ export class IssuePriorities { url: `/rest/api/2/priority/${parameters.id}`, method: 'PUT', data: { + avatarId: parameters.avatarId, description: parameters.description, iconUrl: parameters.iconUrl, name: parameters.name, @@ -238,4 +258,37 @@ export class IssuePriorities { return this.client.sendRequest(config, callback); } + + /** + * Deletes an issue priority. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriority(parameters: Parameters.DeletePriority, callback: Callback): Promise; + /** + * Deletes an issue priority. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-2-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriority(parameters: Parameters.DeletePriority, callback?: never): Promise; + async deletePriority(parameters: Parameters.DeletePriority, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/priority/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version2/issueProperties.ts b/src/version2/issueProperties.ts index 322a7ec9ef..6420625bb5 100644 --- a/src/version2/issueProperties.ts +++ b/src/version2/issueProperties.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 IssueProperties { diff --git a/src/version2/issueRemoteLinks.ts b/src/version2/issueRemoteLinks.ts index 12943c64cd..907c06971f 100644 --- a/src/version2/issueRemoteLinks.ts +++ b/src/version2/issueRemoteLinks.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 IssueRemoteLinks { diff --git a/src/version2/issueResolutions.ts b/src/version2/issueResolutions.ts index 10922ceae9..7aacebfd5b 100644 --- a/src/version2/issueResolutions.ts +++ b/src/version2/issueResolutions.ts @@ -1,12 +1,35 @@ 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 IssueResolutions { constructor(private client: Client) {} + /** + * Returns a list of all issue resolution values. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolutions(callback: Callback): Promise; + /** + * Returns a list of all issue resolution values. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolutions(callback?: never): Promise; + async getResolutions(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/resolution', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + /** * Creates an issue resolution. * @@ -91,8 +114,8 @@ export class IssueResolutions { url: '/rest/api/2/resolution/move', method: 'PUT', data: { - ids: parameters.ids, after: parameters.after, + ids: parameters.ids, position: parameters.position, }, }; @@ -148,6 +171,35 @@ export class IssueResolutions { return this.client.sendRequest(config, callback); } + /** + * Returns an issue resolution value. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolution( + parameters: Parameters.GetResolution, + callback: Callback, + ): Promise; + /** + * Returns an issue resolution value. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolution(parameters: Parameters.GetResolution, callback?: never): Promise; + async getResolution( + parameters: Parameters.GetResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/resolution/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + /** * Updates an issue resolution. * @@ -169,7 +221,6 @@ export class IssueResolutions { data: { ...parameters, name: parameters.name, - description: parameters.description, id: undefined, }, }; @@ -188,10 +239,7 @@ export class IssueResolutions { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteResolution( - parameters: Parameters.DeleteResolution, - callback: Callback, - ): Promise; + async deleteResolution(parameters: Parameters.DeleteResolution, callback: Callback): Promise; /** * Deletes an issue resolution. * @@ -203,11 +251,8 @@ export class IssueResolutions { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteResolution( - parameters: Parameters.DeleteResolution, - callback?: never, - ): Promise; - async deleteResolution( + async deleteResolution(parameters: Parameters.DeleteResolution, callback?: never): Promise; + async deleteResolution( parameters: Parameters.DeleteResolution, callback?: Callback, ): Promise { diff --git a/src/version2/issueSearch.ts b/src/version2/issueSearch.ts index 0d6414ec3c..3a84e9cce5 100644 --- a/src/version2/issueSearch.ts +++ b/src/version2/issueSearch.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 IssueSearch { @@ -76,10 +76,7 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async matchIssues( - parameters: Parameters.MatchIssues | undefined, - callback: Callback, - ): Promise; + async matchIssues(parameters: Parameters.MatchIssues, callback: Callback): Promise; /** * Checks whether one or more issues would be returned by one or more JQL queries. * @@ -91,17 +88,17 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async matchIssues(parameters?: Parameters.MatchIssues, callback?: never): Promise; + async matchIssues(parameters: Parameters.MatchIssues, callback?: never): Promise; async matchIssues( - parameters?: Parameters.MatchIssues, + parameters: Parameters.MatchIssues, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/jql/match', method: 'POST', data: { - jqls: parameters?.jqls, - issueIds: parameters?.issueIds, + issueIds: parameters.issueIds, + jqls: parameters.jqls, }, }; @@ -125,7 +122,7 @@ export class IssueSearch { * to view the issue. */ async searchForIssuesUsingJql( - parameters: Parameters.SearchForIssuesUsingJql | undefined, + parameters: Parameters.SearchForIssuesUsingJql, callback: Callback, ): Promise; /** @@ -145,25 +142,26 @@ export class IssueSearch { * to view the issue. */ async searchForIssuesUsingJql( - parameters?: Parameters.SearchForIssuesUsingJql, + parameters: Parameters.SearchForIssuesUsingJql, callback?: never, ): Promise; async searchForIssuesUsingJql( - parameters?: Parameters.SearchForIssuesUsingJql, + parameters: Parameters.SearchForIssuesUsingJql, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/search', method: 'GET', params: { - jql: parameters?.jql, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - validateQuery: parameters?.validateQuery, - fields: parameters?.fields, - expand: parameters?.expand, - properties: parameters?.properties, - fieldsByKeys: parameters?.fieldsByKeys, + jql: parameters.jql, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + properties: parameters.properties, + fieldsByKeys: parameters.fieldsByKeys, + failFast: parameters.failFast, }, }; @@ -218,14 +216,248 @@ export class IssueSearch { url: '/rest/api/2/search', method: 'POST', data: { + expand: parameters?.expand, + fields: parameters?.fields, + fieldsByKeys: parameters?.fieldsByKeys, jql: parameters?.jql, - startAt: parameters?.startAt, maxResults: parameters?.maxResults, - fields: parameters?.fields, - validateQuery: parameters?.validateQuery, - expand: parameters?.expand, properties: parameters?.properties, - fieldsByKeys: parameters?.fieldsByKeys, + startAt: parameters?.startAt, + validateQuery: parameters?.validateQuery, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Provide an estimated count of the issues that match the [JQL](https://confluence.atlassian.com/x/egORLQ). Recent + * updates might not be immediately visible in the returned output. This endpoint requires JQL to be bounded. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async countIssues(parameters: Parameters.CountIssues, callback: Callback): Promise; + /** + * Provide an estimated count of the issues that match the [JQL](https://confluence.atlassian.com/x/egORLQ). Recent + * updates might not be immediately visible in the returned output. This endpoint requires JQL to be bounded. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async countIssues(parameters: Parameters.CountIssues, callback?: never): Promise; + async countIssues( + parameters: Parameters.CountIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/search/approximate-count', + method: 'POST', + data: { + jql: parameters.jql, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Searches for IDs of issues using [JQL](https://confluence.atlassian.com/x/egORLQ). + * + * Use the [Search](#api-rest-api-2-search-post) endpoint if you need to fetch more than just issue IDs. The Search + * endpoint returns more information, but may take much longer to respond to requests. This is because it uses a + * different mechanism for ordering results than this endpoint and doesn't provide the total number of results for + * your query. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesIds( + parameters: Parameters.SearchForIssuesIds, + callback: Callback, + ): Promise; + /** + * Searches for IDs of issues using [JQL](https://confluence.atlassian.com/x/egORLQ). + * + * Use the [Search](#api-rest-api-2-search-post) endpoint if you need to fetch more than just issue IDs. The Search + * endpoint returns more information, but may take much longer to respond to requests. This is because it uses a + * different mechanism for ordering results than this endpoint and doesn't provide the total number of results for + * your query. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesIds( + parameters: Parameters.SearchForIssuesIds, + callback?: never, + ): Promise; + async searchForIssuesIds( + parameters: Parameters.SearchForIssuesIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/search/id', + method: 'POST', + data: { + jql: parameters.jql, + maxResults: parameters.maxResults, + nextPageToken: parameters.nextPageToken, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately + * visible in the returned search results. If you need + * [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) consistency, you can + * utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. This operation can be accessed + * anonymously. + * + * If the JQL query expression is too large to be encoded as a query parameter, use the + * [POST](#api-rest-api-2-search-post) version of this resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJqlEnhancedSearch( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch, + callback: Callback, + ): Promise; + /** + * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately + * visible in the returned search results. If you need + * [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) consistency, you can + * utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. This operation can be accessed + * anonymously. + * + * If the JQL query expression is too large to be encoded as a query parameter, use the + * [POST](#api-rest-api-2-search-post) version of this resource. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJqlEnhancedSearch( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch, + callback?: never, + ): Promise; + async searchForIssuesUsingJqlEnhancedSearch( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/search/jql', + method: 'GET', + params: { + jql: parameters.jql, + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + fields: parameters.fields, + expand: parameters.expand, + properties: parameters.properties, + fieldsByKeys: parameters.fieldsByKeys, + failFast: parameters.failFast, + reconcileIssues: parameters.reconcileIssues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately + * visible in the returned search results. If you need + * [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) consistency, you can + * utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. This operation can be accessed + * anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJqlEnhancedSearchPost( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost, + callback: Callback, + ): Promise; + /** + * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately + * visible in the returned search results. If you need + * [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) consistency, you can + * utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. This operation can be accessed + * anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJqlEnhancedSearchPost( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost, + callback?: never, + ): Promise; + async searchForIssuesUsingJqlEnhancedSearchPost( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/search/jql', + method: 'POST', + data: { + jql: parameters.jql, + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + fields: parameters.fields, + expand: parameters.expand, + properties: parameters.properties, + fieldsByKeys: parameters.fieldsByKeys, + failFast: parameters.failFast, + reconcileIssues: parameters.reconcileIssues, }, }; diff --git a/src/version2/issueSecurityLevel.ts b/src/version2/issueSecurityLevel.ts index 5a665fbd60..07187c1368 100644 --- a/src/version2/issueSecurityLevel.ts +++ b/src/version2/issueSecurityLevel.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 IssueSecurityLevel { diff --git a/src/version2/issueSecuritySchemes.ts b/src/version2/issueSecuritySchemes.ts index 60c089ea24..50c7f3ae3b 100644 --- a/src/version2/issueSecuritySchemes.ts +++ b/src/version2/issueSecuritySchemes.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 { paramSerializer } from '../paramSerializer'; import { RequestConfig } from '../requestConfig'; diff --git a/src/version2/issueTypeProperties.ts b/src/version2/issueTypeProperties.ts index cb3dd26eb3..478bcbd18c 100644 --- a/src/version2/issueTypeProperties.ts +++ b/src/version2/issueTypeProperties.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 IssueTypeProperties { diff --git a/src/version2/issueTypeSchemes.ts b/src/version2/issueTypeSchemes.ts index 1f9e7cfe95..2f47421e72 100644 --- a/src/version2/issueTypeSchemes.ts +++ b/src/version2/issueTypeSchemes.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 IssueTypeSchemes { @@ -60,7 +60,7 @@ export class IssueTypeSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueTypeScheme( - parameters: Parameters.CreateIssueTypeScheme | undefined, + parameters: Parameters.CreateIssueTypeScheme, callback: Callback, ): Promise; /** @@ -70,21 +70,21 @@ export class IssueTypeSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueTypeScheme( - parameters?: Parameters.CreateIssueTypeScheme, + parameters: Parameters.CreateIssueTypeScheme, callback?: never, ): Promise; async createIssueTypeScheme( - parameters?: Parameters.CreateIssueTypeScheme, + parameters: Parameters.CreateIssueTypeScheme, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/issuetypescheme', method: 'POST', data: { - name: parameters?.name, - description: parameters?.description, - defaultIssueTypeId: parameters?.defaultIssueTypeId, - issueTypeIds: parameters?.issueTypeIds, + name: parameters.name, + description: parameters.description, + defaultIssueTypeId: parameters.defaultIssueTypeId, + issueTypeIds: parameters.issueTypeIds, }, }; @@ -189,7 +189,7 @@ export class IssueTypeSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async assignIssueTypeSchemeToProject( - parameters: Parameters.AssignIssueTypeSchemeToProject | undefined, + parameters: Parameters.AssignIssueTypeSchemeToProject, callback: Callback, ): Promise; /** @@ -204,19 +204,19 @@ export class IssueTypeSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async assignIssueTypeSchemeToProject( - parameters?: Parameters.AssignIssueTypeSchemeToProject, + parameters: Parameters.AssignIssueTypeSchemeToProject, callback?: never, ): Promise; async assignIssueTypeSchemeToProject( - parameters?: Parameters.AssignIssueTypeSchemeToProject, + parameters: Parameters.AssignIssueTypeSchemeToProject, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/issuetypescheme/project', method: 'PUT', data: { - issueTypeSchemeId: parameters?.issueTypeSchemeId, - projectId: parameters?.projectId, + issueTypeSchemeId: parameters.issueTypeSchemeId, + projectId: parameters.projectId, }, }; diff --git a/src/version2/issueTypeScreenSchemes.ts b/src/version2/issueTypeScreenSchemes.ts index 34dacadc5f..22bdb1a124 100644 --- a/src/version2/issueTypeScreenSchemes.ts +++ b/src/version2/issueTypeScreenSchemes.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 IssueTypeScreenSchemes { @@ -60,7 +60,7 @@ export class IssueTypeScreenSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueTypeScreenScheme( - parameters: Parameters.CreateIssueTypeScreenScheme | undefined, + parameters: Parameters.CreateIssueTypeScreenScheme, callback: Callback, ): Promise; /** @@ -70,20 +70,20 @@ export class IssueTypeScreenSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueTypeScreenScheme( - parameters?: Parameters.CreateIssueTypeScreenScheme, + parameters: Parameters.CreateIssueTypeScreenScheme, callback?: never, ): Promise; async createIssueTypeScreenScheme( - parameters?: Parameters.CreateIssueTypeScreenScheme, + parameters: Parameters.CreateIssueTypeScreenScheme, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/issuetypescreenscheme', method: 'POST', data: { - name: parameters?.name, - description: parameters?.description, - issueTypeMappings: parameters?.issueTypeMappings, + name: parameters.name, + description: parameters.description, + issueTypeMappings: parameters.issueTypeMappings, }, }; diff --git a/src/version2/issueTypes.ts b/src/version2/issueTypes.ts index 84721d580e..8ec2cb6f28 100644 --- a/src/version2/issueTypes.ts +++ b/src/version2/issueTypes.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 IssueTypes { @@ -51,7 +51,7 @@ export class IssueTypes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueType( - parameters: Parameters.CreateIssueType | undefined, + parameters: Parameters.CreateIssueType, callback: Callback, ): Promise; /** @@ -61,20 +61,20 @@ export class IssueTypes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueType( - parameters?: Parameters.CreateIssueType, + parameters: Parameters.CreateIssueType, callback?: never, ): Promise; async createIssueType( - parameters?: Parameters.CreateIssueType, + parameters: Parameters.CreateIssueType, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/issuetype', method: 'POST', data: { - name: parameters?.name, - description: parameters?.description, - hierarchyLevel: parameters?.hierarchyLevel, + description: parameters.description, + hierarchyLevel: parameters.hierarchyLevel, + name: parameters.name, }, }; @@ -191,9 +191,9 @@ export class IssueTypes { url: `/rest/api/2/issuetype/${parameters.id}`, method: 'PUT', data: { - name: parameters.name, - description: parameters.description, avatarId: parameters.avatarId, + description: parameters.description, + name: parameters.name, }, }; @@ -231,7 +231,7 @@ export class IssueTypes { url: `/rest/api/2/issuetype/${id}`, method: 'DELETE', params: { - alternativeIssueTypeId: typeof parameters !== 'string' && parameters.alternativeIssueTypeId, + alternativeIssueTypeId: typeof parameters !== 'string' ? parameters.alternativeIssueTypeId : undefined, }, }; @@ -279,16 +279,6 @@ export class IssueTypes { /** * Loads an avatar for the issue type. * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * For example: `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check'\ - * --header 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url - * 'https://your-domain.atlassian.net/rest/api/2/issuetype/{issueTypeId}'This` - * * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of * the image. The length of the square's sides is set to the smaller of the height or width of the image. * @@ -307,16 +297,6 @@ export class IssueTypes { /** * Loads an avatar for the issue type. * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * For example: `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check'\ - * --header 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url - * 'https://your-domain.atlassian.net/rest/api/2/issuetype/{issueTypeId}'This` - * * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of * the image. The length of the square's sides is set to the smaller of the height or width of the image. * @@ -339,11 +319,16 @@ export class IssueTypes { const config: RequestConfig = { url: `/rest/api/2/issuetype/${parameters.id}/avatar2`, method: 'POST', + headers: { + 'X-Atlassian-Token': 'no-check', + 'Content-Type': parameters.mimeType, + }, params: { x: parameters.x, y: parameters.y, - size: parameters.size, + size: parameters.size ?? 0, }, + data: parameters.avatar, }; return this.client.sendRequest(config, callback); diff --git a/src/version2/issueVotes.ts b/src/version2/issueVotes.ts index 913436f674..469a423e7b 100644 --- a/src/version2/issueVotes.ts +++ b/src/version2/issueVotes.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 IssueVotes { diff --git a/src/version2/issueWatchers.ts b/src/version2/issueWatchers.ts index 43144b8aba..fca09eaceb 100644 --- a/src/version2/issueWatchers.ts +++ b/src/version2/issueWatchers.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 IssueWatchers { diff --git a/src/version2/issueWorklogProperties.ts b/src/version2/issueWorklogProperties.ts index 8cac5e88da..d9ec0af85f 100644 --- a/src/version2/issueWorklogProperties.ts +++ b/src/version2/issueWorklogProperties.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 IssueWorklogProperties { diff --git a/src/version2/issueWorklogs.ts b/src/version2/issueWorklogs.ts index 31482bb4df..b709eefd9b 100644 --- a/src/version2/issueWorklogs.ts +++ b/src/version2/issueWorklogs.ts @@ -1,15 +1,15 @@ 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 IssueWorklogs { constructor(private client: Client) {} /** - * Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and - * time. + * Returns worklogs for an issue (ordered by created time), starting from the oldest worklog or from the worklog + * started on or after a date and time. * * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). @@ -30,8 +30,8 @@ export class IssueWorklogs { callback: Callback, ): Promise; /** - * Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and - * time. + * Returns worklogs for an issue (ordered by created time), starting from the oldest worklog or from the worklog + * started on or after a date and time. * * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). @@ -61,11 +61,11 @@ export class IssueWorklogs { url: `/rest/api/2/issue/${issueIdOrKey}/worklog`, method: 'GET', params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - startedAfter: typeof parameters !== 'string' && parameters.startedAfter, - startedBefore: typeof parameters !== 'string' && parameters.startedBefore, - expand: typeof parameters !== 'string' && parameters.expand, + startAt: typeof parameters !== 'string' ? parameters.startAt : undefined, + maxResults: typeof parameters !== 'string' ? parameters.maxResults : undefined, + startedAfter: typeof parameters !== 'string' ? parameters.startedAfter : undefined, + startedBefore: typeof parameters !== 'string' ? parameters.startedBefore : undefined, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, }, }; @@ -117,20 +117,139 @@ export class IssueWorklogs { overrideEditableFlag: parameters.overrideEditableFlag, }, data: { - self: parameters.self, author: parameters.author, - updateAuthor: parameters.updateAuthor, comment: parameters.comment, created: parameters.created, - updated: parameters.updated, - visibility: parameters.visibility, - started: parameters.started, - timeSpent: parameters.timeSpent, - timeSpentSeconds: parameters.timeSpentSeconds, id: parameters.id, issueId: parameters.issueId, properties: parameters.properties, + self: parameters.self, + started: parameters.started, + timeSpent: parameters.timeSpent, + timeSpentSeconds: parameters.timeSpentSeconds, + updateAuthor: parameters.updateAuthor, + updated: parameters.updated, + visibility: parameters.visibility, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a list of worklogs from an issue. This is an experimental API with limitations: + * + * - You can't delete more than 5000 worklogs at once. + * - No notifications will be sent for deleted worklogs. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog. + * - If any worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async bulkDeleteWorklogs(parameters: Parameters.BulkDeleteWorklogs, callback: Callback): Promise; + /** + * Deletes a list of worklogs from an issue. This is an experimental API with limitations: + * + * - You can't delete more than 5000 worklogs at once. + * - No notifications will be sent for deleted worklogs. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog. + * - If any worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async bulkDeleteWorklogs(parameters: Parameters.BulkDeleteWorklogs, callback?: never): Promise; + async bulkDeleteWorklogs( + parameters: Parameters.BulkDeleteWorklogs, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog`, + method: 'DELETE', + params: { + adjustEstimate: parameters.adjustEstimate, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + data: { + ids: parameters.ids, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a list of worklogs from one issue to another. This is an experimental API with several limitations: + * + * - You can't move more than 5000 worklogs at once. + * - You can't move worklogs containing an attachment. + * - You can't move worklogs restricted by project roles. + * - No notifications will be sent for moved worklogs. + * - No webhooks or events will be sent for moved worklogs. + * - No issue history will be recorded for moved worklogs. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the projects containing the + * source and destination issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ and _Edit all worklogs_](https://confluence.atlassian.com/x/yodKLg)[project + * permission](https://confluence.atlassian.com/x/yodKLg) + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async bulkMoveWorklogs(parameters: Parameters.BulkMoveWorklogs, callback: Callback): Promise; + /** + * Moves a list of worklogs from one issue to another. This is an experimental API with several limitations: + * + * - You can't move more than 5000 worklogs at once. + * - You can't move worklogs containing an attachment. + * - You can't move worklogs restricted by project roles. + * - No notifications will be sent for moved worklogs. + * - No webhooks or events will be sent for moved worklogs. + * - No issue history will be recorded for moved worklogs. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the projects containing the + * source and destination issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ and _Edit all worklogs_](https://confluence.atlassian.com/x/yodKLg)[project + * permission](https://confluence.atlassian.com/x/yodKLg) + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async bulkMoveWorklogs(parameters: Parameters.BulkMoveWorklogs, callback?: never): Promise; + async bulkMoveWorklogs(parameters: Parameters.BulkMoveWorklogs, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/${parameters.issueIdOrKey}/worklog/move`, + method: 'POST', + params: { + adjustEstimate: parameters.adjustEstimate, + overrideEditableFlag: parameters.overrideEditableFlag, }, + data: parameters.worklogs, }; return this.client.sendRequest(config, callback); diff --git a/src/version2/issues.ts b/src/version2/issues.ts index 2c00ffa2c5..d06fb26551 100644 --- a/src/version2/issues.ts +++ b/src/version2/issues.ts @@ -1,12 +1,70 @@ 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 Issues { constructor(private client: Client) {} + /** + * Bulk fetch changelogs for multiple issues and filter by fields + * + * Returns a paginated list of all changelogs for given issues sorted by changelog date and issue IDs, starting from + * the oldest changelog and smallest issue ID. + * + * Issues are identified by their ID or key, and optionally changelogs can be filtered by their field IDs. You can + * request the changelogs of up to 1000 issues and can filter them by up to 10 field IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the projects that the issues + * are in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issues. + */ + async getBulkChangelogs( + parameters: Parameters.GetBulkChangelogs, + callback: Callback, + ): Promise; + /** + * Bulk fetch changelogs for multiple issues and filter by fields + * + * Returns a paginated list of all changelogs for given issues sorted by changelog date and issue IDs, starting from + * the oldest changelog and smallest issue ID. + * + * Issues are identified by their ID or key, and optionally changelogs can be filtered by their field IDs. You can + * request the changelogs of up to 1000 issues and can filter them by up to 10 field IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the projects that the issues + * are in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issues. + */ + async getBulkChangelogs( + parameters: Parameters.GetBulkChangelogs, + callback?: never, + ): Promise; + async getBulkChangelogs( + parameters: Parameters.GetBulkChangelogs, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/changelog/bulkfetch', + method: 'POST', + data: { + fieldIds: parameters.fieldIds, + issueIdsOrKeys: parameters.issueIdsOrKeys, + maxResults: parameters.maxResults, + nextPageToken: parameters.nextPageToken, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Returns all issue events. * @@ -97,9 +155,9 @@ export class Issues { * of the submitted request. * * You can use the [get - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get) + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-tasks/#api-rest-api-2-task-taskid-get) * and [cancel - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-tasks/#api-rest-api-2-task-taskid-cancel-post) * APIs to manage the request. * * **Note that:** @@ -114,20 +172,17 @@ export class Issues { * * **Signed-in users only:** This API can't be accessed anonymously. * - * **Rate limiting:** Only a single request per user can be active at any given time. + * **Rate limiting:** Only a single request per jira instance can be active at any given time. */ - async archiveIssuesAsync( - parameters: Parameters.ArchiveIssuesAsync, - callback: Callback, - ): Promise; + async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback: Callback): Promise; /** * Enables admins to archive up to 100,000 issues in a single request using JQL, returning the URL to check the status * of the submitted request. * * You can use the [get - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-get) + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-tasks/#api-rest-api-2-task-taskid-get) * and [cancel - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-tasks/#api-rest-api-3-task-taskid-cancel-post) + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-tasks/#api-rest-api-2-task-taskid-cancel-post) * APIs to manage the request. * * **Note that:** @@ -142,10 +197,10 @@ export class Issues { * * **Signed-in users only:** This API can't be accessed anonymously. * - * **Rate limiting:** Only a single request per user can be active at any given time. + * **Rate limiting:** Only a single request per jira instance can be active at any given time. */ - async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; - async archiveIssuesAsync( + async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; + async archiveIssuesAsync( parameters: Parameters.ArchiveIssuesAsync, callback?: Callback, ): Promise { @@ -271,36 +326,106 @@ export class Issues { } /** - * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each - * issue type for the user. Use the information to populate the requests in [ Create - * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * Returns the details for a set of requested issues. You can request up to 100 issues. + * + * Each issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive + * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or + * other redirect is **not** returned. * - * The request can be restricted to specific projects or issue types using the query parameters. The response will - * contain information for the valid projects, issue types, or project and issue type combinations requested. Note - * that invalid project, issue type, or project and issue type combinations do not generate errors. + * Issues will be returned in ascending `id` order. If there are errors, Jira will return a list of issues which + * couldn't be fetched along with error messages. * * This operation can be accessed anonymously. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create - * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkFetchIssues( + parameters: Parameters.BulkFetchIssues, + callback: Callback, + ): Promise; + /** + * Returns the details for a set of requested issues. You can request up to 100 issues. + * + * Each issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive + * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or + * other redirect is **not** returned. + * + * Issues will be returned in ascending `id` order. If there are errors, Jira will return a list of issues which + * couldn't be fetched along with error messages. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkFetchIssues(parameters: Parameters.BulkFetchIssues, callback?: never): Promise; + async bulkFetchIssues( + parameters: Parameters.BulkFetchIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/bulkfetch', + method: 'POST', + data: { + expand: parameters.expand, + fields: parameters.fields, + fieldsByKeys: parameters.fieldsByKeys, + issueIdsOrKeys: parameters.issueIdsOrKeys, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * @deprecated Returns details of projects, issue types within projects, and, when requested, the create screen fields + * for each issue type for the user. Use the information to populate the requests in [ Create + * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * + * Deprecated, see [Create Issue Meta Endpoint Deprecation + * Notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1304). + * + * The request can be restricted to specific projects or issue types using the query parameters. The response will + * contain information for the valid projects, issue types, or project and issue type combinations requested. Note + * that invalid project, issue type, or project and issue type combinations do not generate errors. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. */ async getCreateIssueMeta( parameters: Parameters.GetCreateIssueMeta | undefined, callback: Callback, ): Promise; /** - * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each - * issue type for the user. Use the information to populate the requests in [ Create - * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * @deprecated Returns details of projects, issue types within projects, and, when requested, the create screen fields + * for each issue type for the user. Use the information to populate the requests in [ Create + * issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). * - * The request can be restricted to specific projects or issue types using the query parameters. The response will - * contain information for the valid projects, issue types, or project and issue type combinations requested. Note - * that invalid project, issue type, or project and issue type combinations do not generate errors. + * Deprecated, see [Create Issue Meta Endpoint Deprecation + * Notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1304). * - * This operation can be accessed anonymously. + * The request can be restricted to specific projects or issue types using the query parameters. The response will + * contain information for the valid projects, issue types, or project and issue type combinations requested. Note + * that invalid project, issue type, or project and issue type combinations do not generate errors. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create - * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. */ async getCreateIssueMeta( parameters?: Parameters.GetCreateIssueMeta, @@ -325,6 +450,134 @@ export class Issues { return this.client.sendRequest(config, callback); } + /** + * Returns a page of issue type metadata for a specified project. Use the information to populate the requests in [ + * Create issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMetaIssueTypes( + parameters: Parameters.GetCreateIssueMetaIssueTypes, + callback: Callback, + ): Promise; + /** + * Returns a page of issue type metadata for a specified project. Use the information to populate the requests in [ + * Create issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMetaIssueTypes( + parameters: Parameters.GetCreateIssueMetaIssueTypes, + callback?: never, + ): Promise; + async getCreateIssueMetaIssueTypes( + parameters: Parameters.GetCreateIssueMetaIssueTypes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/createmeta/${parameters.projectIdOrKey}/issuetypes`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a page of field metadata for a specified project and issuetype id. Use the information to populate the + * requests in [ Create issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMetaIssueTypeId( + parameters: Parameters.GetCreateIssueMetaIssueTypeId, + callback: Callback, + ): Promise; + /** + * Returns a page of field metadata for a specified project and issuetype id. Use the information to populate the + * requests in [ Create issue](#api-rest-api-2-issue-post) and [Create issues](#api-rest-api-2-issue-bulk-post). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMetaIssueTypeId( + parameters: Parameters.GetCreateIssueMetaIssueTypeId, + callback?: never, + ): Promise; + async getCreateIssueMetaIssueTypeId( + parameters: Parameters.GetCreateIssueMetaIssueTypeId, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/issue/createmeta/${parameters.projectIdOrKey}/issuetypes/${parameters.issueTypeId}`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all issues breaching and approaching per-issue limits. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) is required for the project the + * issues are in. Results may be incomplete otherwise + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueLimitReport( + parameters: Parameters.GetIssueLimitReport | undefined, + callback: Callback, + ): Promise; + /** + * Returns all issues breaching and approaching per-issue limits. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) is required for the project the + * issues are in. Results may be incomplete otherwise + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueLimitReport( + parameters?: Parameters.GetIssueLimitReport, + callback?: never, + ): Promise; + async getIssueLimitReport( + parameters?: Parameters.GetIssueLimitReport, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/issue/limit/report', + method: 'GET', + params: { + isReturningKeys: parameters?.isReturningKeys, + }, + data: { + issuesApproachingLimitParams: parameters?.issuesApproachingLimitParams, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Enables admins to unarchive up to 1000 issues in a single request using issue ID/key, returning details of the * issue(s) unarchived in the process and the errors encountered, if any. @@ -424,11 +677,11 @@ export class Issues { url: `/rest/api/2/issue/${issueIdOrKey}`, method: 'GET', params: { - fields: typeof parameters !== 'string' && parameters.fields, - fieldsByKeys: typeof parameters !== 'string' && parameters.fieldsByKeys, - expand: typeof parameters !== 'string' && parameters.expand, - properties: typeof parameters !== 'string' && parameters.properties, - updateHistory: typeof parameters !== 'string' && parameters.updateHistory, + fields: typeof parameters !== 'string' ? parameters.fields : undefined, + fieldsByKeys: typeof parameters !== 'string' ? parameters.fieldsByKeys : undefined, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, + properties: typeof parameters !== 'string' ? parameters.properties : undefined, + updateHistory: typeof parameters !== 'string' ? parameters.updateHistory : undefined, }, }; @@ -436,7 +689,9 @@ export class Issues { } /** - * Edits an issue. A transition may be applied and issue properties updated as part of the edit. + * Edits an issue. Issue properties may be updated as part of the edit. Please note that issue transition is not + * supported and is ignored here. To transition an issue, please use [Transition + * issue](#api-rest-api-2-issue-issueIdOrKey-transitions-post). * * The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are * determined using [ Get edit issue metadata](#api-rest-api-2-issue-issueIdOrKey-editmeta-get). @@ -460,7 +715,9 @@ export class Issues { */ async editIssue(parameters: Parameters.EditIssue, callback: Callback): Promise; /** - * Edits an issue. A transition may be applied and issue properties updated as part of the edit. + * Edits an issue. Issue properties may be updated as part of the edit. Please note that issue transition is not + * supported and is ignored here. To transition an issue, please use [Transition + * issue](#api-rest-api-2-issue-issueIdOrKey-transitions-post). * * The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are * determined using [ Get edit issue metadata](#api-rest-api-2-issue-issueIdOrKey-editmeta-get). @@ -545,7 +802,7 @@ export class Issues { url: `/rest/api/2/issue/${issueIdOrKey}`, method: 'DELETE', params: { - deleteSubtasks: typeof parameters !== 'string' && parameters.deleteSubtasks, + deleteSubtasks: typeof parameters !== 'string' ? parameters.deleteSubtasks : undefined, }, }; @@ -659,8 +916,8 @@ export class Issues { url: `/rest/api/2/issue/${issueIdOrKey}/changelog`, method: 'GET', params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, + startAt: typeof parameters !== 'string' ? parameters.startAt : undefined, + maxResults: typeof parameters !== 'string' ? parameters.maxResults : undefined, }, }; @@ -836,8 +1093,8 @@ export class Issues { url: `/rest/api/2/issue/${issueIdOrKey}/editmeta`, method: 'GET', params: { - overrideScreenSecurity: typeof parameters !== 'string' && parameters.overrideScreenSecurity, - overrideEditableFlag: typeof parameters !== 'string' && parameters.overrideEditableFlag, + overrideScreenSecurity: typeof parameters !== 'string' ? parameters.overrideScreenSecurity : undefined, + overrideEditableFlag: typeof parameters !== 'string' ? parameters.overrideEditableFlag : undefined, }, }; @@ -940,11 +1197,12 @@ export class Issues { url: `/rest/api/2/issue/${issueIdOrKey}/transitions`, method: 'GET', params: { - expand: typeof parameters !== 'string' && parameters.expand, - transitionId: typeof parameters !== 'string' && parameters.transitionId, - skipRemoteOnlyCondition: typeof parameters !== 'string' && parameters.skipRemoteOnlyCondition, - includeUnavailableTransitions: typeof parameters !== 'string' && parameters.includeUnavailableTransitions, - sortByOpsBarAndStatus: typeof parameters !== 'string' && parameters.sortByOpsBarAndStatus, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, + transitionId: typeof parameters !== 'string' ? parameters.transitionId : undefined, + skipRemoteOnlyCondition: typeof parameters !== 'string' ? parameters.skipRemoteOnlyCondition : undefined, + includeUnavailableTransitions: + typeof parameters !== 'string' ? parameters.includeUnavailableTransitions : undefined, + sortByOpsBarAndStatus: typeof parameters !== 'string' ? parameters.sortByOpsBarAndStatus : undefined, }, }; diff --git a/src/version2/jQL.ts b/src/version2/jQL.ts index a5dd54bb97..54f434391e 100644 --- a/src/version2/jQL.ts +++ b/src/version2/jQL.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 JQL { @@ -170,7 +170,7 @@ export class JQL { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async parseJqlQueries( - parameters: Parameters.ParseJqlQueries | undefined, + parameters: Parameters.ParseJqlQueries, callback: Callback, ): Promise; /** @@ -183,21 +183,21 @@ export class JQL { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async parseJqlQueries( - parameters?: Parameters.ParseJqlQueries, + parameters: Parameters.ParseJqlQueries, callback?: never, ): Promise; async parseJqlQueries( - parameters?: Parameters.ParseJqlQueries, + parameters: Parameters.ParseJqlQueries, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/jql/parse', method: 'POST', params: { - validation: parameters?.validation, + validation: parameters.validation, }, data: { - queries: parameters?.queries, + queries: parameters.queries, }, }; @@ -261,7 +261,7 @@ export class JQL { * Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in * JQL - * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post). + * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-jql/#api-rest-api-2-jql-sanitize-post). * * Before sanitization each JQL query is parsed. The queries are returned in the same order that they were passed. * @@ -284,7 +284,7 @@ export class JQL { * Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers * (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in * JQL - * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post). + * queries](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-jql/#api-rest-api-2-jql-sanitize-post). * * Before sanitization each JQL query is parsed. The queries are returned in the same order that they were passed. * diff --git a/src/version2/jiraExpressions.ts b/src/version2/jiraExpressions.ts index 4138ae15ef..e34c2b88ca 100644 --- a/src/version2/jiraExpressions.ts +++ b/src/version2/jiraExpressions.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 JiraExpressions { @@ -46,8 +46,8 @@ export class JiraExpressions { check: parameters?.check, }, data: { - expressions: parameters?.expressions, contextVariables: parameters?.contextVariables, + expressions: parameters?.expressions, }, }; @@ -106,11 +106,12 @@ export class JiraExpressions { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue. Permission to access Jira Software is - * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + * example, different users may see different comments on the same issue.\ + * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or + * fields (for example, `issue.sprint`). */ async evaluateJiraExpression( - parameters: Parameters.EvaluateJiraExpression | undefined, + parameters: Parameters.EvaluateJiraExpression, callback: Callback, ): Promise; /** @@ -165,26 +166,174 @@ export class JiraExpressions { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue. Permission to access Jira Software is - * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + * example, different users may see different comments on the same issue.\ + * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or + * fields (for example, `issue.sprint`). */ async evaluateJiraExpression( - parameters?: Parameters.EvaluateJiraExpression, + parameters: Parameters.EvaluateJiraExpression, callback?: never, ): Promise; async evaluateJiraExpression( - parameters?: Parameters.EvaluateJiraExpression, + parameters: Parameters.EvaluateJiraExpression, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/expression/eval', method: 'POST', params: { - expand: parameters?.expand, + expand: parameters.expand, + }, + data: { + context: parameters.context, + expression: parameters.expression, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Evaluates a Jira expression and returns its value. The difference between this and `eval` is that this endpoint + * uses the enhanced search API when evaluating JQL queries. This API is eventually consistent, unlike the strongly + * consistent `eval` API. This allows for better performance and scalability. In addition, this API's response for JQL + * evaluation is based on a scrolling view (backed by a `nextPageToken`) instead of a paginated view (backed by + * `startAt` and `totalCount`). + * + * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible + * way. Consult the [Jira expressions + * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. + * + * #### Context variables + * + * The following context variables are available to Jira expressions evaluated by this resource. Their presence + * depends on various factors; usually you need to manually request them in the context object sent in the payload, + * but some of them are added automatically under certain conditions. + * + * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The + * current user. Always available and equal to `null` if the request is anonymous. + * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The + * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. + * Available only for authenticated requests made by Connect apps (read more here: [Authentication for Connect + * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). + * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The + * current issue. Available only when the issue is provided in the request context object. + * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of + * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A + * collection of issues matching a JQL query. Available only when JQL is provided in the request context object. + * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): + * The current project. Available only when the project is provided in the request context object. + * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): + * The current sprint. Available only when the sprint is provided in the request context object. + * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The + * current board. Available only when the board is provided in the request context object. + * - `serviceDesk` + * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): + * The current service desk. Available only when the service desk is provided in the request context object. + * - `customerRequest` + * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): + * The current customer request. Available only when the customer request is provided in the request context + * object. + * + * In addition, you can pass custom context variables along with their types. You can then access them from the Jira + * expression by key. You can use the following variables in a custom context: + * + * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. + * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) + * specified by ID or key. All the fields of the issue object are available in the Jira expression. + * - `json`: A JSON object containing custom content. + * - `list`: A JSON list of `user`, `issue`, or `json` variable types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. + * However, an expression may return different results for different users depending on their permissions. For + * example, different users may see different comments on the same issue.\ + * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or + * fields (for example, `issue.sprint`). + */ + async evaluateJiraExpressionUsingEnhancedSearch( + parameters: Parameters.EvaluateJiraExpressionUsingEnhancedSearch, + callback: Callback, + ): Promise; + /** + * Evaluates a Jira expression and returns its value. The difference between this and `eval` is that this endpoint + * uses the enhanced search API when evaluating JQL queries. This API is eventually consistent, unlike the strongly + * consistent `eval` API. This allows for better performance and scalability. In addition, this API's response for JQL + * evaluation is based on a scrolling view (backed by a `nextPageToken`) instead of a paginated view (backed by + * `startAt` and `totalCount`). + * + * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible + * way. Consult the [Jira expressions + * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. + * + * #### Context variables + * + * The following context variables are available to Jira expressions evaluated by this resource. Their presence + * depends on various factors; usually you need to manually request them in the context object sent in the payload, + * but some of them are added automatically under certain conditions. + * + * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The + * current user. Always available and equal to `null` if the request is anonymous. + * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The + * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. + * Available only for authenticated requests made by Connect apps (read more here: [Authentication for Connect + * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). + * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The + * current issue. Available only when the issue is provided in the request context object. + * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of + * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A + * collection of issues matching a JQL query. Available only when JQL is provided in the request context object. + * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): + * The current project. Available only when the project is provided in the request context object. + * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): + * The current sprint. Available only when the sprint is provided in the request context object. + * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The + * current board. Available only when the board is provided in the request context object. + * - `serviceDesk` + * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): + * The current service desk. Available only when the service desk is provided in the request context object. + * - `customerRequest` + * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): + * The current customer request. Available only when the customer request is provided in the request context + * object. + * + * In addition, you can pass custom context variables along with their types. You can then access them from the Jira + * expression by key. You can use the following variables in a custom context: + * + * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. + * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) + * specified by ID or key. All the fields of the issue object are available in the Jira expression. + * - `json`: A JSON object containing custom content. + * - `list`: A JSON list of `user`, `issue`, or `json` variable types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required**: None. + * However, an expression may return different results for different users depending on their permissions. For + * example, different users may see different comments on the same issue.\ + * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or + * fields (for example, `issue.sprint`). + */ + async evaluateJiraExpressionUsingEnhancedSearch( + parameters: Parameters.EvaluateJiraExpressionUsingEnhancedSearch, + callback?: never, + ): Promise; + async evaluateJiraExpressionUsingEnhancedSearch( + parameters: Parameters.EvaluateJiraExpressionUsingEnhancedSearch, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/expression/evaluate', + method: 'POST', + params: { + expand: parameters.expand, }, data: { - expression: parameters?.expression, - context: parameters?.context, + expression: parameters.expression, + context: parameters.context, }, }; diff --git a/src/version2/jiraSettings.ts b/src/version2/jiraSettings.ts index 1ac57eaa79..03a13fef0e 100644 --- a/src/version2/jiraSettings.ts +++ b/src/version2/jiraSettings.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 JiraSettings { @@ -88,18 +88,17 @@ export class JiraSettings { * * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). * - * | Key | Description | Default value | - * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | - * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | - * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | - * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | - * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | - * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | - * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | - * | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | - * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | - * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | - * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | + * | Key | Description | Default value | + * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | + * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | + * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | + * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | + * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | + * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | + * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | + * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | + * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | + * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | * * #### Look and feel * @@ -148,18 +147,17 @@ export class JiraSettings { * * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). * - * | Key | Description | Default value | - * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | - * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | - * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | - * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | - * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | - * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | - * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | - * | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | - * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | - * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | - * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | + * | Key | Description | Default value | + * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | + * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | + * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | + * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | + * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | + * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | + * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | + * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | + * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | + * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | * * #### Look and feel * diff --git a/src/version2/jqlFunctionsApps.ts b/src/version2/jqlFunctionsApps.ts index ac95c558e5..59c779ae0e 100644 --- a/src/version2/jqlFunctionsApps.ts +++ b/src/version2/jqlFunctionsApps.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 JqlFunctionsApps { @@ -13,6 +13,9 @@ export class JqlFunctionsApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This * API is only accessible to apps and apps can only inspect their own functions. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async getPrecomputations( parameters: Parameters.GetPrecomputations | undefined, @@ -24,6 +27,9 @@ export class JqlFunctionsApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This * API is only accessible to apps and apps can only inspect their own functions. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async getPrecomputations( parameters?: Parameters.GetPrecomputations, @@ -53,9 +59,12 @@ export class JqlFunctionsApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** An API * for apps to update their own precomputations. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updatePrecomputations( - parameters: Parameters.UpdatePrecomputations | undefined, + parameters: Parameters.UpdatePrecomputations, callback: Callback, ): Promise; /** @@ -63,17 +72,69 @@ export class JqlFunctionsApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** An API * for apps to update their own precomputations. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ - async updatePrecomputations(parameters?: Parameters.UpdatePrecomputations, callback?: never): Promise; + async updatePrecomputations(parameters: Parameters.UpdatePrecomputations, callback?: never): Promise; async updatePrecomputations( - parameters?: Parameters.UpdatePrecomputations, + parameters: Parameters.UpdatePrecomputations, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/jql/function/computation', method: 'POST', + params: { + skipNotFoundPrecomputations: parameters.skipNotFoundPrecomputations, + }, + data: { + values: parameters.values, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns function precomputations by IDs, along with information about when they were created, updated, and last + * used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This + * API is only accessible to apps and apps can only inspect their own functions. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. + */ + async getPrecomputationsByID( + parameters: Parameters.GetPrecomputationsByID, + callback: Callback, + ): Promise; + /** + * Returns function precomputations by IDs, along with information about when they were created, updated, and last + * used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** This + * API is only accessible to apps and apps can only inspect their own functions. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. + */ + async getPrecomputationsByID( + parameters: Parameters.GetPrecomputationsByID, + callback?: never, + ): Promise; + async getPrecomputationsByID( + parameters: Parameters.GetPrecomputationsByID, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/jql/function/computation/search', + method: 'POST', + params: { + orderBy: parameters.orderBy, + }, data: { - values: parameters?.values, + precomputationIDs: parameters.precomputationIDs, }, }; diff --git a/src/version2/labels.ts b/src/version2/labels.ts index 9a8bc62248..25c32078f5 100644 --- a/src/version2/labels.ts +++ b/src/version2/labels.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 Labels { diff --git a/src/version2/licenseMetrics.ts b/src/version2/licenseMetrics.ts index bf12582bf8..ad8e1121b2 100644 --- a/src/version2/licenseMetrics.ts +++ b/src/version2/licenseMetrics.ts @@ -1,6 +1,6 @@ import * as Models from './models'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class LicenseMetrics { diff --git a/src/version2/models/addAtlassianTeamRequest.ts b/src/version2/models/addAtlassianTeamRequest.ts new file mode 100644 index 0000000000..61b43a6018 --- /dev/null +++ b/src/version2/models/addAtlassianTeamRequest.ts @@ -0,0 +1,12 @@ +export interface AddAtlassianTeamRequest { + /** The capacity for the Atlassian team. */ + capacity?: number; + /** The Atlassian team ID. */ + id: string; + /** The ID of the issue source for the Atlassian team. */ + issueSourceId?: number; + /** The planning style for the Atlassian team. This must be "Scrum" or "Kanban". */ + planningStyle: 'Scrum' | 'Kanban' | string; + /** The sprint length for the Atlassian team. */ + sprintLength?: number; +} diff --git a/src/version2/models/addNotificationsDetails.ts b/src/version2/models/addNotificationsDetails.ts new file mode 100644 index 0000000000..388d257615 --- /dev/null +++ b/src/version2/models/addNotificationsDetails.ts @@ -0,0 +1,7 @@ +import { NotificationSchemeEventDetails } from './notificationSchemeEventDetails'; + +/** Details of notifications which should be added to the notification scheme. */ +export interface AddNotificationsDetails { + /** The list of notifications which should be added to the notification scheme. */ + notificationSchemeEvents: NotificationSchemeEventDetails[]; +} diff --git a/src/version2/models/avatar.ts b/src/version2/models/avatar.ts index 59626a2763..eae07991d1 100644 --- a/src/version2/models/avatar.ts +++ b/src/version2/models/avatar.ts @@ -1,3 +1,5 @@ +import { AvatarUrls } from './avatarUrls'; + /** Details of an avatar. */ export interface Avatar { /** The file name of the avatar icon. Returned for system avatars. */ @@ -5,16 +7,16 @@ export interface Avatar { /** The ID of the avatar. */ id: string; /** Whether the avatar can be deleted. */ - isDeletable?: boolean; + isDeletable: boolean; /** Whether the avatar is used in Jira. For example, shown as a project's avatar. */ - isSelected?: boolean; + isSelected: boolean; /** Whether the avatar is a system avatar. */ - isSystemAvatar?: boolean; + isSystemAvatar: boolean; /** * The owner of the avatar. For a system avatar the owner is null (and nothing is returned). For non-system avatars * this is the appropriate identifier, such as the ID for a project or the account ID for a user. */ owner?: string; /** The list of avatar icon URLs. */ - urls?: {}; + urls: AvatarUrls; } diff --git a/src/version2/models/avatarWithDetails.ts b/src/version2/models/avatarWithDetails.ts index 15f5f99071..f0c47200c6 100644 --- a/src/version2/models/avatarWithDetails.ts +++ b/src/version2/models/avatarWithDetails.ts @@ -2,5 +2,5 @@ export interface AvatarWithDetails { /** The content type of the avatar. Expected values include 'image/png', 'image/svg+xml', or any other valid MIME type. */ contentType: 'image/png' | 'image/svg+xml' | string; /** The binary representation of the avatar image. */ - avatar: ArrayBuffer; + avatar: Uint8Array; } diff --git a/src/version2/models/avatars.ts b/src/version2/models/avatars.ts index df93aa3ca5..bec166433b 100644 --- a/src/version2/models/avatars.ts +++ b/src/version2/models/avatars.ts @@ -3,7 +3,7 @@ import { Avatar } from './avatar'; /** Details about system and custom avatars. */ export interface Avatars { /** Custom avatars list. */ - custom?: Avatar[]; + custom: Avatar[]; /** System avatars list. */ - system?: Avatar[]; + system: Avatar[]; } diff --git a/src/version2/models/bulkChangelog.ts b/src/version2/models/bulkChangelog.ts new file mode 100644 index 0000000000..55644ab007 --- /dev/null +++ b/src/version2/models/bulkChangelog.ts @@ -0,0 +1,12 @@ +import { IssueChangeLog } from './issueChangeLog'; + +/** A page of changelogs which is designed to handle multiple issues */ +export interface BulkChangelog { + /** The list of issues changelogs. */ + issueChangeLogs?: IssueChangeLog[]; + /** + * Continuation token to fetch the next page. If this result represents the last or the only page, this token will be + * null. + */ + nextPageToken?: string; +} diff --git a/src/version2/models/bulkChangelogRequest.ts b/src/version2/models/bulkChangelogRequest.ts new file mode 100644 index 0000000000..b6162735ac --- /dev/null +++ b/src/version2/models/bulkChangelogRequest.ts @@ -0,0 +1,11 @@ +/** Request bean for bulk changelog retrieval */ +export interface BulkChangelogRequest { + /** List of field IDs to filter changelogs */ + fieldIds?: string[]; + /** List of issue IDs/keys to fetch changelogs for */ + issueIdsOrKeys: string[]; + /** The maximum number of items to return per page */ + maxResults?: number; + /** The cursor for pagination */ + nextPageToken?: string; +} diff --git a/src/version2/models/bulkContextualConfiguration.ts b/src/version2/models/bulkContextualConfiguration.ts new file mode 100644 index 0000000000..e175ae50a8 --- /dev/null +++ b/src/version2/models/bulkContextualConfiguration.ts @@ -0,0 +1,13 @@ +/** Details of the contextual configuration for a custom field. */ +export interface BulkContextualConfiguration { + /** The field configuration. */ + configuration?: {}; + /** The ID of the custom field. */ + customFieldId: string; + /** The ID of the field context the configuration is associated with. */ + fieldContextId: string; + /** The ID of the configuration. */ + id: string; + /** The field value schema. */ + schema?: {}; +} diff --git a/src/version2/models/bulkIssue.ts b/src/version2/models/bulkIssue.ts new file mode 100644 index 0000000000..8134e65eb7 --- /dev/null +++ b/src/version2/models/bulkIssue.ts @@ -0,0 +1,14 @@ +import { IssueError } from './issueError'; +import { Issue } from './issue'; + +/** The list of requested issues & fields. */ +export interface BulkIssue { + /** + * When Jira can't return an issue enumerated in a request due to a retriable error or payload constraint, we'll + * return the respective issue ID with a corresponding error message. This list is empty when there are no errors + * Issues which aren't found or that the user doesn't have permission to view won't be returned in this list. + */ + issueErrors?: IssueError[]; + /** The list of issues. */ + issues?: Issue[]; +} diff --git a/src/version2/models/component.ts b/src/version2/models/component.ts new file mode 100644 index 0000000000..d41a2c219f --- /dev/null +++ b/src/version2/models/component.ts @@ -0,0 +1,8 @@ +export interface Component { + ari?: string; + description?: string; + id?: string; + metadata?: {}; + name?: string; + self?: string; +} diff --git a/src/version2/models/configurationsListParameters.ts b/src/version2/models/configurationsListParameters.ts new file mode 100644 index 0000000000..0ded35d16e --- /dev/null +++ b/src/version2/models/configurationsListParameters.ts @@ -0,0 +1,5 @@ +/** List of custom fields identifiers which will be used to filter configurations */ +export interface ConfigurationsListParameters { + /** List of IDs or keys of the custom fields. It can be a mix of IDs and keys in the same query. */ + fieldIdsOrKeys: string[]; +} diff --git a/src/version2/models/createCrossProjectReleaseRequest.ts b/src/version2/models/createCrossProjectReleaseRequest.ts new file mode 100644 index 0000000000..ad86f7182f --- /dev/null +++ b/src/version2/models/createCrossProjectReleaseRequest.ts @@ -0,0 +1,6 @@ +export interface CreateCrossProjectReleaseRequest { + /** The cross-project release name. */ + name: string; + /** The IDs of the releases to include in the cross-project release. */ + releaseIds?: number[]; +} diff --git a/src/version2/models/createCustomFieldRequest.ts b/src/version2/models/createCustomFieldRequest.ts new file mode 100644 index 0000000000..08f438709f --- /dev/null +++ b/src/version2/models/createCustomFieldRequest.ts @@ -0,0 +1,6 @@ +export interface CreateCustomFieldRequest { + /** The custom field ID. */ + customFieldId: number; + /** Allows filtering issues based on their values for the custom field. */ + filter?: boolean; +} diff --git a/src/version2/models/createDateFieldRequest.ts b/src/version2/models/createDateFieldRequest.ts new file mode 100644 index 0000000000..8c70d94eb2 --- /dev/null +++ b/src/version2/models/createDateFieldRequest.ts @@ -0,0 +1,6 @@ +export interface CreateDateFieldRequest { + /** A date custom field ID. This is required if the type is "DateCustomField". */ + dateCustomFieldId?: number; + /** The date field type. This must be "DueDate", "TargetStartDate", "TargetEndDate" or "DateCustomField". */ + type: 'DueDate' | 'TargetStartDate' | 'TargetEndDate' | 'DateCustomField' | string; +} diff --git a/src/version2/models/createExclusionRulesRequest.ts b/src/version2/models/createExclusionRulesRequest.ts new file mode 100644 index 0000000000..88a7aca6eb --- /dev/null +++ b/src/version2/models/createExclusionRulesRequest.ts @@ -0,0 +1,14 @@ +export interface CreateExclusionRulesRequest { + /** The IDs of the issues to exclude from the plan. */ + issueIds?: number[]; + /** The IDs of the issue types to exclude from the plan. */ + issueTypeIds?: number[]; + /** Issues completed this number of days ago will be excluded from the plan. */ + numberOfDaysToShowCompletedIssues?: number; + /** The IDs of the releases to exclude from the plan. */ + releaseIds?: number[]; + /** The IDs of the work status categories to exclude from the plan. */ + workStatusCategoryIds?: number[]; + /** The IDs of the work statuses to exclude from the plan. */ + workStatusIds?: number[]; +} diff --git a/src/version2/models/createIssueSourceRequest.ts b/src/version2/models/createIssueSourceRequest.ts new file mode 100644 index 0000000000..87f7d3c1f3 --- /dev/null +++ b/src/version2/models/createIssueSourceRequest.ts @@ -0,0 +1,9 @@ +export interface CreateIssueSourceRequest { + /** The issue source type. This must be "Board", "Project" or "Filter". */ + type: 'Board' | 'Project' | 'Filter' | string; + /** + * The issue source value. This must be a board ID if the type is "Board", a project ID if the type is "Project" or a + * filter ID if the type is "Filter". + */ + value: number; +} diff --git a/src/version2/models/createPermissionHolderRequest.ts b/src/version2/models/createPermissionHolderRequest.ts new file mode 100644 index 0000000000..1e0ab09af0 --- /dev/null +++ b/src/version2/models/createPermissionHolderRequest.ts @@ -0,0 +1,9 @@ +export interface CreatePermissionHolderRequest { + /** The permission holder type. This must be "Group" or "AccountId". */ + type: 'Group' | 'AccountId' | string; + /** + * The permission holder value. This must be a group name if the type is "Group" or an account ID if the type is + * "AccountId". + */ + value: string; +} diff --git a/src/version2/models/createPermissionRequest.ts b/src/version2/models/createPermissionRequest.ts new file mode 100644 index 0000000000..0ce59481d7 --- /dev/null +++ b/src/version2/models/createPermissionRequest.ts @@ -0,0 +1,7 @@ +import { CreatePermissionHolderRequest } from './createPermissionHolderRequest'; + +export interface CreatePermissionRequest { + holder?: CreatePermissionHolderRequest; + /** The permission type. This must be "View" or "Edit". */ + type: 'View' | 'Edit' | string; +} diff --git a/src/version2/models/createPlanOnlyTeamRequest.ts b/src/version2/models/createPlanOnlyTeamRequest.ts new file mode 100644 index 0000000000..f53a44b781 --- /dev/null +++ b/src/version2/models/createPlanOnlyTeamRequest.ts @@ -0,0 +1,14 @@ +export interface CreatePlanOnlyTeamRequest { + /** The capacity for the plan-only team. */ + capacity?: number; + /** The ID of the issue source for the plan-only team. */ + issueSourceId?: number; + /** The account IDs of the plan-only team members. */ + memberAccountIds?: string[]; + /** The plan-only team name. */ + name: string; + /** The planning style for the plan-only team. This must be "Scrum" or "Kanban". */ + planningStyle: 'Scrum' | 'Kanban' | string; + /** The sprint length for the plan-only team. */ + sprintLength?: number; +} diff --git a/src/version2/models/createPlanRequest.ts b/src/version2/models/createPlanRequest.ts new file mode 100644 index 0000000000..c567101c93 --- /dev/null +++ b/src/version2/models/createPlanRequest.ts @@ -0,0 +1,23 @@ +import { CreateCrossProjectReleaseRequest } from './createCrossProjectReleaseRequest'; +import { CreateCustomFieldRequest } from './createCustomFieldRequest'; +import { CreateExclusionRulesRequest } from './createExclusionRulesRequest'; +import { CreateIssueSourceRequest } from './createIssueSourceRequest'; +import { CreatePermissionRequest } from './createPermissionRequest'; +import { CreateSchedulingRequest } from './createSchedulingRequest'; + +export interface CreatePlanRequest { + /** The cross-project releases to include in the plan. */ + crossProjectReleases?: CreateCrossProjectReleaseRequest[]; + /** The custom fields for the plan. */ + customFields?: CreateCustomFieldRequest[]; + exclusionRules?: CreateExclusionRulesRequest; + /** The issue sources to include in the plan. */ + issueSources: CreateIssueSourceRequest[]; + /** The account ID of the plan lead. */ + leadAccountId?: string; + /** The plan name. */ + name: string; + /** The permissions for the plan. */ + permissions?: CreatePermissionRequest[]; + scheduling?: CreateSchedulingRequest; +} diff --git a/src/version2/models/createPriorityDetails.ts b/src/version2/models/createPriorityDetails.ts index 363c7a2759..934f9993bf 100644 --- a/src/version2/models/createPriorityDetails.ts +++ b/src/version2/models/createPriorityDetails.ts @@ -1,9 +1,40 @@ /** Details of an issue priority. */ export interface CreatePriorityDetails { + /** + * The ID for the avatar for the priority. Either the iconUrl or avatarId must be defined, but not both. This + * parameter is nullable and will become mandatory once the iconUrl parameter is deprecated. + */ + avatarId?: number; /** The description of the priority. */ description?: string; - /** The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. */ - iconUrl?: string; + /** + * The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. Either + * the iconUrl or avatarId must be defined, but not both. + * + * @deprecated This property is deprecated and will be removed in a future version. Use `avatarId` instead. + */ + iconUrl?: + | '/images/icons/priorities/blocker.png' + | '/images/icons/priorities/critical.png' + | '/images/icons/priorities/high.png' + | '/images/icons/priorities/highest.png' + | '/images/icons/priorities/low.png' + | '/images/icons/priorities/lowest.png' + | '/images/icons/priorities/major.png' + | '/images/icons/priorities/medium.png' + | '/images/icons/priorities/minor.png' + | '/images/icons/priorities/trivial.png' + | '/images/icons/priorities/blocker_new.png' + | '/images/icons/priorities/critical_new.png' + | '/images/icons/priorities/high_new.png' + | '/images/icons/priorities/highest_new.png' + | '/images/icons/priorities/low_new.png' + | '/images/icons/priorities/lowest_new.png' + | '/images/icons/priorities/major_new.png' + | '/images/icons/priorities/medium_new.png' + | '/images/icons/priorities/minor_new.png' + | '/images/icons/priorities/trivial_new.png' + | string; /** The name of the priority. Must be unique. */ name: string; /** The status color of the priority in 3-digit or 6-digit hexadecimal format. */ diff --git a/src/version2/models/createPrioritySchemeDetails.ts b/src/version2/models/createPrioritySchemeDetails.ts new file mode 100644 index 0000000000..48059e0c6c --- /dev/null +++ b/src/version2/models/createPrioritySchemeDetails.ts @@ -0,0 +1,16 @@ +import { PriorityMapping } from './priorityMapping'; + +/** Details of a new priority scheme */ +export interface CreatePrioritySchemeDetails { + /** The ID of the default priority for the priority scheme. */ + defaultPriorityId: number; + /** The description of the priority scheme. */ + description?: string; + mappings?: PriorityMapping; + /** The name of the priority scheme. Must be unique. */ + name: string; + /** The IDs of priorities in the scheme. */ + priorityIds: number[]; + /** The IDs of projects that will use the priority scheme. */ + projectIds?: number[]; +} diff --git a/src/version2/models/createSchedulingRequest.ts b/src/version2/models/createSchedulingRequest.ts new file mode 100644 index 0000000000..400b3c9e1f --- /dev/null +++ b/src/version2/models/createSchedulingRequest.ts @@ -0,0 +1,12 @@ +import { CreateDateFieldRequest } from './createDateFieldRequest'; + +export interface CreateSchedulingRequest { + /** The dependencies for the plan. This must be "Sequential" or "Concurrent". */ + dependencies?: 'Sequential' | 'Concurrent' | string; + endDate?: CreateDateFieldRequest; + /** The estimation unit for the plan. This must be "StoryPoints", "Days" or "Hours". */ + estimation: 'StoryPoints' | 'Days' | 'Hours' | string; + /** The inferred dates for the plan. This must be "None", "SprintDates" or "ReleaseDates". */ + inferredDates?: 'None' | 'SprintDates' | 'ReleaseDates' | string; + startDate?: CreateDateFieldRequest; +} diff --git a/src/version2/models/dataClassificationLevels.ts b/src/version2/models/dataClassificationLevels.ts new file mode 100644 index 0000000000..8358ceb249 --- /dev/null +++ b/src/version2/models/dataClassificationLevels.ts @@ -0,0 +1,7 @@ +import { DataClassificationTag } from './dataClassificationTag'; + +/** The data classification. */ +export interface DataClassificationLevels { + /** The data classifications. */ + classifications?: DataClassificationTag[]; +} diff --git a/src/version2/models/dataClassificationTag.ts b/src/version2/models/dataClassificationTag.ts new file mode 100644 index 0000000000..672de56a1c --- /dev/null +++ b/src/version2/models/dataClassificationTag.ts @@ -0,0 +1,17 @@ +/** The data classification. */ +export interface DataClassificationTag { + /** The color of the data classification object. */ + color?: string; + /** The description of the data classification object. */ + description?: string; + /** The guideline of the data classification object. */ + guideline?: string; + /** The ID of the data classification object. */ + id: string; + /** The name of the data classification object. */ + name?: string; + /** The rank of the data classification object. */ + rank?: number; + /** The status of the data classification object. */ + status: string; +} diff --git a/src/version2/models/duplicatePlanRequest.ts b/src/version2/models/duplicatePlanRequest.ts new file mode 100644 index 0000000000..3d5c98beaf --- /dev/null +++ b/src/version2/models/duplicatePlanRequest.ts @@ -0,0 +1,4 @@ +export interface DuplicatePlanRequest { + /** The plan name. */ + name: string; +} diff --git a/src/version2/models/enhancedSearchRequest.ts b/src/version2/models/enhancedSearchRequest.ts new file mode 100644 index 0000000000..538583a0d5 --- /dev/null +++ b/src/version2/models/enhancedSearchRequest.ts @@ -0,0 +1,99 @@ +export interface EnhancedSearchRequest { + /** + * The [JQL](https://confluence.atlassian.com/x/egORLQ) expression. For performance reasons, this parameter requires a + * bounded query. A bounded query is a query with a search restriction. + * + * - Example of an unbounded query: `order by key desc`. + * - Example of a bounded query: `assignee = currentUser() order by key`. + * + * Additionally, `orderBy` clause can contain a maximum of 7 fields. + */ + jql?: string; + /** + * The token for a page to fetch that is not the first page. The first page has a `nextPageToken` of `null`. Use the + * `nextPageToken` to fetch the next page of issues. + */ + nextPageToken?: string; + /** + * The maximum number of items to return per page. To manage page size, API may return fewer items per page where a + * large number of fields are requested. The greatest number of items returned per page is achieved when requesting + * `id` or `key` only. + * + * It returns max 5000 issues. + * + * Default: `50` + * + * Format: `int32` + */ + maxResults?: number; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a + * comma-separated list. Expand options include: + * + * - `*all` Returns all fields. + * - `*navigable` Returns navigable fields. + * - `id` Returns only issue IDs. + * - Any issue field, prefixed with a minus to exclude. + * + * The default is `id`. + * + * Examples: + * + * - `summary,comment` Returns only the summary and comments fields. + * - `-description` Returns all navigable (default) fields except description. + * - `*all,-comment` Returns all fields except comments. + * + * Multiple `fields` parameters can be included in a request. + * + * Note: By default, this resource returns IDs only. This differs from [GET + * issue](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-get) + * where the default is all fields. + */ + fields?: string[]; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about issues in the response. Note that, unlike the majority of instances where `expand` is specified, + * `expand` is defined as a comma-delimited string of values. The expand options are: + * + * - `renderedFields` Returns field values rendered in HTML format. + * - `names` Returns the display name of each field. + * - `schema` Returns the schema describing a field type. + * - `transitions` Returns all possible transitions for the issue. + * - `operations` Returns all possible operations for the issue. + * - `editmeta` Returns information about how each field can be edited. + * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each + * version of a field's value, with the highest numbered item representing the most recent version. + * + * Examples: `names,changelog` Returns the display name of each field as well as a list of recent updates to an issue. + */ + expand?: + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | ( + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + )[] + | string + | string[]; + /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ + properties?: string[]; + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys?: boolean; + /** Fail this request early if we can't retrieve all field data. The default is `false`. */ + failFast?: boolean; + /** Strong consistency issue ids to be reconciled with search results. Accepts max 50 ids. All issues must exist. */ + reconcileIssues?: number[]; +} diff --git a/src/version2/models/evaluatedJiraExpression.ts b/src/version2/models/evaluatedJiraExpression.ts new file mode 100644 index 0000000000..c4eeb513c7 --- /dev/null +++ b/src/version2/models/evaluatedJiraExpression.ts @@ -0,0 +1,16 @@ +import { JExpEvaluateMetaData } from './jExpEvaluateMetaData'; + +/** + * The result of evaluating a Jira expression.This bean will be replacing `JiraExpressionResultBean` bean as part of new + * evaluate endpoint + */ +export interface EvaluatedJiraExpression { + meta?: JExpEvaluateMetaData; + /** + * The value of the evaluated expression. It may be a primitive JSON value or a Jira REST API object. (Some + * expressions do not produce any meaningful results—for example, an expression that returns a lambda function—if + * that's the case a simple string representation is returned. These string representations should not be relied upon + * and may change without notice.) + */ + value: {}; +} diff --git a/src/version2/models/fieldCreateMetadata.ts b/src/version2/models/fieldCreateMetadata.ts new file mode 100644 index 0000000000..462e2c172e --- /dev/null +++ b/src/version2/models/fieldCreateMetadata.ts @@ -0,0 +1,26 @@ +import { JsonType } from './jsonType'; + +/** The metadata describing an issue field for createmeta. */ +export interface FieldCreateMetadata { + /** The list of values allowed in the field. */ + allowedValues?: {}[]; + /** The URL that can be used to automatically complete the field. */ + autoCompleteUrl?: string; + /** The configuration properties. */ + configuration?: {}; + /** The default value of the field. */ + defaultValue?: {}; + /** The field id. */ + fieldId: string; + /** Whether the field has a default value. */ + hasDefaultValue?: boolean; + /** The key of the field. */ + key: string; + /** The name of the field. */ + name: string; + /** The list of operations that can be performed on the field. */ + operations: string[]; + /** Whether the field is required. */ + required: boolean; + schema?: JsonType; +} diff --git a/src/version2/models/filter.ts b/src/version2/models/filter.ts index ac37b1db24..84c57805b2 100644 --- a/src/version2/models/filter.ts +++ b/src/version2/models/filter.ts @@ -5,6 +5,12 @@ import { UserList } from './userList'; /** Details about a filter. */ export interface Filter { + /** + * @experimental [Experimental] Approximate last used time. Returns the date and time when the filter was last used. Returns `null` + * if the filter hasn't been used after tracking was enabled. For performance reasons, timestamps aren't updated in + * real time and therefore may not be exactly accurate. + */ + approximateLastUsed?: string; /** A description of the filter. */ description?: string; /** The groups and projects that can edit the filter. */ diff --git a/src/version2/models/filterDetails.ts b/src/version2/models/filterDetails.ts index d4b8b3d624..a44d9ea59b 100644 --- a/src/version2/models/filterDetails.ts +++ b/src/version2/models/filterDetails.ts @@ -4,6 +4,12 @@ import { User } from './user'; /** Details of a filter. */ export interface FilterDetails { + /** + * @experimental [Experimental] Approximate last used time. Returns the date and time when the filter was last used. Returns `null` + * if the filter hasn't been used after tracking was enabled. For performance reasons, timestamps aren't updated in + * real time and therefore may not be exactly accurate. + */ + approximateLastUsed?: string; /** The description of the filter. */ description?: string; /** diff --git a/src/version2/models/getAtlassianTeamResponse.ts b/src/version2/models/getAtlassianTeamResponse.ts new file mode 100644 index 0000000000..ad60480d52 --- /dev/null +++ b/src/version2/models/getAtlassianTeamResponse.ts @@ -0,0 +1,12 @@ +export interface GetAtlassianTeamResponse { + /** The capacity for the Atlassian team. */ + capacity?: number; + /** The Atlassian team ID. */ + id: string; + /** The ID of the issue source for the Atlassian team. */ + issueSourceId?: number; + /** The planning style for the Atlassian team. This is "Scrum" or "Kanban". */ + planningStyle: 'Scrum' | 'Kanban' | string; + /** The sprint length for the Atlassian team. */ + sprintLength?: number; +} diff --git a/src/version2/models/getCrossProjectReleaseResponse.ts b/src/version2/models/getCrossProjectReleaseResponse.ts new file mode 100644 index 0000000000..4e41368cc5 --- /dev/null +++ b/src/version2/models/getCrossProjectReleaseResponse.ts @@ -0,0 +1,6 @@ +export interface GetCrossProjectReleaseResponse { + /** The cross-project release name. */ + name?: string; + /** The IDs of the releases included in the cross-project release. */ + releaseIds?: number[]; +} diff --git a/src/version2/models/getCustomFieldResponse.ts b/src/version2/models/getCustomFieldResponse.ts new file mode 100644 index 0000000000..8ac304ff9b --- /dev/null +++ b/src/version2/models/getCustomFieldResponse.ts @@ -0,0 +1,6 @@ +export interface GetCustomFieldResponse { + /** The custom field ID. */ + customFieldId: number; + /** Allows filtering issues based on their values for the custom field. */ + filter?: boolean; +} diff --git a/src/version2/models/getDateFieldResponse.ts b/src/version2/models/getDateFieldResponse.ts new file mode 100644 index 0000000000..d2293240a8 --- /dev/null +++ b/src/version2/models/getDateFieldResponse.ts @@ -0,0 +1,6 @@ +export interface GetDateFieldResponse { + /** A date custom field ID. This is returned if the type is "DateCustomField". */ + dateCustomFieldId?: number; + /** The date field type. This is "DueDate", "TargetStartDate", "TargetEndDate" or "DateCustomField". */ + type: 'DueDate' | 'TargetStartDate' | 'TargetEndDate' | 'DateCustomField' | string; +} diff --git a/src/version2/models/getExclusionRulesResponse.ts b/src/version2/models/getExclusionRulesResponse.ts new file mode 100644 index 0000000000..c2852ef738 --- /dev/null +++ b/src/version2/models/getExclusionRulesResponse.ts @@ -0,0 +1,14 @@ +export interface GetExclusionRulesResponse { + /** The IDs of the issues excluded from the plan. */ + issueIds?: number[]; + /** The IDs of the issue types excluded from the plan. */ + issueTypeIds?: number[]; + /** Issues completed this number of days ago are excluded from the plan. */ + numberOfDaysToShowCompletedIssues: number; + /** The IDs of the releases excluded from the plan. */ + releaseIds?: number[]; + /** The IDs of the work status categories excluded from the plan. */ + workStatusCategoryIds?: number[]; + /** The IDs of the work statuses excluded from the plan. */ + workStatusIds?: number[]; +} diff --git a/src/version2/models/getIssueSourceResponse.ts b/src/version2/models/getIssueSourceResponse.ts new file mode 100644 index 0000000000..fd864bf6ad --- /dev/null +++ b/src/version2/models/getIssueSourceResponse.ts @@ -0,0 +1,9 @@ +export interface GetIssueSourceResponse { + /** The issue source type. This is "Board", "Project" or "Filter". */ + type: 'Board' | 'Project' | 'Filter' | 'Custom' | string; + /** + * The issue source value. This is a board ID if the type is "Board", a project ID if the type is "Project" or a + * filter ID if the type is "Filter". + */ + value: number; +} diff --git a/src/version2/models/getPermissionHolderResponse.ts b/src/version2/models/getPermissionHolderResponse.ts new file mode 100644 index 0000000000..4d44c9cb87 --- /dev/null +++ b/src/version2/models/getPermissionHolderResponse.ts @@ -0,0 +1,9 @@ +export interface GetPermissionHolderResponse { + /** The permission holder type. This is "Group" or "AccountId". */ + type: 'Group' | 'AccountId' | string; + /** + * The permission holder value. This is a group name if the type is "Group" or an account ID if the type is + * "AccountId". + */ + value: string; +} diff --git a/src/version2/models/getPermissionResponse.ts b/src/version2/models/getPermissionResponse.ts new file mode 100644 index 0000000000..c778b582bc --- /dev/null +++ b/src/version2/models/getPermissionResponse.ts @@ -0,0 +1,7 @@ +import { GetPermissionHolderResponse } from './getPermissionHolderResponse'; + +export interface GetPermissionResponse { + holder?: GetPermissionHolderResponse; + /** The permission type. This is "View" or "Edit". */ + type: 'View' | 'Edit' | string; +} diff --git a/src/version2/models/getPlanOnlyTeamResponse.ts b/src/version2/models/getPlanOnlyTeamResponse.ts new file mode 100644 index 0000000000..5dd4cf00e0 --- /dev/null +++ b/src/version2/models/getPlanOnlyTeamResponse.ts @@ -0,0 +1,16 @@ +export interface GetPlanOnlyTeamResponse { + /** The capacity for the plan-only team. */ + capacity?: number; + /** The plan-only team ID. */ + id: number; + /** The ID of the issue source for the plan-only team. */ + issueSourceId?: number; + /** The account IDs of the plan-only team members. */ + memberAccountIds?: string[]; + /** The plan-only team name. */ + name: string; + /** The planning style for the plan-only team. This is "Scrum" or "Kanban". */ + planningStyle: 'Scrum' | 'Kanban' | string; + /** The sprint length for the plan-only team. */ + sprintLength?: number; +} diff --git a/src/version2/models/getPlanResponseForPage.ts b/src/version2/models/getPlanResponseForPage.ts new file mode 100644 index 0000000000..63a774a14f --- /dev/null +++ b/src/version2/models/getPlanResponseForPage.ts @@ -0,0 +1,12 @@ +import { GetIssueSourceResponse } from './getIssueSourceResponse'; + +export interface GetPlanResponseForPage { + /** The plan ID. */ + id: string; + /** The issue sources included in the plan. */ + issueSources?: GetIssueSourceResponse[]; + /** The plan name. */ + name: string; + /** The plan status. This is "Active", "Trashed" or "Archived". */ + status: 'Active' | 'Trashed' | 'Archived' | string; +} diff --git a/src/version2/models/getSchedulingResponse.ts b/src/version2/models/getSchedulingResponse.ts new file mode 100644 index 0000000000..8a284167f7 --- /dev/null +++ b/src/version2/models/getSchedulingResponse.ts @@ -0,0 +1,12 @@ +import { GetDateFieldResponse } from './getDateFieldResponse'; + +export interface GetSchedulingResponse { + /** The dependencies for the plan. This is "Sequential" or "Concurrent". */ + dependencies: 'Sequential' | 'Concurrent' | string; + endDate?: GetDateFieldResponse; + /** The estimation unit for the plan. This is "StoryPoints", "Days" or "Hours". */ + estimation: 'StoryPoints' | 'Days' | 'Hours' | string; + /** The inferred dates for the plan. This is "None", "SprintDates" or "ReleaseDates". */ + inferredDates: 'None' | 'SprintDates' | 'ReleaseDates' | string; + startDate?: GetDateFieldResponse; +} diff --git a/src/version2/models/getTeamResponseForPage.ts b/src/version2/models/getTeamResponseForPage.ts new file mode 100644 index 0000000000..6d49ebff03 --- /dev/null +++ b/src/version2/models/getTeamResponseForPage.ts @@ -0,0 +1,8 @@ +export interface GetTeamResponseForPage { + /** The team ID. */ + id: string; + /** The team name. This is returned if the type is "PlanOnly". */ + name?: string; + /** The team type. This is "PlanOnly" or "Atlassian". */ + type: 'PlanOnly' | 'Atlassian' | string; +} diff --git a/src/version2/models/idSearchRequest.ts b/src/version2/models/idSearchRequest.ts new file mode 100644 index 0000000000..4f15da0140 --- /dev/null +++ b/src/version2/models/idSearchRequest.ts @@ -0,0 +1,8 @@ +export interface IdSearchRequest { + /** A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. Order by clauses are not allowed. */ + jql?: string; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** The continuation token to fetch the next page. This token is provided by the response of this endpoint. */ + nextPageToken?: string; +} diff --git a/src/version2/models/idSearchResults.ts b/src/version2/models/idSearchResults.ts new file mode 100644 index 0000000000..596045fb5c --- /dev/null +++ b/src/version2/models/idSearchResults.ts @@ -0,0 +1,10 @@ +/** Result of your JQL search. Returns a list of issue IDs and a token to fetch the next page if one exists. */ +export interface IdSearchResults { + /** The list of issue IDs found by the search. */ + issueIds?: number[]; + /** + * Continuation token to fetch the next page. If this result represents the last or the only page this token will be + * null. + */ + nextPageToken?: string; +} diff --git a/src/version2/models/index.ts b/src/version2/models/index.ts index 63f87a2208..92252ef4e8 100644 --- a/src/version2/models/index.ts +++ b/src/version2/models/index.ts @@ -1,7 +1,9 @@ export * from './actorInput'; export * from './actorsMap'; +export * from './addAtlassianTeamRequest'; export * from './addField'; export * from './addGroup'; +export * from './addNotificationsDetails'; export * from './addSecuritySchemeLevelsRequest'; export * from './announcementBannerConfiguration'; export * from './announcementBannerConfigurationUpdate'; @@ -32,10 +34,13 @@ export * from './avatar'; export * from './avatars'; export * from './avatarUrls'; export * from './avatarWithDetails'; +export * from './bulkChangelog'; +export * from './bulkChangelogRequest'; export * from './bulkChangeOwnerDetails'; export * from './bulkCustomFieldOptionCreateRequest'; export * from './bulkCustomFieldOptionUpdateRequest'; export * from './bulkEditShareableEntity'; +export * from './bulkIssue'; export * from './bulkIssueIsWatching'; export * from './bulkIssuePropertyUpdateRequest'; export * from './bulkOperationErrorResult'; @@ -50,11 +55,13 @@ export * from './changedWorklogs'; export * from './changelog'; export * from './columnItem'; export * from './comment'; +export * from './component'; export * from './componentIssuesCount'; export * from './componentWithIssueCount'; export * from './conditionGroupConfiguration'; export * from './conditionGroupUpdate'; export * from './configuration'; +export * from './configurationsListParameters'; export * from './connectCustomFieldValue'; export * from './connectCustomFieldValues'; export * from './connectModule'; @@ -67,14 +74,23 @@ export * from './containerOfWorkflowSchemeAssociations'; export * from './contextForProjectAndIssueType'; export * from './contextualConfiguration'; export * from './convertedJQLQueries'; +export * from './createCrossProjectReleaseRequest'; export * from './createCustomFieldContext'; +export * from './createCustomFieldRequest'; export * from './createdIssue'; export * from './createdIssues'; +export * from './createExclusionRulesRequest'; export * from './createIssueSecuritySchemeDetails'; +export * from './createIssueSourceRequest'; export * from './createNotificationSchemeDetails'; +export * from './createPermissionRequest'; +export * from './createPlanOnlyTeamRequest'; +export * from './createPlanRequest'; export * from './createPriorityDetails'; +export * from './createPrioritySchemeDetails'; export * from './createProjectDetails'; export * from './createResolutionDetails'; +export * from './createSchedulingRequest'; export * from './createUiModificationDetails'; export * from './createUpdateRoleRequest'; export * from './createWorkflowCondition'; @@ -109,18 +125,23 @@ export * from './dashboardGadgetResponse'; export * from './dashboardGadgetSettings'; export * from './dashboardGadgetUpdateRequest'; export * from './dashboardUser'; +export * from './dataClassificationLevels'; export * from './dateRangeFilter'; export * from './defaultLevelValue'; export * from './defaultShareScope'; export * from './defaultWorkflow'; export * from './documentVersion'; +export * from './duplicatePlanRequest'; +export * from './enhancedSearchRequest'; export * from './entityProperty'; export * from './entityPropertyDetails'; export * from './error'; export * from './errorCollection'; export * from './errors'; +export * from './evaluatedJiraExpression'; export * from './eventNotification'; export * from './exportArchivedIssuesTaskProgress'; +export * from './exportArchivedIssuesTaskProgress'; export * from './failedWebhook'; export * from './failedWebhooks'; export * from './field'; @@ -148,6 +169,8 @@ export * from './foundGroups'; export * from './foundUsers'; export * from './foundUsersAndGroups'; export * from './functionReferenceData'; +export * from './getAtlassianTeamResponse'; +export * from './getPlanOnlyTeamResponse'; export * from './globalScope'; export * from './group'; export * from './groupDetails'; @@ -160,11 +183,14 @@ export * from './historyMetadataParticipant'; export * from './icon'; export * from './id'; export * from './idOrKey'; +export * from './idSearchRequest'; +export * from './idSearchResults'; export * from './includedFields'; export * from './issue'; export * from './issueArchivalSync'; export * from './issueChangelogIds'; export * from './issueCommentListRequest'; +export * from './issueContextVariable'; export * from './issueCreateMetadata'; export * from './issueEntityProperties'; export * from './issueEntityPropertiesForMultiUpdate'; @@ -175,6 +201,8 @@ export * from './issueFieldOptionCreate'; export * from './issueFieldOptionScope'; export * from './issueFilterForBulkPropertyDelete'; export * from './issueFilterForBulkPropertySet'; +export * from './issueLimitReport'; +export * from './issueLimitReportRequest'; export * from './issueLink'; export * from './issueLinkType'; export * from './issueLinkTypes'; @@ -219,13 +247,20 @@ export * from './issueTypeWithStatus'; export * from './issueTypeWorkflowMapping'; export * from './issueUpdateDetails'; export * from './issueUpdateMetadata'; +export * from './jexpEvaluateCtxIssues'; +export * from './jexpEvaluateCtxJqlIssues'; +export * from './jExpEvaluateIssuesJqlMetaData'; +export * from './jExpEvaluateIssuesMeta'; +export * from './jExpEvaluateMetaData'; export * from './jexpIssues'; export * from './jexpJqlIssues'; export * from './jiraExpressionAnalysis'; export * from './jiraExpressionComplexity'; export * from './jiraExpressionEvalContext'; export * from './jiraExpressionEvalRequest'; +export * from './jiraExpressionEvaluateContext'; export * from './jiraExpressionEvaluationMetaData'; +export * from './jiraExpressionEvalUsingEnhancedSearchRequest'; export * from './jiraExpressionForAnalysis'; export * from './jiraExpressionResult'; export * from './jiraExpressionsAnalysis'; @@ -233,9 +268,11 @@ export * from './jiraExpressionsComplexity'; export * from './jiraExpressionsComplexityValue'; export * from './jiraExpressionValidationError'; export * from './jiraStatus'; -export * from './jiraWorkflow'; -export * from './jiraWorkflowStatus'; +export * from './jQLCount'; +export * from './jQLCountRequest'; export * from './jqlFunctionPrecomputation'; +export * from './jqlFunctionPrecomputationGetByIdRequest'; +export * from './jqlFunctionPrecomputationGetByIdResponse'; export * from './jqlFunctionPrecomputationUpdate'; export * from './jqlFunctionPrecomputationUpdateRequest'; export * from './jQLPersonalDataMigrationRequest'; @@ -250,6 +287,7 @@ export * from './jqlQueryOrderByClauseElement'; export * from './jqlQueryToSanitize'; export * from './jQLQueryWithUnknownUsers'; export * from './jQLReferenceData'; +export * from './jsonContextVariable'; export * from './jsonType'; export * from './license'; export * from './licensedApplication'; @@ -260,6 +298,8 @@ export * from './linkIssueRequestJson'; export * from './listWrapperCallbackApplicationRole'; export * from './listWrapperCallbackGroupName'; export * from './locale'; +export * from './mappingsByIssueTypeOverride'; +export * from './mappingsByWorkflow'; export * from './moveField'; export * from './multiIssueEntityProperties'; export * from './multipleCustomFieldValuesUpdate'; @@ -283,6 +323,7 @@ export * from './operationMessage'; export * from './operations'; export * from './orderOfCustomFieldOptions'; export * from './orderOfIssueTypes'; +export * from './pageBulkContextualConfiguration'; export * from './pageChangelog'; export * from './pageComment'; export * from './pageComponentWithIssueCount'; @@ -316,6 +357,8 @@ export * from './pageJqlFunctionPrecomputation'; export * from './pageNotificationScheme'; export * from './pageOfChangelogs'; export * from './pageOfComments'; +export * from './pageOfCreateMetaIssueTypes'; +export * from './pageOfCreateMetaIssueTypeWithField'; export * from './pageOfDashboards'; export * from './pageOfStatuses'; export * from './pageOfWorklogs'; @@ -336,6 +379,8 @@ export * from './pageUserDetails'; export * from './pageUserKey'; export * from './pageVersion'; export * from './pageWebhook'; +export * from './pageWithCursorGetPlanResponseForPage'; +export * from './pageWithCursorGetTeamResponseForPage'; export * from './pageWorkflow'; export * from './pageWorkflowScheme'; export * from './pageWorkflowTransitionRules'; @@ -350,13 +395,19 @@ export * from './permissionScheme'; export * from './permissionSchemes'; export * from './permissionsKeys'; export * from './permittedProjects'; +export * from './plan'; export * from './priority'; export * from './priorityId'; +export * from './priorityMapping'; +export * from './prioritySchemeId'; +export * from './prioritySchemeWithPaginatedPrioritiesAndProjects'; +export * from './priorityWithSequence'; export * from './project'; export * from './projectAndIssueTypePair'; export * from './projectAvatars'; export * from './projectCategory'; export * from './projectComponent'; +export * from './projectDataPolicies'; export * from './projectDetails'; export * from './projectEmailAddress'; export * from './projectFeature'; @@ -390,6 +441,7 @@ export * from './remoteIssueLink'; export * from './remoteIssueLinkIdentifies'; export * from './remoteIssueLinkRequest'; export * from './remoteObject'; +export * from './removeOptionFromIssuesResult'; export * from './reorderIssuePriorities'; export * from './reorderIssueResolutionsRequest'; export * from './resolution'; @@ -410,6 +462,7 @@ export * from './screenSchemeDetails'; export * from './screenSchemeId'; export * from './screenTypes'; export * from './screenWithTab'; +export * from './searchAndReconcileResults'; export * from './searchAutoComplete'; export * from './searchRequest'; export * from './searchResults'; @@ -423,12 +476,14 @@ export * from './securitySchemeMembersRequest'; export * from './securitySchemes'; export * from './securitySchemeWithProjects'; export * from './serverInformation'; +export * from './serviceRegistry'; export * from './setDefaultLevelsRequest'; export * from './setDefaultPriorityRequest'; export * from './setDefaultResolutionRequest'; export * from './sharePermission'; export * from './sharePermissionInput'; export * from './simpleApplicationProperty'; +export * from './simpleErrorCollection'; export * from './simpleLink'; export * from './simpleListWrapperApplicationRole'; export * from './simpleListWrapperGroupName'; @@ -441,14 +496,19 @@ export * from './statusLayoutUpdate'; export * from './statusMapping'; export * from './statusMappingDTO'; export * from './statusMigration'; +export * from './statusProjectIssueTypeUsageDTO'; +export * from './statusProjectUsageDTO'; export * from './statusReferenceAndPort'; export * from './statusScope'; export * from './statusUpdate'; export * from './statusUpdateRequest'; +export * from './statusWorkflowUsageDTO'; export * from './suggestedIssue'; +export * from './suggestedMappingsRequest'; export * from './systemAvatars'; export * from './tabMetadata'; export * from './taskProgressObject'; +export * from './taskProgressRemoveOptionFromIssuesResult'; export * from './timeTrackingConfiguration'; export * from './timeTrackingDetails'; export * from './timeTrackingProvider'; @@ -461,12 +521,15 @@ export * from './uiModificationDetails'; export * from './uiModificationIdentifiers'; export * from './unrestrictedUserEmail'; export * from './updateCustomFieldDetails'; +export * from './updateDefaultProjectClassification'; export * from './updatedProjectCategory'; export * from './updateFieldConfigurationSchemeDetails'; export * from './updateIssueSecurityLevelDetails'; export * from './updateIssueSecuritySchemeRequest'; export * from './updateNotificationSchemeDetails'; export * from './updatePriorityDetails'; +export * from './updatePrioritySchemeRequest'; +export * from './updatePrioritySchemeResponse'; export * from './updateProjectDetails'; export * from './updateResolutionDetails'; export * from './updateScreenDetails'; @@ -476,6 +539,7 @@ export * from './updateUiModificationDetails'; export * from './updateUserToGroup'; export * from './user'; export * from './userAvatarUrls'; +export * from './userContextVariable'; export * from './userDetails'; export * from './userKey'; export * from './userList'; @@ -487,6 +551,7 @@ export * from './version'; export * from './versionIssueCounts'; export * from './versionIssuesStatus'; export * from './versionMove'; +export * from './versionRelatedWork'; export * from './versionUnresolvedIssuesCount'; export * from './versionUsageInCustomField'; export * from './visibility'; @@ -502,11 +567,12 @@ export * from './workflowCapabilities'; export * from './workflowCondition'; export * from './workflowCreate'; export * from './workflowCreateRequest'; -export * from './workflowCreateResponse'; export * from './workflowElementReference'; export * from './workflowId'; export * from './workflowLayout'; export * from './workflowOperations'; +export * from './workflowProjectIssueTypeUsageDTO'; +export * from './workflowProjectUsageDTO'; export * from './workflowRead'; export * from './workflowReferenceStatus'; export * from './workflowRuleConfiguration'; @@ -514,10 +580,19 @@ export * from './workflowRules'; export * from './workflowRulesSearch'; export * from './workflowRulesSearchDetails'; export * from './workflowScheme'; +export * from './workflowSchemeAssociation'; export * from './workflowSchemeAssociations'; export * from './workflowSchemeIdName'; export * from './workflowSchemeProjectAssociation'; +export * from './workflowSchemeProjectUsage'; +export * from './workflowSchemeReadRequest'; +export * from './workflowSchemeReadResponse'; +export * from './workflowSchemeUpdateRequest'; +export * from './workflowSchemeUpdateRequiredMappingsRequest'; +export * from './workflowSchemeUpdateRequiredMappingsResponse'; +export * from './workflowSchemeUsageDTO'; export * from './workflowScope'; +export * from './workflowSearchResponse'; export * from './workflowStatus'; export * from './workflowStatusAndPort'; export * from './workflowStatusLayout'; @@ -536,8 +611,9 @@ export * from './workflowTransitions'; export * from './workflowTrigger'; export * from './workflowUpdate'; export * from './workflowUpdateRequest'; -export * from './workflowUpdateResponse'; export * from './workflowValidationError'; export * from './workflowValidationErrorList'; export * from './worklog'; export * from './worklogIdsRequest'; +export * from './worklogsMoveRequest'; +export * from './workspaceDataPolicy'; diff --git a/src/version2/models/issueChangeLog.ts b/src/version2/models/issueChangeLog.ts new file mode 100644 index 0000000000..cab78f577e --- /dev/null +++ b/src/version2/models/issueChangeLog.ts @@ -0,0 +1,9 @@ +import { Changelog } from './changelog'; + +/** List of changelogs that belong to single issue */ +export interface IssueChangeLog { + /** List of changelogs that belongs to given issueId. */ + changeHistories?: Changelog[]; + /** The ID of the issue. */ + issueId?: string; +} diff --git a/src/version2/models/issueContextVariable.ts b/src/version2/models/issueContextVariable.ts new file mode 100644 index 0000000000..5307834f70 --- /dev/null +++ b/src/version2/models/issueContextVariable.ts @@ -0,0 +1,8 @@ +export interface IssueContextVariable { + /** The issue ID. */ + id?: number; + /** The issue key. */ + key?: string; + /** Type of custom context variable. */ + type: string; +} diff --git a/src/version2/models/issueError.ts b/src/version2/models/issueError.ts new file mode 100644 index 0000000000..e48a85799f --- /dev/null +++ b/src/version2/models/issueError.ts @@ -0,0 +1,7 @@ +/** Describes the error that occurred when retrieving data for a particular issue. */ +export interface IssueError { + /** The error that occurred when fetching this issue. */ + errorMessage?: string; + /** The ID of the issue. */ + id?: string; +} diff --git a/src/version2/models/issueLimitReport.ts b/src/version2/models/issueLimitReport.ts new file mode 100644 index 0000000000..df5798701a --- /dev/null +++ b/src/version2/models/issueLimitReport.ts @@ -0,0 +1,8 @@ +export interface IssueLimitReport { + /** A list of ids of issues approaching the limit and their field count */ + issuesApproachingLimit?: {}; + /** A list of ids of issues breaching the limit and their field count */ + issuesBreachingLimit?: {}; + /** The fields and their defined limits */ + limits?: {}; +} diff --git a/src/version2/models/issueLimitReportRequest.ts b/src/version2/models/issueLimitReportRequest.ts new file mode 100644 index 0000000000..c99f57bc06 --- /dev/null +++ b/src/version2/models/issueLimitReportRequest.ts @@ -0,0 +1,9 @@ +export interface IssueLimitReportRequest { + /** + * A list of fields and their respective approaching limit threshold. Required for querying issues approaching limits. + * Optional for querying issues breaching limits. Accepted fields are: `comment`, `worklog`, `attachment`, + * `remoteIssueLinks`, and `issuelinks`. Example: `{"issuesApproachingLimitParams": {"comment": 4500, "attachment": + * 1800}}` + */ + issuesApproachingLimitParams?: {}; +} diff --git a/src/version2/models/jExpEvaluateIssuesJqlMetaData.ts b/src/version2/models/jExpEvaluateIssuesJqlMetaData.ts new file mode 100644 index 0000000000..c97480a3e2 --- /dev/null +++ b/src/version2/models/jExpEvaluateIssuesJqlMetaData.ts @@ -0,0 +1,5 @@ +/** The description of the page of issues loaded by the provided JQL query. */ +export interface JExpEvaluateIssuesJqlMetaData { + /** Next Page token for the next page of issues. */ + nextPageToken?: string; +} diff --git a/src/version2/models/jExpEvaluateIssuesMeta.ts b/src/version2/models/jExpEvaluateIssuesMeta.ts new file mode 100644 index 0000000000..383f8138b4 --- /dev/null +++ b/src/version2/models/jExpEvaluateIssuesMeta.ts @@ -0,0 +1,10 @@ +import { JExpEvaluateIssuesJqlMetaData } from './jExpEvaluateIssuesJqlMetaData'; + +/** Meta data describing the `issues` context variable. */ +export interface JExpEvaluateIssuesMeta { + /** + * The description of the page of issues loaded by the provided JQL query. This bean will be replacing + * IssuesJqlMetaDataBean bean as part of new `evaluate` endpoint + */ + jql?: JExpEvaluateIssuesJqlMetaData; +} diff --git a/src/version2/models/jExpEvaluateMetaData.ts b/src/version2/models/jExpEvaluateMetaData.ts new file mode 100644 index 0000000000..0ac32411da --- /dev/null +++ b/src/version2/models/jExpEvaluateMetaData.ts @@ -0,0 +1,15 @@ +import { JExpEvaluateIssuesMeta } from './jExpEvaluateIssuesMeta'; +import { JiraExpressionsComplexity } from './jiraExpressionsComplexity'; + +export interface JExpEvaluateMetaData { + /** + * Contains information about the expression complexity. For example, the number of steps it took to evaluate the + * expression. + */ + complexity?: JiraExpressionsComplexity; + /** + * Contains information about the `issues` variable in the context. For example, is the issues were loaded with JQL, + * information about the page will be included here. + */ + issues?: JExpEvaluateIssuesMeta; +} diff --git a/src/version2/models/jQLCount.ts b/src/version2/models/jQLCount.ts new file mode 100644 index 0000000000..a3270ef92a --- /dev/null +++ b/src/version2/models/jQLCount.ts @@ -0,0 +1,4 @@ +export interface JQLCount { + /** Number of issues matching JQL query. */ + count?: number; +} diff --git a/src/version2/models/jQLCountRequest.ts b/src/version2/models/jQLCountRequest.ts new file mode 100644 index 0000000000..3eb6cce3be --- /dev/null +++ b/src/version2/models/jQLCountRequest.ts @@ -0,0 +1,7 @@ +export interface JQLCountRequest { + /** + * A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. For performance reasons, this parameter requires a + * bounded query. A bounded query is a query with a search restriction. + */ + jql?: string; +} diff --git a/src/version2/models/jexpEvaluateCtxIssues.ts b/src/version2/models/jexpEvaluateCtxIssues.ts new file mode 100644 index 0000000000..9c5d3b449b --- /dev/null +++ b/src/version2/models/jexpEvaluateCtxIssues.ts @@ -0,0 +1,6 @@ +import { JexpEvaluateCtxJqlIssues } from './jexpEvaluateCtxJqlIssues'; + +/** The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. */ +export interface JexpEvaluateCtxIssues { + jql?: JexpEvaluateCtxJqlIssues; +} diff --git a/src/version2/models/jexpEvaluateCtxJqlIssues.ts b/src/version2/models/jexpEvaluateCtxJqlIssues.ts new file mode 100644 index 0000000000..4fc211b9d9 --- /dev/null +++ b/src/version2/models/jexpEvaluateCtxJqlIssues.ts @@ -0,0 +1,15 @@ +/** The JQL query that specifies the set of issues available in the Jira expression. */ +export interface JexpEvaluateCtxJqlIssues { + /** + * The maximum number of issues to return from the JQL query. Inspect `meta.issues.jql.maxResults` in the response to + * ensure the maximum value has not been exceeded. + */ + maxResults?: number; + /** + * The token for a page to fetch that is not the first page. The first page has a `nextPageToken` of `null`. Use the + * `nextPageToken` to fetch the next page of issues. + */ + nextPageToken?: string; + /** The JQL query, required to be bounded. Additionally, `orderBy` clause can contain a maximum of 7 fields */ + query?: string; +} diff --git a/src/version2/models/jiraExpressionEvalUsingEnhancedSearchRequest.ts b/src/version2/models/jiraExpressionEvalUsingEnhancedSearchRequest.ts new file mode 100644 index 0000000000..f8a07cffb2 --- /dev/null +++ b/src/version2/models/jiraExpressionEvalUsingEnhancedSearchRequest.ts @@ -0,0 +1,8 @@ +import { JiraExpressionEvaluateContext } from './jiraExpressionEvaluateContext'; + +export interface JiraExpressionEvalUsingEnhancedSearchRequest { + /** The Jira expression to evaluate. */ + expression: string; + /** The context in which the Jira expression is evaluated. */ + context?: JiraExpressionEvaluateContext; +} diff --git a/src/version2/models/jiraExpressionEvaluateContext.ts b/src/version2/models/jiraExpressionEvaluateContext.ts new file mode 100644 index 0000000000..78464888ad --- /dev/null +++ b/src/version2/models/jiraExpressionEvaluateContext.ts @@ -0,0 +1,33 @@ +import { IssueContextVariable } from './issueContextVariable'; +import { JsonContextVariable } from './jsonContextVariable'; +import { UserContextVariable } from './userContextVariable'; +import { IdOrKey } from './idOrKey'; +import { JexpEvaluateCtxIssues } from './jexpEvaluateCtxIssues'; + +export interface JiraExpressionEvaluateContext { + issue?: IdOrKey; + issues?: JexpEvaluateCtxIssues; + project?: IdOrKey; + /** The ID of the sprint that is available under the `sprint` variable when evaluating the expression. */ + sprint?: number; + /** The ID of the board that is available under the `board` variable when evaluating the expression. */ + board?: number; + /** The ID of the service desk that is available under the `serviceDesk` variable when evaluating the expression. */ + serviceDesk?: number; + /** + * The ID of the customer request that is available under the `customerRequest` variable when evaluating the + * expression. This is the same as the ID of the underlying Jira issue, but the customer request context variable will + * have a different type. + */ + customerRequest?: number; + /** + * Custom context variables and their types. These variable types are available for use in a custom context: + * + * `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. `issue`: An + * [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) specified by ID + * or key. All the fields of the issue object are available in the Jira expression. `json`: A JSON object containing + * custom content. `list`: A JSON list of `user`, `issue`, or `json` variable types. + */ + custom?: (UserContextVariable | IssueContextVariable | JsonContextVariable)[]; +} diff --git a/src/version2/models/jqlFunctionPrecomputationGetByIdRequest.ts b/src/version2/models/jqlFunctionPrecomputationGetByIdRequest.ts new file mode 100644 index 0000000000..f9afb489d9 --- /dev/null +++ b/src/version2/models/jqlFunctionPrecomputationGetByIdRequest.ts @@ -0,0 +1,4 @@ +/** Request to fetch precomputations by ID. */ +export interface JqlFunctionPrecomputationGetByIdRequest { + precomputationIDs?: string[]; +} diff --git a/src/version2/models/jqlFunctionPrecomputationGetByIdResponse.ts b/src/version2/models/jqlFunctionPrecomputationGetByIdResponse.ts new file mode 100644 index 0000000000..391c1f8663 --- /dev/null +++ b/src/version2/models/jqlFunctionPrecomputationGetByIdResponse.ts @@ -0,0 +1,9 @@ +import { JqlFunctionPrecomputation } from './jqlFunctionPrecomputation'; + +/** Get precomputations by ID response. */ +export interface JqlFunctionPrecomputationGetByIdResponse { + /** List of precomputations that were not found. */ + notFoundPrecomputationIDs?: string[]; + /** The list of precomputations. */ + precomputations?: JqlFunctionPrecomputation[]; +} diff --git a/src/version2/models/jsonContextVariable.ts b/src/version2/models/jsonContextVariable.ts new file mode 100644 index 0000000000..c57466c381 --- /dev/null +++ b/src/version2/models/jsonContextVariable.ts @@ -0,0 +1,6 @@ +export interface JsonContextVariable { + /** Type of custom context variable. */ + type: string; + /** A JSON object containing custom content. */ + value?: any; +} diff --git a/src/version2/models/jsonNode.ts b/src/version2/models/jsonNode.ts new file mode 100644 index 0000000000..402169b828 --- /dev/null +++ b/src/version2/models/jsonNode.ts @@ -0,0 +1,38 @@ +export interface JsonNode { + array?: boolean; + bigDecimal?: boolean; + bigInteger?: boolean; + bigIntegerValue?: number; + binary?: boolean; + binaryValue?: string[]; + boolean?: boolean; + booleanValue?: boolean; + containerNode?: boolean; + decimalValue?: number; + double?: boolean; + doubleValue?: number; + elements?: {}; + fieldNames?: {}; + fields?: {}; + floatingPointNumber?: boolean; + int?: boolean; + intValue?: number; + integralNumber?: boolean; + long?: boolean; + longValue?: number; + missingNode?: boolean; + null?: boolean; + number?: boolean; + numberType?: 'INT' | 'LONG' | 'BIG_INTEGER' | 'FLOAT' | 'DOUBLE' | 'BIG_DECIMAL' | string; + numberValue?: number; + object?: boolean; + pojo?: boolean; + textValue?: string; + textual?: boolean; + valueAsBoolean?: boolean; + valueAsDouble?: number; + valueAsInt?: number; + valueAsLong?: number; + valueAsText?: string; + valueNode?: boolean; +} diff --git a/src/version2/models/mappingsByIssueTypeOverride.ts b/src/version2/models/mappingsByIssueTypeOverride.ts new file mode 100644 index 0000000000..570d8dfde5 --- /dev/null +++ b/src/version2/models/mappingsByIssueTypeOverride.ts @@ -0,0 +1,13 @@ +import { WorkflowAssociationStatusMapping } from './workflowAssociationStatusMapping'; + +/** + * Overrides, for the selected issue types, any status mappings provided in `statusMappingsByWorkflows`. Status mappings + * are required when the new workflow for an issue type doesn't contain all statuses that the old workflow has. Status + * mappings can be provided by a combination of `statusMappingsByWorkflows` and `statusMappingsByIssueTypeOverride`. + */ +export interface MappingsByIssueTypeOverride { + /** The ID of the issue type for this mapping. */ + issueTypeId: string; + /** The list of status mappings. */ + statusMappings: WorkflowAssociationStatusMapping[]; +} diff --git a/src/version2/models/mappingsByWorkflow.ts b/src/version2/models/mappingsByWorkflow.ts new file mode 100644 index 0000000000..484dcec961 --- /dev/null +++ b/src/version2/models/mappingsByWorkflow.ts @@ -0,0 +1,15 @@ +import { WorkflowAssociationStatusMapping } from './workflowAssociationStatusMapping'; + +/** + * The status mappings by workflows. Status mappings are required when the new workflow for an issue type doesn't + * contain all statuses that the old workflow has. Status mappings can be provided by a combination of + * `statusMappingsByWorkflows` and `statusMappingsByIssueTypeOverride`. + */ +export interface MappingsByWorkflow { + /** The ID of the new workflow. */ + newWorkflowId: string; + /** The ID of the old workflow. */ + oldWorkflowId: string; + /** The list of status mappings. */ + statusMappings: WorkflowAssociationStatusMapping[]; +} diff --git a/src/version3/models/pageBeanFieldConfigurationDetails.ts b/src/version2/models/pageBulkContextualConfiguration.ts similarity index 73% rename from src/version3/models/pageBeanFieldConfigurationDetails.ts rename to src/version2/models/pageBulkContextualConfiguration.ts index 37b3f277a9..3c931a1436 100644 --- a/src/version3/models/pageBeanFieldConfigurationDetails.ts +++ b/src/version2/models/pageBulkContextualConfiguration.ts @@ -1,19 +1,19 @@ -import { FieldConfigurationDetails } from './fieldConfigurationDetails'; +import { BulkContextualConfiguration } from './bulkContextualConfiguration'; /** A page of items. */ -export interface PageBeanFieldConfigurationDetails { - /** The URL of the page. */ - self?: string; - /** If there is another page of results, the URL of the next page. */ - nextPage?: string; +export interface PageBulkContextualConfiguration { + /** Whether this is the last page. */ + isLast?: boolean; /** The maximum number of items that could be returned. */ maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; /** The index of the first item returned. */ startAt?: number; /** The number of items returned. */ total?: number; - /** Whether this is the last page. */ - isLast?: boolean; /** The list of items. */ - values?: FieldConfigurationDetails[]; + values?: BulkContextualConfiguration[]; } diff --git a/src/version2/models/pageOfCreateMetaIssueTypeWithField.ts b/src/version2/models/pageOfCreateMetaIssueTypeWithField.ts new file mode 100644 index 0000000000..3e5ce43d55 --- /dev/null +++ b/src/version2/models/pageOfCreateMetaIssueTypeWithField.ts @@ -0,0 +1,14 @@ +import { FieldCreateMetadata } from './fieldCreateMetadata'; + +/** A page of CreateMetaIssueType with Field. */ +export interface PageOfCreateMetaIssueTypeWithField { + /** The collection of FieldCreateMetaBeans. */ + fields?: FieldCreateMetadata[]; + /** The maximum number of items to return per page. */ + maxResults?: number; + results?: FieldCreateMetadata[]; + /** The index of the first item returned. */ + startAt?: number; + /** The total number of items in all pages. */ + total?: number; +} diff --git a/src/version2/models/pageOfCreateMetaIssueTypes.ts b/src/version2/models/pageOfCreateMetaIssueTypes.ts new file mode 100644 index 0000000000..42b514a7ed --- /dev/null +++ b/src/version2/models/pageOfCreateMetaIssueTypes.ts @@ -0,0 +1,14 @@ +import { IssueTypeIssueCreateMetadata } from './issueTypeIssueCreateMetadata'; + +/** A page of CreateMetaIssueTypes. */ +export interface PageOfCreateMetaIssueTypes { + createMetaIssueType?: IssueTypeIssueCreateMetadata[]; + /** The list of CreateMetaIssueType. */ + issueTypes?: IssueTypeIssueCreateMetadata[]; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The total number of items in all pages. */ + total?: number; +} diff --git a/src/version2/models/pageWithCursorGetPlanResponseForPage.ts b/src/version2/models/pageWithCursorGetPlanResponseForPage.ts new file mode 100644 index 0000000000..7b6c103ded --- /dev/null +++ b/src/version2/models/pageWithCursorGetPlanResponseForPage.ts @@ -0,0 +1,10 @@ +import { GetPlanResponseForPage } from './getPlanResponseForPage'; + +export interface PageWithCursorGetPlanResponseForPage { + cursor?: string; + last?: boolean; + nextPageCursor?: string; + size?: number; + total?: number; + values?: GetPlanResponseForPage[]; +} diff --git a/src/version2/models/pageWithCursorGetTeamResponseForPage.ts b/src/version2/models/pageWithCursorGetTeamResponseForPage.ts new file mode 100644 index 0000000000..015c2316bd --- /dev/null +++ b/src/version2/models/pageWithCursorGetTeamResponseForPage.ts @@ -0,0 +1,10 @@ +import { GetTeamResponseForPage } from './getTeamResponseForPage'; + +export interface PageWithCursorGetTeamResponseForPage { + cursor?: string; + last?: boolean; + nextPageCursor?: string; + size?: number; + total?: number; + values?: GetTeamResponseForPage[]; +} diff --git a/src/version2/models/plan.ts b/src/version2/models/plan.ts new file mode 100644 index 0000000000..2b42c63d0c --- /dev/null +++ b/src/version2/models/plan.ts @@ -0,0 +1,29 @@ +import { GetCrossProjectReleaseResponse } from './getCrossProjectReleaseResponse'; +import { GetCustomFieldResponse } from './getCustomFieldResponse'; +import { GetExclusionRulesResponse } from './getExclusionRulesResponse'; +import { GetIssueSourceResponse } from './getIssueSourceResponse'; +import { GetPermissionResponse } from './getPermissionResponse'; +import { GetSchedulingResponse } from './getSchedulingResponse'; + +export interface Plan { + /** The cross-project releases included in the plan. */ + crossProjectReleases?: GetCrossProjectReleaseResponse[]; + /** The custom fields for the plan. */ + customFields?: GetCustomFieldResponse[]; + exclusionRules?: GetExclusionRulesResponse; + /** The plan ID. */ + id: number; + /** The issue sources included in the plan. */ + issueSources?: GetIssueSourceResponse[]; + /** The date when the plan was last saved in UTC. */ + lastSaved?: string; + /** The account ID of the plan lead. */ + leadAccountId?: string; + /** The plan name. */ + name?: string; + /** The permissions for the plan. */ + permissions?: GetPermissionResponse[]; + scheduling?: GetSchedulingResponse; + /** The plan status. This is "Active", "Trashed" or "Archived". */ + status: 'Active' | 'Trashed' | 'Archived' | string; +} diff --git a/src/version2/models/priorityMapping.ts b/src/version2/models/priorityMapping.ts new file mode 100644 index 0000000000..5141c9dd63 --- /dev/null +++ b/src/version2/models/priorityMapping.ts @@ -0,0 +1,18 @@ +/** Mapping of issue priorities for changes in priority schemes. */ +export interface PriorityMapping { + /** + * The mapping of priorities for issues being migrated **into** this priority scheme. Key is the old priority ID, + * value is the new priority ID (must exist in this priority scheme). + * + * E.g. The current priority scheme has priority ID `10001`. Issues with priority ID `10000` are being migrated into this priority scheme will need mapping to new priorities. The `in` mapping would be `{"10000": 10001}`. + */ + in?: {}; + /** + * The mapping of priorities for issues being migrated **out of** this priority scheme. Key is the old priority ID + * (must exist in this priority scheme), value is the new priority ID (must exist in the default priority scheme). + * Required for updating an existing priority scheme. Not used when creating a new priority scheme. + * + * E.g. The current priority scheme has priority ID `10001`. Issues with priority ID `10001` are being migrated out of this priority scheme will need mapping to new priorities. The `out` mapping would be `{"10001": 10000}`. + */ + out?: {}; +} diff --git a/src/version2/models/prioritySchemeChangesWithoutMappings.ts b/src/version2/models/prioritySchemeChangesWithoutMappings.ts new file mode 100644 index 0000000000..51c1ea7e02 --- /dev/null +++ b/src/version2/models/prioritySchemeChangesWithoutMappings.ts @@ -0,0 +1,4 @@ +export interface PrioritySchemeChangesWithoutMappings { + /** Affected entity ids. */ + ids: number[]; +} diff --git a/src/version2/models/prioritySchemeId.ts b/src/version2/models/prioritySchemeId.ts new file mode 100644 index 0000000000..7e349f2e21 --- /dev/null +++ b/src/version2/models/prioritySchemeId.ts @@ -0,0 +1,8 @@ +import { TaskProgressNode } from './taskProgressNode'; + +/** The ID of a priority scheme. */ +export interface PrioritySchemeId { + /** The ID of the priority scheme. */ + id?: string; + task?: TaskProgressNode; +} diff --git a/src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts b/src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts new file mode 100644 index 0000000000..9dc5ed1bc5 --- /dev/null +++ b/src/version2/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts @@ -0,0 +1,21 @@ +import { Paginated } from '../../paginated'; +import { ProjectDetails } from './projectDetails'; +import { PriorityWithSequence } from './priorityWithSequence'; + +/** A priority scheme with paginated priorities and projects. */ +export interface PrioritySchemeWithPaginatedPrioritiesAndProjects { + default?: boolean; + /** The ID of the default issue priority. */ + defaultPriorityId?: string; + /** The description of the priority scheme */ + description?: string; + /** The ID of the priority scheme. */ + id: string; + isDefault?: boolean; + /** The name of the priority scheme */ + name: string; + priorities?: Paginated; + projects?: Paginated; + /** The URL of the priority scheme. */ + self?: string; +} diff --git a/src/version2/models/priorityWithSequence.ts b/src/version2/models/priorityWithSequence.ts new file mode 100644 index 0000000000..8012f612ad --- /dev/null +++ b/src/version2/models/priorityWithSequence.ts @@ -0,0 +1,19 @@ +/** An issue priority with sequence information. */ +export interface PriorityWithSequence { + /** The description of the issue priority. */ + description?: string; + /** The URL of the icon for the issue priority. */ + iconUrl?: string; + /** The ID of the issue priority. */ + id?: string; + /** Whether this priority is the default. */ + isDefault?: boolean; + /** The name of the issue priority. */ + name?: string; + /** The URL of the issue priority. */ + self?: string; + /** The sequence of the issue priority. */ + sequence?: string; + /** The color used to indicate the issue priority. */ + statusColor?: string; +} diff --git a/src/version2/models/projectComponent.ts b/src/version2/models/projectComponent.ts index 6703ca07d0..2ab1585277 100644 --- a/src/version2/models/projectComponent.ts +++ b/src/version2/models/projectComponent.ts @@ -2,6 +2,8 @@ import { User } from './user'; /** Details about a project component. */ export interface ProjectComponent { + /** Compass component's ID. Can't be updated. Not required for creating a Project Component. */ + ari?: string; assignee?: User; /** * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` @@ -39,6 +41,8 @@ export interface ProjectComponent { * for details. */ leadUserName?: string; + /** Compass component's metadata. Can't be updated. Not required for creating a Project Component. */ + metadata?: {}; /** * The unique name for the component in the project. Required when creating a component. Optional when updating a * component. The maximum length is 255 characters. diff --git a/src/version2/models/projectDataPolicies.ts b/src/version2/models/projectDataPolicies.ts new file mode 100644 index 0000000000..22bbb2d14e --- /dev/null +++ b/src/version2/models/projectDataPolicies.ts @@ -0,0 +1,7 @@ +import { ProjectWithDataPolicy } from './projectWithDataPolicy'; + +/** Details about data policies for a list of projects. */ +export interface ProjectDataPolicies { + /** List of projects with data policies. */ + projectDataPolicies?: ProjectWithDataPolicy[]; +} diff --git a/src/version2/models/projectDataPolicy.ts b/src/version2/models/projectDataPolicy.ts new file mode 100644 index 0000000000..4a8b013ea6 --- /dev/null +++ b/src/version2/models/projectDataPolicy.ts @@ -0,0 +1,5 @@ +/** Details about data policy. */ +export interface ProjectDataPolicy { + /** Whether the project contains any content inaccessible to the requesting application. */ + anyContentBlocked?: boolean; +} diff --git a/src/version2/models/projectUsage.ts b/src/version2/models/projectUsage.ts new file mode 100644 index 0000000000..2cc468d44c --- /dev/null +++ b/src/version2/models/projectUsage.ts @@ -0,0 +1,5 @@ +/** The project. */ +export interface ProjectUsage { + /** The project ID. */ + id?: string; +} diff --git a/src/version2/models/projectUsagePage.ts b/src/version2/models/projectUsagePage.ts new file mode 100644 index 0000000000..f018c8e7b1 --- /dev/null +++ b/src/version2/models/projectUsagePage.ts @@ -0,0 +1,9 @@ +import { ProjectUsage } from './projectUsage'; + +/** A page of projects. */ +export interface ProjectUsagePage { + /** Page token for the next page of project usages. */ + nextPageToken?: string; + /** The list of projects. */ + values?: ProjectUsage[]; +} diff --git a/src/version2/models/projectWithDataPolicy.ts b/src/version2/models/projectWithDataPolicy.ts new file mode 100644 index 0000000000..99830d5726 --- /dev/null +++ b/src/version2/models/projectWithDataPolicy.ts @@ -0,0 +1,8 @@ +import { ProjectDataPolicy } from './projectDataPolicy'; + +/** Details about data policies for a project. */ +export interface ProjectWithDataPolicy { + dataPolicy?: ProjectDataPolicy; + /** The project ID. */ + id?: number; +} diff --git a/src/version2/models/removeOptionFromIssuesResult.ts b/src/version2/models/removeOptionFromIssuesResult.ts new file mode 100644 index 0000000000..cf18ad7c2f --- /dev/null +++ b/src/version2/models/removeOptionFromIssuesResult.ts @@ -0,0 +1,9 @@ +import { SimpleErrorCollection } from './simpleErrorCollection'; + +export interface RemoveOptionFromIssuesResult { + errors?: SimpleErrorCollection; + /** The IDs of the modified issues. */ + modifiedIssues?: number[]; + /** The IDs of the unchanged issues, those issues where errors prevent modification. */ + unmodifiedIssues?: number[]; +} diff --git a/src/version2/models/requiredMappingByIssueType.ts b/src/version2/models/requiredMappingByIssueType.ts new file mode 100644 index 0000000000..3d85f836c5 --- /dev/null +++ b/src/version2/models/requiredMappingByIssueType.ts @@ -0,0 +1,7 @@ +/** The list of required status mappings by issue type. */ +export interface RequiredMappingByIssueType { + /** The ID of the issue type. */ + issueTypeId?: string; + /** The status IDs requiring mapping. */ + statusIds?: string[]; +} diff --git a/src/version2/models/requiredMappingByWorkflows.ts b/src/version2/models/requiredMappingByWorkflows.ts new file mode 100644 index 0000000000..b30e14666e --- /dev/null +++ b/src/version2/models/requiredMappingByWorkflows.ts @@ -0,0 +1,9 @@ +/** The list of required status mappings by workflow. */ +export interface RequiredMappingByWorkflows { + /** The ID of the source workflow. */ + sourceWorkflowId?: string; + /** The status IDs requiring mapping. */ + statusIds?: string[]; + /** The ID of the target workflow. */ + targetWorkflowId?: string; +} diff --git a/src/version2/models/ruleConfiguration.ts b/src/version2/models/ruleConfiguration.ts index bcd3aefc4c..4acde27293 100644 --- a/src/version2/models/ruleConfiguration.ts +++ b/src/version2/models/ruleConfiguration.ts @@ -4,7 +4,7 @@ export interface RuleConfiguration { disabled?: boolean; /** * EXPERIMENTAL: A tag used to filter rules in [Get workflow transition rule - * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). + * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflow-transition-rules/#api-rest-api-2-workflow-rule-config-get). */ tag?: string; /** Configuration of the rule, as it is stored by the Connect or the Forge app on the rule configuration page. */ diff --git a/src/version2/models/searchAndReconcileResults.ts b/src/version2/models/searchAndReconcileResults.ts new file mode 100644 index 0000000000..26c78d14f5 --- /dev/null +++ b/src/version2/models/searchAndReconcileResults.ts @@ -0,0 +1,16 @@ +import { Issue } from './issue'; + +/** The result of a JQL search. */ +export interface SearchAndReconcileResults { + /** The list of issues found by the search or reconsiliation. */ + issues?: Issue[]; + /** The ID and name of each field in the search results. */ + names?: {}; + /** + * Continuation token to fetch the next page. If this result represents the last or the only page this token will be + * null. This token will expire in 7 days. + */ + nextPageToken?: string; + /** The schema describing the field types in the search results. */ + schema?: {}; +} diff --git a/src/version2/models/serviceRegistry.ts b/src/version2/models/serviceRegistry.ts new file mode 100644 index 0000000000..d46bfa2b86 --- /dev/null +++ b/src/version2/models/serviceRegistry.ts @@ -0,0 +1,15 @@ +import { ServiceRegistryTier } from './serviceRegistryTier'; + +export interface ServiceRegistry { + /** Service description */ + description?: string; + /** Service ID */ + id?: string; + /** Service name */ + name?: string; + /** Organization ID */ + organizationId?: string; + /** Service revision */ + revision?: string; + serviceTier?: ServiceRegistryTier; +} diff --git a/src/version2/models/serviceRegistryTier.ts b/src/version2/models/serviceRegistryTier.ts new file mode 100644 index 0000000000..b9f2ff9ca8 --- /dev/null +++ b/src/version2/models/serviceRegistryTier.ts @@ -0,0 +1,12 @@ +export interface ServiceRegistryTier { + /** Tier description */ + description?: string; + /** Tier ID */ + id?: string; + /** Tier level */ + level?: number; + /** Tier name */ + name?: string; + /** Name key of the tier */ + nameKey?: string; +} diff --git a/src/version2/models/simpleErrorCollection.ts b/src/version2/models/simpleErrorCollection.ts new file mode 100644 index 0000000000..d3920e1594 --- /dev/null +++ b/src/version2/models/simpleErrorCollection.ts @@ -0,0 +1,10 @@ +export interface SimpleErrorCollection { + /** The list of error messages produced by this operation. For example, "input parameter 'key' must be provided" */ + errorMessages?: string[]; + /** + * The list of errors by parameter returned by the operation. For example,"projectKey": "Project keys must start with + * an uppercase letter, followed by one or more uppercase alphanumeric characters." + */ + errors?: {}; + httpStatusCode?: number; +} diff --git a/src/version2/models/simpleUsage.ts b/src/version2/models/simpleUsage.ts new file mode 100644 index 0000000000..b1ddd95231 --- /dev/null +++ b/src/version2/models/simpleUsage.ts @@ -0,0 +1,7 @@ +/** Represents a usage of an entity by a project ID and related issue type IDs. */ +export interface SimpleUsage { + /** The issue type IDs for the usage. */ + issueTypeIds: string[]; + /** The project ID for the usage. */ + projectId: string; +} diff --git a/src/version2/models/statusMetadata.ts b/src/version2/models/statusMetadata.ts new file mode 100644 index 0000000000..f6eaa22aaf --- /dev/null +++ b/src/version2/models/statusMetadata.ts @@ -0,0 +1,9 @@ +/** The details of the statuses in the associated workflows. */ +export interface StatusMetadata { + /** The category of the status. */ + category?: 'TODO' | 'IN_PROGRESS' | 'DONE' | string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; +} diff --git a/src/version2/models/statusProjectIssueTypeUsage.ts b/src/version2/models/statusProjectIssueTypeUsage.ts new file mode 100644 index 0000000000..3141919ee9 --- /dev/null +++ b/src/version2/models/statusProjectIssueTypeUsage.ts @@ -0,0 +1,5 @@ +/** The list of issue types. */ +export interface StatusProjectIssueTypeUsage { + /** The issue type ID. */ + id?: string; +} diff --git a/src/version2/models/statusProjectIssueTypeUsageDTO.ts b/src/version2/models/statusProjectIssueTypeUsageDTO.ts new file mode 100644 index 0000000000..73397025c5 --- /dev/null +++ b/src/version2/models/statusProjectIssueTypeUsageDTO.ts @@ -0,0 +1,10 @@ +import { StatusProjectIssueTypeUsagePage } from './statusProjectIssueTypeUsagePage'; + +/** The issue types using this status in a project. */ +export interface StatusProjectIssueTypeUsageDTO { + issueTypes?: StatusProjectIssueTypeUsagePage; + /** The project ID. */ + projectId?: string; + /** The status ID. */ + statusId?: string; +} diff --git a/src/version2/models/statusProjectIssueTypeUsagePage.ts b/src/version2/models/statusProjectIssueTypeUsagePage.ts new file mode 100644 index 0000000000..b273c4e6c2 --- /dev/null +++ b/src/version2/models/statusProjectIssueTypeUsagePage.ts @@ -0,0 +1,9 @@ +import { StatusProjectIssueTypeUsage } from './statusProjectIssueTypeUsage'; + +/** A page of issue types. */ +export interface StatusProjectIssueTypeUsagePage { + /** Page token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of issue types. */ + values?: StatusProjectIssueTypeUsage[]; +} diff --git a/src/version2/models/statusProjectUsage.ts b/src/version2/models/statusProjectUsage.ts new file mode 100644 index 0000000000..10f8b53619 --- /dev/null +++ b/src/version2/models/statusProjectUsage.ts @@ -0,0 +1,5 @@ +/** The project. */ +export interface StatusProjectUsage { + /** The project ID. */ + id?: string; +} diff --git a/src/version2/models/statusProjectUsageDTO.ts b/src/version2/models/statusProjectUsageDTO.ts new file mode 100644 index 0000000000..315a9377ed --- /dev/null +++ b/src/version2/models/statusProjectUsageDTO.ts @@ -0,0 +1,8 @@ +import { StatusProjectUsagePage } from './statusProjectUsagePage'; + +/** The projects using this status. */ +export interface StatusProjectUsageDTO { + projects?: StatusProjectUsagePage; + /** The status ID. */ + statusId?: string; +} diff --git a/src/version2/models/statusProjectUsagePage.ts b/src/version2/models/statusProjectUsagePage.ts new file mode 100644 index 0000000000..5a9583f815 --- /dev/null +++ b/src/version2/models/statusProjectUsagePage.ts @@ -0,0 +1,9 @@ +import { StatusProjectUsage } from './statusProjectUsage'; + +/** A page of projects. */ +export interface StatusProjectUsagePage { + /** Page token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of projects. */ + values?: StatusProjectUsage[]; +} diff --git a/src/version2/models/statusWorkflowUsageDTO.ts b/src/version2/models/statusWorkflowUsageDTO.ts new file mode 100644 index 0000000000..bad0f5011d --- /dev/null +++ b/src/version2/models/statusWorkflowUsageDTO.ts @@ -0,0 +1,8 @@ +import { StatusWorkflowUsagePage } from './statusWorkflowUsagePage'; + +/** Workflows using the status. */ +export interface StatusWorkflowUsageDTO { + /** The status ID. */ + statusId?: string; + workflows?: StatusWorkflowUsagePage; +} diff --git a/src/version2/models/statusWorkflowUsagePage.ts b/src/version2/models/statusWorkflowUsagePage.ts new file mode 100644 index 0000000000..6d358d8517 --- /dev/null +++ b/src/version2/models/statusWorkflowUsagePage.ts @@ -0,0 +1,9 @@ +import { StatusWorkflowUsageWorkflow } from './statusWorkflowUsageWorkflow'; + +/** A page of workflows. */ +export interface StatusWorkflowUsagePage { + /** Page token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of statuses. */ + values?: StatusWorkflowUsageWorkflow[]; +} diff --git a/src/version2/models/statusWorkflowUsageWorkflow.ts b/src/version2/models/statusWorkflowUsageWorkflow.ts new file mode 100644 index 0000000000..3e860725b5 --- /dev/null +++ b/src/version2/models/statusWorkflowUsageWorkflow.ts @@ -0,0 +1,5 @@ +/** The worflow. */ +export interface StatusWorkflowUsageWorkflow { + /** The workflow ID. */ + id?: string; +} diff --git a/src/version2/models/statusesPerWorkflow.ts b/src/version2/models/statusesPerWorkflow.ts new file mode 100644 index 0000000000..d4b31c1b71 --- /dev/null +++ b/src/version2/models/statusesPerWorkflow.ts @@ -0,0 +1,9 @@ +/** The statuses associated with each workflow. */ +export interface StatusesPerWorkflow { + /** The ID of the initial status for the workflow. */ + initialStatusId?: string; + /** The status IDs associated with the workflow. */ + statuses?: string[]; + /** The ID of the workflow. */ + workflowId?: string; +} diff --git a/src/version2/models/suggestedMappingsForPrioritiesRequestBean.ts b/src/version2/models/suggestedMappingsForPrioritiesRequestBean.ts new file mode 100644 index 0000000000..9102196ab0 --- /dev/null +++ b/src/version2/models/suggestedMappingsForPrioritiesRequestBean.ts @@ -0,0 +1,7 @@ +/** Details of changes to a priority scheme's priorities that require suggested priority mappings. */ +export interface SuggestedMappingsForPrioritiesRequestBean { + /** The ids of priorities being removed from the scheme. */ + add?: number[]; + /** The ids of priorities being removed from the scheme. */ + remove?: number[]; +} diff --git a/src/version2/models/suggestedMappingsForProjectsRequestBean.ts b/src/version2/models/suggestedMappingsForProjectsRequestBean.ts new file mode 100644 index 0000000000..50b3d45b90 --- /dev/null +++ b/src/version2/models/suggestedMappingsForProjectsRequestBean.ts @@ -0,0 +1,5 @@ +/** Details of changes to a priority scheme's projects that require suggested priority mappings. */ +export interface SuggestedMappingsForProjectsRequestBean { + /** The ids of projects being added to the scheme. */ + add?: number[]; +} diff --git a/src/version2/models/suggestedMappingsRequest.ts b/src/version2/models/suggestedMappingsRequest.ts new file mode 100644 index 0000000000..4606cbcddb --- /dev/null +++ b/src/version2/models/suggestedMappingsRequest.ts @@ -0,0 +1,14 @@ +import { SuggestedMappingsForPrioritiesRequestBean } from './suggestedMappingsForPrioritiesRequestBean'; +import { SuggestedMappingsForProjectsRequestBean } from './suggestedMappingsForProjectsRequestBean'; + +/** Details of changes to a priority scheme that require suggested priority mappings. */ +export interface SuggestedMappingsRequest { + /** The maximum number of results that could be on the page. */ + maxResults?: number; + priorities?: SuggestedMappingsForPrioritiesRequestBean; + projects?: SuggestedMappingsForProjectsRequestBean; + /** The id of the priority scheme. */ + schemeId?: number; + /** The index of the first item returned on the page. */ + startAt?: number; +} diff --git a/src/version2/models/systemAvatars.ts b/src/version2/models/systemAvatars.ts index b7a72d47f9..bb60531b88 100644 --- a/src/version2/models/systemAvatars.ts +++ b/src/version2/models/systemAvatars.ts @@ -3,5 +3,5 @@ import { Avatar } from './avatar'; /** List of system avatars. */ export interface SystemAvatars { /** A list of avatar details. */ - system?: Avatar[]; + system: Omit[]; } diff --git a/src/version2/models/taskProgressNode.ts b/src/version2/models/taskProgressNode.ts new file mode 100644 index 0000000000..d49fa81446 --- /dev/null +++ b/src/version2/models/taskProgressNode.ts @@ -0,0 +1,30 @@ +import { JsonNode } from './jsonNode'; + +/** Details about a task. */ +export interface TaskProgressNode { + /** The description of the task. */ + description?: string; + /** The execution time of the task, in milliseconds. */ + elapsedRuntime: number; + /** A timestamp recording when the task was finished. */ + finished?: number; + /** The ID of the task. */ + id: string; + /** A timestamp recording when the task progress was last updated. */ + lastUpdate: number; + /** Information about the progress of the task. */ + message?: string; + /** The progress of the task, as a percentage complete. */ + progress: number; + result?: JsonNode; + /** The URL of the task. */ + self: string; + /** A timestamp recording when the task was started. */ + started?: number; + /** The status of the task. */ + status: 'ENQUEUED' | 'RUNNING' | 'COMPLETE' | 'FAILED' | 'CANCEL_REQUESTED' | 'CANCELLED' | 'DEAD' | string; + /** A timestamp recording when the task was submitted. */ + submitted: number; + /** The ID of the user who submitted the task. */ + submittedBy: number; +} diff --git a/src/version2/models/taskProgressRemoveOptionFromIssuesResult.ts b/src/version2/models/taskProgressRemoveOptionFromIssuesResult.ts new file mode 100644 index 0000000000..4d8a7b38b4 --- /dev/null +++ b/src/version2/models/taskProgressRemoveOptionFromIssuesResult.ts @@ -0,0 +1,30 @@ +import { RemoveOptionFromIssuesResult } from './removeOptionFromIssuesResult'; + +/** Details about a task. */ +export interface TaskProgressRemoveOptionFromIssuesResult { + /** The description of the task. */ + description?: string; + /** The execution time of the task, in milliseconds. */ + elapsedRuntime: number; + /** A timestamp recording when the task was finished. */ + finished?: number; + /** The ID of the task. */ + id: string; + /** A timestamp recording when the task progress was last updated. */ + lastUpdate: number; + /** Information about the progress of the task. */ + message?: string; + /** The progress of the task, as a percentage complete. */ + progress: number; + result?: RemoveOptionFromIssuesResult; + /** The URL of the task. */ + self: string; + /** A timestamp recording when the task was started. */ + started?: number; + /** The status of the task. */ + status: 'ENQUEUED' | 'RUNNING' | 'COMPLETE' | 'FAILED' | 'CANCEL_REQUESTED' | 'CANCELLED' | 'DEAD' | string; + /** A timestamp recording when the task was submitted. */ + submitted: number; + /** The ID of the user who submitted the task. */ + submittedBy: number; +} diff --git a/src/version2/models/updateDefaultProjectClassification.ts b/src/version2/models/updateDefaultProjectClassification.ts new file mode 100644 index 0000000000..70ce9a4184 --- /dev/null +++ b/src/version2/models/updateDefaultProjectClassification.ts @@ -0,0 +1,5 @@ +/** The request for updating the default project classification level. */ +export interface UpdateDefaultProjectClassification { + /** The ID of the project classification. */ + id: string; +} diff --git a/src/version2/models/updatePrioritiesInSchemeRequest.ts b/src/version2/models/updatePrioritiesInSchemeRequest.ts new file mode 100644 index 0000000000..43fcd0e551 --- /dev/null +++ b/src/version2/models/updatePrioritiesInSchemeRequest.ts @@ -0,0 +1,7 @@ +import { PrioritySchemeChangesWithoutMappings } from './prioritySchemeChangesWithoutMappings'; + +/** Update priorities in a scheme */ +export interface UpdatePrioritiesInSchemeRequest { + add?: PrioritySchemeChangesWithoutMappings; + remove?: PrioritySchemeChangesWithoutMappings; +} diff --git a/src/version2/models/updatePriorityDetails.ts b/src/version2/models/updatePriorityDetails.ts index ab3ed530a2..5d61df8da2 100644 --- a/src/version2/models/updatePriorityDetails.ts +++ b/src/version2/models/updatePriorityDetails.ts @@ -1,9 +1,37 @@ /** Details of an issue priority. */ export interface UpdatePriorityDetails { + /** The ID for the avatar for the priority. This parameter is nullable and both iconUrl and avatarId cannot be defined. */ + avatarId?: number; /** The description of the priority. */ description?: string; - /** The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. */ - iconUrl?: string; + /** + * The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. Both + * iconUrl and avatarId cannot be defined. + * + * @deprecated This property is deprecated and will be removed in a future version. Use `avatarId` instead. + */ + iconUrl?: + | '/images/icons/priorities/blocker.png' + | '/images/icons/priorities/critical.png' + | '/images/icons/priorities/high.png' + | '/images/icons/priorities/highest.png' + | '/images/icons/priorities/low.png' + | '/images/icons/priorities/lowest.png' + | '/images/icons/priorities/major.png' + | '/images/icons/priorities/medium.png' + | '/images/icons/priorities/minor.png' + | '/images/icons/priorities/trivial.png' + | '/images/icons/priorities/blocker_new.png' + | '/images/icons/priorities/critical_new.png' + | '/images/icons/priorities/high_new.png' + | '/images/icons/priorities/highest_new.png' + | '/images/icons/priorities/low_new.png' + | '/images/icons/priorities/lowest_new.png' + | '/images/icons/priorities/major_new.png' + | '/images/icons/priorities/medium_new.png' + | '/images/icons/priorities/minor_new.png' + | '/images/icons/priorities/trivial_new.png' + | string; /** The name of the priority. Must be unique. */ name?: string; /** The status color of the priority in 3-digit or 6-digit hexadecimal format. */ diff --git a/src/version2/models/updatePrioritySchemeRequest.ts b/src/version2/models/updatePrioritySchemeRequest.ts new file mode 100644 index 0000000000..95ecc0e93a --- /dev/null +++ b/src/version2/models/updatePrioritySchemeRequest.ts @@ -0,0 +1,16 @@ +import { PriorityMapping } from './priorityMapping'; +import { UpdatePrioritiesInSchemeRequest } from './updatePrioritiesInSchemeRequest'; +import { UpdateProjectsInSchemeRequest } from './updateProjectsInSchemeRequest'; + +/** Details of a priority scheme. */ +export interface UpdatePrioritySchemeRequest { + /** The default priority of the scheme. */ + defaultPriorityId?: number; + /** The description of the priority scheme. */ + description?: string; + mappings?: PriorityMapping; + /** The name of the priority scheme. Must be unique. */ + name?: string; + priorities?: UpdatePrioritiesInSchemeRequest; + projects?: UpdateProjectsInSchemeRequest; +} diff --git a/src/version2/models/updatePrioritySchemeResponse.ts b/src/version2/models/updatePrioritySchemeResponse.ts new file mode 100644 index 0000000000..236481e5b3 --- /dev/null +++ b/src/version2/models/updatePrioritySchemeResponse.ts @@ -0,0 +1,8 @@ +import { PrioritySchemeWithPaginatedPrioritiesAndProjects } from './prioritySchemeWithPaginatedPrioritiesAndProjects'; +import { TaskProgressNode } from './taskProgressNode'; + +/** Details of the updated priority scheme. */ +export interface UpdatePrioritySchemeResponse { + priorityScheme?: PrioritySchemeWithPaginatedPrioritiesAndProjects; + task?: TaskProgressNode; +} diff --git a/src/version2/models/updateProjectDetails.ts b/src/version2/models/updateProjectDetails.ts index c042c8d57a..6fc4a51306 100644 --- a/src/version2/models/updateProjectDetails.ts +++ b/src/version2/models/updateProjectDetails.ts @@ -1,17 +1,22 @@ /** Details about the project. */ export interface UpdateProjectDetails { - /** The default assignee when creating issues for this project. */ - assigneeType?: string; - /** An integer value for the project's avatar. */ - avatarId?: number; /** - * The ID of the project's category. A complete list of category IDs is found using the [Get all project - * categories](#api-rest-api-2-projectCategory-get) operation. To remove the project category from the project, set - * the value to `-1.` + * Project keys must be unique and start with an uppercase letter followed by one or more uppercase alphanumeric + * characters. The maximum length is 10 characters. */ - categoryId?: number; + key?: string; + /** The name of the project. */ + name?: string; /** A brief description of the project. */ description?: string; + /** The account ID of the project lead. Cannot be provided with `lead`. */ + leadAccountId: string; + /** A link to information about this project, such as project documentation */ + url?: string; + /** The default assignee when creating issues for this project. */ + assigneeType?: string; + /** An integer value for the project's avatar. */ + avatarId?: number; /** * The ID of the issue security scheme for the project, which enables you to control who can and cannot view issues. * Use the [Get issue security schemes](#api-rest-api-2-issuesecurityschemes-get) resource to get all issue security @@ -19,24 +24,24 @@ export interface UpdateProjectDetails { */ issueSecurityScheme?: number; /** - * Project keys must be unique and start with an uppercase letter followed by one or more uppercase alphanumeric - * characters. The maximum length is 10 characters. + * The ID of the permission scheme for the project. Use the [Get all permission + * schemes](#api-rest-api-2-permissionscheme-get) resource to see a list of all permission scheme IDs. */ - key?: string; - /** The account ID of the project lead. Cannot be provided with `lead`. */ - leadAccountId: string; - /** The name of the project. */ - name?: string; + permissionScheme?: number; /** * The ID of the notification scheme for the project. Use the [Get notification * schemes](#api-rest-api-2-notificationscheme-get) resource to get a list of notification scheme IDs. */ notificationScheme?: number; /** - * The ID of the permission scheme for the project. Use the [Get all permission - * schemes](#api-rest-api-2-permissionscheme-get) resource to see a list of all permission scheme IDs. + * The ID of the project's category. A complete list of category IDs is found using the [Get all project + * categories](#api-rest-api-2-projectCategory-get) operation. To remove the project category from the project, set + * the value to `-1.` */ - permissionScheme?: number; - /** A link to information about this project, such as project documentation */ - url?: string; + categoryId?: number; + /** + * Previous project keys to be released from the current project. Released keys must belong to the current project and + * not contain the current project key + */ + releasedProjectKeys?: string[]; } diff --git a/src/version2/models/updateProjectsInSchemeRequest.ts b/src/version2/models/updateProjectsInSchemeRequest.ts new file mode 100644 index 0000000000..2269174ee8 --- /dev/null +++ b/src/version2/models/updateProjectsInSchemeRequest.ts @@ -0,0 +1,7 @@ +import { PrioritySchemeChangesWithoutMappings } from './prioritySchemeChangesWithoutMappings'; + +/** Update projects in a scheme */ +export interface UpdateProjectsInSchemeRequest { + add?: PrioritySchemeChangesWithoutMappings; + remove?: PrioritySchemeChangesWithoutMappings; +} diff --git a/src/version2/models/userContextVariable.ts b/src/version2/models/userContextVariable.ts new file mode 100644 index 0000000000..3db08c9615 --- /dev/null +++ b/src/version2/models/userContextVariable.ts @@ -0,0 +1,6 @@ +export interface UserContextVariable { + /** The account ID of the user. */ + accountId: string; + /** Type of custom context variable. */ + type: string; +} diff --git a/src/version2/models/version.ts b/src/version2/models/version.ts index 5c2cd84911..9be11f4e2b 100644 --- a/src/version2/models/version.ts +++ b/src/version2/models/version.ts @@ -1,8 +1,17 @@ -import { SimpleLink } from './simpleLink'; +import { VersionApprover } from './versionApprover'; import { VersionIssuesStatus } from './versionIssuesStatus'; +import { SimpleLink } from './simpleLink'; /** Details about a project version. */ export interface Version { + /** If the expand option `approvers` is used, returns a list containing the approvers for this version. */ + approvers?: VersionApprover[]; + /** Indicates that the version is archived. Optional when creating or updating a version. */ + archived?: boolean; + /** The description of the version. Optional when creating or updating a version. The maximum size is 16,384 bytes. */ + description?: string; + /** If the expand option `driver` is used, returns the Atlassian account ID of the driver. */ + driver?: string; /** * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional * information about version in the response. This parameter accepts a comma-separated list. Expand options include: @@ -19,15 +28,11 @@ export interface Version { self?: string; /** The ID of the version. */ id?: string; - /** The description of the version. Optional when creating or updating a version. */ - description?: string; /** * The unique name of the version. Required when creating a version. Optional when updating a version. The maximum * length is 255 characters. */ name?: string; - /** Indicates that the version is archived. Optional when creating or updating a version. */ - archived?: boolean; /** * Indicates that the version is released. If the version is released a request to release again is ignored. Not * applicable when creating a version. Optional when updating a version. @@ -59,7 +64,7 @@ export interface Version { * The ID of the project to which this version is attached. Required when creating a version. Not applicable when * updating a version. */ - projectId: number; + projectId: string | number; /** * The URL of the self link to the version to which all unfixed issues are moved when a version is released. Not * applicable when creating a version. Optional when updating a version. diff --git a/src/version2/models/versionApprover.ts b/src/version2/models/versionApprover.ts new file mode 100644 index 0000000000..2a4b447c5a --- /dev/null +++ b/src/version2/models/versionApprover.ts @@ -0,0 +1,11 @@ +/** Contains details about a version approver. */ +export interface VersionApprover { + /** The Atlassian account ID of the approver. */ + accountId?: string; + /** A description of why the user is declining the approval. */ + declineReason?: string; + /** A description of what the user is approving within the specified version. */ + description?: string; + /** The status of the approval, which can be _PENDING_, _APPROVED_, or _DECLINED_ */ + status?: string; +} diff --git a/src/version2/models/versionRelatedWork.ts b/src/version2/models/versionRelatedWork.ts new file mode 100644 index 0000000000..d8e8e88a06 --- /dev/null +++ b/src/version2/models/versionRelatedWork.ts @@ -0,0 +1,16 @@ +/** Associated related work to a version */ +export interface VersionRelatedWork { + /** The category of the related work */ + category: string; + /** The ID of the issue associated with the related work (if there is one). Cannot be updated via the Rest API. */ + issueId?: number; + /** + * The id of the related work. For the native release note related work item, this will be null, and Rest API does not + * support updating it. + */ + relatedWorkId?: string; + /** The title of the related work */ + title?: string; + /** The URL of the related work. Will be null for the native release note related work item, but is otherwise required. */ + url?: string; +} diff --git a/src/version2/models/webhook.ts b/src/version2/models/webhook.ts index 7886ad7274..e9e804f184 100644 --- a/src/version2/models/webhook.ts +++ b/src/version2/models/webhook.ts @@ -4,7 +4,7 @@ export interface Webhook { events: string[]; /** * The date after which the webhook is no longer sent. Use [Extend webhook - * life](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-webhooks/#api-rest-api-3-webhook-refresh-put) + * life](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-webhooks/#api-rest-api-2-webhook-refresh-put) * to extend the date. */ expirationDate?: number; diff --git a/src/version2/models/workflowAssociationStatusMapping.ts b/src/version2/models/workflowAssociationStatusMapping.ts new file mode 100644 index 0000000000..17d5e22fe6 --- /dev/null +++ b/src/version2/models/workflowAssociationStatusMapping.ts @@ -0,0 +1,7 @@ +/** The list of status mappings. */ +export interface WorkflowAssociationStatusMapping { + /** The ID of the status in the new workflow. */ + newStatusId: string; + /** The ID of the status in the old workflow that isn't present in the new workflow. */ + oldStatusId: string; +} diff --git a/src/version2/models/workflowMetadataAndIssueTypeRestModel.ts b/src/version2/models/workflowMetadataAndIssueTypeRestModel.ts new file mode 100644 index 0000000000..b418fdf196 --- /dev/null +++ b/src/version2/models/workflowMetadataAndIssueTypeRestModel.ts @@ -0,0 +1,8 @@ +import { WorkflowMetadataRestModel } from './workflowMetadataRestModel'; + +/** The workflow metadata and issue type IDs which use this workflow. */ +export interface WorkflowMetadataAndIssueTypeRestModel { + /** The list of issue type IDs for the mapping. */ + issueTypeIds: string[]; + workflow: WorkflowMetadataRestModel; +} diff --git a/src/version2/models/workflowMetadataRestModel.ts b/src/version2/models/workflowMetadataRestModel.ts new file mode 100644 index 0000000000..480f13505f --- /dev/null +++ b/src/version2/models/workflowMetadataRestModel.ts @@ -0,0 +1,20 @@ +import { SimpleUsage } from './simpleUsage'; +import { DocumentVersion } from './documentVersion'; + +/** Workflow metadata and usage detail. */ +export interface WorkflowMetadataRestModel { + /** The description of the workflow. */ + description: string; + /** The ID of the workflow. */ + id: string; + /** The name of the workflow. */ + name: string; + /** + * Deprecated. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298) for details. + * + * Use the optional `workflows.usages` expand to get additional information about the projects and issue types associated with the workflows in the workflow scheme. + */ + usage: SimpleUsage[]; + version: DocumentVersion; +} diff --git a/src/version2/models/workflowProjectIssueTypeUsage.ts b/src/version2/models/workflowProjectIssueTypeUsage.ts new file mode 100644 index 0000000000..9e5e7f3ec1 --- /dev/null +++ b/src/version2/models/workflowProjectIssueTypeUsage.ts @@ -0,0 +1,5 @@ +/** The issue type. */ +export interface WorkflowProjectIssueTypeUsage { + /** The ID of the issue type. */ + id?: string; +} diff --git a/src/version2/models/workflowProjectIssueTypeUsageDTO.ts b/src/version2/models/workflowProjectIssueTypeUsageDTO.ts new file mode 100644 index 0000000000..fa23a7595e --- /dev/null +++ b/src/version2/models/workflowProjectIssueTypeUsageDTO.ts @@ -0,0 +1,10 @@ +import { WorkflowProjectIssueTypeUsagePage } from './workflowProjectIssueTypeUsagePage'; + +/** Issue types associated with the workflow for a project. */ +export interface WorkflowProjectIssueTypeUsageDTO { + issueTypes?: WorkflowProjectIssueTypeUsagePage; + /** The ID of the project. */ + projectId?: string; + /** The ID of the workflow. */ + workflowId?: string; +} diff --git a/src/version2/models/workflowProjectIssueTypeUsagePage.ts b/src/version2/models/workflowProjectIssueTypeUsagePage.ts new file mode 100644 index 0000000000..33efc451d8 --- /dev/null +++ b/src/version2/models/workflowProjectIssueTypeUsagePage.ts @@ -0,0 +1,9 @@ +import { WorkflowProjectIssueTypeUsage } from './workflowProjectIssueTypeUsage'; + +/** A page of issue types. */ +export interface WorkflowProjectIssueTypeUsagePage { + /** Token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of issue types. */ + values?: WorkflowProjectIssueTypeUsage[]; +} diff --git a/src/version2/models/workflowProjectUsageDTO.ts b/src/version2/models/workflowProjectUsageDTO.ts new file mode 100644 index 0000000000..1d3d2b1d13 --- /dev/null +++ b/src/version2/models/workflowProjectUsageDTO.ts @@ -0,0 +1,8 @@ +import { ProjectUsagePage } from './projectUsagePage'; + +/** Projects using the workflow. */ +export interface WorkflowProjectUsageDTO { + projects?: ProjectUsagePage; + /** The workflow ID. */ + workflowId?: string; +} diff --git a/src/version2/models/workflowSchemeAssociation.ts b/src/version2/models/workflowSchemeAssociation.ts new file mode 100644 index 0000000000..9e119c9edb --- /dev/null +++ b/src/version2/models/workflowSchemeAssociation.ts @@ -0,0 +1,7 @@ +/** The explicit association between issue types and a workflow in a workflow scheme. */ +export interface WorkflowSchemeAssociation { + /** The issue types assigned to the workflow. */ + issueTypeIds: string[]; + /** The ID of the workflow. */ + workflowId: string; +} diff --git a/src/version2/models/workflowSchemeProjectUsage.ts b/src/version2/models/workflowSchemeProjectUsage.ts new file mode 100644 index 0000000000..525818ea3b --- /dev/null +++ b/src/version2/models/workflowSchemeProjectUsage.ts @@ -0,0 +1,8 @@ +import { ProjectUsagePage } from './projectUsagePage'; + +/** Projects using the workflow scheme. */ +export interface WorkflowSchemeProjectUsage { + projects?: ProjectUsagePage; + /** The workflow scheme ID. */ + workflowSchemeId?: string; +} diff --git a/src/version2/models/workflowSchemeReadRequest.ts b/src/version2/models/workflowSchemeReadRequest.ts new file mode 100644 index 0000000000..448fe7361e --- /dev/null +++ b/src/version2/models/workflowSchemeReadRequest.ts @@ -0,0 +1,7 @@ +/** The workflow scheme read request body. */ +export interface WorkflowSchemeReadRequest { + /** The list of project IDs to query. */ + projectIds?: string[]; + /** The list of workflow scheme IDs to query. */ + workflowSchemeIds?: string[]; +} diff --git a/src/version2/models/workflowSchemeReadResponse.ts b/src/version2/models/workflowSchemeReadResponse.ts new file mode 100644 index 0000000000..55fef69680 --- /dev/null +++ b/src/version2/models/workflowSchemeReadResponse.ts @@ -0,0 +1,27 @@ +import { WorkflowMetadataRestModel } from './workflowMetadataRestModel'; +import { WorkflowScope } from './workflowScope'; +import { DocumentVersion } from './documentVersion'; +import { WorkflowMetadataAndIssueTypeRestModel } from './workflowMetadataAndIssueTypeRestModel'; + +export interface WorkflowSchemeReadResponse { + defaultWorkflow?: WorkflowMetadataRestModel; + /** The description of the workflow scheme. */ + description?: string; + /** The ID of the workflow scheme. */ + id: string; + /** The name of the workflow scheme. */ + name: string; + /** + * Deprecated. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298) for details. + * + * The IDs of projects using the workflow scheme. + */ + projectIdsUsingScheme?: string[]; + scope: WorkflowScope; + /** Indicates if there's an [asynchronous task](#async-operations) for this workflow scheme. */ + taskId?: string; + version: DocumentVersion; + /** Mappings from workflows to issue types. */ + workflowsForIssueTypes: WorkflowMetadataAndIssueTypeRestModel[]; +} diff --git a/src/version2/models/workflowSchemeUpdateRequest.ts b/src/version2/models/workflowSchemeUpdateRequest.ts new file mode 100644 index 0000000000..fc2a9816c2 --- /dev/null +++ b/src/version2/models/workflowSchemeUpdateRequest.ts @@ -0,0 +1,35 @@ +import { MappingsByIssueTypeOverride } from './mappingsByIssueTypeOverride'; +import { MappingsByWorkflow } from './mappingsByWorkflow'; +import { DocumentVersion } from './documentVersion'; +import { WorkflowSchemeAssociation } from './workflowSchemeAssociation'; + +/** The update workflow scheme payload. */ +export interface WorkflowSchemeUpdateRequest { + /** + * The ID of the workflow for issue types without having a mapping defined in this workflow scheme. Only used in + * global-scoped workflow schemes. If the `defaultWorkflowId` isn't specified, this is set to _Jira Workflow (jira)_. + */ + defaultWorkflowId?: string; + /** The new description for this workflow scheme. */ + description: string; + /** The ID of this workflow scheme. */ + id: string; + /** The new name for this workflow scheme. */ + name: string; + /** + * Overrides, for the selected issue types, any status mappings provided in `statusMappingsByWorkflows`. Status + * mappings are required when the new workflow for an issue type doesn't contain all statuses that the old workflow + * has. Status mappings can be provided by a combination of `statusMappingsByWorkflows` and + * `statusMappingsByIssueTypeOverride`. + */ + statusMappingsByIssueTypeOverride?: MappingsByIssueTypeOverride[]; + /** + * The status mappings by workflows. Status mappings are required when the new workflow for an issue type doesn't + * contain all statuses that the old workflow has. Status mappings can be provided by a combination of + * `statusMappingsByWorkflows` and `statusMappingsByIssueTypeOverride`. + */ + statusMappingsByWorkflows?: MappingsByWorkflow[]; + version: DocumentVersion; + /** Mappings from workflows to issue types. */ + workflowsForIssueTypes?: WorkflowSchemeAssociation[]; +} diff --git a/src/version2/models/workflowSchemeUpdateRequiredMappingsRequest.ts b/src/version2/models/workflowSchemeUpdateRequiredMappingsRequest.ts new file mode 100644 index 0000000000..ccde824efa --- /dev/null +++ b/src/version2/models/workflowSchemeUpdateRequiredMappingsRequest.ts @@ -0,0 +1,14 @@ +import { WorkflowSchemeAssociation } from './workflowSchemeAssociation'; + +/** The request payload to get the required mappings for updating a workflow scheme. */ +export interface WorkflowSchemeUpdateRequiredMappingsRequest { + /** + * The ID of the new default workflow for this workflow scheme. Only used in global-scoped workflow schemes. If it + * isn't specified, is set to _Jira Workflow (jira)_. + */ + defaultWorkflowId?: string; + /** The ID of the workflow scheme. */ + id: string; + /** The new workflow to issue type mappings for this workflow scheme. */ + workflowsForIssueTypes: WorkflowSchemeAssociation[]; +} diff --git a/src/version2/models/workflowSchemeUpdateRequiredMappingsResponse.ts b/src/version2/models/workflowSchemeUpdateRequiredMappingsResponse.ts new file mode 100644 index 0000000000..c0ca2ff563 --- /dev/null +++ b/src/version2/models/workflowSchemeUpdateRequiredMappingsResponse.ts @@ -0,0 +1,15 @@ +import { RequiredMappingByIssueType } from './requiredMappingByIssueType'; +import { RequiredMappingByWorkflows } from './requiredMappingByWorkflows'; +import { StatusMetadata } from './statusMetadata'; +import { StatusesPerWorkflow } from './statusesPerWorkflow'; + +export interface WorkflowSchemeUpdateRequiredMappingsResponse { + /** The list of required status mappings by issue type. */ + statusMappingsByIssueTypes?: RequiredMappingByIssueType[]; + /** The list of required status mappings by workflow. */ + statusMappingsByWorkflows?: RequiredMappingByWorkflows[]; + /** The details of the statuses in the associated workflows. */ + statuses?: StatusMetadata[]; + /** The statuses associated with each workflow. */ + statusesPerWorkflow?: StatusesPerWorkflow[]; +} diff --git a/src/version2/models/workflowSchemeUsage.ts b/src/version2/models/workflowSchemeUsage.ts new file mode 100644 index 0000000000..a6b0fe9530 --- /dev/null +++ b/src/version2/models/workflowSchemeUsage.ts @@ -0,0 +1,5 @@ +/** The worflow scheme. */ +export interface WorkflowSchemeUsage { + /** The workflow scheme ID. */ + id?: string; +} diff --git a/src/version2/models/workflowSchemeUsageDTO.ts b/src/version2/models/workflowSchemeUsageDTO.ts new file mode 100644 index 0000000000..9d660e5b61 --- /dev/null +++ b/src/version2/models/workflowSchemeUsageDTO.ts @@ -0,0 +1,8 @@ +import { WorkflowSchemeUsagePage } from './workflowSchemeUsagePage'; + +/** Workflow schemes using the workflow. */ +export interface WorkflowSchemeUsageDTO { + /** The workflow ID. */ + workflowId?: string; + workflowSchemes?: WorkflowSchemeUsagePage; +} diff --git a/src/version2/models/workflowSchemeUsagePage.ts b/src/version2/models/workflowSchemeUsagePage.ts new file mode 100644 index 0000000000..5b883978f6 --- /dev/null +++ b/src/version2/models/workflowSchemeUsagePage.ts @@ -0,0 +1,9 @@ +import { WorkflowSchemeUsage } from './workflowSchemeUsage'; + +/** A page of workflow schemes. */ +export interface WorkflowSchemeUsagePage { + /** Token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of workflow schemes. */ + values?: WorkflowSchemeUsage[]; +} diff --git a/src/version2/models/workflowSearchResponse.ts b/src/version2/models/workflowSearchResponse.ts new file mode 100644 index 0000000000..966016a32a --- /dev/null +++ b/src/version2/models/workflowSearchResponse.ts @@ -0,0 +1,22 @@ +import { JiraWorkflowStatus } from './jiraWorkflowStatus'; +import { JiraWorkflow } from './jiraWorkflow'; + +/** Page of items, including workflows and related statuses. */ +export interface WorkflowSearchResponse { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** List of statuses. */ + statuses?: JiraWorkflowStatus[]; + /** The number of items returned. */ + total?: number; + /** List of workflows. */ + values?: JiraWorkflow[]; +} diff --git a/src/version2/models/worklogsMoveRequest.ts b/src/version2/models/worklogsMoveRequest.ts new file mode 100644 index 0000000000..212d9419a7 --- /dev/null +++ b/src/version2/models/worklogsMoveRequest.ts @@ -0,0 +1,6 @@ +export interface WorklogsMoveRequest { + /** A list of worklog IDs. */ + ids?: number[]; + /** The issue id or key of the destination issue */ + issueIdOrKey?: string; +} diff --git a/src/version2/models/workspaceDataPolicy.ts b/src/version2/models/workspaceDataPolicy.ts new file mode 100644 index 0000000000..cc0f7bcebb --- /dev/null +++ b/src/version2/models/workspaceDataPolicy.ts @@ -0,0 +1,5 @@ +/** Details about data policy. */ +export interface WorkspaceDataPolicy { + /** Whether the workspace contains any content inaccessible to the requesting application. */ + anyContentBlocked?: boolean; +} diff --git a/src/version2/myself.ts b/src/version2/myself.ts index 2930c9de48..be975fd2ec 100644 --- a/src/version2/myself.ts +++ b/src/version2/myself.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 Myself { @@ -17,6 +17,14 @@ export class Myself { * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the * instance. * + * These system preferences keys will be deprecated by 15/07/2024. You can still retrieve these keys, but it will not + * have any impact on Notification behaviour. + * + * - _user.notifications.watcher_ Whether the user gets notified when they are watcher. + * - _user.notifications.assignee_ Whether the user gets notified when they are assignee. + * - _user.notifications.reporter_ Whether the user gets notified when they are reporter. + * - _user.notifications.mentions_ Whether the user gets notified when they are mentions. + * * Use [ Update a user * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) * from the user management REST API to manage timezone and locale instead. @@ -35,6 +43,14 @@ export class Myself { * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the * instance. * + * These system preferences keys will be deprecated by 15/07/2024. You can still retrieve these keys, but it will not + * have any impact on Notification behaviour. + * + * - _user.notifications.watcher_ Whether the user gets notified when they are watcher. + * - _user.notifications.assignee_ Whether the user gets notified when they are assignee. + * - _user.notifications.reporter_ Whether the user gets notified when they are reporter. + * - _user.notifications.mentions_ Whether the user gets notified when they are mentions. + * * Use [ Update a user * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) * from the user management REST API to manage timezone and locale instead. @@ -61,18 +77,26 @@ export class Myself { * following keys define system preferences that can be set or created: * * - _user.notifications.mimetype_ The mime type used in notifications sent to the user. Defaults to `html`. - * - _user.notify.own.changes_ Whether the user gets notified of their own changes. Defaults to `false`. * - _user.default.share.private_ Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. * Defaults to `true`. * - _user.keyboard.shortcuts.disabled_ Whether keyboard shortcuts are disabled. Defaults to `false`. * - _user.autowatch.disabled_ Whether the user automatically watches issues they create or add a comment to. By * default, not set: the user takes the instance autowatch setting. + * - _user.notifiy.own.changes_ Whether the user gets notified of their own changes. * * Note that these keys are deprecated: * * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. * + * These system preferences keys will be deprecated by 15/07/2024. You can still use these keys to create arbitrary + * preferences, but it will not have any impact on Notification behaviour. + * + * - _user.notifications.watcher_ Whether the user gets notified when they are watcher. + * - _user.notifications.assignee_ Whether the user gets notified when they are assignee. + * - _user.notifications.reporter_ Whether the user gets notified when they are reporter. + * - _user.notifications.mentions_ Whether the user gets notified when they are mentions. + * * Use [ Update a user * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) * from the user management REST API to manage timezone and locale instead. @@ -87,18 +111,26 @@ export class Myself { * following keys define system preferences that can be set or created: * * - _user.notifications.mimetype_ The mime type used in notifications sent to the user. Defaults to `html`. - * - _user.notify.own.changes_ Whether the user gets notified of their own changes. Defaults to `false`. * - _user.default.share.private_ Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. * Defaults to `true`. * - _user.keyboard.shortcuts.disabled_ Whether keyboard shortcuts are disabled. Defaults to `false`. * - _user.autowatch.disabled_ Whether the user automatically watches issues they create or add a comment to. By * default, not set: the user takes the instance autowatch setting. + * - _user.notifiy.own.changes_ Whether the user gets notified of their own changes. * * Note that these keys are deprecated: * * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. * + * These system preferences keys will be deprecated by 15/07/2024. You can still use these keys to create arbitrary + * preferences, but it will not have any impact on Notification behaviour. + * + * - _user.notifications.watcher_ Whether the user gets notified when they are watcher. + * - _user.notifications.assignee_ Whether the user gets notified when they are assignee. + * - _user.notifications.reporter_ Whether the user gets notified when they are reporter. + * - _user.notifications.mentions_ Whether the user gets notified when they are mentions. + * * Use [ Update a user * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) * from the user management REST API to manage timezone and locale instead. diff --git a/src/version2/parameters/addActorUsers.ts b/src/version2/parameters/addActorUsers.ts index 1451229935..6068b4dace 100644 --- a/src/version2/parameters/addActorUsers.ts +++ b/src/version2/parameters/addActorUsers.ts @@ -2,7 +2,7 @@ import { ActorsMap } from '../models'; export interface AddActorUsers extends ActorsMap { /** The project ID or project key (case-sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role * IDs. diff --git a/src/version2/parameters/addAtlassianTeam.ts b/src/version2/parameters/addAtlassianTeam.ts new file mode 100644 index 0000000000..6563e62556 --- /dev/null +++ b/src/version2/parameters/addAtlassianTeam.ts @@ -0,0 +1,6 @@ +import { AddAtlassianTeamRequest } from '../models'; + +export interface AddAtlassianTeam extends AddAtlassianTeamRequest { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version2/parameters/addNotifications.ts b/src/version2/parameters/addNotifications.ts new file mode 100644 index 0000000000..2678cd06c1 --- /dev/null +++ b/src/version2/parameters/addNotifications.ts @@ -0,0 +1,6 @@ +import { AddNotificationsDetails } from '../models'; + +export interface AddNotifications extends AddNotificationsDetails { + /** The ID of the notification scheme. */ + id: string; +} diff --git a/src/version2/parameters/archivePlan.ts b/src/version2/parameters/archivePlan.ts new file mode 100644 index 0000000000..250cc9759f --- /dev/null +++ b/src/version2/parameters/archivePlan.ts @@ -0,0 +1,4 @@ +export interface ArchivePlan { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version2/parameters/archiveProject.ts b/src/version2/parameters/archiveProject.ts index 6030877bc8..21f2d1c389 100644 --- a/src/version2/parameters/archiveProject.ts +++ b/src/version2/parameters/archiveProject.ts @@ -1,4 +1,4 @@ export interface ArchiveProject { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version2/parameters/bulkDeleteWorklogs.ts b/src/version2/parameters/bulkDeleteWorklogs.ts new file mode 100644 index 0000000000..65e9d6883d --- /dev/null +++ b/src/version2/parameters/bulkDeleteWorklogs.ts @@ -0,0 +1,19 @@ +import { WorklogIdsRequest } from '../models'; + +export interface BulkDeleteWorklogs extends WorklogIdsRequest { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * Defines how to update the issue's time estimate, the options are: + * + * `leave` Leaves the estimate unchanged. `auto` Reduces the estimate by the aggregate value of `timeSpent` across all + * worklogs being deleted. + */ + adjustEstimate?: 'leave' | 'auto' | string; + /** + * Whether the work log entries should be removed to the issue even if the issue is not editable, because + * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with + * admin permission can use this flag. + */ + overrideEditableFlag?: boolean; +} diff --git a/src/version2/parameters/bulkFetchIssues.ts b/src/version2/parameters/bulkFetchIssues.ts new file mode 100644 index 0000000000..776528ddf2 --- /dev/null +++ b/src/version2/parameters/bulkFetchIssues.ts @@ -0,0 +1,66 @@ +export interface BulkFetchIssues { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about issues in the response. Note that, unlike the majority of instances where `expand` is specified, + * `expand` is defined as a list of values. The expand options are: + * + * - `renderedFields` Returns field values rendered in HTML format. + * - `names` Returns the display name of each field. + * - `schema` Returns the schema describing a field type. + * - `transitions` Returns all possible transitions for the issue. + * - `operations` Returns all possible operations for the issue. + * - `editmeta` Returns information about how each field can be edited. + * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each + * version of a field's value, with the highest numbered item representing the most recent version. + */ + expand?: + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | string + | ( + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | string + )[]; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a + * comma-separated list. Expand options include: + * + * `*all` Returns all fields. `*navigable` Returns navigable fields. Any issue field, prefixed with a minus to + * exclude. + * + * The default is `*navigable`. + * + * Examples: + * + * `summary,comment` Returns the summary and comments fields only. `-description` Returns all navigable (default) + * fields except description. `*all,-comment` Returns all fields except comments. + * + * Multiple `fields` parameters can be included in a request. + * + * Note: All navigable fields are returned by default. This differs from [GET issue](#api-rest-api-2-issue-issueIdOrKey-get) where the default is all fields. + */ + fields?: string[]; + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys?: boolean; + /** An array of issue IDs or issue keys to fetch. You can mix issue IDs and keys in the same query. */ + issueIdsOrKeys: string[]; + /** + * A list of issue property keys of issue properties to be included in the results. A maximum of 5 issue property keys + * can be specified. + */ + properties?: string[]; +} diff --git a/src/version2/parameters/bulkMoveWorklogs.ts b/src/version2/parameters/bulkMoveWorklogs.ts new file mode 100644 index 0000000000..6e87b7d393 --- /dev/null +++ b/src/version2/parameters/bulkMoveWorklogs.ts @@ -0,0 +1,20 @@ +import { WorklogsMoveRequest } from '../models'; + +export interface BulkMoveWorklogs { + issueIdOrKey: string; + /** + * Defines how to update the issues' time estimate, the options are: + * + * - `leave` Leaves the estimate unchanged. + * - `auto` Reduces the estimate by the aggregate value of `timeSpent` across all worklogs being moved in the source + * issue, and increases it in the destination issue. + */ + adjustEstimate?: 'leave' | 'auto' | string; + /** + * Whether the work log entry should be moved to and from the issues even if the issues are not editable, because + * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with + * admin permission can use this flag. + */ + overrideEditableFlag?: boolean; + worklogs: WorklogsMoveRequest; +} diff --git a/src/version2/parameters/copyDashboard.ts b/src/version2/parameters/copyDashboard.ts index 1e157d012e..905415da28 100644 --- a/src/version2/parameters/copyDashboard.ts +++ b/src/version2/parameters/copyDashboard.ts @@ -2,4 +2,9 @@ import { DashboardDetails } from '../models'; export interface CopyDashboard extends DashboardDetails { id: string; + /** + * Whether admin level permissions are used. It should only be true if the user has _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) + */ + extendAdminPermissions?: boolean; } diff --git a/src/version2/parameters/countIssues.ts b/src/version2/parameters/countIssues.ts new file mode 100644 index 0000000000..527120f2a4 --- /dev/null +++ b/src/version2/parameters/countIssues.ts @@ -0,0 +1,3 @@ +import { JQLCountRequest } from '../models'; + +export interface CountIssues extends JQLCountRequest {} diff --git a/src/version2/parameters/createDashboard.ts b/src/version2/parameters/createDashboard.ts index eb78135c41..372243bbac 100644 --- a/src/version2/parameters/createDashboard.ts +++ b/src/version2/parameters/createDashboard.ts @@ -3,4 +3,9 @@ import { DashboardDetails, SharePermission } from '../models'; export interface CreateDashboard extends Omit { /** The edit permissions for the dashboard. */ editPermissions?: SharePermission[]; + /** + * Whether admin level permissions are used. It should only be true if the user has _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) + */ + extendAdminPermissions?: boolean; } diff --git a/src/version2/parameters/createIssueTypeAvatar.ts b/src/version2/parameters/createIssueTypeAvatar.ts index ba645723db..b463b3f791 100644 --- a/src/version2/parameters/createIssueTypeAvatar.ts +++ b/src/version2/parameters/createIssueTypeAvatar.ts @@ -5,6 +5,12 @@ export interface CreateIssueTypeAvatar { x?: number; /** The Y coordinate of the top-left corner of the crop region. */ y?: number; - /** The length of each side of the crop region. */ - size: number; + /** + * The length of each side of the crop region. + * + * @default 0 + */ + size?: number; + mimeType: string; + avatar: Buffer | ArrayBuffer | Uint8Array; } diff --git a/src/version2/parameters/createPlan.ts b/src/version2/parameters/createPlan.ts new file mode 100644 index 0000000000..bd032ad93d --- /dev/null +++ b/src/version2/parameters/createPlan.ts @@ -0,0 +1,6 @@ +import { CreatePlanRequest } from '../models'; + +export interface CreatePlan extends CreatePlanRequest { + /** Whether to accept group IDs instead of group names. Group names are deprecated. */ + useGroupId?: boolean; +} diff --git a/src/version2/parameters/createPlanOnlyTeam.ts b/src/version2/parameters/createPlanOnlyTeam.ts new file mode 100644 index 0000000000..29915aabce --- /dev/null +++ b/src/version2/parameters/createPlanOnlyTeam.ts @@ -0,0 +1,6 @@ +import { CreatePlanOnlyTeamRequest } from '../models'; + +export interface CreatePlanOnlyTeam extends CreatePlanOnlyTeamRequest { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version2/parameters/createPriorityScheme.ts b/src/version2/parameters/createPriorityScheme.ts new file mode 100644 index 0000000000..0b4d135d0e --- /dev/null +++ b/src/version2/parameters/createPriorityScheme.ts @@ -0,0 +1,3 @@ +import { CreatePrioritySchemeDetails } from '../models'; + +export interface CreatePriorityScheme extends CreatePrioritySchemeDetails {} diff --git a/src/version2/parameters/createProjectAvatar.ts b/src/version2/parameters/createProjectAvatar.ts index cbc3eebfe5..16b8739cbd 100644 --- a/src/version2/parameters/createProjectAvatar.ts +++ b/src/version2/parameters/createProjectAvatar.ts @@ -1,11 +1,16 @@ export interface CreateProjectAvatar { /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; - avatar: any; + projectIdOrKey: string | number; /** The X coordinate of the top-left corner of the crop region. */ x?: number; /** The Y coordinate of the top-left corner of the crop region. */ y?: number; - /** The length of each side of the crop region. */ + /** + * The length of each side of the crop region. + * + * @default 0 + */ size?: number; + mimeType: string; + avatar: Buffer | ArrayBuffer | Uint8Array | any; } diff --git a/src/version2/parameters/createRelatedWork.ts b/src/version2/parameters/createRelatedWork.ts new file mode 100644 index 0000000000..e3c0616741 --- /dev/null +++ b/src/version2/parameters/createRelatedWork.ts @@ -0,0 +1,5 @@ +import { VersionRelatedWork } from '../models'; + +export interface CreateRelatedWork extends VersionRelatedWork { + id: string; +} diff --git a/src/version2/parameters/deleteActor.ts b/src/version2/parameters/deleteActor.ts index 0fe12c7572..d2afd2b430 100644 --- a/src/version2/parameters/deleteActor.ts +++ b/src/version2/parameters/deleteActor.ts @@ -1,6 +1,6 @@ export interface DeleteActor { /** The project ID or project key (case-sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role * IDs. diff --git a/src/version2/parameters/deleteComment.ts b/src/version2/parameters/deleteComment.ts index a06ad01e85..5050950ed1 100644 --- a/src/version2/parameters/deleteComment.ts +++ b/src/version2/parameters/deleteComment.ts @@ -3,4 +3,5 @@ export interface DeleteComment { issueIdOrKey: string; /** The ID of the comment. */ id: string; + parentId?: string; } diff --git a/src/version2/parameters/deletePlanOnlyTeam.ts b/src/version2/parameters/deletePlanOnlyTeam.ts new file mode 100644 index 0000000000..d87ea6bd4b --- /dev/null +++ b/src/version2/parameters/deletePlanOnlyTeam.ts @@ -0,0 +1,6 @@ +export interface DeletePlanOnlyTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the plan-only team. */ + planOnlyTeamId: number; +} diff --git a/src/version2/parameters/deletePriority.ts b/src/version2/parameters/deletePriority.ts new file mode 100644 index 0000000000..224cd5fc3d --- /dev/null +++ b/src/version2/parameters/deletePriority.ts @@ -0,0 +1,4 @@ +export interface DeletePriority { + /** The ID of the issue priority. */ + id: string; +} diff --git a/src/version2/parameters/deletePriorityScheme.ts b/src/version2/parameters/deletePriorityScheme.ts new file mode 100644 index 0000000000..3ac3ff970c --- /dev/null +++ b/src/version2/parameters/deletePriorityScheme.ts @@ -0,0 +1,4 @@ +export interface DeletePriorityScheme { + /** The priority scheme ID. */ + schemeId: number; +} diff --git a/src/version2/parameters/deleteProject.ts b/src/version2/parameters/deleteProject.ts index 618778ed43..41bb57bb4c 100644 --- a/src/version2/parameters/deleteProject.ts +++ b/src/version2/parameters/deleteProject.ts @@ -1,6 +1,6 @@ export interface DeleteProject { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** Whether this project is placed in the Jira recycle bin where it will be available for restoration. */ enableUndo?: boolean; } diff --git a/src/version2/parameters/deleteProjectAsynchronously.ts b/src/version2/parameters/deleteProjectAsynchronously.ts index 0c86e1e714..713570ef41 100644 --- a/src/version2/parameters/deleteProjectAsynchronously.ts +++ b/src/version2/parameters/deleteProjectAsynchronously.ts @@ -1,4 +1,4 @@ export interface DeleteProjectAsynchronously { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version2/parameters/deleteProjectAvatar.ts b/src/version2/parameters/deleteProjectAvatar.ts index db737d25af..78d2ed7859 100644 --- a/src/version2/parameters/deleteProjectAvatar.ts +++ b/src/version2/parameters/deleteProjectAvatar.ts @@ -1,6 +1,6 @@ export interface DeleteProjectAvatar { /** The project ID or (case-sensitive) key. */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** The ID of the avatar. */ id: number; } diff --git a/src/version2/parameters/deleteProjectProperty.ts b/src/version2/parameters/deleteProjectProperty.ts index 737828fb3c..981906bfc3 100644 --- a/src/version2/parameters/deleteProjectProperty.ts +++ b/src/version2/parameters/deleteProjectProperty.ts @@ -1,6 +1,6 @@ export interface DeleteProjectProperty { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** * The project property key. Use [Get project property keys](#api-rest-api-2-project-projectIdOrKey-properties-get) to * get a list of all project property keys. diff --git a/src/version2/parameters/deleteRelatedWork.ts b/src/version2/parameters/deleteRelatedWork.ts new file mode 100644 index 0000000000..2980e8f2e5 --- /dev/null +++ b/src/version2/parameters/deleteRelatedWork.ts @@ -0,0 +1,6 @@ +export interface DeleteRelatedWork { + /** The ID of the version that the target related work belongs to. */ + versionId: string; + /** The ID of the related work to delete. */ + relatedWorkId: string; +} diff --git a/src/version2/parameters/duplicatePlan.ts b/src/version2/parameters/duplicatePlan.ts new file mode 100644 index 0000000000..10a25d70f8 --- /dev/null +++ b/src/version2/parameters/duplicatePlan.ts @@ -0,0 +1,6 @@ +import { DuplicatePlanRequest } from '../models'; + +export interface DuplicatePlan extends DuplicatePlanRequest { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version2/parameters/editIssue.ts b/src/version2/parameters/editIssue.ts index 1be9cc59a8..f5ad5596df 100644 --- a/src/version2/parameters/editIssue.ts +++ b/src/version2/parameters/editIssue.ts @@ -23,7 +23,7 @@ export interface EditIssue extends IssueUpdateDetails { overrideEditableFlag?: boolean; /** * Whether the response should contain the issue with fields edited in this request. The returned issue will have the - * same format as in the [Get issue API](#api-rest-api-3-issue-issueidorkey-get). + * same format as in the [Get issue API](#api-rest-api-2-issue-issueidorkey-get). */ returnIssue?: boolean; /** The Get issue API expand parameter to use in the response if the `returnIssue` parameter is `true`. */ diff --git a/src/version2/parameters/evaluateJiraExpressionUsingEnhancedSearch.ts b/src/version2/parameters/evaluateJiraExpressionUsingEnhancedSearch.ts new file mode 100644 index 0000000000..299ff4d949 --- /dev/null +++ b/src/version2/parameters/evaluateJiraExpressionUsingEnhancedSearch.ts @@ -0,0 +1,13 @@ +import { JiraExpressionEvalUsingEnhancedSearchRequest } from '../models'; + +export interface EvaluateJiraExpressionUsingEnhancedSearch extends JiraExpressionEvalUsingEnhancedSearchRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts `meta.complexity` that returns information about the expression + * complexity. For example, the number of expensive operations used by the expression and how close the expression is + * to reaching the [complexity + * limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing + * and debugging your expressions. + */ + expand?: string; +} diff --git a/src/version2/parameters/findAssignableUsers.ts b/src/version2/parameters/findAssignableUsers.ts index 54f9e3a09f..78bb7397f6 100644 --- a/src/version2/parameters/findAssignableUsers.ts +++ b/src/version2/parameters/findAssignableUsers.ts @@ -20,6 +20,8 @@ export interface FindAssignableUsers { project?: string; /** The key of the issue. Required, unless `project` is specified. */ issueKey?: string; + /** The ID of the issue. Required, unless `issueKey` or `project` is specified. */ + issueId?: string; /** The index of the first item to return in a page of results (page offset). */ startAt?: number; /** diff --git a/src/version2/parameters/findComponentsForProjects.ts b/src/version2/parameters/findComponentsForProjects.ts new file mode 100644 index 0000000000..018417db88 --- /dev/null +++ b/src/version2/parameters/findComponentsForProjects.ts @@ -0,0 +1,19 @@ +export interface FindComponentsForProjects { + /** The project IDs and/or project keys (case sensitive). */ + projectIdsOrKeys?: string[]; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * `description` Sorts by the component description. `name` Sorts by component name. + */ + orderBy?: 'description' | '-description' | '+description' | 'name' | '-name' | '+name' | string; + /** + * Filter the results using a literal string. Components with a matching `name` or `description` are returned (case + * insensitive). + */ + query?: string; +} diff --git a/src/version2/parameters/findUserKeysByQuery.ts b/src/version2/parameters/findUserKeysByQuery.ts index 14b12d1fd0..b6c92aef83 100644 --- a/src/version2/parameters/findUserKeysByQuery.ts +++ b/src/version2/parameters/findUserKeysByQuery.ts @@ -3,6 +3,12 @@ export interface FindUserKeysByQuery { query: string; /** The index of the first item to return in a page of results (page offset). */ startAt?: number; - /** The maximum number of items to return per page. */ + /** + * The maximum number of items to return per page. + * + * @deprecated Use `maxResult` instead. + */ maxResults?: number; + /** The maximum number of items to return per page. */ + maxResult?: number; } diff --git a/src/version2/parameters/getAllProjectAvatars.ts b/src/version2/parameters/getAllProjectAvatars.ts index ba78677a9f..ed47d2ffff 100644 --- a/src/version2/parameters/getAllProjectAvatars.ts +++ b/src/version2/parameters/getAllProjectAvatars.ts @@ -1,4 +1,4 @@ export interface GetAllProjectAvatars { /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version2/parameters/getAllStatuses.ts b/src/version2/parameters/getAllStatuses.ts index c82be96267..c10d765625 100644 --- a/src/version2/parameters/getAllStatuses.ts +++ b/src/version2/parameters/getAllStatuses.ts @@ -1,4 +1,4 @@ export interface GetAllStatuses { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version2/parameters/getAllUserDataClassificationLevels.ts b/src/version2/parameters/getAllUserDataClassificationLevels.ts new file mode 100644 index 0000000000..eb477fbdde --- /dev/null +++ b/src/version2/parameters/getAllUserDataClassificationLevels.ts @@ -0,0 +1,6 @@ +export interface GetAllUserDataClassificationLevels { + /** Optional set of statuses to filter by. */ + status?: ('PUBLISHED' | 'ARCHIVED' | 'DRAFT' | string)[]; + /** Ordering of the results by a given field. If not provided, values will not be sorted. */ + orderBy?: 'rank' | '-rank' | '+rank' | string; +} diff --git a/src/version2/parameters/getAtlassianTeam.ts b/src/version2/parameters/getAtlassianTeam.ts new file mode 100644 index 0000000000..b3bc42a2b5 --- /dev/null +++ b/src/version2/parameters/getAtlassianTeam.ts @@ -0,0 +1,6 @@ +export interface GetAtlassianTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the Atlassian team. */ + atlassianTeamId: string; +} diff --git a/src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts b/src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts new file mode 100644 index 0000000000..da7ba318f6 --- /dev/null +++ b/src/version2/parameters/getAvailablePrioritiesByPriorityScheme.ts @@ -0,0 +1,12 @@ +export interface GetAvailablePrioritiesByPriorityScheme { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** The string to query priorities on by name. */ + query?: string; + /** The priority scheme ID. */ + schemeId: string; + /** A list of priority IDs to exclude from the results. */ + exclude?: string[]; +} diff --git a/src/version2/parameters/getAvatars.ts b/src/version2/parameters/getAvatars.ts index 94f9acecf2..aa4d2b86be 100644 --- a/src/version2/parameters/getAvatars.ts +++ b/src/version2/parameters/getAvatars.ts @@ -2,5 +2,5 @@ export interface GetAvatars { /** The avatar type. */ type: 'project' | 'issuetype' | string; /** The ID of the item the avatar is associated with. */ - entityId: string; + entityId: number | string; } diff --git a/src/version2/parameters/getBulkChangelogs.ts b/src/version2/parameters/getBulkChangelogs.ts new file mode 100644 index 0000000000..fefc8eb77f --- /dev/null +++ b/src/version2/parameters/getBulkChangelogs.ts @@ -0,0 +1,3 @@ +import { BulkChangelogRequest } from '../models'; + +export interface GetBulkChangelogs extends BulkChangelogRequest {} diff --git a/src/version2/parameters/getBulkScreenTabs.ts b/src/version2/parameters/getBulkScreenTabs.ts new file mode 100644 index 0000000000..6f8227f85a --- /dev/null +++ b/src/version2/parameters/getBulkScreenTabs.ts @@ -0,0 +1,16 @@ +export interface GetBulkScreenTabs { + /** + * The list of screen IDs. To include multiple screen IDs, provide an ampersand-separated list. For example, + * `screenId=10000&screenId=10001`. + */ + screenId?: number[]; + /** + * The list of tab IDs. To include multiple tab IDs, provide an ampersand-separated list. For example, + * `tabId=10000&tabId=10001`. + */ + tabId?: number[]; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. The maximum number is 100, */ + maxResult?: number; +} diff --git a/src/version2/parameters/getCreateIssueMetaIssueTypeId.ts b/src/version2/parameters/getCreateIssueMetaIssueTypeId.ts new file mode 100644 index 0000000000..6195fc1f49 --- /dev/null +++ b/src/version2/parameters/getCreateIssueMetaIssueTypeId.ts @@ -0,0 +1,10 @@ +export interface GetCreateIssueMetaIssueTypeId { + /** The ID or key of the project. */ + projectIdOrKey: string; + /** The issuetype ID. */ + issueTypeId: string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getCreateIssueMetaIssueTypes.ts b/src/version2/parameters/getCreateIssueMetaIssueTypes.ts new file mode 100644 index 0000000000..dc20e141b5 --- /dev/null +++ b/src/version2/parameters/getCreateIssueMetaIssueTypes.ts @@ -0,0 +1,8 @@ +export interface GetCreateIssueMetaIssueTypes { + /** The ID or key of the project. */ + projectIdOrKey: string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getCustomFieldsConfigurations.ts b/src/version2/parameters/getCustomFieldsConfigurations.ts new file mode 100644 index 0000000000..7039e4b8ba --- /dev/null +++ b/src/version2/parameters/getCustomFieldsConfigurations.ts @@ -0,0 +1,34 @@ +import { ConfigurationsListParameters } from '../models'; + +export interface GetCustomFieldsConfigurations extends ConfigurationsListParameters { + /** + * The list of configuration IDs. To include multiple configurations, separate IDs with an ampersand: + * `id=10000&id=10001`. Can't be provided with `fieldContextId`, `issueId`, `projectKeyOrId`, or `issueTypeId`. + */ + id?: number[]; + /** + * The list of field context IDs. To include multiple field contexts, separate IDs with an ampersand: + * `fieldContextId=10000&fieldContextId=10001`. Can't be provided with `id`, `issueId`, `projectKeyOrId`, or + * `issueTypeId`. + */ + fieldContextId?: number[]; + /** + * The ID of the issue to filter results by. If the issue doesn't exist, an empty list is returned. Can't be provided + * with `projectKeyOrId`, or `issueTypeId`. + */ + issueId?: number; + /** + * The ID or key of the project to filter results by. Must be provided with `issueTypeId`. Can't be provided with + * `issueId`. + */ + projectKeyOrId?: string; + /** + * The ID of the issue type to filter results by. Must be provided with `projectKeyOrId`. Can't be provided with + * `issueId`. + */ + issueTypeId?: string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getDefaultProjectClassification.ts b/src/version2/parameters/getDefaultProjectClassification.ts new file mode 100644 index 0000000000..cf8683da7a --- /dev/null +++ b/src/version2/parameters/getDefaultProjectClassification.ts @@ -0,0 +1,4 @@ +export interface GetDefaultProjectClassification { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; +} diff --git a/src/version2/parameters/getFeaturesForProject.ts b/src/version2/parameters/getFeaturesForProject.ts index 81902eb044..0e1567cd84 100644 --- a/src/version2/parameters/getFeaturesForProject.ts +++ b/src/version2/parameters/getFeaturesForProject.ts @@ -1,4 +1,4 @@ export interface GetFeaturesForProject { /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version2/parameters/getFieldConfigurationSchemeProjectMapping.ts b/src/version2/parameters/getFieldConfigurationSchemeProjectMapping.ts index fc16570b25..2bbc23e7ab 100644 --- a/src/version2/parameters/getFieldConfigurationSchemeProjectMapping.ts +++ b/src/version2/parameters/getFieldConfigurationSchemeProjectMapping.ts @@ -7,5 +7,5 @@ export interface GetFieldConfigurationSchemeProjectMapping { * The list of project IDs. To include multiple projects, separate IDs with ampersand: * `projectId=10000&projectId=10001`. */ - projectId: number[]; + projectId: (string | number)[]; } diff --git a/src/version2/parameters/getFiltersPaginated.ts b/src/version2/parameters/getFiltersPaginated.ts index 8dbaac430c..ea3bf95207 100644 --- a/src/version2/parameters/getFiltersPaginated.ts +++ b/src/version2/parameters/getFiltersPaginated.ts @@ -112,4 +112,10 @@ export interface GetFiltersPaginated { * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ overrideSharePermissions?: boolean; + /** + * When `true` this will perform a case-insensitive substring match for the provided `filterName`. When `false` the + * filter name will be searched using [full text search + * syntax](https://support.atlassian.com/jira-software-cloud/docs/search-for-issues-using-the-text-field/). + */ + isSubstringMatch?: boolean; } diff --git a/src/version2/parameters/getHierarchy.ts b/src/version2/parameters/getHierarchy.ts index 2ea2e76b1e..ee2ae8c627 100644 --- a/src/version2/parameters/getHierarchy.ts +++ b/src/version2/parameters/getHierarchy.ts @@ -1,4 +1,4 @@ export interface GetHierarchy { /** The ID of the project. */ - projectId: number; + projectId: string | number; } diff --git a/src/version2/parameters/getIssue.ts b/src/version2/parameters/getIssue.ts index 683b429396..5fb6802390 100644 --- a/src/version2/parameters/getIssue.ts +++ b/src/version2/parameters/getIssue.ts @@ -67,4 +67,10 @@ export interface GetIssue { * field. */ updateHistory?: boolean; + /** + * Whether to fail the request quickly in case of an error while loading fields for an issue. For `failFast=true`, if + * one field fails, the entire operation fails. For `failFast=false`, the operation will continue even if a field + * fails. It will return a valid response, but without values for the failed field(s). + */ + failFast?: boolean; } diff --git a/src/version2/parameters/getIssueLimitReport.ts b/src/version2/parameters/getIssueLimitReport.ts new file mode 100644 index 0000000000..288f038e99 --- /dev/null +++ b/src/version2/parameters/getIssueLimitReport.ts @@ -0,0 +1,10 @@ +import { IssueLimitReportRequest } from '../models'; + +export interface GetIssueLimitReport extends IssueLimitReportRequest { + /** + * Return issue keys instead of issue ids in the response. + * + * Usage: Add `?isReturningKeys=true` to the end of the path to request issue keys. + */ + isReturningKeys?: boolean; +} diff --git a/src/version2/parameters/getIssueTypeSchemeForProjects.ts b/src/version2/parameters/getIssueTypeSchemeForProjects.ts index 80a6339149..aaf455ca82 100644 --- a/src/version2/parameters/getIssueTypeSchemeForProjects.ts +++ b/src/version2/parameters/getIssueTypeSchemeForProjects.ts @@ -7,5 +7,5 @@ export interface GetIssueTypeSchemeForProjects { * The list of project IDs. To include multiple project IDs, provide an ampersand-separated list. For example, * `projectId=10000&projectId=10001`. */ - projectId: number[]; + projectId: (string | number)[]; } diff --git a/src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.ts b/src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.ts index 401790f9d7..82ac3fabdc 100644 --- a/src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.ts +++ b/src/version2/parameters/getIssueTypeScreenSchemeProjectAssociations.ts @@ -7,5 +7,5 @@ export interface GetIssueTypeScreenSchemeProjectAssociations { * The list of project IDs. To include multiple projects, separate IDs with ampersand: * `projectId=10000&projectId=10001`. */ - projectId: number[]; + projectId: (string | number)[]; } diff --git a/src/version2/parameters/getIssueTypesForProject.ts b/src/version2/parameters/getIssueTypesForProject.ts index 11d1f2e25a..b06312da99 100644 --- a/src/version2/parameters/getIssueTypesForProject.ts +++ b/src/version2/parameters/getIssueTypesForProject.ts @@ -1,6 +1,6 @@ export interface GetIssueTypesForProject { /** The ID of the project. */ - projectId: number; + projectId: string | number; /** * The level of the issue type to filter by. Use: * diff --git a/src/version2/parameters/getNotificationSchemeToProjectMappings.ts b/src/version2/parameters/getNotificationSchemeToProjectMappings.ts index 34cfec0e7b..bfb504e6e2 100644 --- a/src/version2/parameters/getNotificationSchemeToProjectMappings.ts +++ b/src/version2/parameters/getNotificationSchemeToProjectMappings.ts @@ -1,8 +1,8 @@ export interface GetNotificationSchemeToProjectMappings { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The list of notifications scheme IDs to be filtered out */ notificationSchemeId?: string[]; /** The list of project IDs to be filtered out */ diff --git a/src/version2/parameters/getPlan.ts b/src/version2/parameters/getPlan.ts new file mode 100644 index 0000000000..9ed1b0df18 --- /dev/null +++ b/src/version2/parameters/getPlan.ts @@ -0,0 +1,6 @@ +export interface GetPlan { + /** The ID of the plan. */ + planId: number; + /** Whether to return group IDs instead of group names. Group names are deprecated. */ + useGroupId?: boolean; +} diff --git a/src/version2/parameters/getPlanOnlyTeam.ts b/src/version2/parameters/getPlanOnlyTeam.ts new file mode 100644 index 0000000000..f48b73a426 --- /dev/null +++ b/src/version2/parameters/getPlanOnlyTeam.ts @@ -0,0 +1,6 @@ +export interface GetPlanOnlyTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the plan-only team. */ + planOnlyTeamId: number; +} diff --git a/src/version2/parameters/getPlans.ts b/src/version2/parameters/getPlans.ts new file mode 100644 index 0000000000..2633d4c9e8 --- /dev/null +++ b/src/version2/parameters/getPlans.ts @@ -0,0 +1,10 @@ +export interface GetPlans { + /** Whether to include trashed plans in the results. */ + includeTrashed?: boolean; + /** Whether to include archived plans in the results. */ + includeArchived?: boolean; + /** The cursor to start from. If not provided, the first page will be returned. */ + cursor?: string; + /** The maximum number of plans to return per page. The maximum value is 50. The default value is 50. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getPolicies.ts b/src/version2/parameters/getPolicies.ts new file mode 100644 index 0000000000..afba75fdec --- /dev/null +++ b/src/version2/parameters/getPolicies.ts @@ -0,0 +1,4 @@ +export interface GetPolicies { + /** A list of project identifiers. This parameter accepts a comma-separated list. */ + ids?: string; +} diff --git a/src/version2/parameters/getPrecomputations.ts b/src/version2/parameters/getPrecomputations.ts index 69e5f90059..bc668412fe 100644 --- a/src/version2/parameters/getPrecomputations.ts +++ b/src/version2/parameters/getPrecomputations.ts @@ -11,12 +11,13 @@ export interface GetPrecomputations { /** The maximum number of items to return per page. */ maxResults?: number; /** - * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * @deprecated [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a + * field: * - * - `functionKey` Sorts by the functionKey. - * - `used` Sorts by the used timestamp. - * - `created` Sorts by the created timestamp. - * - `updated` Sorts by the updated timestamp. + * - `functionKey` Sorts by the functionKey. + * - `used` Sorts by the used timestamp. + * - `created` Sorts by the created timestamp. + * - `updated` Sorts by the updated timestamp. */ filter?: string; orderBy?: diff --git a/src/version2/parameters/getPrecomputationsByID.ts b/src/version2/parameters/getPrecomputationsByID.ts new file mode 100644 index 0000000000..e0edd4b2df --- /dev/null +++ b/src/version2/parameters/getPrecomputationsByID.ts @@ -0,0 +1,11 @@ +import { JqlFunctionPrecomputationGetByIdRequest } from '../models'; + +export interface GetPrecomputationsByID extends JqlFunctionPrecomputationGetByIdRequest { + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * `functionKey` Sorts by the functionKey. `used` Sorts by the used timestamp. `created` Sorts by the created + * timestamp. `updated` Sorts by the updated timestamp. + */ + orderBy?: string; +} diff --git a/src/version2/parameters/getPrioritiesByPriorityScheme.ts b/src/version2/parameters/getPrioritiesByPriorityScheme.ts new file mode 100644 index 0000000000..6cd7fcedac --- /dev/null +++ b/src/version2/parameters/getPrioritiesByPriorityScheme.ts @@ -0,0 +1,8 @@ +export interface GetPrioritiesByPriorityScheme { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** The priority scheme ID. */ + schemeId: string; +} diff --git a/src/version2/parameters/getPrioritySchemes.ts b/src/version2/parameters/getPrioritySchemes.ts new file mode 100644 index 0000000000..b5917ef600 --- /dev/null +++ b/src/version2/parameters/getPrioritySchemes.ts @@ -0,0 +1,28 @@ +export interface GetPrioritySchemes { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** + * A set of priority IDs to filter by. To include multiple IDs, provide an ampersand-separated list. For example, + * `priorityId=10000&priorityId=10001`. + */ + priorityId?: number[]; + /** + * A set of priority scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `schemeId=10000&schemeId=10001`. + */ + schemeId?: number[]; + /** The name of scheme to search for. */ + schemeName?: string; + /** Whether only the default priority is returned. */ + onlyDefault?: boolean; + /** The ordering to return the priority schemes by. */ + orderBy?: 'name' | '+name' | '-name' | string; + /** + * A comma separated list of additional information to return. "priorities" will return priorities associated with the + * priority scheme. "projects" will return projects associated with the priority scheme. + * `expand=priorities,projects`. + */ + expand?: string; +} diff --git a/src/version2/parameters/getProjectComponents.ts b/src/version2/parameters/getProjectComponents.ts index 4bdde93bb0..5c47fd94d6 100644 --- a/src/version2/parameters/getProjectComponents.ts +++ b/src/version2/parameters/getProjectComponents.ts @@ -1,4 +1,12 @@ export interface GetProjectComponents { /** The project ID or project key (case sensitive). */ projectIdOrKey: string; + /** + * The source of the components to return. Can be `jira` (default), `compass` or `auto`. When `auto` is specified, the + * API will return connected Compass components if the project is opted into Compass, otherwise it will return Jira + * components. Defaults to `jira`. + * + * @default jira + */ + componentSource?: 'jira' | 'compass' | 'auto' | string; } diff --git a/src/version2/parameters/getProjectComponentsPaginated.ts b/src/version2/parameters/getProjectComponentsPaginated.ts index 5625e9ee39..f861052bd0 100644 --- a/src/version2/parameters/getProjectComponentsPaginated.ts +++ b/src/version2/parameters/getProjectComponentsPaginated.ts @@ -1,6 +1,6 @@ export interface GetProjectComponentsPaginated { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** The index of the first item to return in a page of results (page offset). */ startAt?: number; /** The maximum number of items to return per page. */ @@ -32,4 +32,12 @@ export interface GetProjectComponentsPaginated { * insensitive). */ query?: string; + /** + * The source of the components to return. Can be `jira` (default), `compass` or `auto`. When `auto` is specified, the + * API will return connected Compass components if the project is opted into Compass, otherwise it will return Jira + * components. Defaults to `jira`. + * + * @default jira + */ + componentSource?: 'jira' | 'compass' | 'auto' | string; } diff --git a/src/version2/parameters/getProjectEmail.ts b/src/version2/parameters/getProjectEmail.ts index e12df4811b..5a8b7e0ab5 100644 --- a/src/version2/parameters/getProjectEmail.ts +++ b/src/version2/parameters/getProjectEmail.ts @@ -1,4 +1,4 @@ export interface GetProjectEmail { /** The project ID. */ - projectId: number; + projectId: string | number; } diff --git a/src/version2/parameters/getProjectIssueTypeUsagesForStatus.ts b/src/version2/parameters/getProjectIssueTypeUsagesForStatus.ts new file mode 100644 index 0000000000..80deab4e9d --- /dev/null +++ b/src/version2/parameters/getProjectIssueTypeUsagesForStatus.ts @@ -0,0 +1,10 @@ +export interface GetProjectIssueTypeUsagesForStatus { + /** The statusId to fetch issue type usages for */ + statusId: string; + /** The projectId to fetch issue type usages for */ + projectId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getProjectProperty.ts b/src/version2/parameters/getProjectProperty.ts index 6391195772..bbccb2a75e 100644 --- a/src/version2/parameters/getProjectProperty.ts +++ b/src/version2/parameters/getProjectProperty.ts @@ -1,6 +1,6 @@ export interface GetProjectProperty { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** * The project property key. Use [Get project property keys](#api-rest-api-2-project-projectIdOrKey-properties-get) to * get a list of all project property keys. diff --git a/src/version2/parameters/getProjectPropertyKeys.ts b/src/version2/parameters/getProjectPropertyKeys.ts index 0774dabd91..ed63fb62bb 100644 --- a/src/version2/parameters/getProjectPropertyKeys.ts +++ b/src/version2/parameters/getProjectPropertyKeys.ts @@ -1,4 +1,4 @@ export interface GetProjectPropertyKeys { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version2/parameters/getProjectRole.ts b/src/version2/parameters/getProjectRole.ts index 4744a48b91..9e20884faf 100644 --- a/src/version2/parameters/getProjectRole.ts +++ b/src/version2/parameters/getProjectRole.ts @@ -1,6 +1,6 @@ export interface GetProjectRole { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role * IDs. diff --git a/src/version2/parameters/getProjectRoleDetails.ts b/src/version2/parameters/getProjectRoleDetails.ts index 4ec30420fc..4330c48a78 100644 --- a/src/version2/parameters/getProjectRoleDetails.ts +++ b/src/version2/parameters/getProjectRoleDetails.ts @@ -1,6 +1,6 @@ export interface GetProjectRoleDetails { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** Whether the roles should be filtered to include only those the user is assigned to. */ currentMember?: boolean; excludeConnectAddons?: boolean; diff --git a/src/version2/parameters/getProjectRoles.ts b/src/version2/parameters/getProjectRoles.ts index 6de9e0b486..3f5792c849 100644 --- a/src/version2/parameters/getProjectRoles.ts +++ b/src/version2/parameters/getProjectRoles.ts @@ -1,4 +1,4 @@ export interface GetProjectRoles { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version2/parameters/getProjectUsagesForStatus.ts b/src/version2/parameters/getProjectUsagesForStatus.ts new file mode 100644 index 0000000000..0e8913c901 --- /dev/null +++ b/src/version2/parameters/getProjectUsagesForStatus.ts @@ -0,0 +1,8 @@ +export interface GetProjectUsagesForStatus { + /** The statusId to fetch project usages for */ + statusId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getProjectUsagesForWorkflow.ts b/src/version2/parameters/getProjectUsagesForWorkflow.ts new file mode 100644 index 0000000000..e70544f1f4 --- /dev/null +++ b/src/version2/parameters/getProjectUsagesForWorkflow.ts @@ -0,0 +1,8 @@ +export interface GetProjectUsagesForWorkflow { + /** The workflow ID */ + workflowId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getProjectUsagesForWorkflowScheme.ts b/src/version2/parameters/getProjectUsagesForWorkflowScheme.ts new file mode 100644 index 0000000000..0266959608 --- /dev/null +++ b/src/version2/parameters/getProjectUsagesForWorkflowScheme.ts @@ -0,0 +1,8 @@ +export interface GetProjectUsagesForWorkflowScheme { + /** The workflow scheme ID */ + workflowSchemeId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getProjectVersions.ts b/src/version2/parameters/getProjectVersions.ts index e717caade7..27c96b0c7c 100644 --- a/src/version2/parameters/getProjectVersions.ts +++ b/src/version2/parameters/getProjectVersions.ts @@ -1,6 +1,6 @@ export interface GetProjectVersions { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional * information in the response. This parameter accepts `operations`, which returns actions that can be performed on diff --git a/src/version2/parameters/getProjectVersionsPaginated.ts b/src/version2/parameters/getProjectVersionsPaginated.ts index ed3176eda9..46df6f405d 100644 --- a/src/version2/parameters/getProjectVersionsPaginated.ts +++ b/src/version2/parameters/getProjectVersionsPaginated.ts @@ -1,6 +1,6 @@ export interface GetProjectVersionsPaginated { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** The index of the first item to return in a page of results (page offset). */ startAt?: number; /** The maximum number of items to return per page. */ diff --git a/src/version2/parameters/getProjectsByPriorityScheme.ts b/src/version2/parameters/getProjectsByPriorityScheme.ts new file mode 100644 index 0000000000..607505f6d4 --- /dev/null +++ b/src/version2/parameters/getProjectsByPriorityScheme.ts @@ -0,0 +1,12 @@ +export interface GetProjectsByPriorityScheme { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** The project IDs to filter by. For example, `projectId=10000&projectId=10001`. */ + projectId?: number[]; + /** The priority scheme ID. */ + schemeId: string; + /** The string to query projects on by name. */ + query?: string; +} diff --git a/src/version2/parameters/getRelatedWork.ts b/src/version2/parameters/getRelatedWork.ts new file mode 100644 index 0000000000..b6388182d0 --- /dev/null +++ b/src/version2/parameters/getRelatedWork.ts @@ -0,0 +1,4 @@ +export interface GetRelatedWork { + /** The ID of the version. */ + id: string; +} diff --git a/src/version2/parameters/getResolution.ts b/src/version2/parameters/getResolution.ts new file mode 100644 index 0000000000..13eba23264 --- /dev/null +++ b/src/version2/parameters/getResolution.ts @@ -0,0 +1,4 @@ +export interface GetResolution { + /** The ID of the issue resolution value. */ + id: string; +} diff --git a/src/version2/parameters/getSecurityLevelMembers.ts b/src/version2/parameters/getSecurityLevelMembers.ts index 1c16a7eaad..ceb2e31ef6 100644 --- a/src/version2/parameters/getSecurityLevelMembers.ts +++ b/src/version2/parameters/getSecurityLevelMembers.ts @@ -1,8 +1,8 @@ export interface GetSecurityLevelMembers { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** * The list of issue security level member IDs. To include multiple issue security level members separate IDs with an * ampersand: `id=10000&id=10001`. diff --git a/src/version2/parameters/getSecurityLevels.ts b/src/version2/parameters/getSecurityLevels.ts index 7b2fccad02..cd8503604b 100644 --- a/src/version2/parameters/getSecurityLevels.ts +++ b/src/version2/parameters/getSecurityLevels.ts @@ -1,8 +1,8 @@ export interface GetSecurityLevels { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** * The list of issue security scheme level IDs. To include multiple issue security levels, separate IDs with an * ampersand: `id=10000&id=10001`. diff --git a/src/version2/parameters/getStatusesById.ts b/src/version2/parameters/getStatusesById.ts index 2e1fd4d629..6fcf7cea09 100644 --- a/src/version2/parameters/getStatusesById.ts +++ b/src/version2/parameters/getStatusesById.ts @@ -1,10 +1,13 @@ export interface GetStatusesById { /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Expand options include: + * @deprecated See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298) for details. * - * - `usages` Returns the project and issue types that use the status in their workflow. - * - `workflowUsages` Returns the workflows that use the status. + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `usages` Returns the project and issue types that use the status in their workflow. + * - `workflowUsages` Returns the workflows that use the status. */ expand?: 'usages' | 'workflowUsages' | ('usages' | 'workflowUsages')[] | string | string[]; /** diff --git a/src/version2/parameters/getTeams.ts b/src/version2/parameters/getTeams.ts new file mode 100644 index 0000000000..289f646714 --- /dev/null +++ b/src/version2/parameters/getTeams.ts @@ -0,0 +1,8 @@ +export interface GetTeams { + /** The ID of the plan. */ + planId: number; + /** The cursor to start from. If not provided, the first page will be returned. */ + cursor?: string; + /** The maximum number of plan teams to return per page. The maximum value is 50. The default value is 50. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getWorkflowProjectIssueTypeUsages.ts b/src/version2/parameters/getWorkflowProjectIssueTypeUsages.ts new file mode 100644 index 0000000000..42ce81e475 --- /dev/null +++ b/src/version2/parameters/getWorkflowProjectIssueTypeUsages.ts @@ -0,0 +1,10 @@ +export interface GetWorkflowProjectIssueTypeUsages { + /** The workflow ID */ + workflowId: string; + /** The project ID */ + projectId: number; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getWorkflowSchemeProjectAssociations.ts b/src/version2/parameters/getWorkflowSchemeProjectAssociations.ts index 5aa19373fd..e39ce06f95 100644 --- a/src/version2/parameters/getWorkflowSchemeProjectAssociations.ts +++ b/src/version2/parameters/getWorkflowSchemeProjectAssociations.ts @@ -3,5 +3,5 @@ export interface GetWorkflowSchemeProjectAssociations { * The ID of a project to return the workflow schemes for. To include multiple projects, provide an ampersand-Jim: * oneseparated list. For example, `projectId=10000&projectId=10001`. */ - projectId: number[]; + projectId: (string | number)[]; } diff --git a/src/version2/parameters/getWorkflowSchemeUsagesForWorkflow.ts b/src/version2/parameters/getWorkflowSchemeUsagesForWorkflow.ts new file mode 100644 index 0000000000..dae488d332 --- /dev/null +++ b/src/version2/parameters/getWorkflowSchemeUsagesForWorkflow.ts @@ -0,0 +1,8 @@ +export interface GetWorkflowSchemeUsagesForWorkflow { + /** The workflow ID */ + workflowId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version2/parameters/getWorkflowUsagesForStatus.ts b/src/version2/parameters/getWorkflowUsagesForStatus.ts new file mode 100644 index 0000000000..cdfb21d971 --- /dev/null +++ b/src/version2/parameters/getWorkflowUsagesForStatus.ts @@ -0,0 +1,8 @@ +export interface GetWorkflowUsagesForStatus { + /** The statusId to fetch workflow usages for */ + statusId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version2/parameters/index.ts b/src/version2/parameters/index.ts index a008d2208b..44d7d693f6 100644 --- a/src/version2/parameters/index.ts +++ b/src/version2/parameters/index.ts @@ -1,10 +1,12 @@ export * from './addActorUsers'; +export * from './addAtlassianTeam'; export * from './addAttachment'; export * from './addComment'; export * from './addFieldToDefaultScreen'; export * from './addGadget'; export * from './addIssueTypesToContext'; export * from './addIssueTypesToIssueTypeScheme'; +export * from './addNotifications'; export * from './addProjectRoleActorsToRole'; export * from './addScreenTab'; export * from './addScreenTabField'; @@ -19,6 +21,7 @@ export * from './analyseExpression'; export * from './appendMappingsForIssueTypeScreenScheme'; export * from './archiveIssues'; export * from './archiveIssuesAsync'; +export * from './archivePlan'; export * from './archiveProject'; export * from './assignFieldConfigurationSchemeToProject'; export * from './assignIssue'; @@ -29,16 +32,20 @@ export * from './assignProjectsToCustomFieldContext'; export * from './assignSchemeToProject'; export * from './associateSchemesToProjects'; export * from './bulkDeleteIssueProperty'; +export * from './bulkDeleteWorklogs'; export * from './bulkEditDashboards'; +export * from './bulkFetchIssues'; export * from './bulkGetGroups'; export * from './bulkGetUsers'; export * from './bulkGetUsersMigration'; +export * from './bulkMoveWorklogs'; export * from './bulkSetIssuePropertiesByIssue'; export * from './bulkSetIssueProperty'; export * from './bulkSetIssuesProperties'; export * from './cancelTask'; export * from './changeFilterOwner'; export * from './copyDashboard'; +export * from './countIssues'; export * from './createComponent'; export * from './createCustomField'; export * from './createCustomFieldContext'; @@ -61,11 +68,15 @@ export * from './createNotificationScheme'; export * from './createOrUpdateRemoteIssueLink'; export * from './createPermissionGrant'; export * from './createPermissionScheme'; +export * from './createPlan'; +export * from './createPlanOnlyTeam'; export * from './createPriority'; +export * from './createPriorityScheme'; export * from './createProject'; export * from './createProjectAvatar'; export * from './createProjectCategory'; export * from './createProjectRole'; +export * from './createRelatedWork'; export * from './createResolution'; export * from './createScreen'; export * from './createScreenScheme'; @@ -111,12 +122,16 @@ export * from './deleteIssueTypeScreenScheme'; export * from './deleteNotificationScheme'; export * from './deletePermissionScheme'; export * from './deletePermissionSchemeEntity'; +export * from './deletePlanOnlyTeam'; +export * from './deletePriority'; +export * from './deletePriorityScheme'; export * from './deleteProject'; export * from './deleteProjectAsynchronously'; export * from './deleteProjectAvatar'; export * from './deleteProjectProperty'; export * from './deleteProjectRole'; export * from './deleteProjectRoleActorsFromRole'; +export * from './deleteRelatedWork'; export * from './deleteRemoteIssueLinkByGlobalId'; export * from './deleteRemoteIssueLinkById'; export * from './deleteResolution'; @@ -139,13 +154,16 @@ export * from './deleteWorkflowTransitionRuleConfigurations'; export * from './deleteWorklog'; export * from './deleteWorklogProperty'; export * from './doTransition'; +export * from './duplicatePlan'; export * from './editIssue'; export * from './evaluateJiraExpression'; +export * from './evaluateJiraExpressionUsingEnhancedSearch'; export * from './expandAttachmentForHumans'; export * from './expandAttachmentForMachines'; export * from './exportArchivedIssues'; export * from './findAssignableUsers'; export * from './findBulkAssignableUsers'; +export * from './findComponentsForProjects'; export * from './findGroups'; export * from './findUserKeysByQuery'; export * from './findUsers'; @@ -171,6 +189,7 @@ export * from './getAllScreenTabFields'; export * from './getAllScreenTabs'; export * from './getAllStatuses'; export * from './getAllSystemAvatars'; +export * from './getAllUserDataClassificationLevels'; export * from './getAllUsers'; export * from './getAllUsersDefault'; export * from './getAllWorkflowSchemes'; @@ -178,17 +197,21 @@ export * from './getAlternativeIssueTypes'; export * from './getApplicationProperty'; export * from './getApplicationRole'; export * from './getAssignedPermissionScheme'; +export * from './getAtlassianTeam'; export * from './getAttachment'; export * from './getAttachmentContent'; export * from './getAttachmentThumbnail'; export * from './getAuditRecords'; export * from './getAutoCompletePost'; +export * from './getAvailablePrioritiesByPriorityScheme'; export * from './getAvailableScreenFields'; export * from './getAvatarImageByID'; export * from './getAvatarImageByOwner'; export * from './getAvatarImageByType'; export * from './getAvatars'; +export * from './getBulkChangelogs'; export * from './getBulkPermissions'; +export * from './getBulkScreenTabs'; export * from './getChangeLogs'; export * from './getChangeLogsByIds'; export * from './getColumns'; @@ -201,14 +224,18 @@ export * from './getComponent'; export * from './getComponentRelatedIssues'; export * from './getContextsForField'; export * from './getCreateIssueMeta'; +export * from './getCreateIssueMetaIssueTypeId'; +export * from './getCreateIssueMetaIssueTypes'; export * from './getCurrentUser'; export * from './getCustomFieldConfiguration'; export * from './getCustomFieldContextsForProjectsAndIssueTypes'; export * from './getCustomFieldOption'; +export * from './getCustomFieldsConfigurations'; export * from './getDashboard'; export * from './getDashboardItemProperty'; export * from './getDashboardItemPropertyKeys'; export * from './getDashboardsPaginated'; +export * from './getDefaultProjectClassification'; export * from './getDefaultValues'; export * from './getDefaultWorkflow'; export * from './getDraftDefaultWorkflow'; @@ -230,6 +257,7 @@ export * from './getIdsOfWorklogsDeletedSince'; export * from './getIdsOfWorklogsModifiedSince'; export * from './getIssue'; export * from './getIssueFieldOption'; +export * from './getIssueLimitReport'; export * from './getIssueLink'; export * from './getIssueLinkType'; export * from './getIssuePickerResource'; @@ -262,9 +290,16 @@ export * from './getPermissionScheme'; export * from './getPermissionSchemeGrant'; export * from './getPermissionSchemeGrants'; export * from './getPermittedProjects'; +export * from './getPlan'; +export * from './getPlanOnlyTeam'; +export * from './getPlans'; +export * from './getPolicies'; export * from './getPrecomputations'; +export * from './getPrecomputationsByID'; export * from './getPreference'; +export * from './getPrioritiesByPriorityScheme'; export * from './getPriority'; +export * from './getPrioritySchemes'; export * from './getProject'; export * from './getProjectCategoryById'; export * from './getProjectComponents'; @@ -272,6 +307,7 @@ export * from './getProjectComponentsPaginated'; export * from './getProjectContextMapping'; export * from './getProjectEmail'; export * from './getProjectIssueSecurityScheme'; +export * from './getProjectIssueTypeUsagesForStatus'; export * from './getProjectProperty'; export * from './getProjectPropertyKeys'; export * from './getProjectRole'; @@ -279,13 +315,19 @@ export * from './getProjectRoleActorsForRole'; export * from './getProjectRoleById'; export * from './getProjectRoleDetails'; export * from './getProjectRoles'; +export * from './getProjectsByPriorityScheme'; export * from './getProjectsForIssueTypeScreenScheme'; export * from './getProjectTypeByKey'; +export * from './getProjectUsagesForStatus'; +export * from './getProjectUsagesForWorkflow'; +export * from './getProjectUsagesForWorkflowScheme'; export * from './getProjectVersions'; export * from './getProjectVersionsPaginated'; export * from './getRecent'; +export * from './getRelatedWork'; export * from './getRemoteIssueLinkById'; export * from './getRemoteIssueLinks'; +export * from './getResolution'; export * from './getScreens'; export * from './getScreenSchemes'; export * from './getScreensForField'; @@ -299,6 +341,7 @@ export * from './getStatus'; export * from './getStatusCategory'; export * from './getStatusesById'; export * from './getTask'; +export * from './getTeams'; export * from './getTransitions'; export * from './getTrashedFieldsPaginated'; export * from './getUiModifications'; @@ -318,14 +361,17 @@ export * from './getVersionUnresolvedIssues'; export * from './getVisibleIssueFieldOptions'; export * from './getVotes'; export * from './getWorkflow'; +export * from './getWorkflowProjectIssueTypeUsages'; export * from './getWorkflowScheme'; export * from './getWorkflowSchemeDraft'; export * from './getWorkflowSchemeDraftIssueType'; export * from './getWorkflowSchemeIssueType'; export * from './getWorkflowSchemeProjectAssociations'; +export * from './getWorkflowSchemeUsagesForWorkflow'; export * from './getWorkflowsPaginated'; export * from './getWorkflowTransitionProperties'; export * from './getWorkflowTransitionRuleConfigurations'; +export * from './getWorkflowUsagesForStatus'; export * from './getWorklog'; export * from './getWorklogProperty'; export * from './getWorklogPropertyKeys'; @@ -346,11 +392,14 @@ export * from './publishDraftWorkflowScheme'; export * from './putAddonProperty'; export * from './putAppProperty'; export * from './readWorkflows'; +export * from './readWorkflowSchemes'; export * from './refreshWebhooks'; export * from './registerDynamicWebhooks'; export * from './registerModules'; +export * from './removeAtlassianTeam'; export * from './removeAttachment'; export * from './removeCustomFieldContextFromProjects'; +export * from './removeDefaultProjectClassification'; export * from './removeGadget'; export * from './removeGroup'; export * from './removeIssueTypeFromIssueTypeScheme'; @@ -371,6 +420,7 @@ export * from './removeWatcher'; export * from './renameScreenTab'; export * from './reorderCustomFieldOptions'; export * from './reorderIssueTypesInIssueTypeScheme'; +export * from './replaceCustomFieldOption'; export * from './replaceIssueFieldOption'; export * from './resetColumns'; export * from './resetUserColumns'; @@ -378,14 +428,19 @@ export * from './restore'; export * from './restoreCustomField'; export * from './sanitiseJqlQueries'; export * from './search'; +export * from './searchForIssuesIds'; export * from './searchForIssuesUsingJql'; +export * from './searchForIssuesUsingJqlEnhancedSearch'; +export * from './searchForIssuesUsingJqlEnhancedSearchPost'; export * from './searchForIssuesUsingJqlPost'; export * from './searchPriorities'; export * from './searchProjects'; export * from './searchProjectsUsingSecuritySchemes'; export * from './searchResolutions'; export * from './searchSecuritySchemes'; +export * from './searchWorkflows'; export * from './selectTimeTrackingImplementation'; +export * from './services'; export * from './setActors'; export * from './setApplicationProperty'; export * from './setBanner'; @@ -410,9 +465,12 @@ export * from './setWorkflowSchemeDraftIssueType'; export * from './setWorkflowSchemeIssueType'; export * from './setWorklogProperty'; export * from './storeAvatar'; +export * from './suggestedPrioritiesForMappings'; export * from './toggleFeatureForProject'; export * from './trashCustomField'; +export * from './trashPlan'; export * from './unarchiveIssues'; +export * from './updateAtlassianTeam'; export * from './updateComment'; export * from './updateComponent'; export * from './updateCustomField'; @@ -421,6 +479,7 @@ export * from './updateCustomFieldContext'; export * from './updateCustomFieldOption'; export * from './updateCustomFieldValue'; export * from './updateDashboard'; +export * from './updateDefaultProjectClassification'; export * from './updateDefaultScreenScheme'; export * from './updateDefaultWorkflow'; export * from './updateDraftDefaultWorkflow'; @@ -441,14 +500,19 @@ export * from './updateIssueTypeScreenScheme'; export * from './updateMultipleCustomFieldValues'; export * from './updateNotificationScheme'; export * from './updatePermissionScheme'; +export * from './updatePlan'; +export * from './updatePlanOnlyTeam'; export * from './updatePrecomputations'; export * from './updatePriority'; +export * from './updatePriorityScheme'; export * from './updateProject'; export * from './updateProjectAvatar'; export * from './updateProjectCategory'; export * from './updateProjectEmail'; +export * from './updateRelatedWork'; export * from './updateRemoteIssueLink'; export * from './updateResolution'; +export * from './updateSchemes'; export * from './updateScreen'; export * from './updateScreenScheme'; export * from './updateSecurityLevel'; @@ -459,6 +523,7 @@ export * from './updateWorkflowMapping'; export * from './updateWorkflows'; export * from './updateWorkflowScheme'; export * from './updateWorkflowSchemeDraft'; +export * from './updateWorkflowSchemeMappings'; export * from './updateWorkflowTransitionProperty'; export * from './updateWorkflowTransitionRuleConfigurations'; export * from './updateWorklog'; diff --git a/src/version2/parameters/readWorkflowSchemes.ts b/src/version2/parameters/readWorkflowSchemes.ts new file mode 100644 index 0000000000..85984b43fe --- /dev/null +++ b/src/version2/parameters/readWorkflowSchemes.ts @@ -0,0 +1,14 @@ +import { WorkflowSchemeReadRequest } from '../models'; + +export interface ReadWorkflowSchemes extends WorkflowSchemeReadRequest { + /** + * Deprecated. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298) for details. + * + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `workflows.usages` Returns the project and issue types that each workflow in the workflow scheme is associated + * with. + */ + expand?: string; +} diff --git a/src/version2/parameters/readWorkflows.ts b/src/version2/parameters/readWorkflows.ts index c1248108f5..cc844a5386 100644 --- a/src/version2/parameters/readWorkflows.ts +++ b/src/version2/parameters/readWorkflows.ts @@ -1,18 +1,20 @@ import { ProjectAndIssueTypePair } from '../models'; export interface ReadWorkflows { + /** + * Return the new fields (`toStatusReference`/`links`) instead of the deprecated fields (`to`/`from`) for workflow + * transition port mappings. + */ + useTransitionLinksFormat?: boolean; + /** + * Return the new field `approvalConfiguration` instead of the deprecated status properties for approval + * configuration. + */ + useApprovalConfiguration?: boolean; /** The list of projects and issue types to query. */ projectAndIssueTypes?: ProjectAndIssueTypePair[]; /** The list of workflow IDs to query. */ workflowIds?: string[]; /** The list of workflow names to query. */ workflowNames?: string[]; - /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Expand options include: - * - * `workflows.usages` Returns the project and issue types that each workflow is associated with. `statuses.usages` - * Returns the project and issue types that each status is associated with. - */ - expand?: string; } diff --git a/src/version2/parameters/removeAtlassianTeam.ts b/src/version2/parameters/removeAtlassianTeam.ts new file mode 100644 index 0000000000..02650c1553 --- /dev/null +++ b/src/version2/parameters/removeAtlassianTeam.ts @@ -0,0 +1,6 @@ +export interface RemoveAtlassianTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the Atlassian team. */ + atlassianTeamId: string; +} diff --git a/src/version2/parameters/removeDefaultProjectClassification.ts b/src/version2/parameters/removeDefaultProjectClassification.ts new file mode 100644 index 0000000000..103f00b406 --- /dev/null +++ b/src/version2/parameters/removeDefaultProjectClassification.ts @@ -0,0 +1,4 @@ +export interface RemoveDefaultProjectClassification { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; +} diff --git a/src/version2/parameters/replaceCustomFieldOption.ts b/src/version2/parameters/replaceCustomFieldOption.ts new file mode 100644 index 0000000000..aa7b88be53 --- /dev/null +++ b/src/version2/parameters/replaceCustomFieldOption.ts @@ -0,0 +1,12 @@ +export interface ReplaceCustomFieldOption { + /** The ID of the option that will replace the currently selected option. */ + replaceWith?: number; + /** A JQL query that specifies the issues to be updated. For example, _project=10000_. */ + jql?: string; + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the option to be deselected. */ + optionId: number; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version2/parameters/restore.ts b/src/version2/parameters/restore.ts index 07853edc20..c8fd6ca5ef 100644 --- a/src/version2/parameters/restore.ts +++ b/src/version2/parameters/restore.ts @@ -1,4 +1,4 @@ export interface Restore { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version2/parameters/searchForIssuesIds.ts b/src/version2/parameters/searchForIssuesIds.ts new file mode 100644 index 0000000000..3c6179bc0b --- /dev/null +++ b/src/version2/parameters/searchForIssuesIds.ts @@ -0,0 +1,3 @@ +import { IdSearchRequest } from '../models'; + +export interface SearchForIssuesIds extends IdSearchRequest {} diff --git a/src/version2/parameters/searchForIssuesUsingJql.ts b/src/version2/parameters/searchForIssuesUsingJql.ts index bb85f45aeb..8e1a025a00 100644 --- a/src/version2/parameters/searchForIssuesUsingJql.ts +++ b/src/version2/parameters/searchForIssuesUsingJql.ts @@ -76,4 +76,10 @@ export interface SearchForIssuesUsingJql { properties?: string[]; /** Reference fields by their key (rather than ID). */ fieldsByKeys?: boolean; + /** + * Whether to fail the request quickly in case of an error while loading fields for an issue. For `failFast=true`, if + * one field fails, the entire operation fails. For `failFast=false`, the operation will continue even if a field + * fails. It will return a valid response, but without values for the failed field(s). + */ + failFast?: boolean; } diff --git a/src/version2/parameters/searchForIssuesUsingJqlEnhancedSearch.ts b/src/version2/parameters/searchForIssuesUsingJqlEnhancedSearch.ts new file mode 100644 index 0000000000..d40a56810d --- /dev/null +++ b/src/version2/parameters/searchForIssuesUsingJqlEnhancedSearch.ts @@ -0,0 +1,79 @@ +export interface SearchForIssuesUsingJqlEnhancedSearch { + /** + * The [JQL](https://confluence.atlassian.com/x/egORLQ) expression. For performance reasons, this parameter requires a + * bounded query. A bounded query is a query with a search restriction. + * + * - Example of an unbounded query: `order by key desc`. + * - Example of a bounded query: `assignee = currentUser() order by key`. + * + * Additionally, `orderBy` clause can contain a maximum of 7 fields. + */ + jql: string; + /** + * The token for a page to fetch that is not the first page. The first page has a `nextPageToken` of `null`. Use the + * `nextPageToken` to fetch the next page of issues. + */ + nextPageToken?: string; + /** + * The maximum number of items to return per page. To manage page size, API may return fewer items per page where a + * large number of fields are requested. The greatest number of items returned per page is achieved when requesting + * `id` or `key` only. + * + * It returns max 5000 issues. + * + * Default: `50` + * + * Format: `int32` + */ + maxResults?: number; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a + * comma-separated list. Expand options include: + * + * - `*all` Returns all fields. + * - `*navigable` Returns navigable fields. + * - `id` Returns only issue IDs. + * - Any issue field, prefixed with a minus to exclude. + * + * The default is `id`. + * + * Examples: + * + * - `summary,comment` Returns only the summary and comments fields. + * - `-description` Returns all navigable (default) fields except description. + * - `*all,-comment` Returns all fields except comments. + * + * Multiple `fields` parameters can be included in a request. + * + * Note: By default, this resource returns IDs only. This differs from [GET + * issue](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-issueidorkey-get) + * where the default is all fields. + */ + fields?: string[]; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information about issues in the response. Note that, unlike the majority of instances where `expand` is specified, + * `expand` is defined as a comma-delimited string of values. The expand options are: + * + * - `renderedFields` Returns field values rendered in HTML format. + * - `names` Returns the display name of each field. + * - `schema` Returns the schema describing a field type. + * - `transitions` Returns all possible transitions for the issue. + * - `operations` Returns all possible operations for the issue. + * - `editmeta` Returns information about how each field can be edited. + * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each + * version of a field's value, with the highest numbered item representing the most recent version. + * + * Examples: `names,changelog` Returns the display name of each field as well as a list of recent updates to an issue. + */ + expand?: string; + /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ + properties?: string[]; + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys?: boolean; + /** Fail this request early if we can't retrieve all field data. The default is `false`. */ + failFast?: boolean; + /** Strong consistency issue ids to be reconciled with search results. Accepts max 50 ids. All issues must exist. */ + reconcileIssues?: number[]; +} diff --git a/src/version2/parameters/searchForIssuesUsingJqlEnhancedSearchPost.ts b/src/version2/parameters/searchForIssuesUsingJqlEnhancedSearchPost.ts new file mode 100644 index 0000000000..f00326bc86 --- /dev/null +++ b/src/version2/parameters/searchForIssuesUsingJqlEnhancedSearchPost.ts @@ -0,0 +1,3 @@ +import { EnhancedSearchRequest } from '../models'; + +export interface SearchForIssuesUsingJqlEnhancedSearchPost extends EnhancedSearchRequest {} diff --git a/src/version2/parameters/searchPriorities.ts b/src/version2/parameters/searchPriorities.ts index 8e1dae180c..7ad7be9707 100644 --- a/src/version2/parameters/searchPriorities.ts +++ b/src/version2/parameters/searchPriorities.ts @@ -10,6 +10,13 @@ export interface SearchPriorities { * `projectId=10010&projectId=10111`. */ projectId?: string[]; + /** The name of priority to search for. */ + priorityName?: string; /** Whether only the default priority is returned. */ onlyDefault?: boolean; + /** + * Use `schemes` to return the associated priority schemes for each priority. Limited to returning first 15 priority + * schemes per priority. + */ + expand?: 'schemes' | string; } diff --git a/src/version2/parameters/searchProjectsUsingSecuritySchemes.ts b/src/version2/parameters/searchProjectsUsingSecuritySchemes.ts index 6e2ee07020..ba08b5778f 100644 --- a/src/version2/parameters/searchProjectsUsingSecuritySchemes.ts +++ b/src/version2/parameters/searchProjectsUsingSecuritySchemes.ts @@ -1,8 +1,8 @@ export interface SearchProjectsUsingSecuritySchemes { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The list of security scheme IDs to be filtered out. */ issueSecuritySchemeId?: string[]; /** The list of project IDs to be filtered out. */ diff --git a/src/version2/parameters/searchSecuritySchemes.ts b/src/version2/parameters/searchSecuritySchemes.ts index 21e4af570f..150e06463d 100644 --- a/src/version2/parameters/searchSecuritySchemes.ts +++ b/src/version2/parameters/searchSecuritySchemes.ts @@ -1,8 +1,8 @@ export interface SearchSecuritySchemes { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** * The list of issue security scheme IDs. To include multiple issue security scheme IDs, separate IDs with an * ampersand: `id=10000&id=10001`. diff --git a/src/version2/parameters/searchWorkflows.ts b/src/version2/parameters/searchWorkflows.ts new file mode 100644 index 0000000000..b0c6e94475 --- /dev/null +++ b/src/version2/parameters/searchWorkflows.ts @@ -0,0 +1,25 @@ +export interface SearchWorkflows { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * `values.transitions` Returns the transitions that each workflow is associated with. + */ + expand?: string; + /** String used to perform a case-insensitive partial match with workflow name. */ + queryString?: string; + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * `name` Sorts by workflow name. `created` Sorts by create time. `updated` Sorts by update time. + */ + orderBy?: string; + /** The scope of the workflow. Global for company-managed projects and Project for team-managed projects. */ + scope?: string; + /** Filters active and inactive workflows. */ + isActive?: boolean; +} diff --git a/src/version2/parameters/services.ts b/src/version2/parameters/services.ts new file mode 100644 index 0000000000..296a9d0439 --- /dev/null +++ b/src/version2/parameters/services.ts @@ -0,0 +1,4 @@ +export interface Services { + /** The ID of the services (the strings starting with "b:" need to be decoded in Base64). */ + serviceIds: string[]; +} diff --git a/src/version2/parameters/setActors.ts b/src/version2/parameters/setActors.ts index 9fe40f868e..eb3a8f16be 100644 --- a/src/version2/parameters/setActors.ts +++ b/src/version2/parameters/setActors.ts @@ -2,7 +2,7 @@ import { ProjectRoleActorsUpdate } from '../models'; export interface SetActors extends ProjectRoleActorsUpdate { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** * The ID of the project role. Use [Get all project roles](#api-rest-api-2-role-get) to get a list of project role * IDs. diff --git a/src/version2/parameters/setProjectProperty.ts b/src/version2/parameters/setProjectProperty.ts index 518b1d3e9e..ac6535a5ee 100644 --- a/src/version2/parameters/setProjectProperty.ts +++ b/src/version2/parameters/setProjectProperty.ts @@ -1,6 +1,6 @@ export interface SetProjectProperty { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** The key of the project property. The maximum length is 255 characters. */ propertyKey: string; propertyValue: any; diff --git a/src/version2/parameters/storeAvatar.ts b/src/version2/parameters/storeAvatar.ts index b9f98e0b99..6b119338a9 100644 --- a/src/version2/parameters/storeAvatar.ts +++ b/src/version2/parameters/storeAvatar.ts @@ -2,12 +2,17 @@ export interface StoreAvatar { /** The avatar type. */ type: 'project' | 'issuetype' | string; /** The ID of the item the avatar is associated with. */ - entityId: string; + entityId: number | string; /** The X coordinate of the top-left corner of the crop region. */ x?: number; /** The Y coordinate of the top-left corner of the crop region. */ y?: number; - /** The length of each side of the crop region. */ - size: number; - avatar: any; + /** + * The length of each side of the crop region. + * + * @default 0 + */ + size?: number; + mimeType: string; + avatar: Buffer | ArrayBuffer | Uint8Array | any; } diff --git a/src/version2/parameters/suggestedPrioritiesForMappings.ts b/src/version2/parameters/suggestedPrioritiesForMappings.ts new file mode 100644 index 0000000000..ed706bf989 --- /dev/null +++ b/src/version2/parameters/suggestedPrioritiesForMappings.ts @@ -0,0 +1,3 @@ +import { SuggestedMappingsRequest } from '../models'; + +export interface SuggestedPrioritiesForMappings extends SuggestedMappingsRequest {} diff --git a/src/version2/parameters/toggleFeatureForProject.ts b/src/version2/parameters/toggleFeatureForProject.ts index c5a8fde0f7..7891492f04 100644 --- a/src/version2/parameters/toggleFeatureForProject.ts +++ b/src/version2/parameters/toggleFeatureForProject.ts @@ -2,7 +2,7 @@ import { ProjectFeatureToggleRequest } from '../models'; export interface ToggleFeatureForProject extends ProjectFeatureToggleRequest { /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** The key of the feature. */ featureKey: string; } diff --git a/src/version2/parameters/trashPlan.ts b/src/version2/parameters/trashPlan.ts new file mode 100644 index 0000000000..e960cc100a --- /dev/null +++ b/src/version2/parameters/trashPlan.ts @@ -0,0 +1,4 @@ +export interface TrashPlan { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version2/parameters/updateAtlassianTeam.ts b/src/version2/parameters/updateAtlassianTeam.ts new file mode 100644 index 0000000000..d5a9fb9dfe --- /dev/null +++ b/src/version2/parameters/updateAtlassianTeam.ts @@ -0,0 +1,6 @@ +export interface UpdateAtlassianTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the Atlassian team. */ + atlassianTeamId: string; +} diff --git a/src/version2/parameters/updateDashboard.ts b/src/version2/parameters/updateDashboard.ts index 3b01c0c2d9..7144648aa6 100644 --- a/src/version2/parameters/updateDashboard.ts +++ b/src/version2/parameters/updateDashboard.ts @@ -3,4 +3,9 @@ import { DashboardDetails } from '../models'; export interface UpdateDashboard extends DashboardDetails { /** The ID of the dashboard to update. */ id: string; + /** + * Whether admin level permissions are used. It should only be true if the user has _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) + */ + extendAdminPermissions?: boolean; } diff --git a/src/version2/parameters/updateDefaultProjectClassification.ts b/src/version2/parameters/updateDefaultProjectClassification.ts new file mode 100644 index 0000000000..01b6cb1eb2 --- /dev/null +++ b/src/version2/parameters/updateDefaultProjectClassification.ts @@ -0,0 +1,6 @@ +import { UpdateDefaultProjectClassification as UpdateDefaultProjectClassificationModel } from '../models'; + +export interface UpdateDefaultProjectClassification extends UpdateDefaultProjectClassificationModel { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; +} diff --git a/src/version2/parameters/updatePlan.ts b/src/version2/parameters/updatePlan.ts new file mode 100644 index 0000000000..0f21fc0003 --- /dev/null +++ b/src/version2/parameters/updatePlan.ts @@ -0,0 +1,6 @@ +export interface UpdatePlan { + /** The ID of the plan. */ + planId: number; + /** Whether to accept group IDs instead of group names. Group names are deprecated. */ + useGroupId?: boolean; +} diff --git a/src/version2/parameters/updatePlanOnlyTeam.ts b/src/version2/parameters/updatePlanOnlyTeam.ts new file mode 100644 index 0000000000..7e4b3b5820 --- /dev/null +++ b/src/version2/parameters/updatePlanOnlyTeam.ts @@ -0,0 +1,6 @@ +export interface UpdatePlanOnlyTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the plan-only team. */ + planOnlyTeamId: number; +} diff --git a/src/version2/parameters/updatePrecomputations.ts b/src/version2/parameters/updatePrecomputations.ts index ecf83b9aaf..7371900380 100644 --- a/src/version2/parameters/updatePrecomputations.ts +++ b/src/version2/parameters/updatePrecomputations.ts @@ -1,3 +1,5 @@ import { JqlFunctionPrecomputationUpdateRequest } from '../models'; -export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest {} +export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest { + skipNotFoundPrecomputations?: boolean; +} diff --git a/src/version2/parameters/updatePriorityScheme.ts b/src/version2/parameters/updatePriorityScheme.ts new file mode 100644 index 0000000000..bbd7a2f666 --- /dev/null +++ b/src/version2/parameters/updatePriorityScheme.ts @@ -0,0 +1,6 @@ +import { UpdatePrioritySchemeRequest } from '../models'; + +export interface UpdatePriorityScheme extends UpdatePrioritySchemeRequest { + /** The ID of the priority scheme. */ + schemeId: number; +} diff --git a/src/version2/parameters/updateProject.ts b/src/version2/parameters/updateProject.ts index 8d8c4117bb..bdaf38e7ab 100644 --- a/src/version2/parameters/updateProject.ts +++ b/src/version2/parameters/updateProject.ts @@ -2,7 +2,7 @@ import { UpdateProjectDetails } from '../models'; export interface UpdateProject extends UpdateProjectDetails { /** The project ID or project key (case-sensitive). */ - projectIdOrKey: number | string; + projectIdOrKey: string | number; /** * The [project * type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes), which diff --git a/src/version2/parameters/updateProjectAvatar.ts b/src/version2/parameters/updateProjectAvatar.ts index d31b4ca4b6..6803b3f5d8 100644 --- a/src/version2/parameters/updateProjectAvatar.ts +++ b/src/version2/parameters/updateProjectAvatar.ts @@ -2,5 +2,5 @@ import { Avatar } from '../models'; export interface UpdateProjectAvatar extends Avatar { /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version2/parameters/updateProjectEmail.ts b/src/version2/parameters/updateProjectEmail.ts index c3bf7237a2..e8f4ca86f7 100644 --- a/src/version2/parameters/updateProjectEmail.ts +++ b/src/version2/parameters/updateProjectEmail.ts @@ -2,5 +2,5 @@ import { ProjectEmailAddress } from '../models'; export interface UpdateProjectEmail extends ProjectEmailAddress { /** The project ID. */ - projectId: number; + projectId: string | number; } diff --git a/src/version2/parameters/updateRelatedWork.ts b/src/version2/parameters/updateRelatedWork.ts new file mode 100644 index 0000000000..4d0d5a170b --- /dev/null +++ b/src/version2/parameters/updateRelatedWork.ts @@ -0,0 +1,6 @@ +import { VersionRelatedWork } from '../models'; + +export interface UpdateRelatedWork extends VersionRelatedWork { + /** The ID of the version to update the related work on. For the related work id, pass it to the input JSON. */ + id: string; +} diff --git a/src/version2/parameters/updateSchemes.ts b/src/version2/parameters/updateSchemes.ts new file mode 100644 index 0000000000..7f9610918f --- /dev/null +++ b/src/version2/parameters/updateSchemes.ts @@ -0,0 +1,3 @@ +import { WorkflowSchemeUpdateRequest } from '../models'; + +export interface UpdateSchemes extends WorkflowSchemeUpdateRequest {} diff --git a/src/version2/parameters/updateWorkflowSchemeMappings.ts b/src/version2/parameters/updateWorkflowSchemeMappings.ts new file mode 100644 index 0000000000..de0323e16e --- /dev/null +++ b/src/version2/parameters/updateWorkflowSchemeMappings.ts @@ -0,0 +1,3 @@ +import { WorkflowSchemeUpdateRequiredMappingsRequest } from '../models'; + +export interface UpdateWorkflowSchemeMappings extends WorkflowSchemeUpdateRequiredMappingsRequest {} diff --git a/src/version2/permissionSchemes.ts b/src/version2/permissionSchemes.ts index 631207f262..42ee9e52d0 100644 --- a/src/version2/permissionSchemes.ts +++ b/src/version2/permissionSchemes.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 PermissionSchemes { @@ -20,8 +20,9 @@ export class PermissionSchemes { * The `holder` object contains information about the user or group being granted the permission. For example, the * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and - * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the - * following properties: + * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. + * + * The `holder` object is defined by the following properties: * * - `type` Identifies the user or group (see the list of types below). * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the @@ -130,8 +131,9 @@ export class PermissionSchemes { * The `holder` object contains information about the user or group being granted the permission. For example, the * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and - * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the - * following properties: + * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. + * + * The `holder` object is defined by the following properties: * * - `type` Identifies the user or group (see the list of types below). * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the @@ -313,7 +315,7 @@ export class PermissionSchemes { url: `/rest/api/2/permissionscheme/${schemeId}`, method: 'GET', params: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, }, }; @@ -479,10 +481,10 @@ export class PermissionSchemes { expand: parameters.expand, }, data: { - id: parameters.id, - self: parameters.self, holder: parameters.holder, + id: parameters.id, permission: parameters.permission, + self: parameters.self, }, }; diff --git a/src/version2/permissions.ts b/src/version2/permissions.ts index d99162674a..eaecef137a 100644 --- a/src/version2/permissions.ts +++ b/src/version2/permissions.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 Permissions { @@ -28,6 +28,12 @@ export class Permissions { * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they * would not have EDIT_ISSUES permission for that issue. * + * For [Jira Service Management project + * permissions](https://support.atlassian.com/jira-cloud-administration/docs/customize-jira-service-management-permissions/), + * this will be evaluated similarly to a user in the customer portal. For example, if the BROWSE_PROJECTS permission + * is granted to Service Project Customer - Portal Access, any users with access to the customer portal will have the + * BROWSE_PROJECTS permission. + * * Global permissions are unaffected by context. * * This operation can be accessed anonymously. @@ -59,6 +65,12 @@ export class Permissions { * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they * would not have EDIT_ISSUES permission for that issue. * + * For [Jira Service Management project + * permissions](https://support.atlassian.com/jira-cloud-administration/docs/customize-jira-service-management-permissions/), + * this will be evaluated similarly to a user in the customer portal. For example, if the BROWSE_PROJECTS permission + * is granted to Service Project Customer - Portal Access, any users with access to the customer portal will have the + * BROWSE_PROJECTS permission. + * * Global permissions are unaffected by context. * * This operation can be accessed anonymously. @@ -98,8 +110,9 @@ export class Permissions { * - Project permissions. * - Global permissions added by plugins. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAllPermissions(callback: Callback): Promise; /** @@ -109,8 +122,9 @@ export class Permissions { * - Project permissions. * - Global permissions added by plugins. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getAllPermissions(callback?: never): Promise; async getAllPermissions(callback?: Callback): Promise { @@ -139,6 +153,11 @@ export class Permissions { * `projectPermissions.issues` are ignored. * - Empty strings in `projectPermissions.permissions` are ignored. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - **Classic**: `read:jira-work` + * - **Granular**: `read:permission:jira` + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** @@ -168,6 +187,11 @@ export class Permissions { * `projectPermissions.issues` are ignored. * - Empty strings in `projectPermissions.permissions` are ignored. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - **Classic**: `read:jira-work` + * - **Granular**: `read:permission:jira` + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** @@ -188,9 +212,9 @@ export class Permissions { url: '/rest/api/2/permissions/check', method: 'POST', data: { - projectPermissions: parameters?.projectPermissions, - globalPermissions: parameters?.globalPermissions, accountId: parameters?.accountId, + globalPermissions: parameters?.globalPermissions, + projectPermissions: parameters?.projectPermissions, }, }; diff --git a/src/version2/plans.ts b/src/version2/plans.ts new file mode 100644 index 0000000000..d52910d586 --- /dev/null +++ b/src/version2/plans.ts @@ -0,0 +1,299 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class Plans { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of plans. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlans( + parameters: Parameters.GetPlans | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of plans. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlans( + parameters?: Parameters.GetPlans, + callback?: never, + ): Promise; + async getPlans( + parameters?: Parameters.GetPlans, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/plans/plan', + method: 'GET', + params: { + includeTrashed: parameters?.includeTrashed, + includeArchived: parameters?.includeArchived, + cursor: parameters?.cursor, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlan(parameters: Parameters.CreatePlan, callback: Callback): Promise; + /** + * Creates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlan(parameters: Parameters.CreatePlan, callback?: never): Promise; + async createPlan(parameters: Parameters.CreatePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/plans/plan', + method: 'POST', + params: { + useGroupId: parameters.useGroupId, + }, + data: { + crossProjectReleases: parameters.crossProjectReleases, + customFields: parameters.customFields, + exclusionRules: parameters.exclusionRules, + issueSources: parameters.issueSources, + leadAccountId: parameters.leadAccountId, + name: parameters.name, + permissions: parameters.permissions, + scheduling: parameters.scheduling, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlan(parameters: Parameters.GetPlan, callback: Callback): Promise; + /** + * Returns a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlan(parameters: Parameters.GetPlan, callback?: never): Promise; + async getPlan(parameters: Parameters.GetPlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}`, + method: 'GET', + params: { + useGroupId: parameters.useGroupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates any of the following details of a plan using [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - Name + * - LeadAccountId + * - Scheduling + * + * - Estimation with StoryPoints, Days or Hours as possible values + * - StartDate + * + * - Type with DueDate, TargetStartDate, TargetEndDate or DateCustomField as possible values + * - DateCustomFieldId + * - EndDate + * + * - Type with DueDate, TargetStartDate, TargetEndDate or DateCustomField as possible values + * - DateCustomFieldId + * - InferredDates with None, SprintDates or ReleaseDates as possible values + * - Dependencies with Sequential or Concurrent as possible values + * - IssueSources + * + * - Type with Board, Project or Filter as possible values + * - Value + * - ExclusionRules + * + * - NumberOfDaysToShowCompletedIssues + * - IssueIds + * - WorkStatusIds + * - WorkStatusCategoryIds + * - IssueTypeIds + * - ReleaseIds + * - CrossProjectReleases + * + * - Name + * - ReleaseIds + * - CustomFields + * + * - CustomFieldId + * - Filter + * - Permissions + * + * - Type with View or Edit as possible values + * - Holder + * + * - Type with Group or AccountId as possible values + * - Value + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan" endpoint to find + * out the order of array elements._ + */ + async updatePlan(parameters: Parameters.UpdatePlan, callback: Callback): Promise; + /** + * Updates any of the following details of a plan using [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - Name + * - LeadAccountId + * - Scheduling + * + * - Estimation with StoryPoints, Days or Hours as possible values + * - StartDate + * + * - Type with DueDate, TargetStartDate, TargetEndDate or DateCustomField as possible values + * - DateCustomFieldId + * - EndDate + * + * - Type with DueDate, TargetStartDate, TargetEndDate or DateCustomField as possible values + * - DateCustomFieldId + * - InferredDates with None, SprintDates or ReleaseDates as possible values + * - Dependencies with Sequential or Concurrent as possible values + * - IssueSources + * + * - Type with Board, Project or Filter as possible values + * - Value + * - ExclusionRules + * + * - NumberOfDaysToShowCompletedIssues + * - IssueIds + * - WorkStatusIds + * - WorkStatusCategoryIds + * - IssueTypeIds + * - ReleaseIds + * - CrossProjectReleases + * + * - Name + * - ReleaseIds + * - CustomFields + * + * - CustomFieldId + * - Filter + * - Permissions + * + * - Type with View or Edit as possible values + * - Holder + * + * - Type with Group or AccountId as possible values + * - Value + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan" endpoint to find + * out the order of array elements._ + */ + async updatePlan(parameters: Parameters.UpdatePlan, callback?: never): Promise; + async updatePlan(parameters: Parameters.UpdatePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}`, + method: 'PUT', + params: { + useGroupId: parameters.useGroupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Archives a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archivePlan(parameters: Parameters.ArchivePlan, callback: Callback): Promise; + /** + * Archives a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archivePlan(parameters: Parameters.ArchivePlan, callback?: never): Promise; + async archivePlan(parameters: Parameters.ArchivePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/archive`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Duplicates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async duplicatePlan(parameters: Parameters.DuplicatePlan, callback: Callback): Promise; + /** + * Duplicates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async duplicatePlan(parameters: Parameters.DuplicatePlan, callback?: never): Promise; + async duplicatePlan(parameters: Parameters.DuplicatePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/duplicate`, + method: 'POST', + data: { + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a plan to trash. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashPlan(parameters: Parameters.TrashPlan, callback: Callback): Promise; + /** + * Moves a plan to trash. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashPlan(parameters: Parameters.TrashPlan, callback?: never): Promise; + async trashPlan(parameters: Parameters.TrashPlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/trash`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/prioritySchemes.ts b/src/version2/prioritySchemes.ts new file mode 100644 index 0000000000..af30279d6c --- /dev/null +++ b/src/version2/prioritySchemes.ts @@ -0,0 +1,330 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; +import { paramSerializer } from '../paramSerializer'; +import { Paginated } from '../paginated'; + +export class PrioritySchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priority schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritySchemes>( + parameters: Parameters.GetPrioritySchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priority schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritySchemes>( + parameters?: Parameters.GetPrioritySchemes, + callback?: never, + ): Promise; + async getPrioritySchemes>( + parameters?: Parameters.GetPrioritySchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priorityscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + priorityId: paramSerializer('priorityId', parameters?.priorityId), + schemeId: paramSerializer('schemeId', parameters?.schemeId), + schemeName: parameters?.schemeName, + onlyDefault: parameters?.onlyDefault, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a new priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPriorityScheme( + parameters: Parameters.CreatePriorityScheme, + callback: Callback, + ): Promise; + /** + * Creates a new priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPriorityScheme( + parameters: Parameters.CreatePriorityScheme, + callback?: never, + ): Promise; + async createPriorityScheme( + parameters: Parameters.CreatePriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priorityscheme', + method: 'POST', + data: { + defaultPriorityId: parameters.defaultPriorityId, + description: parameters.description, + mappings: parameters.mappings, + name: parameters.name, + priorityIds: parameters.priorityIds, + projectIds: parameters.projectIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities that would require mapping, given a change in priorities or projects associated with a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async suggestedPrioritiesForMappings>( + parameters: Parameters.SuggestedPrioritiesForMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities that would require mapping, given a change in priorities or projects associated with a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async suggestedPrioritiesForMappings>( + parameters?: Parameters.SuggestedPrioritiesForMappings, + callback?: never, + ): Promise; + async suggestedPrioritiesForMappings>( + parameters?: Parameters.SuggestedPrioritiesForMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priorityscheme/mappings', + method: 'POST', + data: { + maxResults: parameters?.maxResults, + priorities: parameters?.priorities, + projects: parameters?.projects, + schemeId: parameters?.schemeId, + startAt: parameters?.startAt, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities available for adding to a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAvailablePrioritiesByPriorityScheme>( + parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities available for adding to a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAvailablePrioritiesByPriorityScheme>( + parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, + callback?: never, + ): Promise; + async getAvailablePrioritiesByPriorityScheme>( + parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/priorityscheme/priorities/available', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + query: parameters.query, + schemeId: parameters.schemeId, + exclude: parameters.exclude, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a priority scheme. This includes its details, the lists of priorities and projects in it + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePriorityScheme( + parameters: Parameters.UpdatePriorityScheme, + callback: Callback, + ): Promise; + /** + * Updates a priority scheme. This includes its details, the lists of priorities and projects in it + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePriorityScheme( + parameters: Parameters.UpdatePriorityScheme, + callback?: never, + ): Promise; + async updatePriorityScheme( + parameters: Parameters.UpdatePriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/priorityscheme/${parameters.schemeId}`, + method: 'PUT', + data: { + defaultPriorityId: parameters.defaultPriorityId, + description: parameters.description, + mappings: parameters.mappings, + name: parameters.name, + priorities: parameters.priorities, + projects: parameters.projects, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a priority scheme. + * + * This operation is only available for priority schemes without any associated projects. Any associated projects must + * be removed from the priority scheme before this operation can be performed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriorityScheme( + parameters: Parameters.DeletePriorityScheme, + callback: Callback, + ): Promise; + /** + * Deletes a priority scheme. + * + * This operation is only available for priority schemes without any associated projects. Any associated projects must + * be removed from the priority scheme before this operation can be performed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriorityScheme(parameters: Parameters.DeletePriorityScheme, callback?: never): Promise; + async deletePriorityScheme( + parameters: Parameters.DeletePriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/priorityscheme/${parameters.schemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritiesByPriorityScheme>( + parameters: Parameters.GetPrioritiesByPriorityScheme, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * priorities by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritiesByPriorityScheme>( + parameters: Parameters.GetPrioritiesByPriorityScheme, + callback?: never, + ): Promise; + async getPrioritiesByPriorityScheme>( + parameters: Parameters.GetPrioritiesByPriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/priorityscheme/${parameters.schemeId}/priorities`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * projects by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectsByPriorityScheme( + parameters: Parameters.GetProjectsByPriorityScheme, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * projects by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectsByPriorityScheme( + parameters: Parameters.GetProjectsByPriorityScheme, + callback?: never, + ): Promise; + async getProjectsByPriorityScheme( + parameters: Parameters.GetProjectsByPriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/priorityscheme/${parameters.schemeId}/projects`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: paramSerializer('projectId', parameters.projectId), + query: parameters.query, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectAvatars.ts b/src/version2/projectAvatars.ts index 0fe7bb7c80..74c5b9724b 100644 --- a/src/version2/projectAvatars.ts +++ b/src/version2/projectAvatars.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 ProjectAvatars { @@ -77,12 +77,6 @@ export class ProjectAvatars { /** * Loads an avatar for a project. * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of * the image. The length of the square's sides is set to the smaller of the height or width of the image. * @@ -101,12 +95,6 @@ export class ProjectAvatars { /** * Loads an avatar for a project. * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of * the image. The length of the square's sides is set to the smaller of the height or width of the image. * @@ -129,10 +117,14 @@ export class ProjectAvatars { const config: RequestConfig = { url: `/rest/api/2/project/${parameters.projectIdOrKey}/avatar2`, method: 'POST', + headers: { + 'X-Atlassian-Token': 'no-check', + 'Content-Type': parameters.mimeType, + }, params: { x: parameters.x, y: parameters.y, - size: parameters.size, + size: parameters.size ?? 0, }, data: parameters.avatar, }; diff --git a/src/version2/projectCategories.ts b/src/version2/projectCategories.ts index 407ac3636d..d4681ece7d 100644 --- a/src/version2/projectCategories.ts +++ b/src/version2/projectCategories.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 ProjectCategories { diff --git a/src/version2/projectClassificationLevels.ts b/src/version2/projectClassificationLevels.ts new file mode 100644 index 0000000000..4fcb8ab936 --- /dev/null +++ b/src/version2/projectClassificationLevels.ts @@ -0,0 +1,121 @@ +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class ProjectClassificationLevels { + constructor(private client: Client) {} + + /** + * Returns the default data classification for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultProjectClassification( + parameters: Parameters.GetDefaultProjectClassification, + callback: Callback, + ): Promise; + /** + * Returns the default data classification for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultProjectClassification( + parameters: Parameters.GetDefaultProjectClassification, + callback?: never, + ): Promise; + async getDefaultProjectClassification( + parameters: Parameters.GetDefaultProjectClassification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/classification-level/default`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultProjectClassification( + parameters: Parameters.UpdateDefaultProjectClassification, + callback: Callback, + ): Promise; + /** + * Updates the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultProjectClassification( + parameters: Parameters.UpdateDefaultProjectClassification, + callback?: never, + ): Promise; + async updateDefaultProjectClassification( + parameters: Parameters.UpdateDefaultProjectClassification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/classification-level/default`, + method: 'PUT', + data: { + id: parameters.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Remove the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeDefaultProjectClassification( + parameters: Parameters.RemoveDefaultProjectClassification, + callback: Callback, + ): Promise; + /** + * Remove the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeDefaultProjectClassification( + parameters: Parameters.RemoveDefaultProjectClassification, + callback?: never, + ): Promise; + async removeDefaultProjectClassification( + parameters: Parameters.RemoveDefaultProjectClassification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/project/${parameters.projectIdOrKey}/classification-level/default`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/projectComponents.ts b/src/version2/projectComponents.ts index e7e7cee46f..c51564cbed 100644 --- a/src/version2/projectComponents.ts +++ b/src/version2/projectComponents.ts @@ -1,14 +1,61 @@ 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'; +import { Paginated } from '../paginated'; export class ProjectComponents { constructor(private client: Client) {} /** - * Creates a component. Use components to provide containers for issues within a project. + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * components in a project, including global (Compass) components when applicable. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async findComponentsForProjects>( + parameters: Parameters.FindComponentsForProjects | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of all + * components in a project, including global (Compass) components when applicable. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async findComponentsForProjects>( + parameters?: Parameters.FindComponentsForProjects, + callback?: never, + ): Promise; + async findComponentsForProjects>( + parameters?: Parameters.FindComponentsForProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/component', + method: 'GET', + params: { + projectIdsOrKeys: parameters?.projectIdsOrKeys, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + orderBy: parameters?.orderBy, + query: parameters?.query, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a component. Use components to provide containers for issues within a project. Use components to provide + * containers for issues within a project. * * This operation can be accessed anonymously. * @@ -21,7 +68,8 @@ export class ProjectComponents { callback: Callback, ): Promise; /** - * Creates a component. Use components to provide containers for issues within a project. + * Creates a component. Use components to provide containers for issues within a project. Use components to provide + * containers for issues within a project. * * This operation can be accessed anonymously. * @@ -41,6 +89,7 @@ export class ProjectComponents { url: '/rest/api/2/component', method: 'POST', data: { + ari: parameters.ari, assignee: parameters.assignee, assigneeType: parameters.assigneeType, description: parameters.description, @@ -49,6 +98,7 @@ export class ProjectComponents { lead: parameters.lead, leadAccountId: parameters.leadAccountId, leadUserName: parameters.leadUserName, + metadata: parameters.metadata, name: parameters.name, project: parameters.project, projectId: parameters.projectId, @@ -180,7 +230,7 @@ export class ProjectComponents { url: `/rest/api/2/component/${id}`, method: 'DELETE', params: { - moveIssuesTo: typeof parameters !== 'string' && parameters.moveIssuesTo, + moveIssuesTo: typeof parameters !== 'string' ? parameters.moveIssuesTo : undefined, }, }; @@ -192,6 +242,11 @@ export class ProjectComponents { * * This operation can be accessed anonymously. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - **Classic**: `read:jira-work` + * - **Granular**: `read:field:jira`, `read:project.component:jira` + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getComponentRelatedIssues( @@ -203,6 +258,11 @@ export class ProjectComponents { * * This operation can be accessed anonymously. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - **Classic**: `read:jira-work` + * - **Granular**: `read:field:jira`, `read:project.component:jira` + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ async getComponentRelatedIssues( @@ -228,6 +288,9 @@ export class ProjectComponents { * components in a project. See the [Get project components](#api-rest-api-2-project-projectIdOrKey-components-get) * resource if you want to get a full list of versions without pagination. * + * If your project uses Compass components, this API will return a list of Compass components that are linked to + * issues in that project. + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse @@ -242,6 +305,9 @@ export class ProjectComponents { * components in a project. See the [Get project components](#api-rest-api-2-project-projectIdOrKey-components-get) * resource if you want to get a full list of versions without pagination. * + * If your project uses Compass components, this API will return a list of Compass components that are linked to + * issues in that project. + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse @@ -262,6 +328,7 @@ export class ProjectComponents { startAt: parameters.startAt, maxResults: parameters.maxResults, orderBy: parameters.orderBy, + componentSource: parameters.componentSource, query: parameters.query, }, }; @@ -274,6 +341,9 @@ export class ProjectComponents { * paginated](#api-rest-api-2-project-projectIdOrKey-component-get) resource if you want to get a full list of * components with pagination. * + * If your project uses Compass components, this API will return a paginated list of Compass components that are + * linked to issues in that project. + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse @@ -288,6 +358,9 @@ export class ProjectComponents { * paginated](#api-rest-api-2-project-projectIdOrKey-component-get) resource if you want to get a full list of * components with pagination. * + * If your project uses Compass components, this API will return a paginated list of Compass components that are + * linked to issues in that project. + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse @@ -306,6 +379,9 @@ export class ProjectComponents { const config: RequestConfig = { url: `/rest/api/2/project/${projectIdOrKey}/components`, method: 'GET', + params: { + componentSource: typeof parameters !== 'string' ? parameters.componentSource : undefined, + }, }; return this.client.sendRequest(config, callback); diff --git a/src/version2/projectEmail.ts b/src/version2/projectEmail.ts index 3caf5917a2..19a97e99de 100644 --- a/src/version2/projectEmail.ts +++ b/src/version2/projectEmail.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 ProjectEmail { @@ -46,8 +46,9 @@ export class ProjectEmail { * * If `emailAddress` is an empty string, the default email address is restored. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission.](https://confluence.atlassian.com/x/yodKLg) */ async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback: Callback): Promise; /** @@ -55,8 +56,9 @@ export class ProjectEmail { * * If `emailAddress` is an empty string, the default email address is restored. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission.](https://confluence.atlassian.com/x/yodKLg) */ async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback?: never): Promise; async updateProjectEmail( diff --git a/src/version2/projectFeatures.ts b/src/version2/projectFeatures.ts index 2154dbde01..986815a724 100644 --- a/src/version2/projectFeatures.ts +++ b/src/version2/projectFeatures.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 ProjectFeatures { diff --git a/src/version2/projectKeyAndNameValidation.ts b/src/version2/projectKeyAndNameValidation.ts index 44de219300..6b08bb39b8 100644 --- a/src/version2/projectKeyAndNameValidation.ts +++ b/src/version2/projectKeyAndNameValidation.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 ProjectKeyAndNameValidation { @@ -47,7 +47,7 @@ export class ProjectKeyAndNameValidation { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getValidProjectKey( + async getValidProjectKey( parameters: Parameters.GetValidProjectKey | string | undefined, callback: Callback, ): Promise; @@ -56,11 +56,11 @@ export class ProjectKeyAndNameValidation { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. */ - async getValidProjectKey( + async getValidProjectKey( parameters?: Parameters.GetValidProjectKey | string, callback?: never, ): Promise; - async getValidProjectKey( + async getValidProjectKey( parameters?: Parameters.GetValidProjectKey | string, callback?: Callback, ): Promise { diff --git a/src/version2/projectPermissionSchemes.ts b/src/version2/projectPermissionSchemes.ts index 6bdf11bb58..d3cf9dc73c 100644 --- a/src/version2/projectPermissionSchemes.ts +++ b/src/version2/projectPermissionSchemes.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 ProjectPermissionSchemes { diff --git a/src/version2/projectProperties.ts b/src/version2/projectProperties.ts index d5bba9ec15..af82640c64 100644 --- a/src/version2/projectProperties.ts +++ b/src/version2/projectProperties.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 ProjectProperties { diff --git a/src/version2/projectRoleActors.ts b/src/version2/projectRoleActors.ts index 78e26df825..ddd29b22bf 100644 --- a/src/version2/projectRoleActors.ts +++ b/src/version2/projectRoleActors.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 ProjectRoleActors { diff --git a/src/version2/projectRoles.ts b/src/version2/projectRoles.ts index ece418fe7f..c4df26d9a5 100644 --- a/src/version2/projectRoles.ts +++ b/src/version2/projectRoles.ts @@ -1,15 +1,16 @@ 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 ProjectRoles { constructor(private client: Client) {} /** - * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and - * self URL for each role. + * Returns a list of [project + * roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) for the project + * returning the name and self URL for each role. * * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project * roles](#api-rest-api-2-role-get) for more information. @@ -25,8 +26,9 @@ export class ProjectRoles { callback: Callback, ): Promise; /** - * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and - * self URL for each role. + * Returns a list of [project + * roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) for the project + * returning the name and self URL for each role. * * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project * roles](#api-rest-api-2-role-get) for more information. @@ -104,8 +106,8 @@ export class ProjectRoles { } /** - * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the - * list of project roles is common to all projects. + * Returns all [project roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) and + * the details for each role. Note that the list of project roles is common to all projects. * * This operation can be accessed anonymously. * @@ -118,8 +120,8 @@ export class ProjectRoles { callback: Callback, ): Promise; /** - * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the - * list of project roles is common to all projects. + * Returns all [project roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) and + * the details for each role. Note that the list of project roles is common to all projects. * * This operation can be accessed anonymously. * @@ -141,8 +143,8 @@ export class ProjectRoles { url: `/rest/api/2/project/${projectIdOrKey}/roledetails`, method: 'GET', params: { - currentMember: typeof parameters !== 'string' && parameters.currentMember, - excludeConnectAddons: typeof parameters !== 'string' && parameters.excludeConnectAddons, + currentMember: typeof parameters !== 'string' ? parameters.currentMember : undefined, + excludeConnectAddons: typeof parameters !== 'string' ? parameters.excludeConnectAddons : undefined, }, }; @@ -154,10 +156,10 @@ export class ProjectRoles { * * ### About project roles * - * [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with - * projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have - * a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira - * applications). + * [Project roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) are a flexible + * way to to associate users and groups with projects. In Jira Cloud, the list of project roles is shared globally + * with all projects, but each project can have a different set of actors associated with it (unlike groups, which + * have the same membership throughout all Jira applications). * * Project roles are used in [permission schemes](#api-rest-api-2-permissionscheme-get), [email notification * schemes](#api-rest-api-2-notificationscheme-get), [issue security @@ -170,7 +172,7 @@ export class ProjectRoles { * with a project role. * * Actors may be set as [default - * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) + * members](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/#Specifying-'default-members'-for-a-project-role) * of the project role or set at the project level: * * - Default actors: Users and groups that are assigned to the project role for all newly created projects. The default @@ -187,10 +189,10 @@ export class ProjectRoles { * * ### About project roles * - * [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with - * projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have - * a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira - * applications). + * [Project roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) are a flexible + * way to to associate users and groups with projects. In Jira Cloud, the list of project roles is shared globally + * with all projects, but each project can have a different set of actors associated with it (unlike groups, which + * have the same membership throughout all Jira applications). * * Project roles are used in [permission schemes](#api-rest-api-2-permissionscheme-get), [email notification * schemes](#api-rest-api-2-notificationscheme-get), [issue security @@ -203,7 +205,7 @@ export class ProjectRoles { * with a project role. * * Actors may be set as [default - * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) + * members](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/#Specifying-'default-members'-for-a-project-role) * of the project role or set at the project level: * * - Default actors: Users and groups that are assigned to the project role for all newly created projects. The default @@ -262,8 +264,8 @@ export class ProjectRoles { url: '/rest/api/2/role', method: 'POST', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; @@ -340,8 +342,8 @@ export class ProjectRoles { url: `/rest/api/2/role/${parameters.id}`, method: 'POST', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; @@ -376,8 +378,8 @@ export class ProjectRoles { url: `/rest/api/2/role/${parameters.id}`, method: 'PUT', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; @@ -413,7 +415,7 @@ export class ProjectRoles { url: `/rest/api/2/role/${id}`, method: 'DELETE', params: { - swap: typeof parameters !== 'string' && parameters.swap, + swap: typeof parameters !== 'string' ? parameters.swap : undefined, }, }; diff --git a/src/version2/projectTypes.ts b/src/version2/projectTypes.ts index 82475d06a6..ece0379b00 100644 --- a/src/version2/projectTypes.ts +++ b/src/version2/projectTypes.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 ProjectTypes { diff --git a/src/version2/projectVersions.ts b/src/version2/projectVersions.ts index 4db643ba64..84a97aaf51 100644 --- a/src/version2/projectVersions.ts +++ b/src/version2/projectVersions.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 ProjectVersions { @@ -45,12 +45,12 @@ export class ProjectVersions { url: `/rest/api/2/project/${projectIdOrKey}/version`, method: 'GET', params: { - startAt: typeof parameters !== 'string' && parameters.startAt, - maxResults: typeof parameters !== 'string' && parameters.maxResults, - orderBy: typeof parameters !== 'string' && parameters.orderBy, - query: typeof parameters !== 'string' && parameters.query, - status: typeof parameters !== 'string' && parameters.status, - expand: typeof parameters !== 'string' && parameters.expand, + startAt: typeof parameters !== 'string' ? parameters.startAt : undefined, + maxResults: typeof parameters !== 'string' ? parameters.maxResults : undefined, + orderBy: typeof parameters !== 'string' ? parameters.orderBy : undefined, + query: typeof parameters !== 'string' ? parameters.query : undefined, + status: typeof parameters !== 'string' ? parameters.status : undefined, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, }, }; @@ -95,7 +95,7 @@ export class ProjectVersions { url: `/rest/api/2/project/${projectIdOrKey}/versions`, method: 'GET', params: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, }, }; @@ -130,22 +130,24 @@ export class ProjectVersions { url: '/rest/api/2/version', method: 'POST', data: { + approvers: parameters.approvers, + archived: parameters.archived, + description: parameters.description, + driver: parameters.driver, expand: parameters.expand, - self: parameters.self, id: parameters.id, - description: parameters.description, + issuesStatusForFixVersion: parameters.issuesStatusForFixVersion, + moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, name: parameters.name, - archived: parameters.archived, + operations: parameters.operations, + overdue: parameters.overdue, + projectId: parameters.projectId, + releaseDate: parameters.releaseDate, released: parameters.released, + self: parameters.self, startDate: parameters.startDate, - releaseDate: parameters.releaseDate, - overdue: parameters.overdue, - userStartDate: parameters.userStartDate, userReleaseDate: parameters.userReleaseDate, - projectId: parameters.projectId, - moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, - operations: parameters.operations, - issuesStatusForFixVersion: parameters.issuesStatusForFixVersion, + userStartDate: parameters.userStartDate, }, }; @@ -183,7 +185,7 @@ export class ProjectVersions { url: `/rest/api/2/version/${id}`, method: 'GET', params: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, }, }; @@ -218,6 +220,8 @@ export class ProjectVersions { url: `/rest/api/2/version/${parameters.id}`, method: 'PUT', data: { + approvers: parameters.approvers, + driver: parameters.driver, expand: parameters.expand, description: parameters.description, name: parameters.name, @@ -347,6 +351,140 @@ export class ProjectVersions { return this.client.sendRequest(config, callback); } + /** + * Returns related work items for the given version id. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. + */ + async getRelatedWork( + parameters: Parameters.GetRelatedWork, + callback: Callback, + ): Promise; + /** + * Returns related work items for the given version id. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. + */ + async getRelatedWork( + parameters: Parameters.GetRelatedWork, + callback?: never, + ): Promise; + async getRelatedWork( + parameters: Parameters.GetRelatedWork, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}/relatedwork`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a related work for the given version. You can only create a generic link type of related works via this + * API. relatedWorkId will be auto-generated UUID, that does not need to be provided. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async createRelatedWork( + parameters: Parameters.CreateRelatedWork, + callback: Callback, + ): Promise; + /** + * Creates a related work for the given version. You can only create a generic link type of related works via this + * API. relatedWorkId will be auto-generated UUID, that does not need to be provided. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async createRelatedWork( + parameters: Parameters.CreateRelatedWork, + callback?: never, + ): Promise; + async createRelatedWork( + parameters: Parameters.CreateRelatedWork, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}/relatedwork`, + method: 'POST', + data: { + category: parameters.category, + issueId: parameters.issueId, + relatedWorkId: parameters.relatedWorkId, + title: parameters.title, + url: parameters.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the given related work. You can only update generic link related works via Rest APIs. Any archived version + * related works can't be edited. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async updateRelatedWork( + parameters: Parameters.UpdateRelatedWork, + callback: Callback, + ): Promise; + /** + * Updates the given related work. You can only update generic link related works via Rest APIs. Any archived version + * related works can't be edited. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async updateRelatedWork( + parameters: Parameters.UpdateRelatedWork, + callback?: never, + ): Promise; + async updateRelatedWork( + parameters: Parameters.UpdateRelatedWork, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.id}/relatedwork`, + method: 'PUT', + data: { + category: parameters.category, + issueId: parameters.issueId, + relatedWorkId: parameters.relatedWorkId, + title: parameters.title, + url: parameters.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Deletes a project version. * @@ -390,9 +528,9 @@ export class ProjectVersions { url: `/rest/api/2/version/${parameters.id}/removeAndSwap`, method: 'POST', data: { - moveFixIssuesTo: parameters.moveFixIssuesTo, - moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, customFieldReplacementList: parameters.customFieldReplacementList, + moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, + moveFixIssuesTo: parameters.moveFixIssuesTo, }, }; @@ -436,4 +574,38 @@ export class ProjectVersions { return this.client.sendRequest(config, callback); } + + /** + * Deletes the given related work for the given version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async deleteRelatedWork(parameters: Parameters.DeleteRelatedWork, callback: Callback): Promise; + /** + * Deletes the given related work for the given version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async deleteRelatedWork(parameters: Parameters.DeleteRelatedWork, callback?: never): Promise; + async deleteRelatedWork( + parameters: Parameters.DeleteRelatedWork, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/version/${parameters.versionId}/relatedwork/${parameters.relatedWorkId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version2/projects.ts b/src/version2/projects.ts index 0ad37105c4..27b71982d9 100644 --- a/src/version2/projects.ts +++ b/src/version2/projects.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 Projects { @@ -10,11 +10,11 @@ export class Projects { /** * Creates a project based on a project type template, as shown in the following table: * - * | Project Type Key | Project Template Key | - * | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | - * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-finance-service-desk`, `com.atlassian.servicedesk:next-gen-it-service-desk`, `com.atlassian.servicedesk:next-gen-hr-service-desk`, `com.atlassian.servicedesk:next-gen-legal-service-desk`, `com.atlassian.servicedesk:next-gen-marketing-service-desk`, `com.atlassian.servicedesk:next-gen-facilities-service-desk`, `com.atlassian.servicedesk:next-gen-general-service-desk`, `com.atlassian.servicedesk:next-gen-general-it-service-desk`, `com.atlassian.servicedesk:next-gen-general-business-service-desk`, `com.atlassian.servicedesk:next-gen-analytics-service-desk`, `com.atlassian.servicedesk:next-gen-finance-service-desk`, `com.atlassian.servicedesk:next-gen-design-service-desk`, `com.atlassian.servicedesk:next-gen-sales-service-desk` | - * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | + * | Project Type Key | Project Template Key | + * | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | + * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-blank-project-business`, `com.atlassian.servicedesk:simplified-blank-project-it`, `com.atlassian.servicedesk:simplified-finance-service-desk`, `com.atlassian.servicedesk:next-gen-it-service-desk`, `com.atlassian.servicedesk:next-gen-hr-service-desk`, `com.atlassian.servicedesk:next-gen-legal-service-desk`, `com.atlassian.servicedesk:next-gen-marketing-service-desk`, `com.atlassian.servicedesk:next-gen-facilities-service-desk`, `com.atlassian.servicedesk:next-gen-general-it-service-desk`, `com.atlassian.servicedesk:next-gen-general-business-service-desk`, `com.atlassian.servicedesk:next-gen-analytics-service-desk`, `com.atlassian.servicedesk:next-gen-finance-service-desk`, `com.atlassian.servicedesk:next-gen-design-service-desk`, `com.atlassian.servicedesk:next-gen-sales-service-desk` | + * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | * * The project types are available according to the installed Jira features as follows: * @@ -37,11 +37,11 @@ export class Projects { /** * Creates a project based on a project type template, as shown in the following table: * - * | Project Type Key | Project Template Key | - * | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | - * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-finance-service-desk`, `com.atlassian.servicedesk:next-gen-it-service-desk`, `com.atlassian.servicedesk:next-gen-hr-service-desk`, `com.atlassian.servicedesk:next-gen-legal-service-desk`, `com.atlassian.servicedesk:next-gen-marketing-service-desk`, `com.atlassian.servicedesk:next-gen-facilities-service-desk`, `com.atlassian.servicedesk:next-gen-general-service-desk`, `com.atlassian.servicedesk:next-gen-general-it-service-desk`, `com.atlassian.servicedesk:next-gen-general-business-service-desk`, `com.atlassian.servicedesk:next-gen-analytics-service-desk`, `com.atlassian.servicedesk:next-gen-finance-service-desk`, `com.atlassian.servicedesk:next-gen-design-service-desk`, `com.atlassian.servicedesk:next-gen-sales-service-desk` | - * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | + * | Project Type Key | Project Template Key | + * | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | + * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-blank-project-business`, `com.atlassian.servicedesk:simplified-blank-project-it`, `com.atlassian.servicedesk:simplified-finance-service-desk`, `com.atlassian.servicedesk:next-gen-it-service-desk`, `com.atlassian.servicedesk:next-gen-hr-service-desk`, `com.atlassian.servicedesk:next-gen-legal-service-desk`, `com.atlassian.servicedesk:next-gen-marketing-service-desk`, `com.atlassian.servicedesk:next-gen-facilities-service-desk`, `com.atlassian.servicedesk:next-gen-general-it-service-desk`, `com.atlassian.servicedesk:next-gen-general-business-service-desk`, `com.atlassian.servicedesk:next-gen-analytics-service-desk`, `com.atlassian.servicedesk:next-gen-finance-service-desk`, `com.atlassian.servicedesk:next-gen-design-service-desk`, `com.atlassian.servicedesk:next-gen-sales-service-desk` | + * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | * * The project types are available according to the installed Jira features as follows: * @@ -223,8 +223,8 @@ export class Projects { url: `/rest/api/2/project/${projectIdOrKey}`, method: 'GET', params: { - expand: typeof parameters !== 'string' && parameters.expand, - properties: typeof parameters !== 'string' && parameters.properties, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, + properties: typeof parameters !== 'string' ? parameters.properties : undefined, }, }; @@ -278,6 +278,7 @@ export class Projects { permissionScheme: parameters.permissionScheme, projectTemplateKey: parameters.projectTemplateKey, projectTypeKey: parameters.projectTypeKey, + releasedProjectKeys: parameters.releasedProjectKeys, url: parameters.url, }, }; @@ -315,7 +316,7 @@ export class Projects { url: `/rest/api/2/project/${projectIdOrKey}`, method: 'DELETE', params: { - enableUndo: typeof parameters !== 'string' && parameters.enableUndo, + enableUndo: typeof parameters !== 'string' ? parameters.enableUndo : undefined, }, }; @@ -556,7 +557,7 @@ export class Projects { url: `/rest/api/2/project/${projectKeyOrId}/notificationscheme`, method: 'GET', params: { - expand: typeof parameters !== 'string' && parameters.expand, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, }, }; diff --git a/src/version2/screenSchemes.ts b/src/version2/screenSchemes.ts index 15947007af..de31c939e5 100644 --- a/src/version2/screenSchemes.ts +++ b/src/version2/screenSchemes.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 ScreenSchemes { diff --git a/src/version2/screenTabFields.ts b/src/version2/screenTabFields.ts index e92889417c..e30fa6afc3 100644 --- a/src/version2/screenTabFields.ts +++ b/src/version2/screenTabFields.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 ScreenTabFields { diff --git a/src/version2/screenTabs.ts b/src/version2/screenTabs.ts index ce6364cc8e..8617cc52bf 100644 --- a/src/version2/screenTabs.ts +++ b/src/version2/screenTabs.ts @@ -1,12 +1,49 @@ 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 ScreenTabs { constructor(private client: Client) {} + /** + * Returns the list of tabs for a bulk of screens. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBulkScreenTabs( + parameters: Parameters.GetBulkScreenTabs | undefined, + callback: Callback, + ): Promise; + /** + * Returns the list of tabs for a bulk of screens. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBulkScreenTabs(parameters?: Parameters.GetBulkScreenTabs, callback?: never): Promise; + async getBulkScreenTabs( + parameters?: Parameters.GetBulkScreenTabs, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/screens/tabs', + method: 'GET', + params: { + screenId: parameters?.screenId, + tabId: parameters?.tabId, + startAt: parameters?.startAt, + maxResult: parameters?.maxResult, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Returns the list of tabs for a screen. * diff --git a/src/version2/screens.ts b/src/version2/screens.ts index f48782532e..c3b6b9a373 100644 --- a/src/version2/screens.ts +++ b/src/version2/screens.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 Screens { diff --git a/src/version2/serverInfo.ts b/src/version2/serverInfo.ts index cbf18c43ef..93bacd002f 100644 --- a/src/version2/serverInfo.ts +++ b/src/version2/serverInfo.ts @@ -1,6 +1,6 @@ import * as Models from './models'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class ServerInfo { diff --git a/src/version2/serviceRegistry.ts b/src/version2/serviceRegistry.ts new file mode 100644 index 0000000000..37b9f92701 --- /dev/null +++ b/src/version2/serviceRegistry.ts @@ -0,0 +1,38 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class ServiceRegistry { + constructor(private client: Client) {} + + /** + * Retrieve the attributes of given service registries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request and the servicesIds belong to the tenant you are requesting + */ + async services(parameters: Parameters.Services, callback: Callback): Promise; + /** + * Retrieve the attributes of given service registries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only + * Connect apps can make this request and the servicesIds belong to the tenant you are requesting + */ + async services(parameters: Parameters.Services, callback?: never): Promise; + async services( + parameters: Parameters.Services, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/service-registry', + method: 'GET', + params: { + serviceIds: parameters.serviceIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/status.ts b/src/version2/status.ts index e42ed19945..abeba72f2c 100644 --- a/src/version2/status.ts +++ b/src/version2/status.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 Status { @@ -155,7 +155,7 @@ export class Status { } /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * statuses that match a search on name or project. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** @@ -168,7 +168,7 @@ export class Status { callback: Callback, ): Promise; /** - * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of * statuses that match a search on name or project. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** @@ -193,4 +193,82 @@ export class Status { return this.client.sendRequest(config, callback); } + + /** Returns a page of issue types in a project using a given status. */ + async getProjectIssueTypeUsagesForStatus( + parameters: Parameters.GetProjectIssueTypeUsagesForStatus, + callback: Callback, + ): Promise; + /** Returns a page of issue types in a project using a given status. */ + async getProjectIssueTypeUsagesForStatus( + parameters: Parameters.GetProjectIssueTypeUsagesForStatus, + callback?: never, + ): Promise; + async getProjectIssueTypeUsagesForStatus( + parameters: Parameters.GetProjectIssueTypeUsagesForStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/statuses/${parameters.statusId}/project/${parameters.projectId}/issueTypeUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of projects using a given status. */ + async getProjectUsagesForStatus( + parameters: Parameters.GetProjectUsagesForStatus, + callback: Callback, + ): Promise; + /** Returns a page of projects using a given status. */ + async getProjectUsagesForStatus( + parameters: Parameters.GetProjectUsagesForStatus, + callback?: never, + ): Promise; + async getProjectUsagesForStatus( + parameters: Parameters.GetProjectUsagesForStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/statuses/${parameters.statusId}/projectUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of workflows using a given status. */ + async getWorkflowUsagesForStatus( + parameters: Parameters.GetWorkflowUsagesForStatus, + callback: Callback, + ): Promise; + /** Returns a page of workflows using a given status. */ + async getWorkflowUsagesForStatus( + parameters: Parameters.GetWorkflowUsagesForStatus, + callback?: never, + ): Promise; + async getWorkflowUsagesForStatus( + parameters: Parameters.GetWorkflowUsagesForStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/statuses/${parameters.statusId}/workflowUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version2/tasks.ts b/src/version2/tasks.ts index a6e0a82943..4f1df0dcb3 100644 --- a/src/version2/tasks.ts +++ b/src/version2/tasks.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 Tasks { @@ -15,6 +15,10 @@ export class Tasks { * operation that created the task for details. Task details are not permanently retained. As of September 2019, * details are retained for 14 days although this period may change without notice. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - `read:jira-work` + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either * of: * @@ -33,6 +37,10 @@ export class Tasks { * operation that created the task for details. Task details are not permanently retained. As of September 2019, * details are retained for 14 days although this period may change without notice. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - `read:jira-work` + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** either * of: * diff --git a/src/version2/teamsInPlan.ts b/src/version2/teamsInPlan.ts new file mode 100644 index 0000000000..8939971c3f --- /dev/null +++ b/src/version2/teamsInPlan.ts @@ -0,0 +1,322 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class TeamsInPlan { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * plan-only and Atlassian teams in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTeams( + parameters: Parameters.GetTeams, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of + * plan-only and Atlassian teams in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTeams( + parameters: Parameters.GetTeams, + callback?: never, + ): Promise; + async getTeams( + parameters: Parameters.GetTeams, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team`, + method: 'GET', + params: { + cursor: parameters.cursor, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds an existing Atlassian team to a plan and configures their plannning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addAtlassianTeam(parameters: Parameters.AddAtlassianTeam, callback: Callback): Promise; + /** + * Adds an existing Atlassian team to a plan and configures their plannning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addAtlassianTeam(parameters: Parameters.AddAtlassianTeam, callback?: never): Promise; + async addAtlassianTeam(parameters: Parameters.AddAtlassianTeam, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/atlassian`, + method: 'POST', + data: { + capacity: parameters.capacity, + id: parameters.id, + issueSourceId: parameters.issueSourceId, + planningStyle: parameters.planningStyle, + sprintLength: parameters.sprintLength, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns planning settings for an Atlassian team in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAtlassianTeam( + parameters: Parameters.GetAtlassianTeam, + callback: Callback, + ): Promise; + /** + * Returns planning settings for an Atlassian team in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAtlassianTeam( + parameters: Parameters.GetAtlassianTeam, + callback?: never, + ): Promise; + async getAtlassianTeam( + parameters: Parameters.GetAtlassianTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates any of the following planning settings of an Atlassian team in a plan using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get Atlassian team in plan" + * endpoint to find out the order of array elements._ + */ + async updateAtlassianTeam(parameters: Parameters.UpdateAtlassianTeam, callback: Callback): Promise; + /** + * Updates any of the following planning settings of an Atlassian team in a plan using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get Atlassian team in plan" + * endpoint to find out the order of array elements._ + */ + async updateAtlassianTeam(parameters: Parameters.UpdateAtlassianTeam, callback?: never): Promise; + async updateAtlassianTeam( + parameters: Parameters.UpdateAtlassianTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes an Atlassian team from a plan and deletes their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeAtlassianTeam(parameters: Parameters.RemoveAtlassianTeam, callback: Callback): Promise; + /** + * Removes an Atlassian team from a plan and deletes their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeAtlassianTeam(parameters: Parameters.RemoveAtlassianTeam, callback?: never): Promise; + async removeAtlassianTeam( + parameters: Parameters.RemoveAtlassianTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a plan-only team and configures their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlanOnlyTeam( + parameters: Parameters.CreatePlanOnlyTeam, + callback: Callback, + ): Promise; + /** + * Creates a plan-only team and configures their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlanOnlyTeam(parameters: Parameters.CreatePlanOnlyTeam, callback?: never): Promise; + async createPlanOnlyTeam( + parameters: Parameters.CreatePlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/planonly`, + method: 'POST', + data: { + capacity: parameters.capacity, + issueSourceId: parameters.issueSourceId, + memberAccountIds: parameters.memberAccountIds, + name: parameters.name, + planningStyle: parameters.planningStyle, + sprintLength: parameters.sprintLength, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns planning settings for a plan-only team. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlanOnlyTeam( + parameters: Parameters.GetPlanOnlyTeam, + callback: Callback, + ): Promise; + /** + * Returns planning settings for a plan-only team. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlanOnlyTeam( + parameters: Parameters.GetPlanOnlyTeam, + callback?: never, + ): Promise; + async getPlanOnlyTeam( + parameters: Parameters.GetPlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates any of the following planning settings of a plan-only team using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - Name + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * - MemberAccountIds + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan-only team" + * endpoint to find out the order of array elements._ + */ + async updatePlanOnlyTeam(parameters: Parameters.UpdatePlanOnlyTeam, callback: Callback): Promise; + /** + * Updates any of the following planning settings of a plan-only team using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - Name + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * - MemberAccountIds + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan-only team" + * endpoint to find out the order of array elements._ + */ + async updatePlanOnlyTeam(parameters: Parameters.UpdatePlanOnlyTeam, callback?: never): Promise; + async updatePlanOnlyTeam( + parameters: Parameters.UpdatePlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a plan-only team and their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePlanOnlyTeam(parameters: Parameters.DeletePlanOnlyTeam, callback: Callback): Promise; + /** + * Deletes a plan-only team and their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePlanOnlyTeam(parameters: Parameters.DeletePlanOnlyTeam, callback?: never): Promise; + async deletePlanOnlyTeam( + parameters: Parameters.DeletePlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version2/timeTracking.ts b/src/version2/timeTracking.ts index 87358e0fd4..27096e6998 100644 --- a/src/version2/timeTracking.ts +++ b/src/version2/timeTracking.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 TimeTracking { @@ -136,7 +136,7 @@ export class TimeTracking { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async setSharedTimeTrackingConfiguration( - parameters: Parameters.SetSharedTimeTrackingConfiguration | undefined, + parameters: Parameters.SetSharedTimeTrackingConfiguration, callback: Callback, ): Promise; /** @@ -146,21 +146,21 @@ export class TimeTracking { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async setSharedTimeTrackingConfiguration( - parameters?: Parameters.SetSharedTimeTrackingConfiguration, + parameters: Parameters.SetSharedTimeTrackingConfiguration, callback?: never, ): Promise; async setSharedTimeTrackingConfiguration( - parameters?: Parameters.SetSharedTimeTrackingConfiguration, + parameters: Parameters.SetSharedTimeTrackingConfiguration, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/configuration/timetracking/options', method: 'PUT', data: { - workingHoursPerDay: parameters?.workingHoursPerDay, - workingDaysPerWeek: parameters?.workingDaysPerWeek, - timeFormat: parameters?.timeFormat, - defaultUnit: parameters?.defaultUnit, + workingHoursPerDay: parameters.workingHoursPerDay, + workingDaysPerWeek: parameters.workingDaysPerWeek, + timeFormat: parameters.timeFormat, + defaultUnit: parameters.defaultUnit, }, }; diff --git a/src/version2/uIModificationsApps.ts b/src/version2/uIModificationsApps.ts index c6f69acc54..ec3dd88769 100644 --- a/src/version2/uIModificationsApps.ts +++ b/src/version2/uIModificationsApps.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 UIModificationsApps { @@ -11,6 +11,9 @@ export class UIModificationsApps { * Gets UI modifications. UI modifications can only be retrieved by Forge apps. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async getUiModifications( parameters: Parameters.GetUiModifications | undefined, @@ -20,6 +23,9 @@ export class UIModificationsApps { * Gets UI modifications. UI modifications can only be retrieved by Forge apps. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async getUiModifications( parameters?: Parameters.GetUiModifications, @@ -45,13 +51,17 @@ export class UIModificationsApps { /** * Creates a UI modification. UI modification can only be created by Forge apps. * - * Each app can define up to 100 UI modifications. Each UI modification can define up to 1000 contexts. + * Each app can define up to 3000 UI modifications. Each UI modification can define up to 1000 contexts. The same + * context can be assigned to maximum 100 UI modifications. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * * - _None_ if the UI modification is created without contexts. * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the * UI modification is created with contexts. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async createUiModification( parameters: Parameters.CreateUiModification, @@ -60,13 +70,17 @@ export class UIModificationsApps { /** * Creates a UI modification. UI modification can only be created by Forge apps. * - * Each app can define up to 100 UI modifications. Each UI modification can define up to 1000 contexts. + * Each app can define up to 3000 UI modifications. Each UI modification can define up to 1000 contexts. The same + * context can be assigned to maximum 100 UI modifications. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * * - _None_ if the UI modification is created without contexts. * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the * UI modification is created with contexts. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async createUiModification( parameters: Parameters.CreateUiModification, @@ -93,13 +107,17 @@ export class UIModificationsApps { /** * Updates a UI modification. UI modification can only be updated by Forge apps. * - * Each UI modification can define up to 1000 contexts. + * Each UI modification can define up to 1000 contexts. The same context can be assigned to maximum 100 UI + * modifications. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * * - _None_ if the UI modification is created without contexts. * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the * UI modification is created with contexts. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateUiModification( parameters: Parameters.UpdateUiModification, @@ -108,13 +126,17 @@ export class UIModificationsApps { /** * Updates a UI modification. UI modification can only be updated by Forge apps. * - * Each UI modification can define up to 1000 contexts. + * Each UI modification can define up to 1000 contexts. The same context can be assigned to maximum 100 UI + * modifications. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * * - _None_ if the UI modification is created without contexts. * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the * UI modification is created with contexts. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateUiModification(parameters: Parameters.UpdateUiModification, callback?: never): Promise; async updateUiModification( @@ -125,10 +147,10 @@ export class UIModificationsApps { url: `/rest/api/2/uiModifications/${parameters.uiModificationId}`, method: 'PUT', data: { - name: parameters.name, - description: parameters.description, - data: parameters.data, contexts: parameters.contexts, + data: parameters.data, + description: parameters.description, + name: parameters.name, }, }; @@ -140,6 +162,9 @@ export class UIModificationsApps { * only be deleted by Forge apps. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async deleteUiModification( parameters: Parameters.DeleteUiModification | string, @@ -150,6 +175,9 @@ export class UIModificationsApps { * only be deleted by Forge apps. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** None. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async deleteUiModification( parameters: Parameters.DeleteUiModification | string, diff --git a/src/version2/userProperties.ts b/src/version2/userProperties.ts index c4a1b1f94c..48432a12ba 100644 --- a/src/version2/userProperties.ts +++ b/src/version2/userProperties.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 UserProperties { diff --git a/src/version2/userSearch.ts b/src/version2/userSearch.ts index 9d7a4ca6dc..b5c7314cbe 100644 --- a/src/version2/userSearch.ts +++ b/src/version2/userSearch.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 { paramSerializer } from '../paramSerializer'; import { RequestConfig } from '../requestConfig'; @@ -75,9 +75,9 @@ export class UserSearch { * assigned to: * * - A new issue, by providing the `projectKeyOrId`. - * - An updated issue, by providing the `issueKey`. - * - To an issue during a transition (workflow action), by providing the `issueKey` and the transition id in - * `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in + * - An updated issue, by providing the `issueKey` or `issueId`. + * - To an issue during a transition (workflow action), by providing the `issueKey` or `issueId` and the transition id + * in `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in * the `expand` parameter of [ Get issue](#api-rest-api-2-issue-issueIdOrKey-get). * * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is @@ -92,8 +92,9 @@ export class UserSearch { * the user's email address is hidden. See the [Profile visibility * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Assign issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) */ async findAssignableUsers( parameters: Parameters.FindAssignableUsers | undefined, @@ -104,9 +105,9 @@ export class UserSearch { * assigned to: * * - A new issue, by providing the `projectKeyOrId`. - * - An updated issue, by providing the `issueKey`. - * - To an issue during a transition (workflow action), by providing the `issueKey` and the transition id in - * `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in + * - An updated issue, by providing the `issueKey` or `issueId`. + * - To an issue during a transition (workflow action), by providing the `issueKey` or `issueId` and the transition id + * in `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in * the `expand` parameter of [ Get issue](#api-rest-api-2-issue-issueIdOrKey-get). * * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is @@ -121,8 +122,9 @@ export class UserSearch { * the user's email address is hidden. See the [Profile visibility * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** - * Permission to access Jira. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Assign issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) */ async findAssignableUsers( parameters?: Parameters.FindAssignableUsers, @@ -142,6 +144,7 @@ export class UserSearch { accountId: parameters?.accountId, project: parameters?.project, issueKey: parameters?.issueKey, + issueId: parameters?.issueId, startAt: parameters?.startAt, maxResults: parameters?.maxResults, actionDescriptorId: parameters?.actionDescriptorId, @@ -303,7 +306,7 @@ export class UserSearch { } /** - * Returns a list of users that match the search string and property. + * Returns a list of active users that match the search string and property. * * This operation first applies a filter to match the search string and property, and then takes the filtered users in * the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the @@ -325,7 +328,7 @@ export class UserSearch { callback: Callback, ): Promise; /** - * Returns a list of users that match the search string and property. + * Returns a list of active users that match the search string and property. * * This operation first applies a filter to match the search string and property, and then takes the filtered users in * the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the @@ -382,7 +385,9 @@ export class UserSearch { * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. For example, + * if user property `location` is set to value `{"office": {"country": "AU", "city": "Sydney"}}`, then it's possible + * to use `[location].office.city is "Sydney"` to match the user. * * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined * using the `AND` and `OR` operators to form more complex queries. For example: @@ -415,7 +420,9 @@ export class UserSearch { * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. For example, + * if user property `location` is set to value `{"office": {"country": "AU", "city": "Sydney"}}`, then it's possible + * to use `[location].office.city is "Sydney"` to match the user. * * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined * using the `AND` and `OR` operators to form more complex queries. For example: @@ -462,7 +469,9 @@ export class UserSearch { * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. For example, + * if user property `location` is set to value `{"office": {"country": "AU", "city": "Sydney"}}`, then it's possible + * to use `[location].office.city is "Sydney"` to match the user. * * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined * using the `AND` and `OR` operators to form more complex queries. For example: @@ -495,7 +504,9 @@ export class UserSearch { * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. For example, + * if user property `location` is set to value `{"office": {"country": "AU", "city": "Sydney"}}`, then it's possible + * to use `[location].office.city is "Sydney"` to match the user. * * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined * using the `AND` and `OR` operators to form more complex queries. For example: @@ -516,7 +527,7 @@ export class UserSearch { params: { query: parameters.query, startAt: parameters.startAt, - maxResults: parameters.maxResults, + maxResult: parameters.maxResult || parameters.maxResults, }, }; diff --git a/src/version2/users.ts b/src/version2/users.ts index 623d7be9b0..47e7f1647a 100644 --- a/src/version2/users.ts +++ b/src/version2/users.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 { paramSerializer } from '../paramSerializer'; import { RequestConfig } from '../requestConfig'; @@ -18,7 +18,7 @@ export class Users { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getUser(parameters: Parameters.GetUser | undefined, callback: Callback): Promise; + async getUser(parameters: Parameters.GetUser, callback: Callback): Promise; /** * Returns a user. * @@ -29,14 +29,14 @@ export class Users { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** _Browse * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getUser(parameters?: Parameters.GetUser, callback?: never): Promise; - async getUser(parameters?: Parameters.GetUser, callback?: Callback): Promise { + async getUser(parameters: Parameters.GetUser, callback?: never): Promise; + async getUser(parameters: Parameters.GetUser, callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/api/2/user', method: 'GET', params: { - accountId: parameters?.accountId, - expand: parameters?.expand, + accountId: parameters.accountId, + expand: parameters.expand, }, }; @@ -234,44 +234,31 @@ export class Users { * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns * are removed. * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` - * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. * - Permission to access Jira, to set the calling user's columns. */ - async setUserColumns( - parameters: Parameters.SetUserColumns | undefined, - callback: Callback, - ): Promise; + async setUserColumns(parameters: Parameters.SetUserColumns, callback: Callback): Promise; /** * Sets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If an account ID * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns * are removed. * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/2/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` - * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. * - Permission to access Jira, to set the calling user's columns. */ - async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: never): Promise; - async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: Callback): Promise { + async setUserColumns(parameters: Parameters.SetUserColumns, callback?: never): Promise; + async setUserColumns(parameters: Parameters.SetUserColumns, callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/api/2/user/columns', method: 'PUT', params: { - accountId: parameters?.accountId, + accountId: parameters.accountId, }, - data: parameters?.columns, + data: parameters.columns, }; return this.client.sendRequest(config, callback); @@ -311,16 +298,20 @@ export class Users { } /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * Returns a user's email address regardless of the user's profile visibility settings. For Connect apps, this API is + * only available to apps approved by Atlassian, according to these * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + * For Forge apps, this API only supports access via asApp() requests. */ async getUserEmail( parameters: Parameters.GetUserEmail | string, callback: Callback, ): Promise; /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * Returns a user's email address regardless of the user's profile visibility settings. For Connect apps, this API is + * only available to apps approved by Atlassian, according to these * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + * For Forge apps, this API only supports access via asApp() requests. */ async getUserEmail( parameters: Parameters.GetUserEmail | string, @@ -344,16 +335,20 @@ export class Users { } /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * Returns a user's email address regardless of the user's profile visibility settings. For Connect apps, this API is + * only available to apps approved by Atlassian, according to these * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + * For Forge apps, this API only supports access via asApp() requests. */ async getUserEmailBulk( parameters: Parameters.GetUserEmailBulk | string, callback: Callback, ): Promise; /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * Returns a user's email address regardless of the user's profile visibility settings. For Connect apps, this API is + * only available to apps approved by Atlassian, according to these * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + * For Forge apps, this API only supports access via asApp() requests. */ async getUserEmailBulk( parameters: Parameters.GetUserEmailBulk | string, diff --git a/src/version2/webhooks.ts b/src/version2/webhooks.ts index 1d32412afa..2d63f321f9 100644 --- a/src/version2/webhooks.ts +++ b/src/version2/webhooks.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 Webhooks { diff --git a/src/version2/workflowSchemeDrafts.ts b/src/version2/workflowSchemeDrafts.ts index 2a6a38cb1b..5482dd91b5 100644 --- a/src/version2/workflowSchemeDrafts.ts +++ b/src/version2/workflowSchemeDrafts.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 WorkflowSchemeDrafts { diff --git a/src/version2/workflowSchemeProjectAssociations.ts b/src/version2/workflowSchemeProjectAssociations.ts index cda7595756..e8a8df00e0 100644 --- a/src/version2/workflowSchemeProjectAssociations.ts +++ b/src/version2/workflowSchemeProjectAssociations.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 WorkflowSchemeProjectAssociations { @@ -61,7 +61,7 @@ export class WorkflowSchemeProjectAssociations { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async assignSchemeToProject( - parameters: Parameters.AssignSchemeToProject | undefined, + parameters: Parameters.AssignSchemeToProject, callback: Callback, ): Promise; /** @@ -72,17 +72,17 @@ export class WorkflowSchemeProjectAssociations { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async assignSchemeToProject(parameters?: Parameters.AssignSchemeToProject, callback?: never): Promise; + async assignSchemeToProject(parameters: Parameters.AssignSchemeToProject, callback?: never): Promise; async assignSchemeToProject( - parameters?: Parameters.AssignSchemeToProject, + parameters: Parameters.AssignSchemeToProject, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/2/workflowscheme/project', method: 'PUT', data: { - workflowSchemeId: parameters?.workflowSchemeId, - projectId: parameters?.projectId, + workflowSchemeId: parameters.workflowSchemeId, + projectId: parameters.projectId, }, }; diff --git a/src/version2/workflowSchemes.ts b/src/version2/workflowSchemes.ts index fa846e60fa..5f337cc9b0 100644 --- a/src/version2/workflowSchemes.ts +++ b/src/version2/workflowSchemes.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 WorkflowSchemes { @@ -92,6 +92,137 @@ export class WorkflowSchemes { return this.client.sendRequest(config, callback); } + /** + * Returns a list of workflow schemes by providing workflow scheme IDs or project IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflow schemes + * - _Administer projects_ project permissions to access project-scoped workflow schemes + */ + async readWorkflowSchemes( + parameters: Parameters.ReadWorkflowSchemes, + callback: Callback, + ): Promise; + /** + * Returns a list of workflow schemes by providing workflow scheme IDs or project IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflow schemes + * - _Administer projects_ project permissions to access project-scoped workflow schemes + */ + async readWorkflowSchemes( + parameters: Parameters.ReadWorkflowSchemes, + callback?: never, + ): Promise; + async readWorkflowSchemes( + parameters: Parameters.ReadWorkflowSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflowscheme/read', + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + projectIds: parameters.projectIds, + workflowSchemeIds: parameters.workflowSchemeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates company-managed and team-managed project workflow schemes. This API doesn't have a concept of draft, so any + * changes made to a workflow scheme are immediately available. When changing the available statuses for issue types, + * an [asynchronous task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations) + * migrates the issues as defined in the provided mappings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to update all, including global-scoped, workflow schemes. + * - _Administer projects_ project permission to update project-scoped workflow schemes. + */ + async updateSchemes(parameters: Parameters.UpdateSchemes, callback: Callback): Promise; + /** + * Updates company-managed and team-managed project workflow schemes. This API doesn't have a concept of draft, so any + * changes made to a workflow scheme are immediately available. When changing the available statuses for issue types, + * an [asynchronous task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations) + * migrates the issues as defined in the provided mappings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to update all, including global-scoped, workflow schemes. + * - _Administer projects_ project permission to update project-scoped workflow schemes. + */ + async updateSchemes(parameters: Parameters.UpdateSchemes, callback?: never): Promise; + async updateSchemes(parameters: Parameters.UpdateSchemes, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflowscheme/update', + method: 'POST', + data: { + defaultWorkflowId: parameters.defaultWorkflowId, + description: parameters.description, + id: parameters.id, + name: parameters.name, + statusMappingsByIssueTypeOverride: parameters.statusMappingsByIssueTypeOverride, + statusMappingsByWorkflows: parameters.statusMappingsByWorkflows, + version: parameters.version, + workflowsForIssueTypes: parameters.workflowsForIssueTypes, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets the required status mappings for the desired changes to a workflow scheme. The results are provided per issue + * type and workflow. When updating a workflow scheme, status mappings can be provided per issue type, per workflow, + * or both. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ permission to update all, including global-scoped, workflow schemes. + * - _Administer projects_ project permission to update project-scoped workflow schemes. + */ + async updateWorkflowSchemeMappings( + parameters: Parameters.UpdateWorkflowSchemeMappings, + callback: Callback, + ): Promise; + /** + * Gets the required status mappings for the desired changes to a workflow scheme. The results are provided per issue + * type and workflow. When updating a workflow scheme, status mappings can be provided per issue type, per workflow, + * or both. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ permission to update all, including global-scoped, workflow schemes. + * - _Administer projects_ project permission to update project-scoped workflow schemes. + */ + async updateWorkflowSchemeMappings( + parameters: Parameters.UpdateWorkflowSchemeMappings, + callback?: never, + ): Promise; + async updateWorkflowSchemeMappings( + parameters: Parameters.UpdateWorkflowSchemeMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflowscheme/update/mappings', + method: 'POST', + data: { + defaultWorkflowId: parameters.defaultWorkflowId, + id: parameters.id, + workflowsForIssueTypes: parameters.workflowsForIssueTypes, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Returns a workflow scheme. * @@ -593,4 +724,30 @@ export class WorkflowSchemes { return this.client.sendRequest(config, callback); } + + /** Returns a page of projects using a given workflow scheme. */ + async getProjectUsagesForWorkflowScheme( + parameters: Parameters.GetProjectUsagesForWorkflowScheme, + callback: Callback, + ): Promise; + /** Returns a page of projects using a given workflow scheme. */ + async getProjectUsagesForWorkflowScheme( + parameters: Parameters.GetProjectUsagesForWorkflowScheme, + callback?: never, + ): Promise; + async getProjectUsagesForWorkflowScheme( + parameters: Parameters.GetProjectUsagesForWorkflowScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflowscheme/${parameters.workflowSchemeId}/projectUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version2/workflowStatusCategories.ts b/src/version2/workflowStatusCategories.ts index 64588da218..fdc22a1797 100644 --- a/src/version2/workflowStatusCategories.ts +++ b/src/version2/workflowStatusCategories.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 WorkflowStatusCategories { diff --git a/src/version2/workflowStatuses.ts b/src/version2/workflowStatuses.ts index 32d2d469ad..2523fbe410 100644 --- a/src/version2/workflowStatuses.ts +++ b/src/version2/workflowStatuses.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 WorkflowStatuses { diff --git a/src/version2/workflowTransitionProperties.ts b/src/version2/workflowTransitionProperties.ts index 035515a9cc..cdb129cb90 100644 --- a/src/version2/workflowTransitionProperties.ts +++ b/src/version2/workflowTransitionProperties.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 WorkflowTransitionProperties { diff --git a/src/version2/workflowTransitionRules.ts b/src/version2/workflowTransitionRules.ts index ed920a1c35..85874662e6 100644 --- a/src/version2/workflowTransitionRules.ts +++ b/src/version2/workflowTransitionRules.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 WorkflowTransitionRules { @@ -92,7 +92,7 @@ export class WorkflowTransitionRules { * * - Disable a rule. * - Add a `tag`. Use this to filter rules in the [Get workflow transition rule - * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). + * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflow-transition-rules/#api-rest-api-2-workflow-rule-config-get). * * Rules are enabled if the `disabled` parameter is not provided. * @@ -119,7 +119,7 @@ export class WorkflowTransitionRules { * * - Disable a rule. * - Add a `tag`. Use this to filter rules in the [Get workflow transition rule - * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). + * configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflow-transition-rules/#api-rest-api-2-workflow-rule-config-get). * * Rules are enabled if the `disabled` parameter is not provided. * diff --git a/src/version2/workflows.ts b/src/version2/workflows.ts index 8b2729c337..20b0c9c929 100644 --- a/src/version2/workflows.ts +++ b/src/version2/workflows.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 { paramSerializer } from '../paramSerializer'; import { RequestConfig } from '../requestConfig'; @@ -9,7 +9,11 @@ export class Workflows { constructor(private client: Client) {} /** - * Creates a workflow. Workflow transitions are created with the default system transition rules. + * Creates a workflow. You can define transition rules using the shapes detailed in the following sections. If no + * transitional rules are specified the default system transition rules are used. Note: This only applies to + * company-managed scoped workflows. Use [bulk create + * workflows](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflows/#api-rest-api-2-workflows-create-post) + * to create both team and company-managed scoped workflows. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -19,7 +23,11 @@ export class Workflows { callback: Callback, ): Promise; /** - * Creates a workflow. Workflow transitions are created with the default system transition rules. + * Creates a workflow. You can define transition rules using the shapes detailed in the following sections. If no + * transitional rules are specified the default system transition rules are used. Note: This only applies to + * company-managed scoped workflows. Use [bulk create + * workflows](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-workflows/#api-rest-api-2-workflows-create-post) + * to create both team and company-managed scoped workflows. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -140,6 +148,84 @@ export class Workflows { return this.client.sendRequest(config, callback); } + /** Returns a page of issue types using a given workflow within a project. */ + async getWorkflowProjectIssueTypeUsages( + parameters: Parameters.GetWorkflowProjectIssueTypeUsages, + callback: Callback, + ): Promise; + /** Returns a page of issue types using a given workflow within a project. */ + async getWorkflowProjectIssueTypeUsages( + parameters: Parameters.GetWorkflowProjectIssueTypeUsages, + callback?: never, + ): Promise; + async getWorkflowProjectIssueTypeUsages( + parameters: Parameters.GetWorkflowProjectIssueTypeUsages, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflow/${parameters.workflowId}/project/${parameters.projectId}/issueTypeUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of projects using a given workflow. */ + async getProjectUsagesForWorkflow( + parameters: Parameters.GetProjectUsagesForWorkflow, + callback: Callback, + ): Promise; + /** Returns a page of projects using a given workflow. */ + async getProjectUsagesForWorkflow( + parameters: Parameters.GetProjectUsagesForWorkflow, + callback?: never, + ): Promise; + async getProjectUsagesForWorkflow( + parameters: Parameters.GetProjectUsagesForWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflow/${parameters.workflowId}/projectUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of workflow schemes using a given workflow. */ + async getWorkflowSchemeUsagesForWorkflow( + parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, + callback: Callback, + ): Promise; + /** Returns a page of workflow schemes using a given workflow. */ + async getWorkflowSchemeUsagesForWorkflow( + parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, + callback?: never, + ): Promise; + async getWorkflowSchemeUsagesForWorkflow( + parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/2/workflow/${parameters.workflowId}/workflowSchemes`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Returns a list of workflows and related statuses by providing workflow names, workflow IDs, or project and issue * types. @@ -173,7 +259,8 @@ export class Workflows { url: '/rest/api/2/workflows', method: 'POST', params: { - expand: parameters.expand, + useTransitionLinksFormat: parameters.useTransitionLinksFormat, + useApprovalConfiguration: parameters.useApprovalConfiguration, }, data: { projectAndIssueTypes: parameters.projectAndIssueTypes, @@ -188,7 +275,7 @@ export class Workflows { /** * Get the list of workflow capabilities for a specific workflow using either the workflow ID, or the project and * issue type ID pair. The response includes the scope of the workflow, defined as global/project-based, and a list of - * project types that the workflow is scoped to. It also includes all rules organized into their broad categories + * project types that the workflow is scoped to. It also includes all rules organised into their broad categories * (conditions, validators, actions, triggers, screens) as well as the source location (Atlassian-provided, Connect, * Forge). * @@ -204,7 +291,7 @@ export class Workflows { /** * Get the list of workflow capabilities for a specific workflow using either the workflow ID, or the project and * issue type ID pair. The response includes the scope of the workflow, defined as global/project-based, and a list of - * project types that the workflow is scoped to. It also includes all rules organized into their broad categories + * project types that the workflow is scoped to. It also includes all rules organised into their broad categories * (conditions, validators, actions, triggers, screens) as well as the source location (Atlassian-provided, Connect, * Forge). * @@ -242,7 +329,7 @@ export class Workflows { * - _Administer Jira_ project permission to create all, including global-scoped, workflows * - _Administer projects_ project permissions to create project-scoped workflows */ - async createWorkflows( + async createWorkflows( parameters: Parameters.CreateWorkflows, callback: Callback, ): Promise; @@ -254,11 +341,11 @@ export class Workflows { * - _Administer Jira_ project permission to create all, including global-scoped, workflows * - _Administer projects_ project permissions to create project-scoped workflows */ - async createWorkflows( + async createWorkflows( parameters: Parameters.CreateWorkflows, callback?: never, ): Promise; - async createWorkflows( + async createWorkflows( parameters: Parameters.CreateWorkflows, callback?: Callback, ): Promise { @@ -315,6 +402,57 @@ export class Workflows { return this.client.sendRequest(config, callback); } + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of global + * and project workflows. If workflow names are specified in query string, details of those workflows are returned. + * Otherwise, all workflows are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflows + * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access + * project-scoped workflows + */ + async searchWorkflows( + parameters: Parameters.SearchWorkflows | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#pagination) list of global + * and project workflows. If workflow names are specified in query string, details of those workflows are returned. + * Otherwise, all workflows are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflows + * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access + * project-scoped workflows + */ + async searchWorkflows( + parameters?: Parameters.SearchWorkflows, + callback?: never, + ): Promise; + async searchWorkflows( + parameters?: Parameters.SearchWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/2/workflows/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + expand: parameters?.expand, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + scope: parameters?.scope, + isActive: parameters?.isActive, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Update workflows and related statuses. * @@ -323,7 +461,7 @@ export class Workflows { * - _Administer Jira_ project permission to create all, including global-scoped, workflows * - _Administer projects_ project permissions to create project-scoped workflows */ - async updateWorkflows( + async updateWorkflows( parameters: Parameters.UpdateWorkflows, callback: Callback, ): Promise; @@ -335,11 +473,11 @@ export class Workflows { * - _Administer Jira_ project permission to create all, including global-scoped, workflows * - _Administer projects_ project permissions to create project-scoped workflows */ - async updateWorkflows( + async updateWorkflows( parameters: Parameters.UpdateWorkflows, callback?: never, ): Promise; - async updateWorkflows( + async updateWorkflows( parameters: Parameters.UpdateWorkflows, callback?: Callback, ): Promise { diff --git a/src/version3/announcementBanner.ts b/src/version3/announcementBanner.ts index e0e8ff2b27..6838dce374 100644 --- a/src/version3/announcementBanner.ts +++ b/src/version3/announcementBanner.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 AnnouncementBanner { diff --git a/src/version3/appDataPolicies.ts b/src/version3/appDataPolicies.ts new file mode 100644 index 0000000000..990fa5a11d --- /dev/null +++ b/src/version3/appDataPolicies.ts @@ -0,0 +1,44 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class AppDataPolicies { + constructor(private client: Client) {} + + /** Returns data policy for the workspace. */ + async getPolicy(callback: Callback): Promise; + /** Returns data policy for the workspace. */ + async getPolicy(callback?: never): Promise; + async getPolicy(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/data-policy', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns data policies for the projects specified in the request. */ + async getPolicies( + parameters: Parameters.GetPolicies, + callback: Callback, + ): Promise; + /** Returns data policies for the projects specified in the request. */ + async getPolicies(parameters: Parameters.GetPolicies, callback?: never): Promise; + async getPolicies( + parameters: Parameters.GetPolicies, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/data-policy/project', + method: 'GET', + params: { + ids: typeof parameters.ids === 'string' ? parameters.ids : parameters.ids.join(','), + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/appMigration.ts b/src/version3/appMigration.ts index cbea50328c..ef89f47f32 100644 --- a/src/version3/appMigration.ts +++ b/src/version3/appMigration.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 AppMigration { @@ -12,7 +12,7 @@ export class AppMigration { * fields can be updated. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. + * Connect apps can make this request */ async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback: Callback): Promise; /** @@ -20,7 +20,7 @@ export class AppMigration { * fields can be updated. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can make this request. + * Connect apps can make this request */ async updateIssueFields(parameters: Parameters.UpdateIssueFields, callback?: never): Promise; async updateIssueFields( diff --git a/src/version3/appProperties.ts b/src/version3/appProperties.ts index 9dd3e5722f..0bc4f1a0ee 100644 --- a/src/version3/appProperties.ts +++ b/src/version3/appProperties.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 AppProperties { @@ -11,9 +11,8 @@ export class AppProperties { * Gets all the properties of an app. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async getAddonProperties( parameters: Parameters.GetAddonProperties | string, @@ -23,9 +22,8 @@ export class AppProperties { * Gets all the properties of an app. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async getAddonProperties( parameters: Parameters.GetAddonProperties | string, @@ -49,9 +47,8 @@ export class AppProperties { * Returns the key and value of an app's property. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async getAddonProperty( parameters: Parameters.GetAddonProperty, @@ -61,9 +58,8 @@ export class AppProperties { * Returns the key and value of an app's property. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the - * Marketplace can access properties of Connect apps they were [migrated - * from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async getAddonProperty( parameters: Parameters.GetAddonProperty, @@ -88,7 +84,8 @@ export class AppProperties { * maximum length is 32768 characters. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async putAddonProperty( parameters: Parameters.PutAddonProperty, @@ -101,7 +98,8 @@ export class AppProperties { * maximum length is 32768 characters. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async putAddonProperty( parameters: Parameters.PutAddonProperty, @@ -124,14 +122,16 @@ export class AppProperties { * Deletes an app's property. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback: Callback): Promise; /** * Deletes an app's property. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only a - * Connect app whose key matches `addonKey` can make this request. + * Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps can access Connect app + * properties (stored against the same `app.connect.key`). */ async deleteAddonProperty(parameters: Parameters.DeleteAddonProperty, callback?: never): Promise; async deleteAddonProperty( @@ -159,6 +159,9 @@ export class AppProperties { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only * Forge apps can make this request. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async putAppProperty( parameters: Parameters.PutAppProperty, @@ -177,6 +180,9 @@ export class AppProperties { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only * Forge apps can make this request. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async putAppProperty( parameters: Parameters.PutAppProperty, @@ -200,6 +206,9 @@ export class AppProperties { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only * Forge apps can make this request. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback: Callback): Promise; /** @@ -207,6 +216,9 @@ export class AppProperties { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only * Forge apps can make this request. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async deleteAppProperty(parameters: Parameters.DeleteAppProperty, callback?: never): Promise; async deleteAppProperty( diff --git a/src/version3/applicationRoles.ts b/src/version3/applicationRoles.ts index 6ffd77f954..da42434b82 100644 --- a/src/version3/applicationRoles.ts +++ b/src/version3/applicationRoles.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 ApplicationRoles { diff --git a/src/version3/auditRecords.ts b/src/version3/auditRecords.ts index 4dd4989a93..2d6e824134 100644 --- a/src/version3/auditRecords.ts +++ b/src/version3/auditRecords.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 AuditRecords { diff --git a/src/version3/avatars.ts b/src/version3/avatars.ts index 849e211659..f4509b2723 100644 --- a/src/version3/avatars.ts +++ b/src/version3/avatars.ts @@ -1,14 +1,15 @@ 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 Avatars { constructor(private client: Client) {} /** - * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. + * Returns a list of system avatar details by owner type, where the owner types are issue type, project, user or + * priority. * * This operation can be accessed anonymously. * @@ -19,7 +20,8 @@ export class Avatars { callback: Callback, ): Promise; /** - * Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. + * Returns a list of system avatar details by owner type, where the owner types are issue type, project, user or + * priority. * * This operation can be accessed anonymously. * @@ -44,7 +46,7 @@ export class Avatars { } /** - * Returns the system and custom avatars for a project or issue type. + * Returns the system and custom avatars for a project, issue type or priority. * * This operation can be accessed anonymously. * @@ -55,10 +57,11 @@ export class Avatars { * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. * - For system avatars, none. + * - For priority avatars, none. */ async getAvatars(parameters: Parameters.GetAvatars, callback: Callback): Promise; /** - * Returns the system and custom avatars for a project or issue type. + * Returns the system and custom avatars for a project, issue type or priority. * * This operation can be accessed anonymously. * @@ -69,6 +72,7 @@ export class Avatars { * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. * - For system avatars, none. + * - For priority avatars, none. */ async getAvatars(parameters: Parameters.GetAvatars, callback?: never): Promise; async getAvatars(parameters: Parameters.GetAvatars, callback?: Callback): Promise { @@ -81,13 +85,7 @@ export class Avatars { } /** - * Loads a custom avatar for a project or issue type. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * Loads a custom avatar for a project, issue type or priority. * * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of * the image. The length of the square's sides is set to the smaller of the height or width of the image. @@ -96,22 +94,22 @@ export class Avatars { * * After creating the avatar use: * - * - [Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's displayed avatar. - * - [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed - * avatar. + * - [Update issue + * type](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-types/#api-rest-api-3-issuetype-id-put) + * to set it as the issue type's displayed avatar. + * - [Set project + * avatar](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-avatars/#api-rest-api-3-project-projectidorkey-avatar-put) + * to set it as the project's displayed avatar. + * - [Update + * priority](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-priorities/#api-rest-api-3-priority-id-put) + * to set it as the priority's displayed avatar. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async storeAvatar(parameters: Parameters.StoreAvatar, callback: Callback): Promise; /** - * Loads a custom avatar for a project or issue type. - * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. + * Loads a custom avatar for a project, issue type or priority. * * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of * the image. The length of the square's sides is set to the smaller of the height or width of the image. @@ -120,9 +118,15 @@ export class Avatars { * * After creating the avatar use: * - * - [Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's displayed avatar. - * - [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed - * avatar. + * - [Update issue + * type](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-types/#api-rest-api-3-issuetype-id-put) + * to set it as the issue type's displayed avatar. + * - [Set project + * avatar](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-avatars/#api-rest-api-3-project-projectidorkey-avatar-put) + * to set it as the project's displayed avatar. + * - [Update + * priority](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-priorities/#api-rest-api-3-priority-id-put) + * to set it as the priority's displayed avatar. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -132,10 +136,14 @@ export class Avatars { const config: RequestConfig = { url: `/rest/api/3/universal_avatar/type/${parameters.type}/owner/${parameters.entityId}`, method: 'POST', + headers: { + 'X-Atlassian-Token': 'no-check', + 'Content-Type': parameters.mimeType, + }, params: { x: parameters.x, y: parameters.y, - size: parameters.size, + size: parameters.size ?? 0, }, data: parameters.avatar, }; @@ -144,14 +152,14 @@ export class Avatars { } /** - * Deletes an avatar from a project or issue type. + * Deletes an avatar from a project, issue type or priority. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async deleteAvatar(parameters: Parameters.DeleteAvatar, callback: Callback): Promise; /** - * Deletes an avatar from a project or issue type. + * Deletes an avatar from a project, issue type or priority. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -167,7 +175,7 @@ export class Avatars { } /** - * Returns the default project or issue type avatar image. + * Returns the default project, issue type or priority avatar image. * * This operation can be accessed anonymously. * @@ -178,7 +186,7 @@ export class Avatars { callback: Callback, ): Promise; /** - * Returns the default project or issue type avatar image. + * Returns the default project, issue type or priority avatar image. * * This operation can be accessed anonymously. * @@ -199,8 +207,8 @@ export class Avatars { method: 'GET', responseType: 'arraybuffer', params: { - size: typeof parameters !== 'string' && parameters.size, - format: typeof parameters !== 'string' && parameters.format, + size: typeof parameters !== 'string' ? parameters.size : undefined, + format: typeof parameters !== 'string' ? parameters.format : undefined, }, }; @@ -215,7 +223,7 @@ export class Avatars { } /** - * Returns a project or issue type avatar image by ID. + * Returns a project, issue type or priority avatar image by ID. * * This operation can be accessed anonymously. * @@ -226,13 +234,14 @@ export class Avatars { * the project the avatar belongs to. * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. + * - For priority avatars, none. */ async getAvatarImageByID( parameters: Parameters.GetAvatarImageByID, callback: Callback, ): Promise; /** - * Returns a project or issue type avatar image by ID. + * Returns a project, issue type or priority avatar image by ID. * * This operation can be accessed anonymously. * @@ -243,6 +252,7 @@ export class Avatars { * the project the avatar belongs to. * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. + * - For priority avatars, none. */ async getAvatarImageByID( parameters: Parameters.GetAvatarImageByID, @@ -273,7 +283,7 @@ export class Avatars { } /** - * Returns the avatar image for a project or issue type. + * Returns the avatar image for a project, issue type or priority. * * This operation can be accessed anonymously. * @@ -284,13 +294,14 @@ export class Avatars { * the project the avatar belongs to. * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. + * - For priority avatars, none. */ async getAvatarImageByOwner( parameters: Parameters.GetAvatarImageByOwner, callback: Callback, ): Promise; /** - * Returns the avatar image for a project or issue type. + * Returns the avatar image for a project, issue type or priority. * * This operation can be accessed anonymously. * @@ -301,6 +312,7 @@ export class Avatars { * the project the avatar belongs to. * - For custom issue type avatars, _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) * for at least one project the issue type is used in. + * - For priority avatars, none. */ async getAvatarImageByOwner( parameters: Parameters.GetAvatarImageByOwner, diff --git a/src/version3/classificationLevels.ts b/src/version3/classificationLevels.ts new file mode 100644 index 0000000000..5f9b3a5793 --- /dev/null +++ b/src/version3/classificationLevels.ts @@ -0,0 +1,43 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class ClassificationLevels { + constructor(private client: Client) {} + + /** + * Returns all classification levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllUserDataClassificationLevels( + parameters: Parameters.GetAllUserDataClassificationLevels | undefined, + callback: Callback, + ): Promise; + /** + * Returns all classification levels. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + */ + async getAllUserDataClassificationLevels( + parameters?: Parameters.GetAllUserDataClassificationLevels, + callback?: never, + ): Promise; + async getAllUserDataClassificationLevels( + parameters?: Parameters.GetAllUserDataClassificationLevels, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/classification-levels', + method: 'GET', + params: { + status: parameters?.status, + orderBy: parameters?.orderBy, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/client/version3Client.ts b/src/version3/client/version3Client.ts index 25fb690877..a6d4387a6a 100644 --- a/src/version3/client/version3Client.ts +++ b/src/version3/client/version3Client.ts @@ -1,10 +1,12 @@ import { BaseClient } from '../../clients/baseClient'; import { AnnouncementBanner } from '../announcementBanner'; +import { AppDataPolicies } from '../appDataPolicies'; import { AppMigration } from '../appMigration'; import { AppProperties } from '../appProperties'; import { ApplicationRoles } from '../applicationRoles'; import { AuditRecords } from '../auditRecords'; import { Avatars } from '../avatars'; +import { ClassificationLevels } from '../classificationLevels'; import { Dashboards } from '../dashboards'; import { DynamicModules } from '../dynamicModules'; import { FilterSharing } from '../filterSharing'; @@ -13,6 +15,7 @@ import { GroupAndUserPicker } from '../groupAndUserPicker'; import { Groups } from '../groups'; import { InstanceInformation } from '../instanceInformation'; import { IssueAttachments } from '../issueAttachments'; +import { IssueBulkOperations } from '../issueBulkOperations'; import { IssueCommentProperties } from '../issueCommentProperties'; import { IssueComments } from '../issueComments'; import { IssueCustomFieldConfigurationApps } from '../issueCustomFieldConfigurationApps'; @@ -50,9 +53,12 @@ import { Labels } from '../labels'; import { LicenseMetrics } from '../licenseMetrics'; import { Myself } from '../myself'; import { PermissionSchemes } from '../permissionSchemes'; +import { Plans } from '../plans'; +import { PrioritySchemes } from '../prioritySchemes'; import { Permissions } from '../permissions'; import { ProjectAvatars } from '../projectAvatars'; import { ProjectCategories } from '../projectCategories'; +import { ProjectClassificationLevels } from '../projectClassificationLevels'; import { ProjectComponents } from '../projectComponents'; import { ProjectEmail } from '../projectEmail'; import { ProjectFeatures } from '../projectFeatures'; @@ -69,8 +75,10 @@ import { ScreenTabFields } from '../screenTabFields'; import { ScreenTabs } from '../screenTabs'; import { Screens } from '../screens'; import { ServerInfo } from '../serverInfo'; +import { ServiceRegistry } from '../serviceRegistry'; import { Status } from '../status'; import { Tasks } from '../tasks'; +import { TeamsInPlan } from '../teamsInPlan'; import { TimeTracking } from '../timeTracking'; import { UIModificationsApps } from '../uIModificationsApps'; import { UserProperties } from '../userProperties'; @@ -88,11 +96,13 @@ import { WorkflowTransitionRules } from '../workflowTransitionRules'; export class Version3Client extends BaseClient { announcementBanner = new AnnouncementBanner(this); + appDataPolicies = new AppDataPolicies(this); applicationRoles = new ApplicationRoles(this); appMigration = new AppMigration(this); appProperties = new AppProperties(this); auditRecords = new AuditRecords(this); avatars = new Avatars(this); + classificationLevels = new ClassificationLevels(this); dashboards = new Dashboards(this); dynamicModules = new DynamicModules(this); filters = new Filters(this); @@ -101,6 +111,7 @@ export class Version3Client extends BaseClient { groups = new Groups(this); instanceInformation = new InstanceInformation(this); issueAttachments = new IssueAttachments(this); + issueBulkOperations = new IssueBulkOperations(this); issueCommentProperties = new IssueCommentProperties(this); issueComments = new IssueComments(this); issueCustomFieldConfigurationApps = new IssueCustomFieldConfigurationApps(this); @@ -139,8 +150,11 @@ export class Version3Client extends BaseClient { myself = new Myself(this); permissions = new Permissions(this); permissionSchemes = new PermissionSchemes(this); + plans = new Plans(this); + prioritySchemes = new PrioritySchemes(this); projectAvatars = new ProjectAvatars(this); projectCategories = new ProjectCategories(this); + projectClassificationLevels = new ProjectClassificationLevels(this); projectComponents = new ProjectComponents(this); projectEmail = new ProjectEmail(this); projectFeatures = new ProjectFeatures(this); @@ -157,8 +171,10 @@ export class Version3Client extends BaseClient { screenTabFields = new ScreenTabFields(this); screenTabs = new ScreenTabs(this); serverInfo = new ServerInfo(this); + serviceRegistry = new ServiceRegistry(this); status = new Status(this); tasks = new Tasks(this); + teamsInPlan = new TeamsInPlan(this); timeTracking = new TimeTracking(this); uiModificationsApps = new UIModificationsApps(this); userProperties = new UserProperties(this); diff --git a/src/version3/dashboards.ts b/src/version3/dashboards.ts index cbec827763..b81b114161 100644 --- a/src/version3/dashboards.ts +++ b/src/version3/dashboards.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 Dashboards { @@ -70,6 +70,9 @@ export class Dashboards { const config: RequestConfig = { url: '/rest/api/3/dashboard', method: 'POST', + params: { + extendAdminPermissions: parameters.extendAdminPermissions, + }, data: { description: parameters.description, editPermissions: parameters.editPermissions, @@ -648,6 +651,9 @@ export class Dashboards { const config: RequestConfig = { url: `/rest/api/3/dashboard/${parameters.id}`, method: 'PUT', + params: { + extendAdminPermissions: parameters.extendAdminPermissions, + }, data: { description: parameters.description, editPermissions: parameters.editPermissions, @@ -715,6 +721,9 @@ export class Dashboards { const config: RequestConfig = { url: `/rest/api/3/dashboard/${parameters.id}/copy`, method: 'POST', + params: { + extendAdminPermissions: parameters.extendAdminPermissions, + }, data: { description: parameters.description, editPermissions: parameters.editPermissions, diff --git a/src/version3/dynamicModules.ts b/src/version3/dynamicModules.ts index 205b9af6c2..e799a499b7 100644 --- a/src/version3/dynamicModules.ts +++ b/src/version3/dynamicModules.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 DynamicModules { diff --git a/src/version3/filterSharing.ts b/src/version3/filterSharing.ts index be262344a7..715e1e98ef 100644 --- a/src/version3/filterSharing.ts +++ b/src/version3/filterSharing.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 FilterSharing { @@ -159,13 +159,13 @@ export class FilterSharing { url: `/rest/api/3/filter/${parameters.id}/permission`, method: 'POST', data: { - type: parameters.type, - projectId: parameters.projectId, + accountId: parameters.accountId, + groupId: parameters.groupId, groupname: parameters.groupname, + projectId: parameters.projectId, projectRoleId: parameters.projectRoleId, - accountId: parameters.accountId, rights: parameters.rights, - groupId: parameters.groupId, + type: parameters.type, }, }; diff --git a/src/version3/filters.ts b/src/version3/filters.ts index af84c7be04..cf55521b93 100644 --- a/src/version3/filters.ts +++ b/src/version3/filters.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 Filters { @@ -31,10 +31,11 @@ export class Filters { url: '/rest/api/3/filter', method: 'POST', params: { - expand: parameters?.expand, - overrideSharePermissions: parameters?.overrideSharePermissions, + expand: parameters.expand, + overrideSharePermissions: parameters.overrideSharePermissions, }, data: { + approximateLastUsed: parameters.approximateLastUsed, description: parameters.description, editPermissions: parameters.editPermissions, favourite: parameters.favourite, @@ -236,6 +237,7 @@ export class Filters { maxResults: parameters?.maxResults, expand: parameters?.expand, overrideSharePermissions: parameters?.overrideSharePermissions, + isSubstringMatch: parameters?.isSubstringMatch, }, }; diff --git a/src/version3/groupAndUserPicker.ts b/src/version3/groupAndUserPicker.ts index c1f42bbc73..e72ef3b63f 100644 --- a/src/version3/groupAndUserPicker.ts +++ b/src/version3/groupAndUserPicker.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 GroupAndUserPicker { diff --git a/src/version3/groups.ts b/src/version3/groups.ts index 1b30b6cd9e..555647b4d3 100644 --- a/src/version3/groups.ts +++ b/src/version3/groups.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 Groups { @@ -106,8 +106,11 @@ export class Groups { * Note that users are ordered by username, however the username is not returned in the results due to privacy * reasons. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getUsersFromGroup( parameters: Parameters.GetUsersFromGroup, @@ -120,8 +123,11 @@ export class Groups { * Note that users are ordered by username, however the username is not returned in the results due to privacy * reasons. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either + * of: + * + * - _Browse users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async getUsersFromGroup( parameters: Parameters.GetUsersFromGroup, diff --git a/src/version3/index.ts b/src/version3/index.ts index 86cbc71d60..978f72aa76 100644 --- a/src/version3/index.ts +++ b/src/version3/index.ts @@ -1,17 +1,19 @@ export * from './announcementBanner'; -export * from './applicationRoles'; +export * from './appDataPolicies'; export * from './appMigration'; export * from './appProperties'; +export * from './applicationRoles'; export * from './auditRecords'; export * from './avatars'; +export * from './classificationLevels'; export * from './dashboards'; export * from './dynamicModules'; -export * from './filters'; export * from './filterSharing'; +export * from './filters'; export * from './groupAndUserPicker'; export * from './groups'; -export * from './instanceInformation'; export * from './issueAttachments'; +export * from './issueBulkOperations'; export * from './issueCommentProperties'; export * from './issueComments'; export * from './issueCustomFieldConfigurationApps'; @@ -21,26 +23,26 @@ export * from './issueCustomFieldOptionsApps'; export * from './issueCustomFieldValuesApps'; export * from './issueFieldConfigurations'; export * from './issueFields'; -export * from './issueLinks'; export * from './issueLinkTypes'; +export * from './issueLinks'; export * from './issueNavigatorSettings'; export * from './issueNotificationSchemes'; export * from './issuePriorities'; export * from './issueProperties'; export * from './issueRemoteLinks'; export * from './issueResolutions'; -export * from './issues'; export * from './issueSearch'; export * from './issueSecurityLevel'; export * from './issueSecuritySchemes'; export * from './issueTypeProperties'; -export * from './issueTypes'; export * from './issueTypeSchemes'; export * from './issueTypeScreenSchemes'; +export * from './issueTypes'; export * from './issueVotes'; export * from './issueWatchers'; export * from './issueWorklogProperties'; export * from './issueWorklogs'; +export * from './issues'; export * from './jiraExpressions'; export * from './jiraSettings'; export * from './jQL'; @@ -48,10 +50,13 @@ export * from './jqlFunctionsApps'; export * from './labels'; export * from './licenseMetrics'; export * from './myself'; -export * from './permissions'; export * from './permissionSchemes'; +export * from './permissions'; +export * from './plans'; +export * from './prioritySchemes'; export * from './projectAvatars'; export * from './projectCategories'; +export * from './projectClassificationLevels'; export * from './projectComponents'; export * from './projectEmail'; export * from './projectFeatures'; @@ -60,23 +65,24 @@ export * from './projectPermissionSchemes'; export * from './projectProperties'; export * from './projectRoleActors'; export * from './projectRoles'; -export * from './projects'; export * from './projectTypes'; export * from './projectVersions'; -export * from './screens'; +export * from './projects'; export * from './screenSchemes'; export * from './screenTabFields'; export * from './screenTabs'; +export * from './screens'; export * from './serverInfo'; +export * from './serviceRegistry'; export * from './status'; export * from './tasks'; +export * from './teamsInPlan'; export * from './timeTracking'; export * from './uIModificationsApps'; export * from './userProperties'; -export * from './users'; export * from './userSearch'; +export * from './users'; export * from './webhooks'; -export * from './workflows'; export * from './workflowSchemeDrafts'; export * from './workflowSchemeProjectAssociations'; export * from './workflowSchemes'; @@ -84,6 +90,7 @@ export * from './workflowStatusCategories'; export * from './workflowStatuses'; export * from './workflowTransitionProperties'; export * from './workflowTransitionRules'; +export * from './workflows'; export * from './client'; export * as Version3Models from './models'; diff --git a/src/version3/instanceInformation.ts b/src/version3/instanceInformation.ts index 6bc2d59b04..30e0ef888f 100644 --- a/src/version3/instanceInformation.ts +++ b/src/version3/instanceInformation.ts @@ -10,12 +10,16 @@ export class InstanceInformation { * Returns licensing information about the Jira instance. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + * + * @deprecated This method is deprecated and will be removed in a future version. Please use an alternative method. */ async getLicense(callback: Callback): Promise; /** * Returns licensing information about the Jira instance. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. + * + * @deprecated This method is deprecated and will be removed in a future version. Please use an alternative method. */ async getLicense(callback?: never): Promise; async getLicense(callback?: Callback): Promise { diff --git a/src/version3/issueAttachments.ts b/src/version3/issueAttachments.ts index 954d64c282..f0cf74cb36 100644 --- a/src/version3/issueAttachments.ts +++ b/src/version3/issueAttachments.ts @@ -2,8 +2,8 @@ import { FormData, File } from 'formdata-node'; import type { Mime } from 'mime' with { 'resolution-mode': 'import' }; 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 IssueAttachments { @@ -26,6 +26,7 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async getAttachmentContent( parameters: Parameters.GetAttachmentContent | string, @@ -48,6 +49,7 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async getAttachmentContent( parameters: Parameters.GetAttachmentContent | string, @@ -116,6 +118,7 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async getAttachmentThumbnail( parameters: Parameters.GetAttachmentThumbnail | string, @@ -135,6 +138,7 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async getAttachmentThumbnail( parameters: Parameters.GetAttachmentThumbnail | string, @@ -172,6 +176,7 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async getAttachment( parameters: Parameters.GetAttachment | string, @@ -188,6 +193,7 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async getAttachment( parameters: Parameters.GetAttachment | string, @@ -271,6 +277,7 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async expandAttachmentForHumans( parameters: Parameters.ExpandAttachmentForHumans | string, @@ -295,6 +302,7 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async expandAttachmentForHumans( parameters: Parameters.ExpandAttachmentForHumans | string, @@ -333,6 +341,7 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async expandAttachmentForMachines( parameters: Parameters.ExpandAttachmentForMachines | string, @@ -357,6 +366,7 @@ export class IssueAttachments { * in. * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. + * - If attachments are added in private comments, the comment-level restriction will be applied. */ async expandAttachmentForMachines( parameters: Parameters.ExpandAttachmentForMachines | string, diff --git a/src/version3/issueBulkOperations.ts b/src/version3/issueBulkOperations.ts new file mode 100644 index 0000000000..de06dd95dc --- /dev/null +++ b/src/version3/issueBulkOperations.ts @@ -0,0 +1,520 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class IssueBulkOperations { + constructor(private client: Client) {} + + /** + * Use this API to submit a bulk delete request. You can delete up to 1,000 issues in a single operation. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Delete [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Delete-issues/) + * in all projects that contain the selected issues. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkDelete( + parameters: Parameters.SubmitBulkDelete, + callback: Callback, + ): Promise; + /** + * Use this API to submit a bulk delete request. You can delete up to 1,000 issues in a single operation. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Delete [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Delete-issues/) + * in all projects that contain the selected issues. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkDelete( + parameters: Parameters.SubmitBulkDelete, + callback?: never, + ): Promise; + async submitBulkDelete( + parameters: Parameters.SubmitBulkDelete, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/bulk/issues/delete', + method: 'POST', + data: { + selectedIssueIdsOrKeys: parameters.selectedIssueIdsOrKeys, + sendBulkNotification: parameters.sendBulkNotification, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Use this API to get a list of fields visible to the user to perform bulk edit operations. You can pass single or + * multiple issues in the query to get eligible editable fields. This API uses pagination to return responses, + * delivering 50 fields at a time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - Depending on the field, any field-specific permissions required to edit it. + */ + async getBulkEditableFields( + parameters: Parameters.GetBulkEditableFields, + callback: Callback, + ): Promise; + /** + * Use this API to get a list of fields visible to the user to perform bulk edit operations. You can pass single or + * multiple issues in the query to get eligible editable fields. This API uses pagination to return responses, + * delivering 50 fields at a time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - Depending on the field, any field-specific permissions required to edit it. + */ + async getBulkEditableFields( + parameters: Parameters.GetBulkEditableFields, + callback?: never, + ): Promise; + async getBulkEditableFields( + parameters: Parameters.GetBulkEditableFields, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/bulk/issues/fields', + method: 'GET', + params: { + issueIdsOrKeys: parameters.issueIdsOrKeys, + searchText: parameters.searchText, + endingBefore: parameters.endingBefore, + startingAfter: parameters.startingAfter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Use this API to submit a bulk edit request and simultaneously edit multiple issues. There are limits applied to the + * number of issues and fields that can be edited. A single request can accommodate a maximum of 1000 issues + * (including subtasks) and 200 fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - Edit [issues permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) + * in all projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkEdit( + parameters: Parameters.SubmitBulkEdit, + callback: Callback, + ): Promise; + /** + * Use this API to submit a bulk edit request and simultaneously edit multiple issues. There are limits applied to the + * number of issues and fields that can be edited. A single request can accommodate a maximum of 1000 issues + * (including subtasks) and 200 fields. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - Edit [issues permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) + * in all projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkEdit( + parameters: Parameters.SubmitBulkEdit, + callback?: never, + ): Promise; + async submitBulkEdit( + parameters: Parameters.SubmitBulkEdit, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/bulk/issues/fields', + method: 'POST', + data: { + editedFieldsInput: parameters.editedFieldsInput, + selectedActions: parameters.selectedActions, + selectedIssueIdsOrKeys: parameters.selectedIssueIdsOrKeys, + sendBulkNotification: parameters.sendBulkNotification, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Use this API to submit a bulk issue move request. You can move multiple issues, but they must all be moved to and + * from a single project, issue type, and parent. You can't move more than 1000 issues (including subtasks) at once. + * + * #### Scenarios: + * + * This is an early version of the API and it doesn't have full feature parity with the Bulk Move UI experience. + * + * - Moving issue of type A to issue of type B in the same project or a different project: `SUPPORTED` + * - Moving multiple issues of type A in one project to multiple issues of type B in the same project or a different + * project: **`SUPPORTED`** + * - Moving a standard parent issue of type A with its multiple subtask issue types in one project to standard issue of + * type B and multiple subtask issue types in the same project or a different project: `SUPPORTED` + * - Moving an epic issue with its child issues to a different project without losing their relation: `NOT SUPPORTED`\ + * (Workaround: Move them individually and stitch the relationship back with the Bulk Edit API) + * + * #### Limits applied to bulk issue moves: + * + * When using the bulk move, keep in mind that there are limits on the number of issues and fields you can include. + * + * - You can move up to 1,000 issues in a single operation, including any subtasks. + * - All issues must originate from the same project and share the same issue type and parent. + * - The total combined number of fields across all issues must not exceed 1,500,000. For example, if each issue + * includes 15,000 fields, then the maximum number of issues that can be moved is 100. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Move [issues permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) + * in source projects. + * - Create [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in + * destination projects. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in + * destination projects, if moving subtasks only. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkMove( + parameters: Parameters.SubmitBulkMove, + callback: Callback, + ): Promise; + /** + * Use this API to submit a bulk issue move request. You can move multiple issues, but they must all be moved to and + * from a single project, issue type, and parent. You can't move more than 1000 issues (including subtasks) at once. + * + * #### Scenarios: + * + * This is an early version of the API and it doesn't have full feature parity with the Bulk Move UI experience. + * + * - Moving issue of type A to issue of type B in the same project or a different project: `SUPPORTED` + * - Moving multiple issues of type A in one project to multiple issues of type B in the same project or a different + * project: **`SUPPORTED`** + * - Moving a standard parent issue of type A with its multiple subtask issue types in one project to standard issue of + * type B and multiple subtask issue types in the same project or a different project: `SUPPORTED` + * - Moving an epic issue with its child issues to a different project without losing their relation: `NOT SUPPORTED`\ + * (Workaround: Move them individually and stitch the relationship back with the Bulk Edit API) + * + * #### Limits applied to bulk issue moves: + * + * When using the bulk move, keep in mind that there are limits on the number of issues and fields you can include. + * + * - You can move up to 1,000 issues in a single operation, including any subtasks. + * - All issues must originate from the same project and share the same issue type and parent. + * - The total combined number of fields across all issues must not exceed 1,500,000. For example, if each issue + * includes 15,000 fields, then the maximum number of issues that can be moved is 100. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Move [issues permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) + * in source projects. + * - Create [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in + * destination projects. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in + * destination projects, if moving subtasks only. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkMove( + parameters: Parameters.SubmitBulkMove, + callback?: never, + ): Promise; + async submitBulkMove( + parameters: Parameters.SubmitBulkMove, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/bulk/issues/move', + method: 'POST', + data: { + sendBulkNotification: parameters.sendBulkNotification, + targetToSourcesMapping: parameters.targetToSourcesMapping, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Use this API to retrieve a list of transitions available for the specified issues that can be used or bulk + * transition operations. You can submit either single or multiple issues in the query to obtain the available + * transitions. + * + * The response will provide the available transitions for issues, organized by their respective workflows. **Only the + * transitions that are common among the issues within that workflow and do not involve any additional field updates + * will be included.** For bulk transitions that require additional field updates, please utilise the Jira Cloud UI. + * + * You can request available transitions for up to 1,000 issues in a single operation. This API uses pagination to + * return responses, delivering 50 workflows at a time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Transition [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Transition-issues/) + * in all projects that contain the selected issues. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAvailableTransitions( + parameters: Parameters.GetAvailableTransitions, + callback: Callback, + ): Promise; + /** + * Use this API to retrieve a list of transitions available for the specified issues that can be used or bulk + * transition operations. You can submit either single or multiple issues in the query to obtain the available + * transitions. + * + * The response will provide the available transitions for issues, organized by their respective workflows. **Only the + * transitions that are common among the issues within that workflow and do not involve any additional field updates + * will be included.** For bulk transitions that require additional field updates, please utilise the Jira Cloud UI. + * + * You can request available transitions for up to 1,000 issues in a single operation. This API uses pagination to + * return responses, delivering 50 workflows at a time. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Transition [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Transition-issues/) + * in all projects that contain the selected issues. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async getAvailableTransitions( + parameters: Parameters.GetAvailableTransitions, + callback?: never, + ): Promise; + async getAvailableTransitions( + parameters: Parameters.GetAvailableTransitions, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/bulk/issues/transition', + method: 'GET', + params: { + issueIdsOrKeys: parameters.issueIdsOrKeys, + endingBefore: parameters.endingBefore, + startingAfter: parameters.startingAfter, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Use this API to submit a bulk issue status transition request. You can transition multiple issues, alongside with + * their valid transition Ids. You can transition up to 1,000 issues in a single operation. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Transition [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Transition-issues/) + * in all projects that contain the selected issues. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkTransition( + parameters: Parameters.SubmitBulkTransition, + callback: Callback, + ): Promise; + /** + * Use this API to submit a bulk issue status transition request. You can transition multiple issues, alongside with + * their valid transition Ids. You can transition up to 1,000 issues in a single operation. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Transition [issues + * permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/#Transition-issues/) + * in all projects that contain the selected issues. + * - Browse [project + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-permissions/) in all + * projects that contain the selected issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async submitBulkTransition( + parameters: Parameters.SubmitBulkTransition, + callback?: never, + ): Promise; + async submitBulkTransition( + parameters: Parameters.SubmitBulkTransition, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/bulk/issues/transition', + method: 'POST', + data: { + bulkTransitionInputs: parameters.bulkTransitionInputs, + sendBulkNotification: parameters.sendBulkNotification, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Use this to get the progress state for the specified bulk operation `taskId`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Administer Jira [global + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/), or be the + * creator of the task. + * + * If the task is running, this resource will return: + * + * { + * "taskId": "10779", + * "status": "RUNNING", + * "progressPercent": 65, + * "submittedBy": { "accountId": "5b10a2844c20165700ede21g" }, + * "created": 1690180055963, + * "started": 1690180056206, + * "updated": 169018005829 + * } + * + * If the task has completed, then this resource will return: + * + * { + * "processedAccessibleIssues": [10001, 10002], + * "created": 1709189449954, + * "progressPercent": 100, + * "started": 1709189450154, + * "status": "COMPLETE", + * "submittedBy": { "accountId": "5b10a2844c20165700ede21g" }, + * "invalidOrInaccessibleIssueCount": 0, + * "taskId": "10000", + * "totalIssueCount": 2, + * "updated": 1709189450354 + * } + * + * **Note:** You can view task progress for up to 14 days from creation. + */ + async getBulkOperationProgress( + parameters: Parameters.GetBulkOperationProgress, + callback: Callback, + ): Promise; + /** + * Use this to get the progress state for the specified bulk operation `taskId`. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - Global bulk change + * [permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/). + * - Administer Jira [global + * permission](https://support.atlassian.com/jira-cloud-administration/docs/manage-global-permissions/), or be the + * creator of the task. + * + * If the task is running, this resource will return: + * + * { + * "taskId": "10779", + * "status": "RUNNING", + * "progressPercent": 65, + * "submittedBy": { "accountId": "5b10a2844c20165700ede21g" }, + * "created": 1690180055963, + * "started": 1690180056206, + * "updated": 169018005829 + * } + * + * If the task has completed, then this resource will return: + * + * { + * "processedAccessibleIssues": [10001, 10002], + * "created": 1709189449954, + * "progressPercent": 100, + * "started": 1709189450154, + * "status": "COMPLETE", + * "submittedBy": { "accountId": "5b10a2844c20165700ede21g" }, + * "invalidOrInaccessibleIssueCount": 0, + * "taskId": "10000", + * "totalIssueCount": 2, + * "updated": 1709189450354 + * } + * + * **Note:** You can view task progress for up to 14 days from creation. + */ + async getBulkOperationProgress( + parameters: Parameters.GetBulkOperationProgress, + callback?: never, + ): Promise; + async getBulkOperationProgress( + parameters: Parameters.GetBulkOperationProgress, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/bulk/queue/${parameters.taskId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/issueCommentProperties.ts b/src/version3/issueCommentProperties.ts index 2fdecdea69..db07e92cc0 100644 --- a/src/version3/issueCommentProperties.ts +++ b/src/version3/issueCommentProperties.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 IssueCommentProperties { diff --git a/src/version3/issueComments.ts b/src/version3/issueComments.ts index 29d55a8cbf..9e628944d4 100644 --- a/src/version3/issueComments.ts +++ b/src/version3/issueComments.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 IssueComments { @@ -165,18 +165,18 @@ export class IssueComments { expand: parameters.expand, }, data: { - self: parameters.self, - id: parameters.id, author: parameters.author, body, + created: parameters.created, + id: parameters.id, + jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, + jsdPublic: parameters.jsdPublic, + properties: parameters.properties, renderedBody: parameters.renderedBody, + self: parameters.self, updateAuthor: parameters.updateAuthor, - created: parameters.created, updated: parameters.updated, visibility: parameters.visibility, - jsdPublic: parameters.jsdPublic, - jsdAuthorCanSeeRequest: parameters.jsdAuthorCanSeeRequest, - properties: parameters.properties, }, }; @@ -263,7 +263,18 @@ export class IssueComments { parameters: Parameters.UpdateComment, callback?: Callback, ): Promise { - // todo same above + const body = typeof parameters.body === 'string' + ? { + type: 'doc', + version: 1, + content: [ + { + type: 'paragraph', + content: [{ type: 'text', text: parameters.body }], + }, + ], + } + : parameters.body; const config: RequestConfig = { url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, @@ -274,7 +285,7 @@ export class IssueComments { expand: parameters.expand, }, data: { - body: parameters.body, + body, visibility: parameters.visibility, properties: parameters.properties, }, @@ -317,6 +328,9 @@ export class IssueComments { const config: RequestConfig = { url: `/rest/api/3/issue/${parameters.issueIdOrKey}/comment/${parameters.id}`, method: 'DELETE', + params: { + parentId: parameters.parentId, + }, }; return this.client.sendRequest(config, callback); diff --git a/src/version3/issueCustomFieldConfigurationApps.ts b/src/version3/issueCustomFieldConfigurationApps.ts index 662e4fca60..7e8f8e61d5 100644 --- a/src/version3/issueCustomFieldConfigurationApps.ts +++ b/src/version3/issueCustomFieldConfigurationApps.ts @@ -1,7 +1,8 @@ +import { paramSerializer } from '../paramSerializer'; 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 IssueCustomFieldConfigurationApps { @@ -9,7 +10,79 @@ export class IssueCustomFieldConfigurationApps { /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). + * configurations for list of custom fields of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). + * + * The result can be filtered by one of these criteria: + * + * - `id`. + * - `fieldContextId`. + * - `issueId`. + * - `projectKeyOrId` and `issueTypeId`. + * + * Otherwise, all configurations for the provided list of custom fields are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the Forge app that provided the custom field type. + */ + async getCustomFieldsConfigurations( + parameters: Parameters.GetCustomFieldsConfigurations | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * configurations for list of custom fields of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). + * + * The result can be filtered by one of these criteria: + * + * - `id`. + * - `fieldContextId`. + * - `issueId`. + * - `projectKeyOrId` and `issueTypeId`. + * + * Otherwise, all configurations for the provided list of custom fields are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required + * for the Forge app that provided the custom field type. + */ + async getCustomFieldsConfigurations( + parameters?: Parameters.GetCustomFieldsConfigurations, + callback?: never, + ): Promise; + async getCustomFieldsConfigurations( + parameters?: Parameters.GetCustomFieldsConfigurations, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/app/field/context/configuration/list', + method: 'POST', + params: { + id: parameters?.id, + fieldContextId: paramSerializer('fieldContextId', parameters?.fieldContextId), + issueId: parameters?.issueId, + projectKeyOrId: parameters?.projectKeyOrId, + issueTypeId: parameters?.issueTypeId, + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + }, + data: { + fieldIdsOrKeys: parameters?.fieldIdsOrKeys, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * configurations for a custom field of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). * * The result can be filtered by one of these criteria: * @@ -22,7 +95,7 @@ export class IssueCustomFieldConfigurationApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. + * for the Forge app that provided the custom field type. */ async getCustomFieldConfiguration( parameters: Parameters.GetCustomFieldConfiguration | string, @@ -30,7 +103,9 @@ export class IssueCustomFieldConfigurationApps { ): Promise; /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of - * configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). + * configurations for a custom field of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). * * The result can be filtered by one of these criteria: * @@ -43,7 +118,7 @@ export class IssueCustomFieldConfigurationApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. + * for the Forge app that provided the custom field type. */ async getCustomFieldConfiguration( parameters: Parameters.GetCustomFieldConfiguration | string, @@ -73,24 +148,26 @@ export class IssueCustomFieldConfigurationApps { } /** - * Update the configuration for contexts of a custom field created by a [Forge - * app](https://developer.atlassian.com/platform/forge/). + * Update the configuration for contexts of a custom field of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. + * for the Forge app that created the custom field type. */ async updateCustomFieldConfiguration( parameters: Parameters.UpdateCustomFieldConfiguration, callback: Callback, ): Promise; /** - * Update the configuration for contexts of a custom field created by a [Forge - * app](https://developer.atlassian.com/platform/forge/). + * Update the configuration for contexts of a custom field of a + * [type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) created + * by a [Forge app](https://developer.atlassian.com/platform/forge/). * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required - * for the Forge app that created the custom field. + * for the Forge app that created the custom field type. */ async updateCustomFieldConfiguration( parameters: Parameters.UpdateCustomFieldConfiguration, diff --git a/src/version3/issueCustomFieldContexts.ts b/src/version3/issueCustomFieldContexts.ts index c4ade17d87..20aa790f52 100644 --- a/src/version3/issueCustomFieldContexts.ts +++ b/src/version3/issueCustomFieldContexts.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 IssueCustomFieldContexts { @@ -100,11 +100,11 @@ export class IssueCustomFieldContexts { url: `/rest/api/3/field/${parameters.fieldId}/context`, method: 'POST', data: { + description: parameters.description, id: parameters.id, + issueTypeIds: parameters.issueTypeIds, name: parameters.name, - description: parameters.description, projectIds: parameters.projectIds, - issueTypeIds: parameters.issueTypeIds, }, }; @@ -114,7 +114,8 @@ export class IssueCustomFieldContexts { /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of * defaults for a custom field. The results can be filtered by `contextId`, otherwise all values are returned. If no - * defaults are set for a context, nothing is returned. The returned object depends on type of the custom field: + * defaults are set for a context, nothing is returned.\ + * The returned object depends on type of the custom field: * * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. @@ -164,7 +165,8 @@ export class IssueCustomFieldContexts { /** * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of * defaults for a custom field. The results can be filtered by `contextId`, otherwise all values are returned. If no - * defaults are set for a context, nothing is returned. The returned object depends on type of the custom field: + * defaults are set for a context, nothing is returned.\ + * The returned object depends on type of the custom field: * * - `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. * - `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. @@ -513,8 +515,8 @@ export class IssueCustomFieldContexts { url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}`, method: 'PUT', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; diff --git a/src/version3/issueCustomFieldOptions.ts b/src/version3/issueCustomFieldOptions.ts index bddd413e0c..d59bfb7600 100644 --- a/src/version3/issueCustomFieldOptions.ts +++ b/src/version3/issueCustomFieldOptions.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 IssueCustomFieldOptions { @@ -298,4 +298,48 @@ export class IssueCustomFieldOptions { return this.client.sendRequest(config, callback); } + + /** + * Replaces the options of a custom field. + * + * Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect or Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async replaceCustomFieldOption( + parameters: Parameters.ReplaceCustomFieldOption, + callback: Callback, + ): Promise; + /** + * Replaces the options of a custom field. + * + * Note that this operation **only works for issue field select list options created in Jira or using operations from + * the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue + * field select list options created by Connect or Forge apps. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async replaceCustomFieldOption( + parameters: Parameters.ReplaceCustomFieldOption, + callback?: never, + ): Promise; + async replaceCustomFieldOption( + parameters: Parameters.ReplaceCustomFieldOption, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/field/${parameters.fieldId}/context/${parameters.contextId}/option/${parameters.optionId}/issue`, + method: 'DELETE', + params: { + replaceWith: parameters.replaceWith, + jql: parameters.jql, + }, + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version3/issueCustomFieldOptionsApps.ts b/src/version3/issueCustomFieldOptionsApps.ts index 9786d24053..616ebcbe65 100644 --- a/src/version3/issueCustomFieldOptionsApps.ts +++ b/src/version3/issueCustomFieldOptionsApps.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 IssueCustomFieldOptionsApps { @@ -68,6 +68,8 @@ export class IssueCustomFieldOptionsApps { * used with issue field select list options created in Jira or using operations from the [Issue custom field * options](#api-group-Issue-custom-field-options) resource. * + * Each field can have a maximum of 10000 options, and each option can have a maximum of 10000 scopes. + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required * for the app providing the field. @@ -83,6 +85,8 @@ export class IssueCustomFieldOptionsApps { * used with issue field select list options created in Jira or using operations from the [Issue custom field * options](#api-group-Issue-custom-field-options) resource. * + * Each field can have a maximum of 10000 options, and each option can have a maximum of 10000 scopes. + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required * for the app providing the field. @@ -99,9 +103,9 @@ export class IssueCustomFieldOptionsApps { url: `/rest/api/3/field/${parameters.fieldKey}/option`, method: 'POST', data: { - value: parameters.value, - properties: parameters.properties, config: parameters.config, + properties: parameters.properties, + value: parameters.value, }, }; @@ -290,10 +294,10 @@ export class IssueCustomFieldOptionsApps { url: `/rest/api/3/field/${parameters.fieldKey}/option/${parameters.optionId}`, method: 'PUT', data: { + config: parameters.config, id: parameters.id, - value: parameters.value, properties: parameters.properties, - config: parameters.config, + value: parameters.value, }, }; @@ -348,7 +352,7 @@ export class IssueCustomFieldOptionsApps { * can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. * * This is an [asynchronous - * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). The response + * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). The response * object contains a link to the long-running task. * * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be @@ -372,7 +376,7 @@ export class IssueCustomFieldOptionsApps { * can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. * * This is an [asynchronous - * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). The response + * operation](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). The response * object contains a link to the long-running task. * * Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be diff --git a/src/version3/issueCustomFieldValuesApps.ts b/src/version3/issueCustomFieldValuesApps.ts index 890dbb8fa9..b22d1ab2b0 100644 --- a/src/version3/issueCustomFieldValuesApps.ts +++ b/src/version3/issueCustomFieldValuesApps.ts @@ -1,6 +1,6 @@ import * as Parameters from './parameters'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class IssueCustomFieldValuesApps { @@ -8,10 +8,18 @@ export class IssueCustomFieldValuesApps { /** * Updates the value of one or more custom fields on one or more issues. Combinations of custom field and issue should - * be unique within the request. Custom fields can only be updated by the Forge app that created them. + * be unique within the request. + * + * Apps can only perform this operation on [custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/) and [custom + * field types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) + * declared in their own manifests. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. + * the app that owns the custom field or custom field type can update its values with this operation. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateMultipleCustomFieldValues( parameters: Parameters.UpdateMultipleCustomFieldValues, @@ -19,10 +27,18 @@ export class IssueCustomFieldValuesApps { ): Promise; /** * Updates the value of one or more custom fields on one or more issues. Combinations of custom field and issue should - * be unique within the request. Custom fields can only be updated by the Forge app that created them. + * be unique within the request. + * + * Apps can only perform this operation on [custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/) and [custom + * field types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) + * declared in their own manifests. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. + * the app that owns the custom field or custom field type can update its values with this operation. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateMultipleCustomFieldValues( parameters: Parameters.UpdateMultipleCustomFieldValues, @@ -47,22 +63,36 @@ export class IssueCustomFieldValuesApps { } /** - * Updates the value of a custom field on one or more issues. Custom fields can only be updated by the Forge app that - * created them. + * Updates the value of a custom field on one or more issues. + * + * Apps can only perform this operation on [custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/) and [custom + * field types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) + * declared in their own manifests. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. + * the app that owns the custom field or custom field type can update its values with this operation. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateCustomFieldValue( parameters: Parameters.UpdateCustomFieldValue, callback: Callback, ): Promise; /** - * Updates the value of a custom field on one or more issues. Custom fields can only be updated by the Forge app that - * created them. + * Updates the value of a custom field on one or more issues. + * + * Apps can only perform this operation on [custom + * fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/) and [custom + * field types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/) + * declared in their own manifests. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * the app that created the custom field can update its values with this operation. + * the app that owns the custom field or custom field type can update its values with this operation. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updateCustomFieldValue(parameters: Parameters.UpdateCustomFieldValue, callback?: never): Promise; async updateCustomFieldValue( diff --git a/src/version3/issueFieldConfigurations.ts b/src/version3/issueFieldConfigurations.ts index 49b233448c..3779142bb8 100644 --- a/src/version3/issueFieldConfigurations.ts +++ b/src/version3/issueFieldConfigurations.ts @@ -1,8 +1,9 @@ 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'; +import { Paginated } from '../paginated'; export class IssueFieldConfigurations { constructor(private client: Client) {} @@ -21,7 +22,7 @@ export class IssueFieldConfigurations { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getAllFieldConfigurations( + async getAllFieldConfigurations>( parameters: Parameters.GetAllFieldConfigurations | undefined, callback: Callback, ): Promise; @@ -39,11 +40,11 @@ export class IssueFieldConfigurations { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getAllFieldConfigurations( + async getAllFieldConfigurations>( parameters?: Parameters.GetAllFieldConfigurations, callback?: never, ): Promise; - async getAllFieldConfigurations( + async getAllFieldConfigurations>( parameters?: Parameters.GetAllFieldConfigurations, callback?: Callback, ): Promise { @@ -72,7 +73,7 @@ export class IssueFieldConfigurations { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createFieldConfiguration( - parameters: Parameters.CreateFieldConfiguration | undefined, + parameters: Parameters.CreateFieldConfiguration, callback: Callback, ): Promise; /** @@ -85,19 +86,19 @@ export class IssueFieldConfigurations { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createFieldConfiguration( - parameters?: Parameters.CreateFieldConfiguration, + parameters: Parameters.CreateFieldConfiguration, callback?: never, ): Promise; async createFieldConfiguration( - parameters?: Parameters.CreateFieldConfiguration, + parameters: Parameters.CreateFieldConfiguration, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/fieldconfiguration', method: 'POST', data: { - name: parameters?.name, - description: parameters?.description, + description: parameters.description, + name: parameters.name, }, }; @@ -136,8 +137,8 @@ export class IssueFieldConfigurations { url: `/rest/api/3/fieldconfiguration/${parameters.id}`, method: 'PUT', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; @@ -323,7 +324,7 @@ export class IssueFieldConfigurations { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createFieldConfigurationScheme( - parameters: Parameters.CreateFieldConfigurationScheme | undefined, + parameters: Parameters.CreateFieldConfigurationScheme, callback: Callback, ): Promise; /** @@ -335,19 +336,19 @@ export class IssueFieldConfigurations { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createFieldConfigurationScheme( - parameters?: Parameters.CreateFieldConfigurationScheme, + parameters: Parameters.CreateFieldConfigurationScheme, callback?: never, ): Promise; async createFieldConfigurationScheme( - parameters?: Parameters.CreateFieldConfigurationScheme, + parameters: Parameters.CreateFieldConfigurationScheme, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/fieldconfigurationscheme', method: 'POST', data: { - name: parameters?.name, - description: parameters?.description, + description: parameters.description, + name: parameters.name, }, }; @@ -520,8 +521,8 @@ export class IssueFieldConfigurations { url: `/rest/api/3/fieldconfigurationscheme/${parameters.id}`, method: 'PUT', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; diff --git a/src/version3/issueFields.ts b/src/version3/issueFields.ts index b29356e6bd..737c541453 100644 --- a/src/version3/issueFields.ts +++ b/src/version3/issueFields.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 IssueFields { @@ -95,7 +95,7 @@ export class IssueFields { * - Fields that contain a string in the field name or description, by defining `query` * - Specific fields that contain a string in the field name or description, by defining `id` and `query` * - * Only custom fields can be queried, `type` must be set to `custom`. + * Use `type` must be set to `custom` to show custom fields only. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -113,7 +113,7 @@ export class IssueFields { * - Fields that contain a string in the field name or description, by defining `query` * - Specific fields that contain a string in the field name or description, by defining `id` and `query` * - * Only custom fields can be queried, `type` must be set to `custom`. + * Use `type` must be set to `custom` to show custom fields only. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). diff --git a/src/version3/issueLinkTypes.ts b/src/version3/issueLinkTypes.ts index 06b4fc987b..3b82d6d72a 100644 --- a/src/version3/issueLinkTypes.ts +++ b/src/version3/issueLinkTypes.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 IssueLinkTypes { diff --git a/src/version3/issueLinks.ts b/src/version3/issueLinks.ts index e89e9fcda9..f4684aa995 100644 --- a/src/version3/issueLinks.ts +++ b/src/version3/issueLinks.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 IssueLinks { @@ -30,7 +30,7 @@ export class IssueLinks { * to view the issue. * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ - async linkIssues(parameters: Parameters.LinkIssues | undefined, callback: Callback): Promise; + async linkIssues(parameters: Parameters.LinkIssues, callback: Callback): Promise; /** * Creates a link between two issues. Use this operation to indicate a relationship between two issues and optionally * add a comment to the from (outward) issue. To use this resource the site must have [Issue @@ -54,16 +54,16 @@ export class IssueLinks { * to view the issue. * - If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. */ - async linkIssues(parameters?: Parameters.LinkIssues, callback?: never): Promise; - async linkIssues(parameters?: Parameters.LinkIssues, callback?: Callback): Promise { + async linkIssues(parameters: Parameters.LinkIssues, callback?: never): Promise; + async linkIssues(parameters: Parameters.LinkIssues, callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/api/3/issueLink', method: 'POST', data: { - type: parameters?.type, - inwardIssue: parameters?.inwardIssue, - outwardIssue: parameters?.outwardIssue, - comment: parameters?.comment, + comment: parameters.comment, + inwardIssue: parameters.inwardIssue, + outwardIssue: parameters.outwardIssue, + type: parameters.type, }, }; diff --git a/src/version3/issueNavigatorSettings.ts b/src/version3/issueNavigatorSettings.ts index 470e0a389c..05e89df1ed 100644 --- a/src/version3/issueNavigatorSettings.ts +++ b/src/version3/issueNavigatorSettings.ts @@ -1,6 +1,6 @@ import * as Models from './models'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class IssueNavigatorSettings { diff --git a/src/version3/issueNotificationSchemes.ts b/src/version3/issueNotificationSchemes.ts index 2392ff3b88..4c476c3ac0 100644 --- a/src/version3/issueNotificationSchemes.ts +++ b/src/version3/issueNotificationSchemes.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 IssueNotificationSchemes { @@ -215,6 +215,38 @@ export class IssueNotificationSchemes { return this.client.sendRequest(config, callback); } + /** + * Adds notifications to a notification scheme. You can add up to 1000 notifications per request. + * + * _Deprecated: The notification type `EmailAddress` is no longer supported in Cloud. Refer to the + * [changelog](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1031) for more details._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addNotifications(parameters: Parameters.AddNotifications, callback: Callback): Promise; + /** + * Adds notifications to a notification scheme. You can add up to 1000 notifications per request. + * + * _Deprecated: The notification type `EmailAddress` is no longer supported in Cloud. Refer to the + * [changelog](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1031) for more details._ + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addNotifications(parameters: Parameters.AddNotifications, callback?: never): Promise; + async addNotifications(parameters: Parameters.AddNotifications, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/notificationscheme/${parameters.id}/notification`, + method: 'PUT', + data: { + notificationSchemeEvents: parameters.notificationSchemeEvents, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Deletes a notification scheme. * diff --git a/src/version3/issuePriorities.ts b/src/version3/issuePriorities.ts index 4df878f737..03ee8322fb 100644 --- a/src/version3/issuePriorities.ts +++ b/src/version3/issuePriorities.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 { paramSerializer } from '../paramSerializer'; import { RequestConfig } from '../requestConfig'; @@ -34,6 +34,9 @@ export class IssuePriorities { /** * Creates an issue priority. * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ @@ -44,6 +47,9 @@ export class IssuePriorities { /** * Creates an issue priority. * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ @@ -56,6 +62,7 @@ export class IssuePriorities { url: '/rest/api/3/priority', method: 'POST', data: { + avatarId: parameters.avatarId, description: parameters.description, iconUrl: parameters.iconUrl, name: parameters.name, @@ -172,7 +179,9 @@ export class IssuePriorities { maxResults: parameters?.maxResults, id: parameters?.id, projectId: paramSerializer('projectId', parameters?.projectId), + priorityName: parameters?.priorityName, onlyDefault: parameters?.onlyDefault, + expand: parameters?.expand, }, }; @@ -208,6 +217,11 @@ export class IssuePriorities { /** * Updates an issue priority. * + * At least one request body parameter must be defined. + * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ @@ -215,6 +229,11 @@ export class IssuePriorities { /** * Updates an issue priority. * + * At least one request body parameter must be defined. + * + * Deprecation applies to iconUrl param in request body which will be sunset on 16th Mar 2025. For more details refer + * to [changelog](https://developer.atlassian.com/changelog/#CHANGE-1525). + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ @@ -224,6 +243,7 @@ export class IssuePriorities { url: `/rest/api/3/priority/${parameters.id}`, method: 'PUT', data: { + avatarId: parameters.avatarId, description: parameters.description, iconUrl: parameters.iconUrl, name: parameters.name, @@ -233,4 +253,37 @@ export class IssuePriorities { return this.client.sendRequest(config, callback); } + + /** + * Deletes an issue priority. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriority(parameters: Parameters.DeletePriority, callback: Callback): Promise; + /** + * Deletes an issue priority. + * + * This operation is + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the + * `location` link in the response to determine the status of the task and use [Get + * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriority(parameters: Parameters.DeletePriority, callback?: never): Promise; + async deletePriority(parameters: Parameters.DeletePriority, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/priority/${parameters.id}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version3/issueProperties.ts b/src/version3/issueProperties.ts index bd873db325..d1973c7107 100644 --- a/src/version3/issueProperties.ts +++ b/src/version3/issueProperties.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 IssueProperties { @@ -18,7 +18,7 @@ export class IssueProperties { * * - Transactional, either all properties are updated in all eligible issues or, when errors occur, no properties are * updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the * `location` link in the response to determine the status of the task and use [Get * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. * @@ -44,7 +44,7 @@ export class IssueProperties { * * - Transactional, either all properties are updated in all eligible issues or, when errors occur, no properties are * updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the * `location` link in the response to determine the status of the task and use [Get * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. * @@ -83,7 +83,7 @@ export class IssueProperties { * * This operation is: * - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the * `location` link in the response to determine the status of the task and use [Get * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. * - Non-transactional. Updating some entities may fail. Such information will available in the task result. @@ -107,7 +107,7 @@ export class IssueProperties { * * This operation is: * - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the * `location` link in the response to determine the status of the task and use [Get * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. * - Non-transactional. Updating some entities may fail. Such information will available in the task result. @@ -171,7 +171,7 @@ export class IssueProperties { * This operation is: * * - Transactional, either all eligible issues are updated or, when errors occur, none are updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the * `location` link in the response to determine the status of the task and use [Get * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. * @@ -220,7 +220,7 @@ export class IssueProperties { * This operation is: * * - Transactional, either all eligible issues are updated or, when errors occur, none are updated. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the * `location` link in the response to determine the status of the task and use [Get * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. * @@ -241,9 +241,9 @@ export class IssueProperties { url: `/rest/api/3/issue/properties/${parameters.propertyKey}`, method: 'PUT', data: { - value: parameters.value, expression: parameters.expression, filter: parameters.filter, + value: parameters.value, }, }; @@ -268,7 +268,7 @@ export class IssueProperties { * * - Transactional, either the property is deleted from all eligible issues or, when errors occur, no properties are * deleted. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the * `location` link in the response to determine the status of the task and use [Get * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. * @@ -302,7 +302,7 @@ export class IssueProperties { * * - Transactional, either the property is deleted from all eligible issues or, when errors occur, no properties are * deleted. - * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * - [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the * `location` link in the response to determine the status of the task and use [Get * task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. * @@ -326,8 +326,8 @@ export class IssueProperties { url: `/rest/api/3/issue/properties/${parameters.propertyKey}`, method: 'DELETE', data: { - entityIds: parameters.entityIds, currentValue: parameters.currentValue, + entityIds: parameters.entityIds, }, }; diff --git a/src/version3/issueRemoteLinks.ts b/src/version3/issueRemoteLinks.ts index 188d1f5376..ea816d56f7 100644 --- a/src/version3/issueRemoteLinks.ts +++ b/src/version3/issueRemoteLinks.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 IssueRemoteLinks { @@ -114,10 +114,10 @@ export class IssueRemoteLinks { url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink`, method: 'POST', data: { - globalId: parameters.globalId, application: parameters.application, - relationship: parameters.relationship, + globalId: parameters.globalId, object: parameters.object, + relationship: parameters.relationship, }, }; @@ -272,10 +272,10 @@ export class IssueRemoteLinks { url: `/rest/api/3/issue/${parameters.issueIdOrKey}/remotelink/${parameters.linkId}`, method: 'PUT', data: { - globalId: parameters.globalId, application: parameters.application, - relationship: parameters.relationship, + globalId: parameters.globalId, object: parameters.object, + relationship: parameters.relationship, }, }; diff --git a/src/version3/issueResolutions.ts b/src/version3/issueResolutions.ts index 09298953f1..6236cbb0a9 100644 --- a/src/version3/issueResolutions.ts +++ b/src/version3/issueResolutions.ts @@ -1,12 +1,34 @@ 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 IssueResolutions { constructor(private client: Client) {} + /** + * Returns a list of all issue resolution values. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolutions(callback: Callback): Promise; + /** + * Returns a list of all issue resolution values. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolutions(callback?: never): Promise; + async getResolutions(callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/resolution', + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } /** * Creates an issue resolution. * @@ -91,8 +113,8 @@ export class IssueResolutions { url: '/rest/api/3/resolution/move', method: 'PUT', data: { - ids: parameters.ids, after: parameters.after, + ids: parameters.ids, position: parameters.position, }, }; @@ -148,6 +170,35 @@ export class IssueResolutions { return this.client.sendRequest(config, callback); } + /** + * Returns an issue resolution value. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolution( + parameters: Parameters.GetResolution, + callback: Callback, + ): Promise; + /** + * Returns an issue resolution value. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getResolution(parameters: Parameters.GetResolution, callback?: never): Promise; + async getResolution( + parameters: Parameters.GetResolution, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/resolution/${parameters.id}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + /** * Updates an issue resolution. * diff --git a/src/version3/issueSearch.ts b/src/version3/issueSearch.ts index 051a2a4091..ba485a74da 100644 --- a/src/version3/issueSearch.ts +++ b/src/version3/issueSearch.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 IssueSearch { @@ -76,10 +76,7 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async matchIssues( - parameters: Parameters.MatchIssues | undefined, - callback: Callback, - ): Promise; + async matchIssues(parameters: Parameters.MatchIssues, callback: Callback): Promise; /** * Checks whether one or more issues would be returned by one or more JQL queries. * @@ -91,17 +88,17 @@ export class IssueSearch { * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission * to view the issue. */ - async matchIssues(parameters?: Parameters.MatchIssues, callback?: never): Promise; + async matchIssues(parameters: Parameters.MatchIssues, callback?: never): Promise; async matchIssues( - parameters?: Parameters.MatchIssues, + parameters: Parameters.MatchIssues, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/jql/match', method: 'POST', data: { - jqls: parameters?.jqls, - issueIds: parameters?.issueIds, + issueIds: parameters.issueIds, + jqls: parameters.jqls, }, }; @@ -125,7 +122,7 @@ export class IssueSearch { * to view the issue. */ async searchForIssuesUsingJql( - parameters: Parameters.SearchForIssuesUsingJql | undefined, + parameters: Parameters.SearchForIssuesUsingJql, callback: Callback, ): Promise; /** @@ -145,25 +142,26 @@ export class IssueSearch { * to view the issue. */ async searchForIssuesUsingJql( - parameters?: Parameters.SearchForIssuesUsingJql, + parameters: Parameters.SearchForIssuesUsingJql, callback?: never, ): Promise; async searchForIssuesUsingJql( - parameters?: Parameters.SearchForIssuesUsingJql, + parameters: Parameters.SearchForIssuesUsingJql, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/search', method: 'GET', params: { - jql: parameters?.jql, - startAt: parameters?.startAt, - maxResults: parameters?.maxResults, - validateQuery: parameters?.validateQuery, - fields: parameters?.fields, - expand: parameters?.expand, - properties: parameters?.properties, - fieldsByKeys: parameters?.fieldsByKeys, + jql: parameters.jql, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + validateQuery: parameters.validateQuery, + fields: parameters.fields, + expand: parameters.expand, + properties: parameters.properties, + fieldsByKeys: parameters.fieldsByKeys, + failFast: parameters.failFast, }, }; @@ -218,14 +216,260 @@ export class IssueSearch { url: '/rest/api/3/search', method: 'POST', data: { + expand: parameters?.expand, + fields: parameters?.fields, + fieldsByKeys: parameters?.fieldsByKeys, jql: parameters?.jql, - startAt: parameters?.startAt, maxResults: parameters?.maxResults, - fields: parameters?.fields, - validateQuery: parameters?.validateQuery, - expand: parameters?.expand, properties: parameters?.properties, - fieldsByKeys: parameters?.fieldsByKeys, + startAt: parameters?.startAt, + validateQuery: parameters?.validateQuery, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Provide an estimated count of the issues that match the [JQL](https://confluence.atlassian.com/x/egORLQ). Recent + * updates might not be immediately visible in the returned output. This endpoint requires JQL to be bounded. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async countIssues(parameters: Parameters.CountIssues, callback: Callback): Promise; + /** + * Provide an estimated count of the issues that match the [JQL](https://confluence.atlassian.com/x/egORLQ). Recent + * updates might not be immediately visible in the returned output. This endpoint requires JQL to be bounded. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async countIssues(parameters: Parameters.CountIssues, callback?: never): Promise; + async countIssues( + parameters: Parameters.CountIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/search/approximate-count', + method: 'POST', + data: { + jql: parameters.jql, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Searches for IDs of issues using [JQL](https://confluence.atlassian.com/x/egORLQ). + * + * Use the [Search](#api-rest-api-3-search-post) endpoint if you need to fetch more than just issue IDs. The Search + * endpoint returns more information, but may take much longer to respond to requests. This is because it uses a + * different mechanism for ordering results than this endpoint and doesn't provide the total number of results for + * your query. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesIds( + parameters: Parameters.SearchForIssuesIds, + callback: Callback, + ): Promise; + /** + * Searches for IDs of issues using [JQL](https://confluence.atlassian.com/x/egORLQ). + * + * Use the [Search](#api-rest-api-3-search-post) endpoint if you need to fetch more than just issue IDs. The Search + * endpoint returns more information, but may take much longer to respond to requests. This is because it uses a + * different mechanism for ordering results than this endpoint and doesn't provide the total number of results for + * your query. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesIds( + parameters: Parameters.SearchForIssuesIds, + callback?: never, + ): Promise; + async searchForIssuesIds( + parameters: Parameters.SearchForIssuesIds, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/search/id', + method: 'POST', + data: { + jql: parameters.jql, + maxResults: parameters.maxResults, + nextPageToken: parameters.nextPageToken, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately + * visible in the returned search results. + * + * If you need [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) + * consistency, you can utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. + * + * If the JQL query expression is too large to be encoded as a query parameter, use the + * [POST](#searchforissuesusingjqlenhancedsearchpost) version of this resource. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJqlEnhancedSearch( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch, + callback: Callback, + ): Promise; + /** + * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). Recent updates might not be immediately + * visible in the returned search results. + * + * If you need [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) + * consistency, you can utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. + * + * If the JQL query expression is too large to be encoded as a query parameter, use the + * [POST](#searchforissuesusingjqlenhancedsearchpost) version of this resource. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJqlEnhancedSearch( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch, + callback?: never, + ): Promise; + async searchForIssuesUsingJqlEnhancedSearch( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearch, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/search/jql', + method: 'GET', + params: { + jql: parameters.jql, + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + fields: parameters.fields, + expand: parameters.expand, + properties: parameters.properties, + fieldsByKeys: parameters.fieldsByKeys, + failFast: parameters.failFast, + reconcileIssues: parameters.reconcileIssues, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). + * + * If you need [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) + * consistency, you can utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. + * + * There is a [GET](#searchforissuesusingjqlenhancedsearch) version of this resource that can be used for smaller JQL + * query expressions. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJqlEnhancedSearchPost( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost, + callback: Callback, + ): Promise; + /** + * Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). + * + * If you need [read-after-write](https://developer.atlassian.com/cloud/jira/platform/search-and-reconcile/) + * consistency, you can utilize the `reconcileIssues` parameter to ensure stronger consistency assurances. + * + * There is a [GET](#searchforissuesusingjqlenhancedsearch) version of this resource that can be used for smaller JQL + * query expressions. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async searchForIssuesUsingJqlEnhancedSearchPost( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost, + callback?: never, + ): Promise; + async searchForIssuesUsingJqlEnhancedSearchPost( + parameters: Parameters.SearchForIssuesUsingJqlEnhancedSearchPost, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/search', + method: 'POST', + data: { + jql: parameters.jql, + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + fields: parameters.fields, + expand: parameters.expand, + properties: parameters.properties, + fieldsByKeys: parameters.fieldsByKeys, + failFast: parameters.failFast, + reconcileIssues: parameters.reconcileIssues, }, }; diff --git a/src/version3/issueSecurityLevel.ts b/src/version3/issueSecurityLevel.ts index 1a3e866999..39a5fd8fa2 100644 --- a/src/version3/issueSecurityLevel.ts +++ b/src/version3/issueSecurityLevel.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 IssueSecurityLevel { diff --git a/src/version3/issueSecuritySchemes.ts b/src/version3/issueSecuritySchemes.ts index 4618823f56..ebe2eddb81 100644 --- a/src/version3/issueSecuritySchemes.ts +++ b/src/version3/issueSecuritySchemes.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 IssueSecuritySchemes { @@ -299,7 +299,8 @@ export class IssueSecuritySchemes { * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue * security schemes.\ * If you specify the project ID parameter, the result will contain issue security schemes and related project IDs you - * filter by. + * filter by. Use {@link IssueSecuritySchemeResource#searchProjectsUsingSecuritySchemes(String, String, Set, Set)} to + * obtain all projects related to scheme. * * Only issue security schemes in the context of classic projects are returned. * @@ -314,7 +315,8 @@ export class IssueSecuritySchemes { * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of issue * security schemes.\ * If you specify the project ID parameter, the result will contain issue security schemes and related project IDs you - * filter by. + * filter by. Use {@link IssueSecuritySchemeResource#searchProjectsUsingSecuritySchemes(String, String, Set, Set)} to + * obtain all projects related to scheme. * * Only issue security schemes in the context of classic projects are returned. * diff --git a/src/version3/issueTypeProperties.ts b/src/version3/issueTypeProperties.ts index 03c2088b67..41ff4f4da0 100644 --- a/src/version3/issueTypeProperties.ts +++ b/src/version3/issueTypeProperties.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 IssueTypeProperties { diff --git a/src/version3/issueTypeSchemes.ts b/src/version3/issueTypeSchemes.ts index 3aec7af581..461def6959 100644 --- a/src/version3/issueTypeSchemes.ts +++ b/src/version3/issueTypeSchemes.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 IssueTypeSchemes { @@ -60,7 +60,7 @@ export class IssueTypeSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueTypeScheme( - parameters: Parameters.CreateIssueTypeScheme | undefined, + parameters: Parameters.CreateIssueTypeScheme, callback: Callback, ): Promise; /** @@ -70,21 +70,21 @@ export class IssueTypeSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueTypeScheme( - parameters?: Parameters.CreateIssueTypeScheme, + parameters: Parameters.CreateIssueTypeScheme, callback?: never, ): Promise; async createIssueTypeScheme( - parameters?: Parameters.CreateIssueTypeScheme, + parameters: Parameters.CreateIssueTypeScheme, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/issuetypescheme', method: 'POST', data: { - name: parameters?.name, - description: parameters?.description, - defaultIssueTypeId: parameters?.defaultIssueTypeId, - issueTypeIds: parameters?.issueTypeIds, + defaultIssueTypeId: parameters.defaultIssueTypeId, + description: parameters.description, + issueTypeIds: parameters.issueTypeIds, + name: parameters.name, }, }; @@ -189,7 +189,7 @@ export class IssueTypeSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async assignIssueTypeSchemeToProject( - parameters: Parameters.AssignIssueTypeSchemeToProject | undefined, + parameters: Parameters.AssignIssueTypeSchemeToProject, callback: Callback, ): Promise; /** @@ -204,19 +204,19 @@ export class IssueTypeSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async assignIssueTypeSchemeToProject( - parameters?: Parameters.AssignIssueTypeSchemeToProject, + parameters: Parameters.AssignIssueTypeSchemeToProject, callback?: never, ): Promise; async assignIssueTypeSchemeToProject( - parameters?: Parameters.AssignIssueTypeSchemeToProject, + parameters: Parameters.AssignIssueTypeSchemeToProject, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/issuetypescheme/project', method: 'PUT', data: { - issueTypeSchemeId: parameters?.issueTypeSchemeId, - projectId: parameters?.projectId, + issueTypeSchemeId: parameters.issueTypeSchemeId, + projectId: parameters.projectId, }, }; @@ -248,9 +248,9 @@ export class IssueTypeSchemes { url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}`, method: 'PUT', data: { - name: parameters.name, - description: parameters.description, defaultIssueTypeId: parameters.defaultIssueTypeId, + description: parameters.description, + name: parameters.name, }, }; @@ -377,8 +377,8 @@ export class IssueTypeSchemes { url: `/rest/api/3/issuetypescheme/${parameters.issueTypeSchemeId}/issuetype/move`, method: 'PUT', data: { - issueTypeIds: parameters.issueTypeIds, after: parameters.after, + issueTypeIds: parameters.issueTypeIds, position: parameters.position, }, }; diff --git a/src/version3/issueTypeScreenSchemes.ts b/src/version3/issueTypeScreenSchemes.ts index 2b52cba239..3f6b5be5a0 100644 --- a/src/version3/issueTypeScreenSchemes.ts +++ b/src/version3/issueTypeScreenSchemes.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 IssueTypeScreenSchemes { @@ -60,7 +60,7 @@ export class IssueTypeScreenSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueTypeScreenScheme( - parameters: Parameters.CreateIssueTypeScreenScheme | undefined, + parameters: Parameters.CreateIssueTypeScreenScheme, callback: Callback, ): Promise; /** @@ -70,20 +70,20 @@ export class IssueTypeScreenSchemes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueTypeScreenScheme( - parameters?: Parameters.CreateIssueTypeScreenScheme, + parameters: Parameters.CreateIssueTypeScreenScheme, callback?: never, ): Promise; async createIssueTypeScreenScheme( - parameters?: Parameters.CreateIssueTypeScreenScheme, + parameters: Parameters.CreateIssueTypeScreenScheme, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/issuetypescreenscheme', method: 'POST', data: { - name: parameters?.name, - description: parameters?.description, - issueTypeMappings: parameters?.issueTypeMappings, + description: parameters.description, + issueTypeMappings: parameters.issueTypeMappings, + name: parameters.name, }, }; @@ -244,8 +244,8 @@ export class IssueTypeScreenSchemes { url: `/rest/api/3/issuetypescreenscheme/${parameters.issueTypeScreenSchemeId}`, method: 'PUT', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; diff --git a/src/version3/issueTypes.ts b/src/version3/issueTypes.ts index a91e4834ec..7d629fd432 100644 --- a/src/version3/issueTypes.ts +++ b/src/version3/issueTypes.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 IssueTypes { @@ -51,7 +51,7 @@ export class IssueTypes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueType( - parameters: Parameters.CreateIssueType | undefined, + parameters: Parameters.CreateIssueType, callback: Callback, ): Promise; /** @@ -61,20 +61,20 @@ export class IssueTypes { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async createIssueType( - parameters?: Parameters.CreateIssueType, + parameters: Parameters.CreateIssueType, callback?: never, ): Promise; async createIssueType( - parameters?: Parameters.CreateIssueType, + parameters: Parameters.CreateIssueType, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/issuetype', method: 'POST', data: { - name: parameters?.name, - description: parameters?.description, - hierarchyLevel: parameters?.hierarchyLevel, + description: parameters.description, + hierarchyLevel: parameters.hierarchyLevel ?? 0, + name: parameters.name, }, }; @@ -186,9 +186,9 @@ export class IssueTypes { url: `/rest/api/3/issuetype/${parameters.id}`, method: 'PUT', data: { - name: parameters.name, - description: parameters.description, avatarId: parameters.avatarId, + description: parameters.description, + name: parameters.name, }, }; @@ -264,23 +264,14 @@ export class IssueTypes { /** * Loads an avatar for the issue type. * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * For example: `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check'\ - * --header 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url - * 'https://your-domain.atlassian.net/rest/api/3/issuetype/{issueTypeId}'This` - * * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of * the image. The length of the square's sides is set to the smaller of the height or width of the image. * * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. * - * After creating the avatar, use [ Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's - * displayed avatar. + * After creating the avatar, use [ Update issue + * type](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-types/#api-rest-api-3-issuetype-id-put) + * to set it as the issue type's displayed avatar. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -292,23 +283,14 @@ export class IssueTypes { /** * Loads an avatar for the issue type. * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * For example: `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check'\ - * --header 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url - * 'https://your-domain.atlassian.net/rest/api/3/issuetype/{issueTypeId}'This` - * * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of * the image. The length of the square's sides is set to the smaller of the height or width of the image. * * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. * - * After creating the avatar, use [ Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's - * displayed avatar. + * After creating the avatar, use [ Update issue + * type](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-types/#api-rest-api-3-issuetype-id-put) + * to set it as the issue type's displayed avatar. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -324,11 +306,16 @@ export class IssueTypes { const config: RequestConfig = { url: `/rest/api/3/issuetype/${parameters.id}/avatar2`, method: 'POST', + headers: { + 'X-Atlassian-Token': 'no-check', + 'Content-Type': parameters.mimeType, + }, params: { x: parameters.x, y: parameters.y, - size: parameters.size, + size: parameters.size ?? 0, }, + data: parameters.avatar, }; return this.client.sendRequest(config, callback); diff --git a/src/version3/issueVotes.ts b/src/version3/issueVotes.ts index f115e57588..72ee3e4296 100644 --- a/src/version3/issueVotes.ts +++ b/src/version3/issueVotes.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 IssueVotes { diff --git a/src/version3/issueWatchers.ts b/src/version3/issueWatchers.ts index 69e2c03035..efbcc65f97 100644 --- a/src/version3/issueWatchers.ts +++ b/src/version3/issueWatchers.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 IssueWatchers { diff --git a/src/version3/issueWorklogProperties.ts b/src/version3/issueWorklogProperties.ts index 14a743ca9f..b52b7b6f5d 100644 --- a/src/version3/issueWorklogProperties.ts +++ b/src/version3/issueWorklogProperties.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 IssueWorklogProperties { diff --git a/src/version3/issueWorklogs.ts b/src/version3/issueWorklogs.ts index 2b467b6c1e..1737b3ba21 100644 --- a/src/version3/issueWorklogs.ts +++ b/src/version3/issueWorklogs.ts @@ -1,15 +1,15 @@ 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 IssueWorklogs { constructor(private client: Client) {} /** - * Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and - * time. + * Returns worklogs for an issue (ordered by created time), starting from the oldest worklog or from the worklog + * started on or after a date and time. * * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). @@ -30,8 +30,8 @@ export class IssueWorklogs { callback: Callback, ): Promise; /** - * Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and - * time. + * Returns worklogs for an issue (ordered by created time), starting from the oldest worklog or from the worklog + * started on or after a date and time. * * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). @@ -137,20 +137,139 @@ export class IssueWorklogs { overrideEditableFlag: parameters.overrideEditableFlag, }, data: { - self: parameters.self, author: parameters.author, - updateAuthor: parameters.updateAuthor, - comment, + comment: parameters.comment, created: parameters.created, - updated: parameters.updated, - visibility: parameters.visibility, - started: parameters.started, - timeSpent: parameters.timeSpent, - timeSpentSeconds: parameters.timeSpentSeconds, id: parameters.id, issueId: parameters.issueId, properties: parameters.properties, + self: parameters.self, + started: parameters.started, + timeSpent: parameters.timeSpent, + timeSpentSeconds: parameters.timeSpentSeconds, + updateAuthor: parameters.updateAuthor, + updated: parameters.updated, + visibility: parameters.visibility, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a list of worklogs from an issue. This is an experimental API with limitations: + * + * - You can't delete more than 5000 worklogs at once. + * - No notifications will be sent for deleted worklogs. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog. + * - If any worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async bulkDeleteWorklogs(parameters: Parameters.BulkDeleteWorklogs, callback: Callback): Promise; + /** + * Deletes a list of worklogs from an issue. This is an experimental API with limitations: + * + * - You can't delete more than 5000 worklogs at once. + * - No notifications will be sent for deleted worklogs. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the + * issue. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog. + * - If any worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async bulkDeleteWorklogs(parameters: Parameters.BulkDeleteWorklogs, callback?: never): Promise; + async bulkDeleteWorklogs( + parameters: Parameters.BulkDeleteWorklogs, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog`, + method: 'DELETE', + params: { + adjustEstimate: parameters.adjustEstimate, + overrideEditableFlag: parameters.overrideEditableFlag, + }, + data: { + ids: parameters.ids, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a list of worklogs from one issue to another. This is an experimental API with several limitations: + * + * - You can't move more than 5000 worklogs at once. + * - You can't move worklogs containing an attachment. + * - You can't move worklogs restricted by project roles. + * - No notifications will be sent for moved worklogs. + * - No webhooks or events will be sent for moved worklogs. + * - No issue history will be recorded for moved worklogs. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the projects containing the + * source and destination issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ and _Edit all worklogs_](https://confluence.atlassian.com/x/yodKLg)[project + * permission](https://confluence.atlassian.com/x/yodKLg) + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async bulkMoveWorklogs(parameters: Parameters.BulkMoveWorklogs, callback: Callback): Promise; + /** + * Moves a list of worklogs from one issue to another. This is an experimental API with several limitations: + * + * - You can't move more than 5000 worklogs at once. + * - You can't move worklogs containing an attachment. + * - You can't move worklogs restricted by project roles. + * - No notifications will be sent for moved worklogs. + * - No webhooks or events will be sent for moved worklogs. + * - No issue history will be recorded for moved worklogs. + * + * Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see + * [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the projects containing the + * source and destination issues. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + * - _Delete all worklogs_[ and _Edit all worklogs_](https://confluence.atlassian.com/x/yodKLg)[project + * permission](https://confluence.atlassian.com/x/yodKLg) + * - If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + */ + async bulkMoveWorklogs(parameters: Parameters.BulkMoveWorklogs, callback?: never): Promise; + async bulkMoveWorklogs(parameters: Parameters.BulkMoveWorklogs, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/${parameters.issueIdOrKey}/worklog/move`, + method: 'POST', + params: { + adjustEstimate: parameters.adjustEstimate, + overrideEditableFlag: parameters.overrideEditableFlag, }, + data: parameters.worklogs, }; return this.client.sendRequest(config, callback); diff --git a/src/version3/issues.ts b/src/version3/issues.ts index d7a916b21d..db679cf293 100644 --- a/src/version3/issues.ts +++ b/src/version3/issues.ts @@ -1,12 +1,70 @@ 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 Issues { constructor(private client: Client) {} + /** + * Bulk fetch changelogs for multiple issues and filter by fields + * + * Returns a paginated list of all changelogs for given issues sorted by changelog date and issue IDs, starting from + * the oldest changelog and smallest issue ID. + * + * Issues are identified by their ID or key, and optionally changelogs can be filtered by their field IDs. You can + * request the changelogs of up to 1000 issues and can filter them by up to 10 field IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the projects that the issues + * are in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issues. + */ + async getBulkChangelogs( + parameters: Parameters.GetBulkChangelogs, + callback: Callback, + ): Promise; + /** + * Bulk fetch changelogs for multiple issues and filter by fields + * + * Returns a paginated list of all changelogs for given issues sorted by changelog date and issue IDs, starting from + * the oldest changelog and smallest issue ID. + * + * Issues are identified by their ID or key, and optionally changelogs can be filtered by their field IDs. You can + * request the changelogs of up to 1000 issues and can filter them by up to 10 field IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the projects that the issues + * are in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issues. + */ + async getBulkChangelogs( + parameters: Parameters.GetBulkChangelogs, + callback?: never, + ): Promise; + async getBulkChangelogs( + parameters: Parameters.GetBulkChangelogs, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/changelog/bulkfetch', + method: 'POST', + data: { + fieldIds: parameters.fieldIds, + issueIdsOrKeys: parameters.issueIdsOrKeys, + maxResults: parameters.maxResults, + nextPageToken: parameters.nextPageToken, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Returns all issue events. * @@ -84,7 +142,7 @@ export class Issues { parameters: Parameters.CreateIssue, callback?: Callback, ): Promise { - if (parameters.fields?.description && typeof parameters.fields.description === 'string') { + if (typeof parameters.fields.description === 'string') { parameters.fields.description = { type: 'doc', version: 1, @@ -142,12 +200,9 @@ export class Issues { * * **Signed-in users only:** This API can't be accessed anonymously. * - * **Rate limiting:** Only a single request per user can be active at any given time. + * **Rate limiting:** Only a single request per jira instance can be active at any given time. */ - async archiveIssuesAsync( - parameters: Parameters.ArchiveIssuesAsync, - callback: Callback, - ): Promise; + async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback: Callback): Promise; /** * Enables admins to archive up to 100,000 issues in a single request using JQL, returning the URL to check the status * of the submitted request. @@ -170,10 +225,10 @@ export class Issues { * * **Signed-in users only:** This API can't be accessed anonymously. * - * **Rate limiting:** Only a single request per user can be active at any given time. + * **Rate limiting:** Only a single request per jira instance can be active at any given time. */ - async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; - async archiveIssuesAsync( + async archiveIssuesAsync(parameters: Parameters.ArchiveIssuesAsync, callback?: never): Promise; + async archiveIssuesAsync( parameters: Parameters.ArchiveIssuesAsync, callback?: Callback, ): Promise { @@ -303,36 +358,110 @@ export class Issues { } /** - * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each - * issue type for the user. Use the information to populate the requests in [ Create - * issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). + * Returns the details for a set of requested issues. You can request up to 100 issues. * - * The request can be restricted to specific projects or issue types using the query parameters. The response will - * contain information for the valid projects, issue types, or project and issue type combinations requested. Note - * that invalid project, issue type, or project and issue type combinations do not generate errors. + * Each issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive + * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or + * other redirect is **not** returned. + * + * Issues will be returned in ascending `id` order. If there are errors, Jira will return a list of issues which + * couldn't be fetched along with error messages. * * This operation can be accessed anonymously. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Create - * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkFetchIssues( + parameters: Parameters.BulkFetchIssues, + callback: Callback, + ): Promise; + /** + * Returns the details for a set of requested issues. You can request up to 100 issues. + * + * Each issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive + * search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or + * other redirect is **not** returned. + * + * Issues will be returned in ascending `id` order. If there are errors, Jira will return a list of issues which + * couldn't be fetched along with error messages. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Issues + * are included in the response where the user has: + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is + * in. + * - If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission + * to view the issue. + */ + async bulkFetchIssues(parameters: Parameters.BulkFetchIssues, callback?: never): Promise; + async bulkFetchIssues( + parameters: Parameters.BulkFetchIssues, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/bulkfetch', + method: 'POST', + data: { + expand: parameters.expand, + fields: parameters.fields, + fieldsByKeys: parameters.fieldsByKeys, + issueIdsOrKeys: parameters.issueIdsOrKeys, + properties: parameters.properties, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * @deprecated + * + * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each + * issue type for the user. Use the information to populate the requests in [ Create + * issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). + * + * Deprecated, see [Create Issue Meta Endpoint Deprecation + * Notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1304). + * + * The request can be restricted to specific projects or issue types using the query parameters. The response will + * contain information for the valid projects, issue types, or project and issue type combinations requested. Note + * that invalid project, issue type, or project and issue type combinations do not generate errors. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. */ async getCreateIssueMeta( parameters: Parameters.GetCreateIssueMeta | undefined, callback: Callback, ): Promise; /** - * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each - * issue type for the user. Use the information to populate the requests in [ Create - * issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). + * @deprecated * - * The request can be restricted to specific projects or issue types using the query parameters. The response will - * contain information for the valid projects, issue types, or project and issue type combinations requested. Note - * that invalid project, issue type, or project and issue type combinations do not generate errors. + * Returns details of projects, issue types within projects, and, when requested, the create screen fields for each + * issue type for the user. Use the information to populate the requests in [ Create + * issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). * - * This operation can be accessed anonymously. + * Deprecated, see [Create Issue Meta Endpoint Deprecation + * Notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1304). * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Create - * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + * The request can be restricted to specific projects or issue types using the query parameters. The response will + * contain information for the valid projects, issue types, or project and issue type combinations requested. Note + * that invalid project, issue type, or project and issue type combinations do not generate errors. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. */ async getCreateIssueMeta( parameters?: Parameters.GetCreateIssueMeta, @@ -357,6 +486,134 @@ export class Issues { return this.client.sendRequest(config, callback); } + /** + * Returns a page of issue type metadata for a specified project. Use the information to populate the requests in [ + * Create issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMetaIssueTypes( + parameters: Parameters.GetCreateIssueMetaIssueTypes, + callback: Callback, + ): Promise; + /** + * Returns a page of issue type metadata for a specified project. Use the information to populate the requests in [ + * Create issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMetaIssueTypes( + parameters: Parameters.GetCreateIssueMetaIssueTypes, + callback?: never, + ): Promise; + async getCreateIssueMetaIssueTypes( + parameters: Parameters.GetCreateIssueMetaIssueTypes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/createmeta/${parameters.projectIdOrKey}/issuetypes`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a page of field metadata for a specified project and issuetype id. Use the information to populate the + * requests in [ Create issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMetaIssueTypeId( + parameters: Parameters.GetCreateIssueMetaIssueTypeId, + callback: Callback, + ): Promise; + /** + * Returns a page of field metadata for a specified project and issuetype id. Use the information to populate the + * requests in [ Create issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Create + * issues_ [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + */ + async getCreateIssueMetaIssueTypeId( + parameters: Parameters.GetCreateIssueMetaIssueTypeId, + callback?: never, + ): Promise; + async getCreateIssueMetaIssueTypeId( + parameters: Parameters.GetCreateIssueMetaIssueTypeId, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/issue/createmeta/${parameters.projectIdOrKey}/issuetypes/${parameters.issueTypeId}`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns all issues breaching and approaching per-issue limits. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) is required for the project the + * issues are in. Results may be incomplete otherwise + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueLimitReport( + parameters: Parameters.GetIssueLimitReport | undefined, + callback: Callback, + ): Promise; + /** + * Returns all issues breaching and approaching per-issue limits. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) is required for the project the + * issues are in. Results may be incomplete otherwise + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getIssueLimitReport( + parameters?: Parameters.GetIssueLimitReport, + callback?: never, + ): Promise; + async getIssueLimitReport( + parameters?: Parameters.GetIssueLimitReport, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/issue/limit/report', + method: 'GET', + params: { + isReturningKeys: parameters?.isReturningKeys, + }, + data: { + issuesApproachingLimitParams: parameters?.issuesApproachingLimitParams, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Enables admins to unarchive up to 1000 issues in a single request using issue ID/key, returning details of the * issue(s) unarchived in the process and the errors encountered, if any. @@ -456,6 +713,7 @@ export class Issues { expand: parameters.expand, properties: parameters.properties, updateHistory: parameters.updateHistory, + failFast: parameters.failFast, }, }; @@ -463,7 +721,9 @@ export class Issues { } /** - * Edits an issue. A transition may be applied and issue properties updated as part of the edit. + * Edits an issue. Issue properties may be updated as part of the edit. Please note that issue transition is not + * supported and is ignored here. To transition an issue, please use [Transition + * issue](#api-rest-api-3-issue-issueIdOrKey-transitions-post). * * The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are * determined using [ Get edit issue metadata](#api-rest-api-3-issue-issueIdOrKey-editmeta-get). @@ -489,7 +749,9 @@ export class Issues { */ async editIssue(parameters: Parameters.EditIssue, callback: Callback): Promise; /** - * Edits an issue. A transition may be applied and issue properties updated as part of the edit. + * Edits an issue. Issue properties may be updated as part of the edit. Please note that issue transition is not + * supported and is ignored here. To transition an issue, please use [Transition + * issue](#api-rest-api-3-issue-issueIdOrKey-transitions-post). * * The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are * determined using [ Get edit issue metadata](#api-rest-api-3-issue-issueIdOrKey-editmeta-get). diff --git a/src/version3/jQL.ts b/src/version3/jQL.ts index e630da739d..2d2100ea63 100644 --- a/src/version3/jQL.ts +++ b/src/version3/jQL.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 JQL { @@ -96,8 +96,8 @@ export class JQL { url: '/rest/api/3/jql/autocompletedata', method: 'POST', data: { - projectIds: parameters?.projectIds, includeCollapsedFields: parameters?.includeCollapsedFields, + projectIds: parameters?.projectIds, }, }; @@ -170,7 +170,7 @@ export class JQL { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async parseJqlQueries( - parameters: Parameters.ParseJqlQueries | undefined, + parameters: Parameters.ParseJqlQueries, callback: Callback, ): Promise; /** @@ -183,21 +183,21 @@ export class JQL { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async parseJqlQueries( - parameters?: Parameters.ParseJqlQueries, + parameters: Parameters.ParseJqlQueries, callback?: never, ): Promise; async parseJqlQueries( - parameters?: Parameters.ParseJqlQueries, + parameters: Parameters.ParseJqlQueries, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/jql/parse', method: 'POST', params: { - validation: parameters?.validation, + validation: parameters.validation, }, data: { - queries: parameters?.queries, + queries: parameters.queries, }, }; diff --git a/src/version3/jiraExpressions.ts b/src/version3/jiraExpressions.ts index 934f92417f..484b5b02f2 100644 --- a/src/version3/jiraExpressions.ts +++ b/src/version3/jiraExpressions.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 JiraExpressions { @@ -46,8 +46,8 @@ export class JiraExpressions { check: parameters?.check, }, data: { - expressions: parameters?.expressions, contextVariables: parameters?.contextVariables, + expressions: parameters?.expressions, }, }; @@ -106,11 +106,12 @@ export class JiraExpressions { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue. Permission to access Jira Software is - * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + * example, different users may see different comments on the same issue.\ + * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or + * fields (for example, `issue.sprint`). */ async evaluateJiraExpression( - parameters: Parameters.EvaluateJiraExpression | undefined, + parameters: Parameters.EvaluateJiraExpression, callback: Callback, ): Promise; /** @@ -165,26 +166,172 @@ export class JiraExpressions { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. * However, an expression may return different results for different users depending on their permissions. For - * example, different users may see different comments on the same issue. Permission to access Jira Software is - * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + * example, different users may see different comments on the same issue.\ + * Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or + * fields (for example, `issue.sprint`). */ async evaluateJiraExpression( - parameters?: Parameters.EvaluateJiraExpression, + parameters: Parameters.EvaluateJiraExpression, callback?: never, ): Promise; async evaluateJiraExpression( - parameters?: Parameters.EvaluateJiraExpression, + parameters: Parameters.EvaluateJiraExpression, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/expression/eval', method: 'POST', params: { - expand: parameters?.expand, + expand: parameters.expand, + }, + data: { + context: parameters.context, + expression: parameters.expression, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Evaluates a Jira expression and returns its value. The difference between this and `eval` is that this endpoint + * uses the enhanced search API when evaluating JQL queries. This API is eventually consistent, unlike the strongly + * consistent `eval` API. This allows for better performance and scalability. In addition, this API's response for JQL + * evaluation is based on a scrolling view (backed by a `nextPageToken`) instead of a paginated view (backed by + * `startAt` and `totalCount`). + * + * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible + * way. Consult the [Jira expressions + * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. + * + * #### Context variables + * + * The following context variables are available to Jira expressions evaluated by this resource. Their presence + * depends on various factors; usually you need to manually request them in the context object sent in the payload, + * but some of them are added automatically under certain conditions. + * + * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The + * current user. Always available and equal to `null` if the request is anonymous. + * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The + * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. + * Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect + * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). + * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The + * current issue. Available only when the issue is provided in the request context object. + * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of + * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A + * collection of issues matching a JQL query. Available only when JQL is provided in the request context object. + * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): + * The current project. Available only when the project is provided in the request context object. + * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): + * The current sprint. Available only when the sprint is provided in the request context object. + * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The + * current board. Available only when the board is provided in the request context object. + * - `serviceDesk` + * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): + * The current service desk. Available only when the service desk is provided in the request context object. + * - `customerRequest` + * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): + * The current customer request. Available only when the customer request is provided in the request context + * object. + * + * In addition, you can pass custom context variables along with their types. You can then access them from the Jira + * expression by key. You can use the following variables in a custom context: + * + * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. + * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) + * specified by ID or key. All the fields of the issue object are available in the Jira expression. + * - `json`: A JSON object containing custom content. + * - `list`: A JSON list of `user`, `issue`, or `json` variable types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. + * However, an expression may return different results for different users depending on their permissions. For + * example, different users may see different comments on the same issue. Permission to access Jira Software is + * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + */ + async evaluateJiraExpressionUsingEnhancedSearch( + parameters: Parameters.EvaluateJiraExpressionUsingEnhancedSearch, + callback: Callback, + ): Promise; + /** + * Evaluates a Jira expression and returns its value. The difference between this and `eval` is that this endpoint + * uses the enhanced search API when evaluating JQL queries. This API is eventually consistent, unlike the strongly + * consistent `eval` API. This allows for better performance and scalability. In addition, this API's response for JQL + * evaluation is based on a scrolling view (backed by a `nextPageToken`) instead of a paginated view (backed by + * `startAt` and `totalCount`). + * + * This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible + * way. Consult the [Jira expressions + * documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. + * + * #### Context variables + * + * The following context variables are available to Jira expressions evaluated by this resource. Their presence + * depends on various factors; usually you need to manually request them in the context object sent in the payload, + * but some of them are added automatically under certain conditions. + * + * - `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The + * current user. Always available and equal to `null` if the request is anonymous. + * - `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The + * [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. + * Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect + * apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). + * - `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The + * current issue. Available only when the issue is provided in the request context object. + * - `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of + * [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A + * collection of issues matching a JQL query. Available only when JQL is provided in the request context object. + * - `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): + * The current project. Available only when the project is provided in the request context object. + * - `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): + * The current sprint. Available only when the sprint is provided in the request context object. + * - `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The + * current board. Available only when the board is provided in the request context object. + * - `serviceDesk` + * ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): + * The current service desk. Available only when the service desk is provided in the request context object. + * - `customerRequest` + * ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): + * The current customer request. Available only when the customer request is provided in the request context + * object. + * + * In addition, you can pass custom context variables along with their types. You can then access them from the Jira + * expression by key. You can use the following variables in a custom context: + * + * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. + * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) + * specified by ID or key. All the fields of the issue object are available in the Jira expression. + * - `json`: A JSON object containing custom content. + * - `list`: A JSON list of `user`, `issue`, or `json` variable types. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required**: None. + * However, an expression may return different results for different users depending on their permissions. For + * example, different users may see different comments on the same issue. Permission to access Jira Software is + * required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + */ + async evaluateJiraExpressionUsingEnhancedSearch( + parameters: Parameters.EvaluateJiraExpressionUsingEnhancedSearch, + callback?: never, + ): Promise; + async evaluateJiraExpressionUsingEnhancedSearch( + parameters: Parameters.EvaluateJiraExpressionUsingEnhancedSearch, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/expression/evaluate', + method: 'POST', + params: { + expand: parameters.expand, }, data: { - expression: parameters?.expression, - context: parameters?.context, + expression: parameters.expression, + context: parameters.context, }, }; diff --git a/src/version3/jiraSettings.ts b/src/version3/jiraSettings.ts index 530adff118..3a7e1406b4 100644 --- a/src/version3/jiraSettings.ts +++ b/src/version3/jiraSettings.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 JiraSettings { @@ -88,18 +88,17 @@ export class JiraSettings { * * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). * - * | Key | Description | Default value | - * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | - * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | - * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | - * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | - * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | - * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | - * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | - * | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | - * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | - * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | - * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | + * | Key | Description | Default value | + * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | + * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | + * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | + * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | + * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | + * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | + * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | + * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | + * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | + * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | * * #### Look and feel * @@ -148,18 +147,17 @@ export class JiraSettings { * * The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). * - * | Key | Description | Default value | - * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | - * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | - * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | - * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | - * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | - * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | - * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | - * | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | - * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | - * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | - * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | + * | Key | Description | Default value | + * | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | + * | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | + * | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | + * | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | + * | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | + * | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | + * | `jira.issue.actions.order` | The default order of actions (such as _Comments_ or _Change history_) displayed on the issue view. | `asc` | + * | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | + * | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | + * | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | * * #### Look and feel * diff --git a/src/version3/jqlFunctionsApps.ts b/src/version3/jqlFunctionsApps.ts index d45dcf0020..7cfd6b2331 100644 --- a/src/version3/jqlFunctionsApps.ts +++ b/src/version3/jqlFunctionsApps.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 JqlFunctionsApps { @@ -13,6 +13,9 @@ export class JqlFunctionsApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** This * API is only accessible to apps and apps can only inspect their own functions. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async getPrecomputations( parameters: Parameters.GetPrecomputations | undefined, @@ -24,6 +27,9 @@ export class JqlFunctionsApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** This * API is only accessible to apps and apps can only inspect their own functions. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async getPrecomputations( parameters?: Parameters.GetPrecomputations, @@ -53,9 +59,12 @@ export class JqlFunctionsApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** An API * for apps to update their own precomputations. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ async updatePrecomputations( - parameters: Parameters.UpdatePrecomputations | undefined, + parameters: Parameters.UpdatePrecomputations, callback: Callback, ): Promise; /** @@ -63,17 +72,69 @@ export class JqlFunctionsApps { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** An API * for apps to update their own precomputations. + * + * The new `write:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. */ - async updatePrecomputations(parameters?: Parameters.UpdatePrecomputations, callback?: never): Promise; + async updatePrecomputations(parameters: Parameters.UpdatePrecomputations, callback?: never): Promise; async updatePrecomputations( - parameters?: Parameters.UpdatePrecomputations, + parameters: Parameters.UpdatePrecomputations, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/jql/function/computation', method: 'POST', + params: { + skipNotFoundPrecomputations: parameters.skipNotFoundPrecomputations, + }, + data: { + values: parameters.values, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns function precomputations by IDs, along with information about when they were created, updated, and last + * used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** This + * API is only accessible to apps and apps can only inspect their own functions. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. + */ + async getPrecomputationsByID( + parameters: Parameters.GetPrecomputationsByID, + callback: Callback, + ): Promise; + /** + * Returns function precomputations by IDs, along with information about when they were created, updated, and last + * used. Each precomputation has a `value` - the JQL fragment to replace the custom function clause with. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** This + * API is only accessible to apps and apps can only inspect their own functions. + * + * The new `read:app-data:jira` OAuth scope is 100% optional now, and not using it won't break your app. However, we + * recommend adding it to your app's scope list because we will eventually make it mandatory. + */ + async getPrecomputationsByID( + parameters: Parameters.GetPrecomputationsByID, + callback?: never, + ): Promise; + async getPrecomputationsByID( + parameters: Parameters.GetPrecomputationsByID, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/jql/function/computation/search', + method: 'POST', + params: { + orderBy: parameters.orderBy, + }, data: { - values: parameters?.values, + precomputationIDs: parameters.precomputationIDs, }, }; diff --git a/src/version3/labels.ts b/src/version3/labels.ts index d05b19261f..f2a1098be2 100644 --- a/src/version3/labels.ts +++ b/src/version3/labels.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 Labels { diff --git a/src/version3/licenseMetrics.ts b/src/version3/licenseMetrics.ts index 4cd2204fac..2f17676a1c 100644 --- a/src/version3/licenseMetrics.ts +++ b/src/version3/licenseMetrics.ts @@ -1,6 +1,6 @@ import * as Models from './models'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class LicenseMetrics { diff --git a/src/version3/models/approvalConfiguration.ts b/src/version3/models/approvalConfiguration.ts new file mode 100644 index 0000000000..790f18d0a8 --- /dev/null +++ b/src/version3/models/approvalConfiguration.ts @@ -0,0 +1,29 @@ +/** The approval configuration of a status within a workflow. Applies only to Jira Service Management approvals. */ +export interface ApprovalConfiguration { + /** Whether the approval configuration is active. */ + active: 'true' | 'false' | string; + /** + * How the required approval count is calculated. It may be configured to require a specific number of approvals, or + * approval by a percentage of approvers. If the approvers source field is Approver groups, you can configure how many + * approvals per group are required for the request to be approved. The number will be the same across all groups. + */ + conditionType: 'number' | 'percent' | 'numberPerPrincipal' | string; + /** + * The number or percentage of approvals required for a request to be approved. If `conditionType` is `number`, the + * value must be 20 or less. If `conditionType` is `percent`, the value must be 100 or less. + */ + conditionValue: string; + /** A list of roles that should be excluded as possible approvers. */ + exclude?: 'assignee' | 'reporter' | string; + /** The custom field ID of the "Approvers" or "Approver Groups" field. */ + fieldId: string; + /** + * The custom field ID of the field used to pre-populate the Approver field. Only supports the "Affected Services" + * field. + */ + prePopulatedFieldId?: string; + /** The numeric ID of the transition to be executed if the request is approved. */ + transitionApproved: string; + /** The numeric ID of the transition to be executed if the request is declined. */ + transitionRejected: string; +} diff --git a/src/version3/models/avatar.ts b/src/version3/models/avatar.ts index cab1507727..33fa3d8507 100644 --- a/src/version3/models/avatar.ts +++ b/src/version3/models/avatar.ts @@ -1,3 +1,5 @@ +import type { AvatarUrls } from './avatarUrls'; + /** Details of an avatar. */ export interface Avatar { /** The ID of the avatar. */ @@ -8,13 +10,13 @@ export interface Avatar { */ owner?: string; /** Whether the avatar is a system avatar. */ - isSystemAvatar?: boolean; + isSystemAvatar: boolean; /** Whether the avatar is used in Jira. For example, shown as a project's avatar. */ - isSelected?: boolean; + isSelected: boolean; /** Whether the avatar can be deleted. */ - isDeletable?: boolean; + isDeletable: boolean; /** The file name of the avatar icon. Returned for system avatars. */ fileName?: string; /** The list of avatar icon URLs. */ - urls?: {}; + urls: AvatarUrls; } diff --git a/src/version3/models/avatarWithDetails.ts b/src/version3/models/avatarWithDetails.ts index 15f5f99071..f0c47200c6 100644 --- a/src/version3/models/avatarWithDetails.ts +++ b/src/version3/models/avatarWithDetails.ts @@ -2,5 +2,5 @@ export interface AvatarWithDetails { /** The content type of the avatar. Expected values include 'image/png', 'image/svg+xml', or any other valid MIME type. */ contentType: 'image/png' | 'image/svg+xml' | string; /** The binary representation of the avatar image. */ - avatar: ArrayBuffer; + avatar: Uint8Array; } diff --git a/src/version3/models/avatars.ts b/src/version3/models/avatars.ts index 9954aeb966..c2b1b1684e 100644 --- a/src/version3/models/avatars.ts +++ b/src/version3/models/avatars.ts @@ -3,7 +3,7 @@ import { Avatar } from './avatar'; /** Details about system and custom avatars. */ export interface Avatars { /** System avatars list. */ - system?: Avatar[]; + system: Avatar[]; /** Custom avatars list. */ - custom?: Avatar[]; + custom: Avatar[]; } diff --git a/src/version3/models/bulkChangelog.ts b/src/version3/models/bulkChangelog.ts new file mode 100644 index 0000000000..55644ab007 --- /dev/null +++ b/src/version3/models/bulkChangelog.ts @@ -0,0 +1,12 @@ +import { IssueChangeLog } from './issueChangeLog'; + +/** A page of changelogs which is designed to handle multiple issues */ +export interface BulkChangelog { + /** The list of issues changelogs. */ + issueChangeLogs?: IssueChangeLog[]; + /** + * Continuation token to fetch the next page. If this result represents the last or the only page, this token will be + * null. + */ + nextPageToken?: string; +} diff --git a/src/version3/models/bulkChangelogRequest.ts b/src/version3/models/bulkChangelogRequest.ts new file mode 100644 index 0000000000..b6162735ac --- /dev/null +++ b/src/version3/models/bulkChangelogRequest.ts @@ -0,0 +1,11 @@ +/** Request bean for bulk changelog retrieval */ +export interface BulkChangelogRequest { + /** List of field IDs to filter changelogs */ + fieldIds?: string[]; + /** List of issue IDs/keys to fetch changelogs for */ + issueIdsOrKeys: string[]; + /** The maximum number of items to return per page */ + maxResults?: number; + /** The cursor for pagination */ + nextPageToken?: string; +} diff --git a/src/version3/models/bulkContextualConfiguration.ts b/src/version3/models/bulkContextualConfiguration.ts new file mode 100644 index 0000000000..e175ae50a8 --- /dev/null +++ b/src/version3/models/bulkContextualConfiguration.ts @@ -0,0 +1,13 @@ +/** Details of the contextual configuration for a custom field. */ +export interface BulkContextualConfiguration { + /** The field configuration. */ + configuration?: {}; + /** The ID of the custom field. */ + customFieldId: string; + /** The ID of the field context the configuration is associated with. */ + fieldContextId: string; + /** The ID of the configuration. */ + id: string; + /** The field value schema. */ + schema?: {}; +} diff --git a/src/version3/models/bulkEditGetFields.ts b/src/version3/models/bulkEditGetFields.ts new file mode 100644 index 0000000000..aa79b2e628 --- /dev/null +++ b/src/version3/models/bulkEditGetFields.ts @@ -0,0 +1,11 @@ +import { IssueBulkEditField } from './issueBulkEditField'; + +/** Bulk Edit Get Fields Response. */ +export interface BulkEditGetFields { + /** The end cursor for use in pagination. */ + endingBefore?: string; + /** List of all the fields */ + fields?: IssueBulkEditField[]; + /** The start cursor for use in pagination. */ + startingAfter?: string; +} diff --git a/src/version3/models/bulkIssue.ts b/src/version3/models/bulkIssue.ts new file mode 100644 index 0000000000..8134e65eb7 --- /dev/null +++ b/src/version3/models/bulkIssue.ts @@ -0,0 +1,14 @@ +import { IssueError } from './issueError'; +import { Issue } from './issue'; + +/** The list of requested issues & fields. */ +export interface BulkIssue { + /** + * When Jira can't return an issue enumerated in a request due to a retriable error or payload constraint, we'll + * return the respective issue ID with a corresponding error message. This list is empty when there are no errors + * Issues which aren't found or that the user doesn't have permission to view won't be returned in this list. + */ + issueErrors?: IssueError[]; + /** The list of issues. */ + issues?: Issue[]; +} diff --git a/src/version3/models/bulkOperationProgress.ts b/src/version3/models/bulkOperationProgress.ts new file mode 100644 index 0000000000..17bdab4992 --- /dev/null +++ b/src/version3/models/bulkOperationProgress.ts @@ -0,0 +1,32 @@ +import { User } from './user'; + +export interface BulkOperationProgress { + /** A timestamp of when the task was submitted. */ + created?: string; + /** + * Map of issue IDs for which the operation failed and that the user has permission to view, to their one or more + * reasons for failure. These reasons are open-ended text descriptions of the error and are not selected from a + * predefined list of standard reasons. + */ + failedAccessibleIssues?: {}; + /** + * The number of issues that are either invalid or issues that the user doesn't have permission to view, regardless of + * the success or failure of the operation. + */ + invalidOrInaccessibleIssueCount?: number; + /** List of issue IDs for which the operation was successful and that the user has permission to view. */ + processedAccessibleIssues?: number[]; + /** Progress of the task as a percentage. */ + progressPercent?: number; + /** A timestamp of when the task was started. */ + started?: string; + /** The status of the task. */ + status?: 'ENQUEUED' | 'RUNNING' | 'COMPLETE' | 'FAILED' | 'CANCEL_REQUESTED' | 'CANCELLED' | 'DEAD' | string; + submittedBy?: User; + /** The ID of the task. */ + taskId: string; + /** The number of issues that the bulk operation was attempted on. */ + totalIssueCount?: number; + /** A timestamp of when the task progress was last updated. */ + updated?: string; +} diff --git a/src/version3/models/bulkTransitionGetAvailableTransitions.ts b/src/version3/models/bulkTransitionGetAvailableTransitions.ts new file mode 100644 index 0000000000..04147a900d --- /dev/null +++ b/src/version3/models/bulkTransitionGetAvailableTransitions.ts @@ -0,0 +1,11 @@ +import { IssueBulkTransitionForWorkflow } from './issueBulkTransitionForWorkflow'; + +/** Bulk Transition Get Available Transitions Response. */ +export interface BulkTransitionGetAvailableTransitions { + /** List of available transitions for bulk transition operation for requested issues grouped by workflow */ + availableTransitions?: IssueBulkTransitionForWorkflow[]; + /** The end cursor for use in pagination. */ + endingBefore?: string; + /** The start cursor for use in pagination. */ + startingAfter?: string; +} diff --git a/src/version3/models/bulkTransitionSubmitInput.ts b/src/version3/models/bulkTransitionSubmitInput.ts new file mode 100644 index 0000000000..beccb9996d --- /dev/null +++ b/src/version3/models/bulkTransitionSubmitInput.ts @@ -0,0 +1,6 @@ +export interface BulkTransitionSubmitInput { + /** List of all the issue IDs or keys that are to be bulk transitioned. */ + selectedIssueIdsOrKeys: string[]; + /** The ID of the transition that is to be performed on the issues. */ + transitionId: string; +} diff --git a/src/version3/models/component.ts b/src/version3/models/component.ts new file mode 100644 index 0000000000..d41a2c219f --- /dev/null +++ b/src/version3/models/component.ts @@ -0,0 +1,8 @@ +export interface Component { + ari?: string; + description?: string; + id?: string; + metadata?: {}; + name?: string; + self?: string; +} diff --git a/src/version3/models/conditionGroupConfiguration.ts b/src/version3/models/conditionGroupConfiguration.ts new file mode 100644 index 0000000000..0f17defdaa --- /dev/null +++ b/src/version3/models/conditionGroupConfiguration.ts @@ -0,0 +1,15 @@ +import { WorkflowRuleConfiguration } from './workflowRuleConfiguration'; + +/** The conditions group associated with the transition. */ +export interface ConditionGroupConfiguration { + /** The nested conditions of the condition group. */ + conditionGroups?: ConditionGroupConfiguration[]; + /** The rules for this condition. */ + conditions?: WorkflowRuleConfiguration[]; + /** + * Determines how the conditions in the group are evaluated. Accepts either `ANY` or `ALL`. If `ANY` is used, at least + * one condition in the group must be true for the group to evaluate to true. If `ALL` is used, all conditions in the + * group must be true for the group to evaluate to true. + */ + operation?: 'ANY' | 'ALL' | string; +} diff --git a/src/version3/models/configurationsListParameters.ts b/src/version3/models/configurationsListParameters.ts new file mode 100644 index 0000000000..0ded35d16e --- /dev/null +++ b/src/version3/models/configurationsListParameters.ts @@ -0,0 +1,5 @@ +/** List of custom fields identifiers which will be used to filter configurations */ +export interface ConfigurationsListParameters { + /** List of IDs or keys of the custom fields. It can be a mix of IDs and keys in the same query. */ + fieldIdsOrKeys: string[]; +} diff --git a/src/version3/models/createCrossProjectReleaseRequest.ts b/src/version3/models/createCrossProjectReleaseRequest.ts new file mode 100644 index 0000000000..ad86f7182f --- /dev/null +++ b/src/version3/models/createCrossProjectReleaseRequest.ts @@ -0,0 +1,6 @@ +export interface CreateCrossProjectReleaseRequest { + /** The cross-project release name. */ + name: string; + /** The IDs of the releases to include in the cross-project release. */ + releaseIds?: number[]; +} diff --git a/src/version3/models/createCustomFieldRequest.ts b/src/version3/models/createCustomFieldRequest.ts new file mode 100644 index 0000000000..08f438709f --- /dev/null +++ b/src/version3/models/createCustomFieldRequest.ts @@ -0,0 +1,6 @@ +export interface CreateCustomFieldRequest { + /** The custom field ID. */ + customFieldId: number; + /** Allows filtering issues based on their values for the custom field. */ + filter?: boolean; +} diff --git a/src/version3/models/createDateFieldRequest.ts b/src/version3/models/createDateFieldRequest.ts new file mode 100644 index 0000000000..8c70d94eb2 --- /dev/null +++ b/src/version3/models/createDateFieldRequest.ts @@ -0,0 +1,6 @@ +export interface CreateDateFieldRequest { + /** A date custom field ID. This is required if the type is "DateCustomField". */ + dateCustomFieldId?: number; + /** The date field type. This must be "DueDate", "TargetStartDate", "TargetEndDate" or "DateCustomField". */ + type: 'DueDate' | 'TargetStartDate' | 'TargetEndDate' | 'DateCustomField' | string; +} diff --git a/src/version3/models/createExclusionRulesRequest.ts b/src/version3/models/createExclusionRulesRequest.ts new file mode 100644 index 0000000000..88a7aca6eb --- /dev/null +++ b/src/version3/models/createExclusionRulesRequest.ts @@ -0,0 +1,14 @@ +export interface CreateExclusionRulesRequest { + /** The IDs of the issues to exclude from the plan. */ + issueIds?: number[]; + /** The IDs of the issue types to exclude from the plan. */ + issueTypeIds?: number[]; + /** Issues completed this number of days ago will be excluded from the plan. */ + numberOfDaysToShowCompletedIssues?: number; + /** The IDs of the releases to exclude from the plan. */ + releaseIds?: number[]; + /** The IDs of the work status categories to exclude from the plan. */ + workStatusCategoryIds?: number[]; + /** The IDs of the work statuses to exclude from the plan. */ + workStatusIds?: number[]; +} diff --git a/src/version3/models/createIssueSourceRequest.ts b/src/version3/models/createIssueSourceRequest.ts new file mode 100644 index 0000000000..87f7d3c1f3 --- /dev/null +++ b/src/version3/models/createIssueSourceRequest.ts @@ -0,0 +1,9 @@ +export interface CreateIssueSourceRequest { + /** The issue source type. This must be "Board", "Project" or "Filter". */ + type: 'Board' | 'Project' | 'Filter' | string; + /** + * The issue source value. This must be a board ID if the type is "Board", a project ID if the type is "Project" or a + * filter ID if the type is "Filter". + */ + value: number; +} diff --git a/src/version3/models/createPermissionHolderRequest.ts b/src/version3/models/createPermissionHolderRequest.ts new file mode 100644 index 0000000000..1e0ab09af0 --- /dev/null +++ b/src/version3/models/createPermissionHolderRequest.ts @@ -0,0 +1,9 @@ +export interface CreatePermissionHolderRequest { + /** The permission holder type. This must be "Group" or "AccountId". */ + type: 'Group' | 'AccountId' | string; + /** + * The permission holder value. This must be a group name if the type is "Group" or an account ID if the type is + * "AccountId". + */ + value: string; +} diff --git a/src/version3/models/createPermissionRequest.ts b/src/version3/models/createPermissionRequest.ts new file mode 100644 index 0000000000..0ce59481d7 --- /dev/null +++ b/src/version3/models/createPermissionRequest.ts @@ -0,0 +1,7 @@ +import { CreatePermissionHolderRequest } from './createPermissionHolderRequest'; + +export interface CreatePermissionRequest { + holder?: CreatePermissionHolderRequest; + /** The permission type. This must be "View" or "Edit". */ + type: 'View' | 'Edit' | string; +} diff --git a/src/version3/models/createPriorityDetails.ts b/src/version3/models/createPriorityDetails.ts index 6d1af928fd..934f9993bf 100644 --- a/src/version3/models/createPriorityDetails.ts +++ b/src/version3/models/createPriorityDetails.ts @@ -1,11 +1,42 @@ /** Details of an issue priority. */ export interface CreatePriorityDetails { - /** The name of the priority. Must be unique. */ - name: string; + /** + * The ID for the avatar for the priority. Either the iconUrl or avatarId must be defined, but not both. This + * parameter is nullable and will become mandatory once the iconUrl parameter is deprecated. + */ + avatarId?: number; /** The description of the priority. */ description?: string; - /** The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. */ - iconUrl?: string; + /** + * The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. Either + * the iconUrl or avatarId must be defined, but not both. + * + * @deprecated This property is deprecated and will be removed in a future version. Use `avatarId` instead. + */ + iconUrl?: + | '/images/icons/priorities/blocker.png' + | '/images/icons/priorities/critical.png' + | '/images/icons/priorities/high.png' + | '/images/icons/priorities/highest.png' + | '/images/icons/priorities/low.png' + | '/images/icons/priorities/lowest.png' + | '/images/icons/priorities/major.png' + | '/images/icons/priorities/medium.png' + | '/images/icons/priorities/minor.png' + | '/images/icons/priorities/trivial.png' + | '/images/icons/priorities/blocker_new.png' + | '/images/icons/priorities/critical_new.png' + | '/images/icons/priorities/high_new.png' + | '/images/icons/priorities/highest_new.png' + | '/images/icons/priorities/low_new.png' + | '/images/icons/priorities/lowest_new.png' + | '/images/icons/priorities/major_new.png' + | '/images/icons/priorities/medium_new.png' + | '/images/icons/priorities/minor_new.png' + | '/images/icons/priorities/trivial_new.png' + | string; + /** The name of the priority. Must be unique. */ + name: string; /** The status color of the priority in 3-digit or 6-digit hexadecimal format. */ statusColor: string; } diff --git a/src/version3/models/createProjectDetails.ts b/src/version3/models/createProjectDetails.ts index ab05664eb7..6203147f67 100644 --- a/src/version3/models/createProjectDetails.ts +++ b/src/version3/models/createProjectDetails.ts @@ -62,12 +62,30 @@ export interface CreateProjectDetails { | 'com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment' | 'com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking' | 'com.atlassian.servicedesk:simplified-it-service-management' - | 'com.atlassian.servicedesk:simplified-general-service-desk' - | 'com.atlassian.servicedesk:simplified-internal-service-desk' + | 'com.atlassian.servicedesk:simplified-general-service-desk-it' + | 'com.atlassian.servicedesk:simplified-general-service-desk-business' | 'com.atlassian.servicedesk:simplified-external-service-desk' | 'com.atlassian.servicedesk:simplified-hr-service-desk' | 'com.atlassian.servicedesk:simplified-facilities-service-desk' | 'com.atlassian.servicedesk:simplified-legal-service-desk' + | 'com.atlassian.servicedesk:simplified-analytics-service-desk' + | 'com.atlassian.servicedesk:simplified-marketing-service-desk' + | 'com.atlassian.servicedesk:simplified-design-service-desk' + | 'com.atlassian.servicedesk:simplified-sales-service-desk' + | 'com.atlassian.servicedesk:simplified-blank-project-business' + | 'com.atlassian.servicedesk:simplified-blank-project-it' + | 'com.atlassian.servicedesk:simplified-finance-service-desk' + | 'com.atlassian.servicedesk:next-gen-it-service-desk' + | 'com.atlassian.servicedesk:next-gen-hr-service-desk' + | 'com.atlassian.servicedesk:next-gen-legal-service-desk' + | 'com.atlassian.servicedesk:next-gen-marketing-service-desk' + | 'com.atlassian.servicedesk:next-gen-facilities-service-desk' + | 'com.atlassian.servicedesk:next-gen-general-it-service-desk' + | 'com.atlassian.servicedesk:next-gen-general-business-service-desk' + | 'com.atlassian.servicedesk:next-gen-analytics-service-desk' + | 'com.atlassian.servicedesk:next-gen-finance-service-desk' + | 'com.atlassian.servicedesk:next-gen-design-service-desk' + | 'com.atlassian.servicedesk:next-gen-sales-service-desk' | 'com.pyxis.greenhopper.jira:gh-simplified-agility-kanban' | 'com.pyxis.greenhopper.jira:gh-simplified-agility-scrum' | 'com.pyxis.greenhopper.jira:gh-simplified-basic' diff --git a/src/version3/models/createSchedulingRequest.ts b/src/version3/models/createSchedulingRequest.ts new file mode 100644 index 0000000000..400b3c9e1f --- /dev/null +++ b/src/version3/models/createSchedulingRequest.ts @@ -0,0 +1,12 @@ +import { CreateDateFieldRequest } from './createDateFieldRequest'; + +export interface CreateSchedulingRequest { + /** The dependencies for the plan. This must be "Sequential" or "Concurrent". */ + dependencies?: 'Sequential' | 'Concurrent' | string; + endDate?: CreateDateFieldRequest; + /** The estimation unit for the plan. This must be "StoryPoints", "Days" or "Hours". */ + estimation: 'StoryPoints' | 'Days' | 'Hours' | string; + /** The inferred dates for the plan. This must be "None", "SprintDates" or "ReleaseDates". */ + inferredDates?: 'None' | 'SprintDates' | 'ReleaseDates' | string; + startDate?: CreateDateFieldRequest; +} diff --git a/src/version3/models/dataClassificationLevels.ts b/src/version3/models/dataClassificationLevels.ts new file mode 100644 index 0000000000..8358ceb249 --- /dev/null +++ b/src/version3/models/dataClassificationLevels.ts @@ -0,0 +1,7 @@ +import { DataClassificationTag } from './dataClassificationTag'; + +/** The data classification. */ +export interface DataClassificationLevels { + /** The data classifications. */ + classifications?: DataClassificationTag[]; +} diff --git a/src/version3/models/dataClassificationTag.ts b/src/version3/models/dataClassificationTag.ts new file mode 100644 index 0000000000..672de56a1c --- /dev/null +++ b/src/version3/models/dataClassificationTag.ts @@ -0,0 +1,17 @@ +/** The data classification. */ +export interface DataClassificationTag { + /** The color of the data classification object. */ + color?: string; + /** The description of the data classification object. */ + description?: string; + /** The guideline of the data classification object. */ + guideline?: string; + /** The ID of the data classification object. */ + id: string; + /** The name of the data classification object. */ + name?: string; + /** The rank of the data classification object. */ + rank?: number; + /** The status of the data classification object. */ + status: string; +} diff --git a/src/version3/models/documentVersion.ts b/src/version3/models/documentVersion.ts new file mode 100644 index 0000000000..dacc3ebb2f --- /dev/null +++ b/src/version3/models/documentVersion.ts @@ -0,0 +1,7 @@ +/** The current version details of this workflow scheme. */ +export interface DocumentVersion { + /** The version UUID. */ + id?: string; + /** The version number. */ + versionNumber?: number; +} diff --git a/src/version3/models/enhancedSearchRequest.ts b/src/version3/models/enhancedSearchRequest.ts new file mode 100644 index 0000000000..73e8eed2a5 --- /dev/null +++ b/src/version3/models/enhancedSearchRequest.ts @@ -0,0 +1,99 @@ +export interface EnhancedSearchRequest { + /** + * The [JQL](https://confluence.atlassian.com/x/egORLQ) expression. For performance reasons, this parameter requires a + * bounded query. A bounded query is a query with a search restriction. + * + * - Example of an unbounded query: `order by key desc`. + * - Example of a bounded query: `assignee = currentUser() order by key`. + * + * Additionally, `orderBy` clause can contain a maximum of 7 fields. + */ + jql?: string; + /** + * The token for a page to fetch that is not the first page. The first page has a `nextPageToken` of `null`. Use the + * `nextPageToken` to fetch the next page of issues. + */ + nextPageToken?: string; + /** + * The maximum number of items to return per page. To manage page size, API may return fewer items per page where a + * large number of fields are requested. The greatest number of items returned per page is achieved when requesting + * `id` or `key` only. + * + * It returns max 5000 issues. + * + * Default: `50` + * + * Format: `int32` + */ + maxResults?: number; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a + * comma-separated list. Expand options include: + * + * - `*all` Returns all fields. + * - `*navigable` Returns navigable fields. + * - `id` Returns only issue IDs. + * - Any issue field, prefixed with a minus to exclude. + * + * The default is `id`. + * + * Examples: + * + * - `summary,comment` Returns only the summary and comments fields. + * - `-description` Returns all navigable (default) fields except description. + * - `*all,-comment` Returns all fields except comments. + * + * Multiple `fields` parameters can be included in a request. + * + * Note: By default, this resource returns IDs only. This differs from [GET + * issue](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get) + * where the default is all fields. + */ + fields?: string[]; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about issues in the response. Note that, unlike the majority of instances where `expand` is specified, + * `expand` is defined as a comma-delimited string of values. The expand options are: + * + * - `renderedFields` Returns field values rendered in HTML format. + * - `names` Returns the display name of each field. + * - `schema` Returns the schema describing a field type. + * - `transitions` Returns all possible transitions for the issue. + * - `operations` Returns all possible operations for the issue. + * - `editmeta` Returns information about how each field can be edited. + * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each + * version of a field's value, with the highest numbered item representing the most recent version. + * + * Examples: `names,changelog` Returns the display name of each field as well as a list of recent updates to an issue. + */ + expand?: + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | ( + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + )[] + | string + | string[]; + /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ + properties?: string[]; + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys?: boolean; + /** Fail this request early if we can't retrieve all field data. The default is `false`. */ + failFast?: boolean; + /** Strong consistency issue ids to be reconciled with search results. Accepts max 50 ids. All issues must exist. */ + reconcileIssues?: number[]; +} diff --git a/src/version3/models/evaluateMetaData.ts b/src/version3/models/evaluateMetaData.ts new file mode 100644 index 0000000000..82a8086f50 --- /dev/null +++ b/src/version3/models/evaluateMetaData.ts @@ -0,0 +1,8 @@ +import { JiraExpressionsComplexity } from './jiraExpressionsComplexity'; +import { JExpEvaluateIssuesMeta } from './jExpEvaluateIssuesMeta'; + +/** Contains information about the expression evaluation. */ +export interface EvaluateMetaData { + complexity?: JiraExpressionsComplexity; + issues?: JExpEvaluateIssuesMeta; +} diff --git a/src/version3/models/evaluatedJiraExpression.ts b/src/version3/models/evaluatedJiraExpression.ts new file mode 100644 index 0000000000..c59b0abf46 --- /dev/null +++ b/src/version3/models/evaluatedJiraExpression.ts @@ -0,0 +1,16 @@ +import { EvaluateMetaData } from './evaluateMetaData'; + +/** + * The result of evaluating a Jira expression.This bean will be replacing `JiraExpressionResultBean` bean as part of new + * evaluate endpoint + */ +export interface EvaluatedJiraExpression { + meta?: EvaluateMetaData; + /** + * The value of the evaluated expression. It may be a primitive JSON value or a Jira REST API object. (Some + * expressions do not produce any meaningful results—for example, an expression that returns a lambda function—if + * that's the case a simple string representation is returned. These string representations should not be relied upon + * and may change without notice.) + */ + value: {}; +} diff --git a/src/version3/models/fieldCreateMetadata.ts b/src/version3/models/fieldCreateMetadata.ts new file mode 100644 index 0000000000..462e2c172e --- /dev/null +++ b/src/version3/models/fieldCreateMetadata.ts @@ -0,0 +1,26 @@ +import { JsonType } from './jsonType'; + +/** The metadata describing an issue field for createmeta. */ +export interface FieldCreateMetadata { + /** The list of values allowed in the field. */ + allowedValues?: {}[]; + /** The URL that can be used to automatically complete the field. */ + autoCompleteUrl?: string; + /** The configuration properties. */ + configuration?: {}; + /** The default value of the field. */ + defaultValue?: {}; + /** The field id. */ + fieldId: string; + /** Whether the field has a default value. */ + hasDefaultValue?: boolean; + /** The key of the field. */ + key: string; + /** The name of the field. */ + name: string; + /** The list of operations that can be performed on the field. */ + operations: string[]; + /** Whether the field is required. */ + required: boolean; + schema?: JsonType; +} diff --git a/src/version3/models/filter.ts b/src/version3/models/filter.ts index 11b5afeac0..02ded28470 100644 --- a/src/version3/models/filter.ts +++ b/src/version3/models/filter.ts @@ -1,40 +1,46 @@ -import { FilterSubscriptionsList } from './filterSubscriptionsList'; import { SharePermission } from './sharePermission'; import { User } from './user'; import { UserList } from './userList'; +import { FilterSubscriptionsList } from './filterSubscriptionsList'; /** Details about a filter. */ export interface Filter { - /** The URL of the filter. */ - self?: string; + /** + * @experimental [Experimental] Approximate last used time. Returns the date and time when the filter was last used. Returns `null` + * if the filter hasn't been used after tracking was enabled. For performance reasons, timestamps aren't updated in + * real time and therefore may not be exactly accurate. + */ + approximateLastUsed?: string; + /** A description of the filter. */ + description?: string; + /** The groups and projects that can edit the filter. */ + editPermissions?: SharePermission[]; + /** Whether the filter is selected as a favorite. */ + favourite?: boolean; + /** The count of how many users have selected this filter as a favorite, including the filter owner. */ + favouritedCount?: number; /** The unique identifier for the filter. */ id?: string; + /** The JQL query for the filter. For example, _project = SSP AND issuetype = Bug_. */ + jql?: string; /** The name of the filter. Must be unique. */ name: string; - /** A description of the filter. */ - description?: string; owner?: User; - /** The JQL query for the filter. For example, _project = SSP AND issuetype = Bug_. */ - jql?: string; - /** - * A URL to view the filter results in Jira, using the ID of the filter. For example, - * _https://your-domain.atlassian.net/issues/?filter=10100_. - */ - viewUrl?: string; /** * A URL to view the filter results in Jira, using the [Search for issues using * JQL](#api-rest-api-3-filter-search-get) operation with the filter's JQL string to return the filter results. For * example, _https://your-domain.atlassian.net/rest/api/3/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug_. */ searchUrl?: string; - /** Whether the filter is selected as a favorite. */ - favourite?: boolean; - /** The count of how many users have selected this filter as a favorite, including the filter owner. */ - favouritedCount?: number; + /** The URL of the filter. */ + self?: string; /** The groups and projects that the filter is shared with. */ sharePermissions?: SharePermission[]; - /** The groups and projects that can edit the filter. */ - editPermissions?: SharePermission[]; sharedUsers?: UserList; subscriptions?: FilterSubscriptionsList; + /** + * A URL to view the filter results in Jira, using the ID of the filter. For example, + * _https://your-domain.atlassian.net/issues/?filter=10100_. + */ + viewUrl?: string; } diff --git a/src/version3/models/getAtlassianTeamResponse.ts b/src/version3/models/getAtlassianTeamResponse.ts new file mode 100644 index 0000000000..ad60480d52 --- /dev/null +++ b/src/version3/models/getAtlassianTeamResponse.ts @@ -0,0 +1,12 @@ +export interface GetAtlassianTeamResponse { + /** The capacity for the Atlassian team. */ + capacity?: number; + /** The Atlassian team ID. */ + id: string; + /** The ID of the issue source for the Atlassian team. */ + issueSourceId?: number; + /** The planning style for the Atlassian team. This is "Scrum" or "Kanban". */ + planningStyle: 'Scrum' | 'Kanban' | string; + /** The sprint length for the Atlassian team. */ + sprintLength?: number; +} diff --git a/src/version3/models/getCrossProjectReleaseResponse.ts b/src/version3/models/getCrossProjectReleaseResponse.ts new file mode 100644 index 0000000000..4e41368cc5 --- /dev/null +++ b/src/version3/models/getCrossProjectReleaseResponse.ts @@ -0,0 +1,6 @@ +export interface GetCrossProjectReleaseResponse { + /** The cross-project release name. */ + name?: string; + /** The IDs of the releases included in the cross-project release. */ + releaseIds?: number[]; +} diff --git a/src/version3/models/getCustomFieldResponse.ts b/src/version3/models/getCustomFieldResponse.ts new file mode 100644 index 0000000000..8ac304ff9b --- /dev/null +++ b/src/version3/models/getCustomFieldResponse.ts @@ -0,0 +1,6 @@ +export interface GetCustomFieldResponse { + /** The custom field ID. */ + customFieldId: number; + /** Allows filtering issues based on their values for the custom field. */ + filter?: boolean; +} diff --git a/src/version3/models/getDateFieldResponse.ts b/src/version3/models/getDateFieldResponse.ts new file mode 100644 index 0000000000..d2293240a8 --- /dev/null +++ b/src/version3/models/getDateFieldResponse.ts @@ -0,0 +1,6 @@ +export interface GetDateFieldResponse { + /** A date custom field ID. This is returned if the type is "DateCustomField". */ + dateCustomFieldId?: number; + /** The date field type. This is "DueDate", "TargetStartDate", "TargetEndDate" or "DateCustomField". */ + type: 'DueDate' | 'TargetStartDate' | 'TargetEndDate' | 'DateCustomField' | string; +} diff --git a/src/version3/models/getExclusionRulesResponse.ts b/src/version3/models/getExclusionRulesResponse.ts new file mode 100644 index 0000000000..c2852ef738 --- /dev/null +++ b/src/version3/models/getExclusionRulesResponse.ts @@ -0,0 +1,14 @@ +export interface GetExclusionRulesResponse { + /** The IDs of the issues excluded from the plan. */ + issueIds?: number[]; + /** The IDs of the issue types excluded from the plan. */ + issueTypeIds?: number[]; + /** Issues completed this number of days ago are excluded from the plan. */ + numberOfDaysToShowCompletedIssues: number; + /** The IDs of the releases excluded from the plan. */ + releaseIds?: number[]; + /** The IDs of the work status categories excluded from the plan. */ + workStatusCategoryIds?: number[]; + /** The IDs of the work statuses excluded from the plan. */ + workStatusIds?: number[]; +} diff --git a/src/version3/models/getIssueSourceResponse.ts b/src/version3/models/getIssueSourceResponse.ts new file mode 100644 index 0000000000..fd864bf6ad --- /dev/null +++ b/src/version3/models/getIssueSourceResponse.ts @@ -0,0 +1,9 @@ +export interface GetIssueSourceResponse { + /** The issue source type. This is "Board", "Project" or "Filter". */ + type: 'Board' | 'Project' | 'Filter' | 'Custom' | string; + /** + * The issue source value. This is a board ID if the type is "Board", a project ID if the type is "Project" or a + * filter ID if the type is "Filter". + */ + value: number; +} diff --git a/src/version3/models/getPermissionHolderResponse.ts b/src/version3/models/getPermissionHolderResponse.ts new file mode 100644 index 0000000000..4d44c9cb87 --- /dev/null +++ b/src/version3/models/getPermissionHolderResponse.ts @@ -0,0 +1,9 @@ +export interface GetPermissionHolderResponse { + /** The permission holder type. This is "Group" or "AccountId". */ + type: 'Group' | 'AccountId' | string; + /** + * The permission holder value. This is a group name if the type is "Group" or an account ID if the type is + * "AccountId". + */ + value: string; +} diff --git a/src/version3/models/getPermissionResponse.ts b/src/version3/models/getPermissionResponse.ts new file mode 100644 index 0000000000..c778b582bc --- /dev/null +++ b/src/version3/models/getPermissionResponse.ts @@ -0,0 +1,7 @@ +import { GetPermissionHolderResponse } from './getPermissionHolderResponse'; + +export interface GetPermissionResponse { + holder?: GetPermissionHolderResponse; + /** The permission type. This is "View" or "Edit". */ + type: 'View' | 'Edit' | string; +} diff --git a/src/version3/models/getPlanOnlyTeamResponse.ts b/src/version3/models/getPlanOnlyTeamResponse.ts new file mode 100644 index 0000000000..5dd4cf00e0 --- /dev/null +++ b/src/version3/models/getPlanOnlyTeamResponse.ts @@ -0,0 +1,16 @@ +export interface GetPlanOnlyTeamResponse { + /** The capacity for the plan-only team. */ + capacity?: number; + /** The plan-only team ID. */ + id: number; + /** The ID of the issue source for the plan-only team. */ + issueSourceId?: number; + /** The account IDs of the plan-only team members. */ + memberAccountIds?: string[]; + /** The plan-only team name. */ + name: string; + /** The planning style for the plan-only team. This is "Scrum" or "Kanban". */ + planningStyle: 'Scrum' | 'Kanban' | string; + /** The sprint length for the plan-only team. */ + sprintLength?: number; +} diff --git a/src/version3/models/getPlanResponseForPage.ts b/src/version3/models/getPlanResponseForPage.ts new file mode 100644 index 0000000000..63a774a14f --- /dev/null +++ b/src/version3/models/getPlanResponseForPage.ts @@ -0,0 +1,12 @@ +import { GetIssueSourceResponse } from './getIssueSourceResponse'; + +export interface GetPlanResponseForPage { + /** The plan ID. */ + id: string; + /** The issue sources included in the plan. */ + issueSources?: GetIssueSourceResponse[]; + /** The plan name. */ + name: string; + /** The plan status. This is "Active", "Trashed" or "Archived". */ + status: 'Active' | 'Trashed' | 'Archived' | string; +} diff --git a/src/version3/models/getSchedulingResponse.ts b/src/version3/models/getSchedulingResponse.ts new file mode 100644 index 0000000000..8a284167f7 --- /dev/null +++ b/src/version3/models/getSchedulingResponse.ts @@ -0,0 +1,12 @@ +import { GetDateFieldResponse } from './getDateFieldResponse'; + +export interface GetSchedulingResponse { + /** The dependencies for the plan. This is "Sequential" or "Concurrent". */ + dependencies: 'Sequential' | 'Concurrent' | string; + endDate?: GetDateFieldResponse; + /** The estimation unit for the plan. This is "StoryPoints", "Days" or "Hours". */ + estimation: 'StoryPoints' | 'Days' | 'Hours' | string; + /** The inferred dates for the plan. This is "None", "SprintDates" or "ReleaseDates". */ + inferredDates: 'None' | 'SprintDates' | 'ReleaseDates' | string; + startDate?: GetDateFieldResponse; +} diff --git a/src/version3/models/getTeamResponseForPage.ts b/src/version3/models/getTeamResponseForPage.ts new file mode 100644 index 0000000000..6d49ebff03 --- /dev/null +++ b/src/version3/models/getTeamResponseForPage.ts @@ -0,0 +1,8 @@ +export interface GetTeamResponseForPage { + /** The team ID. */ + id: string; + /** The team name. This is returned if the type is "PlanOnly". */ + name?: string; + /** The team type. This is "PlanOnly" or "Atlassian". */ + type: 'PlanOnly' | 'Atlassian' | string; +} diff --git a/src/version3/models/idSearchRequest.ts b/src/version3/models/idSearchRequest.ts new file mode 100644 index 0000000000..4f15da0140 --- /dev/null +++ b/src/version3/models/idSearchRequest.ts @@ -0,0 +1,8 @@ +export interface IdSearchRequest { + /** A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. Order by clauses are not allowed. */ + jql?: string; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** The continuation token to fetch the next page. This token is provided by the response of this endpoint. */ + nextPageToken?: string; +} diff --git a/src/version3/models/idSearchResults.ts b/src/version3/models/idSearchResults.ts new file mode 100644 index 0000000000..596045fb5c --- /dev/null +++ b/src/version3/models/idSearchResults.ts @@ -0,0 +1,10 @@ +/** Result of your JQL search. Returns a list of issue IDs and a token to fetch the next page if one exists. */ +export interface IdSearchResults { + /** The list of issue IDs found by the search. */ + issueIds?: number[]; + /** + * Continuation token to fetch the next page. If this result represents the last or the only page this token will be + * null. + */ + nextPageToken?: string; +} diff --git a/src/version3/models/index.ts b/src/version3/models/index.ts index 68860e2b33..bd559aa79f 100644 --- a/src/version3/models/index.ts +++ b/src/version3/models/index.ts @@ -28,17 +28,23 @@ export * from './avatar'; export * from './avatars'; export * from './avatarUrls'; export * from './avatarWithDetails'; +export * from './bulkChangelog'; +export * from './bulkChangelogRequest'; export * from './bulkChangeOwnerDetails'; export * from './bulkCustomFieldOptionCreateRequest'; export * from './bulkCustomFieldOptionUpdateRequest'; +export * from './bulkEditGetFields'; export * from './bulkEditShareableEntity'; +export * from './bulkIssue'; export * from './bulkIssueIsWatching'; export * from './bulkIssuePropertyUpdateRequest'; export * from './bulkOperationErrorResult'; +export * from './bulkOperationProgress'; export * from './bulkPermissionGrants'; export * from './bulkPermissionsRequest'; export * from './bulkProjectPermissionGrants'; export * from './bulkProjectPermissions'; +export * from './bulkTransitionGetAvailableTransitions'; export * from './changeDetails'; export * from './changedValue'; export * from './changedWorklog'; @@ -46,9 +52,11 @@ export * from './changedWorklogs'; export * from './changelog'; export * from './columnItem'; export * from './comment'; +export * from './component'; export * from './componentIssuesCount'; export * from './componentWithIssueCount'; export * from './configuration'; +export * from './configurationsListParameters'; export * from './connectCustomFieldValue'; export * from './connectCustomFieldValues'; export * from './connectModule'; @@ -61,14 +69,20 @@ export * from './containerOfWorkflowSchemeAssociations'; export * from './contextForProjectAndIssueType'; export * from './contextualConfiguration'; export * from './convertedJQLQueries'; +export * from './createCrossProjectReleaseRequest'; export * from './createCustomFieldContext'; +export * from './createCustomFieldRequest'; export * from './createdIssue'; export * from './createdIssues'; +export * from './createExclusionRulesRequest'; export * from './createIssueSecuritySchemeDetails'; +export * from './createIssueSourceRequest'; export * from './createNotificationSchemeDetails'; +export * from './createPermissionRequest'; export * from './createPriorityDetails'; export * from './createProjectDetails'; export * from './createResolutionDetails'; +export * from './createSchedulingRequest'; export * from './createUiModificationDetails'; export * from './createUpdateRoleRequest'; export * from './createWorkflowCondition'; @@ -103,17 +117,21 @@ export * from './dashboardGadgetResponse'; export * from './dashboardGadgetSettings'; export * from './dashboardGadgetUpdateRequest'; export * from './dashboardUser'; +export * from './dataClassificationLevels'; export * from './dateRangeFilter'; export * from './defaultLevelValue'; export * from './defaultShareScope'; export * from './defaultWorkflow'; export * from './deleteAndReplaceVersion'; export * from './document'; +export * from './documentVersion'; +export * from './enhancedSearchRequest'; export * from './entityProperty'; export * from './entityPropertyDetails'; export * from './error'; export * from './errorCollection'; export * from './errors'; +export * from './evaluatedJiraExpression'; export * from './eventNotification'; export * from './exportArchivedIssuesTaskProgress'; export * from './failedWebhook'; @@ -142,6 +160,8 @@ export * from './foundGroups'; export * from './foundUsers'; export * from './foundUsersAndGroups'; export * from './functionReferenceData'; +export * from './getAtlassianTeamResponse'; +export * from './getPlanOnlyTeamResponse'; export * from './globalScope'; export * from './group'; export * from './groupDetails'; @@ -154,10 +174,16 @@ export * from './historyMetadataParticipant'; export * from './icon'; export * from './id'; export * from './idOrKey'; +export * from './idSearchRequest'; +export * from './idSearchResults'; export * from './includedFields'; export * from './issue'; export * from './issueArchivalSync'; export * from './issueArchivalSyncRequest'; +export * from './issueBulkDeletePayload'; +export * from './issueBulkEditPayload'; +export * from './issueBulkMovePayload'; +export * from './issueBulkTransitionPayload'; export * from './issueChangelogIds'; export * from './issueCommentListRequest'; export * from './issueCreateMetadata'; @@ -170,6 +196,7 @@ export * from './issueFieldOptionCreate'; export * from './issueFieldOptionScope'; export * from './issueFilterForBulkPropertyDelete'; export * from './issueFilterForBulkPropertySet'; +export * from './issueLimitReport'; export * from './issueLink'; export * from './issueLinkType'; export * from './issueLinkTypes'; @@ -214,6 +241,8 @@ export * from './issueTypeWithStatus'; export * from './issueTypeWorkflowMapping'; export * from './issueUpdateDetails'; export * from './issueUpdateMetadata'; +export * from './jExpEvaluateIssuesJqlMetaData'; +export * from './jExpEvaluateIssuesMeta'; export * from './jexpIssues'; export * from './jexpJqlIssues'; export * from './jiraExpressionAnalysis'; @@ -221,6 +250,7 @@ export * from './jiraExpressionComplexity'; export * from './jiraExpressionEvalContext'; export * from './jiraExpressionEvalRequest'; export * from './jiraExpressionEvaluationMetaData'; +export * from './jiraExpressionEvalUsingEnhancedSearchRequest'; export * from './jiraExpressionForAnalysis'; export * from './jiraExpressionResult'; export * from './jiraExpressionsAnalysis'; @@ -228,7 +258,11 @@ export * from './jiraExpressionsComplexity'; export * from './jiraExpressionsComplexityValue'; export * from './jiraExpressionValidationError'; export * from './jiraStatus'; +export * from './jqlCount'; +export * from './jqlCountRequest'; export * from './jqlFunctionPrecomputation'; +export * from './jqlFunctionPrecomputationGetByIdRequest'; +export * from './jqlFunctionPrecomputationGetByIdResponse'; export * from './jqlFunctionPrecomputationUpdate'; export * from './jqlFunctionPrecomputationUpdateRequest'; export * from './jQLPersonalDataMigrationRequest'; @@ -253,6 +287,8 @@ export * from './linkIssueRequestJson'; export * from './listWrapperCallbackApplicationRole'; export * from './listWrapperCallbackGroupName'; export * from './locale'; +export * from './mappingsByIssueTypeOverride'; +export * from './mappingsByWorkflow'; export * from './mark'; export * from './moveField'; export * from './multiIssueEntityProperties'; @@ -277,7 +313,7 @@ export * from './operationMessage'; export * from './operations'; export * from './orderOfCustomFieldOptions'; export * from './orderOfIssueTypes'; -export * from './pageBeanFieldConfigurationDetails'; +export * from './pageBulkContextualConfiguration'; export * from './pageChangelog'; export * from './pageComment'; export * from './pageComponentWithIssueCount'; @@ -310,6 +346,8 @@ export * from './pageJqlFunctionPrecomputation'; export * from './pageNotificationScheme'; export * from './pageOfChangelogs'; export * from './pageOfComments'; +export * from './pageOfCreateMetaIssueTypes'; +export * from './pageOfCreateMetaIssueTypeWithField'; export * from './pageOfDashboards'; export * from './pageOfStatuses'; export * from './pageOfWorklogs'; @@ -330,6 +368,8 @@ export * from './pageUserDetails'; export * from './pageUserKey'; export * from './pageVersion'; export * from './pageWebhook'; +export * from './pageWithCursorGetPlanResponseForPage'; +export * from './pageWithCursorGetTeamResponseForPage'; export * from './pageWorkflow'; export * from './pageWorkflowScheme'; export * from './pageWorkflowTransitionRules'; @@ -344,12 +384,19 @@ export * from './permissionScheme'; export * from './permissionSchemes'; export * from './permissionsKeys'; export * from './permittedProjects'; +export * from './plan'; export * from './priority'; export * from './priorityId'; +export * from './priorityMapping'; +export * from './prioritySchemeId'; +export * from './prioritySchemeWithPaginatedPrioritiesAndProjects'; +export * from './priorityWithSequence'; export * from './project'; +export * from './projectAndIssueTypePair'; export * from './projectAvatars'; export * from './projectCategory'; export * from './projectComponent'; +export * from './projectDataPolicies'; export * from './projectDetails'; export * from './projectEmailAddress'; export * from './projectFeature'; @@ -405,6 +452,8 @@ export * from './screenSchemeDetails'; export * from './screenSchemeId'; export * from './screenTypes'; export * from './screenWithTab'; +export * from './searchAndReconcileResults'; +export * from './searchAndReconcileResults'; export * from './searchAutoCompleteFilter'; export * from './searchRequest'; export * from './searchResults'; @@ -418,6 +467,7 @@ export * from './securitySchemeMembersRequest'; export * from './securitySchemes'; export * from './securitySchemeWithProjects'; export * from './serverInformation'; +export * from './serviceRegistry'; export * from './setDefaultLevelsRequest'; export * from './setDefaultPriorityRequest'; export * from './setDefaultResolutionRequest'; @@ -434,10 +484,15 @@ export * from './statusCreate'; export * from './statusCreateRequest'; export * from './statusDetails'; export * from './statusMapping'; +export * from './statusProjectIssueTypeUsage'; +export * from './statusProjectUsage'; export * from './statusScope'; export * from './statusUpdate'; export * from './statusUpdateRequest'; +export * from './statusWorkflowUsage'; +export * from './submittedBulkOperation'; export * from './suggestedIssue'; +export * from './suggestedMappingsRequest'; export * from './systemAvatars'; export * from './taskProgressObject'; export * from './taskProgressRemoveOptionFromIssuesResult'; @@ -451,12 +506,15 @@ export * from './uiModificationDetails'; export * from './uiModificationIdentifiers'; export * from './unrestrictedUserEmail'; export * from './updateCustomFieldDetails'; +export * from './updateDefaultProjectClassification'; export * from './updatedProjectCategory'; export * from './updateFieldConfigurationSchemeDetails'; export * from './updateIssueSecurityLevelDetails'; export * from './updateIssueSecuritySchemeRequest'; export * from './updateNotificationSchemeDetails'; export * from './updatePriorityDetails'; +export * from './updatePrioritySchemeRequest'; +export * from './updatePrioritySchemeResponse'; export * from './updateProjectDetails'; export * from './updateResolutionDetails'; export * from './updateScreenDetails'; @@ -471,10 +529,12 @@ export * from './userKey'; export * from './userList'; export * from './userMigration'; export * from './userPickerUser'; +export * from './validationOptionsForCreate'; export * from './version'; export * from './versionIssueCounts'; export * from './versionIssuesStatus'; export * from './versionMove'; +export * from './versionRelatedWork'; export * from './versionUnresolvedIssuesCount'; export * from './versionUsageInCustomField'; export * from './visibility'; @@ -485,16 +545,29 @@ export * from './webhookDetails'; export * from './webhookRegistrationDetails'; export * from './webhooksExpirationDate'; export * from './workflow'; +export * from './workflowCapabilities'; export * from './workflowCondition'; +export * from './workflowCreate'; +export * from './workflowCreateRequest'; export * from './workflowId'; export * from './workflowOperations'; +export * from './workflowProjectIssueTypeUsage'; +export * from './workflowProjectUsage'; +export * from './workflowRead'; export * from './workflowRules'; export * from './workflowRulesSearch'; export * from './workflowRulesSearchDetails'; export * from './workflowScheme'; +export * from './workflowSchemeAssociation'; export * from './workflowSchemeAssociations'; export * from './workflowSchemeIdName'; export * from './workflowSchemeProjectAssociation'; +export * from './workflowSchemeProjectUsage'; +export * from './workflowSchemeReadRequest'; +export * from './workflowSchemeReadResponse'; +export * from './workflowSchemeUpdateRequiredMappingsResponse'; +export * from './workflowSchemeUsage'; +export * from './workflowSearchResponse'; export * from './workflowStatus'; export * from './workflowStatusProperties'; export * from './workflowsWithTransitionRulesDetails'; @@ -506,5 +579,11 @@ export * from './workflowTransitionRulesDetails'; export * from './workflowTransitionRulesUpdate'; export * from './workflowTransitionRulesUpdateErrorDetails'; export * from './workflowTransitionRulesUpdateErrors'; +export * from './workflowUpdate'; +export * from './workflowUpdateRequest'; +export * from './workflowUpdateValidateRequest'; +export * from './workflowValidationErrorList'; export * from './worklog'; export * from './worklogIdsRequest'; +export * from './worklogsMoveRequest'; +export * from './workspaceDataPolicy'; diff --git a/src/version3/models/issueBulkDeletePayload.ts b/src/version3/models/issueBulkDeletePayload.ts new file mode 100644 index 0000000000..100907420b --- /dev/null +++ b/src/version3/models/issueBulkDeletePayload.ts @@ -0,0 +1,14 @@ +/** Issue Bulk Delete Payload */ +export interface IssueBulkDeletePayload { + /** + * List of issue IDs or keys which are to be bulk deleted. These IDs or keys can be from different projects and issue + * types. + */ + selectedIssueIdsOrKeys: string[]; + /** + * A boolean value that indicates whether to send a bulk change notification when the issues are being deleted. + * + * If `true`, dispatches a bulk notification email to users about the updates. + */ + sendBulkNotification?: boolean; +} diff --git a/src/version3/models/issueBulkEditField.ts b/src/version3/models/issueBulkEditField.ts new file mode 100644 index 0000000000..f7b188e5df --- /dev/null +++ b/src/version3/models/issueBulkEditField.ts @@ -0,0 +1,20 @@ +export interface IssueBulkEditField { + /** Description of the field. */ + description?: string; + /** A list of options related to the field, applicable in contexts where multiple selections are allowed. */ + fieldOptions?: {}[]; + /** The unique ID of the field. */ + id?: string; + /** Indicates whether the field is mandatory for the operation. */ + isRequired?: boolean; + /** Specifies supported actions (like add, replace, remove) on multi-select fields via an enum. */ + multiSelectFieldOptions?: ('ADD' | 'REMOVE' | 'REPLACE' | 'REMOVE_ALL' | string)[]; + /** The display name of the field. */ + name?: string; + /** A URL to fetch additional data for the field */ + searchUrl?: string; + /** The type of the field. */ + type?: string; + /** A message indicating why the field is unavailable for editing. */ + unavailableMessage?: string; +} diff --git a/src/version3/models/issueBulkEditPayload.ts b/src/version3/models/issueBulkEditPayload.ts new file mode 100644 index 0000000000..c4eb8b98cf --- /dev/null +++ b/src/version3/models/issueBulkEditPayload.ts @@ -0,0 +1,23 @@ +import { JiraIssueFields } from './jiraIssueFields'; + +/** Issue Bulk Edit Payload */ +export interface IssueBulkEditPayload { + editedFieldsInput?: JiraIssueFields; + /** + * List of all the field IDs that are to be bulk edited. Each field ID in this list corresponds to a specific + * attribute of an issue that is set to be modified in the bulk edit operation. The relevant field ID can be obtained + * by calling the Bulk Edit Get Fields REST API (documentation available on this page itself). + */ + selectedActions: string[]; + /** + * List of issue IDs or keys which are to be bulk edited. These IDs or keys can be from different projects and issue + * types. + */ + selectedIssueIdsOrKeys: string[]; + /** + * A boolean value that indicates whether to send a bulk change notification when the issues are being edited. + * + * If `true`, dispatches a bulk notification email to users about the updates. + */ + sendBulkNotification?: boolean; +} diff --git a/src/version3/models/issueBulkMovePayload.ts b/src/version3/models/issueBulkMovePayload.ts new file mode 100644 index 0000000000..c90c317624 --- /dev/null +++ b/src/version3/models/issueBulkMovePayload.ts @@ -0,0 +1,24 @@ +/** Issue Bulk Move Payload */ +export interface IssueBulkMovePayload { + /** + * A boolean value that indicates whether to send a bulk change notification when the issues are being moved. + * + * If `true`, dispatches a bulk notification email to users about the updates. + */ + sendBulkNotification?: boolean; + /** + * An object representing the mapping of issues and data related to destination entities, like fields and statuses, + * that are required during a bulk move. + * + * The key is a string that is created by concatenating the following three entities in order, separated by commas. + * The format is `,,`. It should be unique across mappings provided + * in the payload. If you provide multiple mappings for the same key, only one will be processed. However, the + * operation won't fail, so the error may be hard to track down. + * + * _**Destination project**_ (Required): ID or key of the project to which the issues are being moved. _**Destination + * issueType**_ (Required): ID of the issueType to which the issues are being moved. _**Destination parent ID or + * key**_ (Optional): ID or key of the issue which will become the parent of the issues being moved. Only required + * when the destination issueType is a subtask. + */ + targetToSourcesMapping?: {}; +} diff --git a/src/version3/models/issueBulkTransitionForWorkflow.ts b/src/version3/models/issueBulkTransitionForWorkflow.ts new file mode 100644 index 0000000000..710bf66f6a --- /dev/null +++ b/src/version3/models/issueBulkTransitionForWorkflow.ts @@ -0,0 +1,15 @@ +import { SimplifiedIssueTransition } from './simplifiedIssueTransition'; + +export interface IssueBulkTransitionForWorkflow { + /** Indicates whether all the transitions of this workflow are available in the transitions list or not. */ + isTransitionsFiltered?: boolean; + /** List of issue keys from the request which are associated with this workflow. */ + issues?: string[]; + /** + * List of transitions available for issues from the request which are associated with this workflow. + * + * _This list includes only those transitions that are common across the issues in this workflow and do not involve + * any additional field updates._* + */ + transitions?: SimplifiedIssueTransition[]; +} diff --git a/src/version3/models/issueBulkTransitionPayload.ts b/src/version3/models/issueBulkTransitionPayload.ts new file mode 100644 index 0000000000..7cd8931d97 --- /dev/null +++ b/src/version3/models/issueBulkTransitionPayload.ts @@ -0,0 +1,18 @@ +import { BulkTransitionSubmitInput } from './bulkTransitionSubmitInput'; + +/** Issue Bulk Transition Payload */ +export interface IssueBulkTransitionPayload { + /** + * List of objects and each object has two properties: + * + * Issues that will be bulk transitioned. TransitionId that corresponds to a specific transition of issues that share + * the same workflow. + */ + bulkTransitionInputs: BulkTransitionSubmitInput[]; + /** + * A boolean value that indicates whether to send a bulk change notification when the issues are being transitioned. + * + * If `true`, dispatches a bulk notification email to users about the updates. + */ + sendBulkNotification?: boolean; +} diff --git a/src/version3/models/issueChangeLog.ts b/src/version3/models/issueChangeLog.ts new file mode 100644 index 0000000000..cab78f577e --- /dev/null +++ b/src/version3/models/issueChangeLog.ts @@ -0,0 +1,9 @@ +import { Changelog } from './changelog'; + +/** List of changelogs that belong to single issue */ +export interface IssueChangeLog { + /** List of changelogs that belongs to given issueId. */ + changeHistories?: Changelog[]; + /** The ID of the issue. */ + issueId?: string; +} diff --git a/src/version3/models/issueError.ts b/src/version3/models/issueError.ts new file mode 100644 index 0000000000..e48a85799f --- /dev/null +++ b/src/version3/models/issueError.ts @@ -0,0 +1,7 @@ +/** Describes the error that occurred when retrieving data for a particular issue. */ +export interface IssueError { + /** The error that occurred when fetching this issue. */ + errorMessage?: string; + /** The ID of the issue. */ + id?: string; +} diff --git a/src/version3/models/issueLimitReport.ts b/src/version3/models/issueLimitReport.ts new file mode 100644 index 0000000000..df5798701a --- /dev/null +++ b/src/version3/models/issueLimitReport.ts @@ -0,0 +1,8 @@ +export interface IssueLimitReport { + /** A list of ids of issues approaching the limit and their field count */ + issuesApproachingLimit?: {}; + /** A list of ids of issues breaching the limit and their field count */ + issuesBreachingLimit?: {}; + /** The fields and their defined limits */ + limits?: {}; +} diff --git a/src/version3/models/issueTransitionStatus.ts b/src/version3/models/issueTransitionStatus.ts new file mode 100644 index 0000000000..09f6b49c7a --- /dev/null +++ b/src/version3/models/issueTransitionStatus.ts @@ -0,0 +1,6 @@ +export interface IssueTransitionStatus { + /** The unique ID of the status. */ + statusId?: number; + /** The name of the status. */ + statusName?: string; +} diff --git a/src/version3/models/issueTypeCreate.ts b/src/version3/models/issueTypeCreate.ts index 07a31fd581..c2a0144913 100644 --- a/src/version3/models/issueTypeCreate.ts +++ b/src/version3/models/issueTypeCreate.ts @@ -6,9 +6,10 @@ export interface IssueTypeCreate { /** * The hierarchy level of the issue type. Use: * - * `-1` for Subtask. `0` for Base. + * - `-1` for Subtask. + * - `0` for Base. * - * Defaults to `0`. + * @default 0 */ hierarchyLevel?: number; } diff --git a/src/version3/models/jExpEvaluateIssuesJqlMetaData.ts b/src/version3/models/jExpEvaluateIssuesJqlMetaData.ts new file mode 100644 index 0000000000..5d7e0135c9 --- /dev/null +++ b/src/version3/models/jExpEvaluateIssuesJqlMetaData.ts @@ -0,0 +1,8 @@ +/** + * The description of the page of issues loaded by the provided JQL query.This bean will be replacing + * IssuesJqlMetaDataBean bean as part of new `evaluate` endpoint + */ +export interface JExpEvaluateIssuesJqlMetaData { + /** Next Page token for the next page of issues. */ + nextPageToken: string; +} diff --git a/src/version3/models/jExpEvaluateIssuesMeta.ts b/src/version3/models/jExpEvaluateIssuesMeta.ts new file mode 100644 index 0000000000..43af91acec --- /dev/null +++ b/src/version3/models/jExpEvaluateIssuesMeta.ts @@ -0,0 +1,9 @@ +import { JExpEvaluateIssuesJqlMetaData } from './jExpEvaluateIssuesJqlMetaData'; + +/** + * Meta data describing the `issues` context variable.This bean will be replacing IssuesMetaBean bean as part of new + * `evaluate` endpoint + */ +export interface JExpEvaluateIssuesMeta { + jql?: JExpEvaluateIssuesJqlMetaData; +} diff --git a/src/version3/models/jexpEvaluateCtxIssues.ts b/src/version3/models/jexpEvaluateCtxIssues.ts new file mode 100644 index 0000000000..88f9d7dd55 --- /dev/null +++ b/src/version3/models/jexpEvaluateCtxIssues.ts @@ -0,0 +1,9 @@ +import { JexpEvaluateCtxJqlIssues } from './jexpEvaluateCtxJqlIssues'; + +/** + * The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. This + * bean will be replacing `JexpIssues` bean as part of new `evaluate` endpoint + */ +export interface JexpEvaluateCtxIssues { + jql?: JexpEvaluateCtxJqlIssues; +} diff --git a/src/version3/models/jexpEvaluateCtxJqlIssues.ts b/src/version3/models/jexpEvaluateCtxJqlIssues.ts new file mode 100644 index 0000000000..1cb7757c58 --- /dev/null +++ b/src/version3/models/jexpEvaluateCtxJqlIssues.ts @@ -0,0 +1,19 @@ +/** + * The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. Not all + * issues returned by the JQL query are loaded, only those described by the `nextPageToken` and `maxResults` properties. + * This bean will be replacing JexpJqlIssues bean as part of new `evaluate` endpoint + */ +export interface JexpEvaluateCtxJqlIssues { + /** + * The maximum number of issues to return from the JQL query. max results value considered may be lower than the + * number specific here. + */ + maxResults?: number; + /** + * The token for a page to fetch that is not the first page. The first page has a `nextPageToken` of `null`. Use the + * `nextPageToken` to fetch the next page of issues. + */ + nextPageToken?: string; + /** The JQL query, required to be bounded. Additionally, `orderBy` clause can contain a maximum of 7 fields */ + query?: string; +} diff --git a/src/version3/models/jiraCascadingSelectField.ts b/src/version3/models/jiraCascadingSelectField.ts new file mode 100644 index 0000000000..5d89a9b28e --- /dev/null +++ b/src/version3/models/jiraCascadingSelectField.ts @@ -0,0 +1,7 @@ +import { JiraSelectedOptionField } from './jiraSelectedOptionField'; + +export interface JiraCascadingSelectField { + childOptionValue?: JiraSelectedOptionField; + fieldId: string; + parentOptionValue: JiraSelectedOptionField; +} diff --git a/src/version3/models/jiraColorField.ts b/src/version3/models/jiraColorField.ts new file mode 100644 index 0000000000..5abe3268af --- /dev/null +++ b/src/version3/models/jiraColorField.ts @@ -0,0 +1,6 @@ +import { JiraColorInput } from './jiraColorInput'; + +export interface JiraColorField { + color: JiraColorInput; + fieldId: string; +} diff --git a/src/version3/models/jiraColorInput.ts b/src/version3/models/jiraColorInput.ts new file mode 100644 index 0000000000..270e6da66d --- /dev/null +++ b/src/version3/models/jiraColorInput.ts @@ -0,0 +1,3 @@ +export interface JiraColorInput { + name: string; +} diff --git a/src/version3/models/jiraComponentField.ts b/src/version3/models/jiraComponentField.ts new file mode 100644 index 0000000000..810b1b089b --- /dev/null +++ b/src/version3/models/jiraComponentField.ts @@ -0,0 +1,3 @@ +export interface JiraComponentField { + componentId: number; +} diff --git a/src/version3/models/jiraDateField.ts b/src/version3/models/jiraDateField.ts new file mode 100644 index 0000000000..6d8d951234 --- /dev/null +++ b/src/version3/models/jiraDateField.ts @@ -0,0 +1,6 @@ +import { JiraDateInput } from './jiraDateInput'; + +export interface JiraDateField { + date?: JiraDateInput; + fieldId: string; +} diff --git a/src/version3/models/jiraDateInput.ts b/src/version3/models/jiraDateInput.ts new file mode 100644 index 0000000000..2a742c013e --- /dev/null +++ b/src/version3/models/jiraDateInput.ts @@ -0,0 +1,3 @@ +export interface JiraDateInput { + formattedDate: string; +} diff --git a/src/version3/models/jiraDateTimeField.ts b/src/version3/models/jiraDateTimeField.ts new file mode 100644 index 0000000000..3729898902 --- /dev/null +++ b/src/version3/models/jiraDateTimeField.ts @@ -0,0 +1,6 @@ +import { JiraDateTimeInput } from './jiraDateTimeInput'; + +export interface JiraDateTimeField { + dateTime: JiraDateTimeInput; + fieldId: string; +} diff --git a/src/version3/models/jiraDateTimeInput.ts b/src/version3/models/jiraDateTimeInput.ts new file mode 100644 index 0000000000..a316c55c68 --- /dev/null +++ b/src/version3/models/jiraDateTimeInput.ts @@ -0,0 +1,3 @@ +export interface JiraDateTimeInput { + formattedDateTime: string; +} diff --git a/src/version3/models/jiraDurationField.ts b/src/version3/models/jiraDurationField.ts new file mode 100644 index 0000000000..c7d5465c3a --- /dev/null +++ b/src/version3/models/jiraDurationField.ts @@ -0,0 +1,3 @@ +export interface JiraDurationField { + originalEstimateField: string; +} diff --git a/src/version3/models/jiraExpressionEvalUsingEnhancedSearchRequest.ts b/src/version3/models/jiraExpressionEvalUsingEnhancedSearchRequest.ts new file mode 100644 index 0000000000..f8a07cffb2 --- /dev/null +++ b/src/version3/models/jiraExpressionEvalUsingEnhancedSearchRequest.ts @@ -0,0 +1,8 @@ +import { JiraExpressionEvaluateContext } from './jiraExpressionEvaluateContext'; + +export interface JiraExpressionEvalUsingEnhancedSearchRequest { + /** The Jira expression to evaluate. */ + expression: string; + /** The context in which the Jira expression is evaluated. */ + context?: JiraExpressionEvaluateContext; +} diff --git a/src/version3/models/jiraExpressionEvaluateContext.ts b/src/version3/models/jiraExpressionEvaluateContext.ts new file mode 100644 index 0000000000..326e85d323 --- /dev/null +++ b/src/version3/models/jiraExpressionEvaluateContext.ts @@ -0,0 +1,38 @@ +import { CustomContextVariable } from './customContextVariable'; +import { IdOrKey } from './idOrKey'; +import { JexpEvaluateCtxIssues } from './jexpEvaluateCtxIssues'; + +export interface JiraExpressionEvaluateContext { + /** The ID of the board that is available under the `board` variable when evaluating the expression. */ + board?: number; + /** + * Custom context variables and their types. These variable types are available for use in a custom context: + * + * - `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) + * specified as an Atlassian account ID. + * - `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) + * specified by ID or key. All the fields of the issue object are available in the Jira expression. + * - `json`: A JSON object containing custom content. + * - `list`: A JSON list of `user`, `issue`, or `json` variable types. + */ + custom?: CustomContextVariable[]; + /** + * The ID of the customer request that is available under the `customerRequest` variable when evaluating the + * expression. This is the same as the ID of the underlying Jira issue, but the customer request context variable will + * have a different type. + */ + customerRequest?: number; + issue?: IdOrKey; + issues?: JexpEvaluateCtxIssues; + project?: IdOrKey; + /** The ID of the service desk that is available under the `serviceDesk` variable when evaluating the expression. */ + serviceDesk?: number; + /** The ID of the sprint that is available under the `sprint` variable when evaluating the expression. */ + sprint?: number; +} + +/** + * @deprecated Use {@link JiraExpressionEvaluateContext} instead. This type is retained for backward compatibility and + * will be removed in a future version. + */ +export type JiraExpressionEvaluateContextBean = JiraExpressionEvaluateContext; diff --git a/src/version3/models/jiraGroupInput.ts b/src/version3/models/jiraGroupInput.ts new file mode 100644 index 0000000000..382d45f4a1 --- /dev/null +++ b/src/version3/models/jiraGroupInput.ts @@ -0,0 +1,3 @@ +export interface JiraGroupInput { + groupName: string; +} diff --git a/src/version3/models/jiraIssueFields.ts b/src/version3/models/jiraIssueFields.ts new file mode 100644 index 0000000000..e0bea9e374 --- /dev/null +++ b/src/version3/models/jiraIssueFields.ts @@ -0,0 +1,155 @@ +import { JiraCascadingSelectField } from './jiraCascadingSelectField'; +import { JiraNumberField } from './jiraNumberField'; +import { JiraColorField } from './jiraColorField'; +import { JiraDateField } from './jiraDateField'; +import { JiraDateTimeField } from './jiraDateTimeField'; +import { JiraIssueTypeField } from './jiraIssueTypeField'; +import { JiraLabelsField } from './jiraLabelsField'; +import { JiraMultipleGroupPickerField } from './jiraMultipleGroupPickerField'; +import { JiraMultipleSelectUserPickerField } from './jiraMultipleSelectUserPickerField'; +import { JiraMultipleSelectField } from './jiraMultipleSelectField'; +import { JiraMultipleVersionPickerField } from './jiraMultipleVersionPickerField'; +import { JiraMultiSelectComponentField } from './jiraMultiSelectComponentField'; +import { JiraDurationField } from './jiraDurationField'; +import { JiraPriorityField } from './jiraPriorityField'; +import { JiraRichTextField } from './jiraRichTextField'; +import { JiraSingleGroupPickerField } from './jiraSingleGroupPickerField'; +import { JiraSingleLineTextField } from './jiraSingleLineTextField'; +import { JiraSingleSelectUserPickerField } from './jiraSingleSelectUserPickerField'; +import { JiraSingleSelectField } from './jiraSingleSelectField'; +import { JiraSingleVersionPickerField } from './jiraSingleVersionPickerField'; +import { JiraTimeTrackingField } from './jiraTimeTrackingField'; +import { JiraUrlField } from './jiraUrlField'; + +export interface JiraIssueFields { + /** + * Add or clear a cascading select field: + * + * - To add, specify `optionId` for both parent and child. + * - To clear the child, set its `optionId` to null. + * - To clear both, set the parent's `optionId` to null. + */ + cascadingSelectFields?: JiraCascadingSelectField[]; + /** + * Add or clear a number field: + * + * - To add, specify a numeric `value`. + * - To clear, set `value` to `null`. + */ + clearableNumberFields?: JiraNumberField[]; + /** + * Add or clear a color field: + * + * - To add, specify the color `name`. Available colors are: `purple`, `blue`, `green`, `teal`, `yellow`, `orange`, + * `grey`, `dark purple`, `dark blue`, `dark green`, `dark teal`, `dark yellow`, `dark orange`, `dark grey`. + * - To clear, set the color `name` to an empty string. + */ + colorFields?: JiraColorField[]; + /** + * Add or clear a date picker field: + * + * - To add, specify the date in `d/mmm/yy` format or ISO format `dd-mm-yyyy`. + * - To clear, set `formattedDate` to an empty string. + */ + datePickerFields?: JiraDateField[]; + /** + * Add or clear the planned start date and time: + * + * - To add, specify the date and time in ISO format for `formattedDateTime`. + * - To clear, provide an empty string for `formattedDateTime`. + */ + dateTimePickerFields?: JiraDateTimeField[]; + issueType?: JiraIssueTypeField; + /** + * Edit a labels field: + * + * - Options include `ADD`, `REPLACE`, `REMOVE`, or `REMOVE_ALL` for bulk edits. + * - To clear labels, use the `REMOVE_ALL` option with an empty `labels` array. + */ + labelsFields?: JiraLabelsField[]; + /** + * Add or clear a multi-group picker field: + * + * - To add groups, provide an array of groups with `groupName`s. + * - To clear all groups, use an empty `groups` array. + */ + multipleGroupPickerFields?: JiraMultipleGroupPickerField[]; + /** + * Assign or unassign multiple users to/from a field: + * + * - To assign, provide an array of user `accountId`s. + * - To clear, set `users` to `null`. + */ + multipleSelectClearableUserPickerFields?: JiraMultipleSelectUserPickerField[]; + /** + * Add or clear a multi-select field: + * + * - To add, provide an array of options with `optionId`s. + * - To clear, use an empty `options` array. + */ + multipleSelectFields?: JiraMultipleSelectField[]; + /** + * Edit a multi-version picker field like Fix Versions/Affects Versions: + * + * - Options include `ADD`, `REPLACE`, `REMOVE`, or `REMOVE_ALL` for bulk edits. + * - To clear the field, use the `REMOVE_ALL` option with an empty `versions` array. + */ + multipleVersionPickerFields?: JiraMultipleVersionPickerField[]; + multiselectComponents?: JiraMultiSelectComponentField; + originalEstimateField?: JiraDurationField; + priority?: JiraPriorityField; + /** + * Add or clear a rich text field: + * + * - To add, provide `adfValue`. Note that rich text fields only support ADF values. + * - To clear, use an empty `richText` object. + * + * For ADF format details, refer to: [Atlassian Document + * Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure). + */ + richTextFields?: JiraRichTextField[]; + /** + * Add or clear a single group picker field: + * + * - To add, specify the group with `groupName`. + * - To clear, set `groupName` to an empty string. + */ + singleGroupPickerFields?: JiraSingleGroupPickerField[]; + /** + * Add or clear a single line text field: + * + * - To add, provide the `text` value. + * - To clear, set `text` to an empty string. + */ + singleLineTextFields?: JiraSingleLineTextField[]; + /** + * Edit assignment for single select user picker fields like Assignee/Reporter: + * + * - To assign an issue, specify the user's `accountId`. + * - To unassign an issue, set `user` to `null`. + * - For automatic assignment, set `accountId` to `-1`. + */ + singleSelectClearableUserPickerFields?: JiraSingleSelectUserPickerField[]; + /** + * Add or clear a single select field: + * + * - To add, specify the option with an `optionId`. + * - To clear, pass an option with `optionId` as `-1`. + */ + singleSelectFields?: JiraSingleSelectField[]; + /** + * Add or clear a single version picker field: + * + * - To add, specify the version with a `versionId`. + * - To clear, set `versionId` to `-1`. + */ + singleVersionPickerFields?: JiraSingleVersionPickerField[]; + timeTrackingField?: JiraTimeTrackingField; + /** + * Add or clear a URL field: + * + * - To add, provide the `url` with the desired URL value. + * - To clear, set `url` to an empty string. + */ + urlFields?: JiraUrlField[]; +} diff --git a/src/version3/models/jiraIssueTypeField.ts b/src/version3/models/jiraIssueTypeField.ts new file mode 100644 index 0000000000..56d8fffc0a --- /dev/null +++ b/src/version3/models/jiraIssueTypeField.ts @@ -0,0 +1,3 @@ +export interface JiraIssueTypeField { + issueTypeId: string; +} diff --git a/src/version3/models/jiraLabelsField.ts b/src/version3/models/jiraLabelsField.ts new file mode 100644 index 0000000000..ea888b9a66 --- /dev/null +++ b/src/version3/models/jiraLabelsField.ts @@ -0,0 +1,7 @@ +import { JiraLabelsInput } from './jiraLabelsInput'; + +export interface JiraLabelsField { + bulkEditMultiSelectFieldOption: 'ADD' | 'REMOVE' | 'REPLACE' | 'REMOVE_ALL' | string; + fieldId: string; + labels: JiraLabelsInput[]; +} diff --git a/src/version3/models/jiraLabelsInput.ts b/src/version3/models/jiraLabelsInput.ts new file mode 100644 index 0000000000..1ce6f97508 --- /dev/null +++ b/src/version3/models/jiraLabelsInput.ts @@ -0,0 +1,3 @@ +export interface JiraLabelsInput { + name: string; +} diff --git a/src/version3/models/jiraMultiSelectComponentField.ts b/src/version3/models/jiraMultiSelectComponentField.ts new file mode 100644 index 0000000000..e672e2ee1b --- /dev/null +++ b/src/version3/models/jiraMultiSelectComponentField.ts @@ -0,0 +1,7 @@ +import { JiraComponentField } from './jiraComponentField'; + +export interface JiraMultiSelectComponentField { + bulkEditMultiSelectFieldOption: 'ADD' | 'REMOVE' | 'REPLACE' | 'REMOVE_ALL' | string; + components: JiraComponentField[]; + fieldId: string; +} diff --git a/src/version3/models/jiraMultipleGroupPickerField.ts b/src/version3/models/jiraMultipleGroupPickerField.ts new file mode 100644 index 0000000000..9641d94a21 --- /dev/null +++ b/src/version3/models/jiraMultipleGroupPickerField.ts @@ -0,0 +1,6 @@ +import { JiraGroupInput } from './jiraGroupInput'; + +export interface JiraMultipleGroupPickerField { + fieldId: string; + groups: JiraGroupInput[]; +} diff --git a/src/version3/models/jiraMultipleSelectField.ts b/src/version3/models/jiraMultipleSelectField.ts new file mode 100644 index 0000000000..d07a01f8cc --- /dev/null +++ b/src/version3/models/jiraMultipleSelectField.ts @@ -0,0 +1,6 @@ +import { JiraSelectedOptionField } from './jiraSelectedOptionField'; + +export interface JiraMultipleSelectField { + fieldId: string; + options: JiraSelectedOptionField[]; +} diff --git a/src/version3/models/jiraMultipleSelectUserPickerField.ts b/src/version3/models/jiraMultipleSelectUserPickerField.ts new file mode 100644 index 0000000000..c1763cf2d0 --- /dev/null +++ b/src/version3/models/jiraMultipleSelectUserPickerField.ts @@ -0,0 +1,6 @@ +import { JiraUserField } from './jiraUserField'; + +export interface JiraMultipleSelectUserPickerField { + fieldId: string; + users?: JiraUserField[]; +} diff --git a/src/version3/models/jiraMultipleVersionPickerField.ts b/src/version3/models/jiraMultipleVersionPickerField.ts new file mode 100644 index 0000000000..ab51ebe690 --- /dev/null +++ b/src/version3/models/jiraMultipleVersionPickerField.ts @@ -0,0 +1,7 @@ +import { JiraVersionField } from './jiraVersionField'; + +export interface JiraMultipleVersionPickerField { + bulkEditMultiSelectFieldOption: 'ADD' | 'REMOVE' | 'REPLACE' | 'REMOVE_ALL' | string; + fieldId: string; + versions: JiraVersionField[]; +} diff --git a/src/version3/models/jiraNumberField.ts b/src/version3/models/jiraNumberField.ts new file mode 100644 index 0000000000..559a6bd90d --- /dev/null +++ b/src/version3/models/jiraNumberField.ts @@ -0,0 +1,4 @@ +export interface JiraNumberField { + fieldId: string; + value?: number; +} diff --git a/src/version3/models/jiraPriorityField.ts b/src/version3/models/jiraPriorityField.ts new file mode 100644 index 0000000000..0dfff0bcf7 --- /dev/null +++ b/src/version3/models/jiraPriorityField.ts @@ -0,0 +1,3 @@ +export interface JiraPriorityField { + priorityId: string; +} diff --git a/src/version3/models/jiraRichTextField.ts b/src/version3/models/jiraRichTextField.ts new file mode 100644 index 0000000000..2e123d034b --- /dev/null +++ b/src/version3/models/jiraRichTextField.ts @@ -0,0 +1,6 @@ +import { JiraRichTextInput } from './jiraRichTextInput'; + +export interface JiraRichTextField { + fieldId: string; + richText: JiraRichTextInput; +} diff --git a/src/version3/models/jiraRichTextInput.ts b/src/version3/models/jiraRichTextInput.ts new file mode 100644 index 0000000000..59337b9000 --- /dev/null +++ b/src/version3/models/jiraRichTextInput.ts @@ -0,0 +1,3 @@ +export interface JiraRichTextInput { + adfValue?: {}; +} diff --git a/src/version3/models/jiraSelectedOptionField.ts b/src/version3/models/jiraSelectedOptionField.ts new file mode 100644 index 0000000000..85a2b5c683 --- /dev/null +++ b/src/version3/models/jiraSelectedOptionField.ts @@ -0,0 +1,3 @@ +export interface JiraSelectedOptionField { + optionId?: number; +} diff --git a/src/version3/models/jiraSingleGroupPickerField.ts b/src/version3/models/jiraSingleGroupPickerField.ts new file mode 100644 index 0000000000..ff0de34d0b --- /dev/null +++ b/src/version3/models/jiraSingleGroupPickerField.ts @@ -0,0 +1,6 @@ +import { JiraGroupInput } from './jiraGroupInput'; + +export interface JiraSingleGroupPickerField { + fieldId: string; + group: JiraGroupInput; +} diff --git a/src/version3/models/jiraSingleLineTextField.ts b/src/version3/models/jiraSingleLineTextField.ts new file mode 100644 index 0000000000..c912cc14fd --- /dev/null +++ b/src/version3/models/jiraSingleLineTextField.ts @@ -0,0 +1,4 @@ +export interface JiraSingleLineTextField { + fieldId: string; + text: string; +} diff --git a/src/version3/models/jiraSingleSelectField.ts b/src/version3/models/jiraSingleSelectField.ts new file mode 100644 index 0000000000..028e21dab2 --- /dev/null +++ b/src/version3/models/jiraSingleSelectField.ts @@ -0,0 +1,12 @@ +import { JiraSelectedOptionField } from './jiraSelectedOptionField'; + +/** + * Add or clear a single select field:* + * + * - To add, specify the option with an `optionId`. + * - To clear, pass an option with `optionId` as `-1`. + */ +export interface JiraSingleSelectField { + fieldId: string; + option: JiraSelectedOptionField; +} diff --git a/src/version3/models/jiraSingleSelectUserPickerField.ts b/src/version3/models/jiraSingleSelectUserPickerField.ts new file mode 100644 index 0000000000..f8c6419c87 --- /dev/null +++ b/src/version3/models/jiraSingleSelectUserPickerField.ts @@ -0,0 +1,6 @@ +import { JiraUserField } from './jiraUserField'; + +export interface JiraSingleSelectUserPickerField { + fieldId: string; + user?: JiraUserField; +} diff --git a/src/version3/models/jiraSingleVersionPickerField.ts b/src/version3/models/jiraSingleVersionPickerField.ts new file mode 100644 index 0000000000..80a0d9a015 --- /dev/null +++ b/src/version3/models/jiraSingleVersionPickerField.ts @@ -0,0 +1,6 @@ +import { JiraVersionField } from './jiraVersionField'; + +export interface JiraSingleVersionPickerField { + fieldId: string; + version: JiraVersionField; +} diff --git a/src/version3/models/jiraStatus.ts b/src/version3/models/jiraStatus.ts index 2780805b6d..2e413b7428 100644 --- a/src/version3/models/jiraStatus.ts +++ b/src/version3/models/jiraStatus.ts @@ -3,15 +3,20 @@ import { StatusScope } from './statusScope'; /** Details of a status. */ export interface JiraStatus { + /** The description of the status. */ + description?: string; /** The ID of the status. */ id?: string; /** The name of the status. */ name?: string; - /** The category of the status. */ - statusCategory?: string; scope?: StatusScope; - /** The description of the status. */ - description?: string; - /** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ + /** The category of the status. */ + statusCategory?: 'TODO' | 'IN_PROGRESS' | 'DONE' | string; + /** + * @deprecated See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298) for details. + * + * Projects and issue types where the status is used. Only available if the `usages` expand is requested. + */ usages?: ProjectIssueTypes[]; } diff --git a/src/version3/models/jiraTimeTrackingField.ts b/src/version3/models/jiraTimeTrackingField.ts new file mode 100644 index 0000000000..1f4a466203 --- /dev/null +++ b/src/version3/models/jiraTimeTrackingField.ts @@ -0,0 +1,3 @@ +export interface JiraTimeTrackingField { + timeRemaining: string; +} diff --git a/src/version3/models/jiraUrlField.ts b/src/version3/models/jiraUrlField.ts new file mode 100644 index 0000000000..0e0b743301 --- /dev/null +++ b/src/version3/models/jiraUrlField.ts @@ -0,0 +1,4 @@ +export interface JiraUrlField { + fieldId: string; + url: string; +} diff --git a/src/version3/models/jiraUserField.ts b/src/version3/models/jiraUserField.ts new file mode 100644 index 0000000000..570fa7d2a5 --- /dev/null +++ b/src/version3/models/jiraUserField.ts @@ -0,0 +1,3 @@ +export interface JiraUserField { + accountId: string; +} diff --git a/src/version3/models/jiraVersionField.ts b/src/version3/models/jiraVersionField.ts new file mode 100644 index 0000000000..43e1c54d9f --- /dev/null +++ b/src/version3/models/jiraVersionField.ts @@ -0,0 +1,3 @@ +export interface JiraVersionField { + versionId?: string; +} diff --git a/src/version3/models/jiraWorkflow.ts b/src/version3/models/jiraWorkflow.ts new file mode 100644 index 0000000000..2b53d045f1 --- /dev/null +++ b/src/version3/models/jiraWorkflow.ts @@ -0,0 +1,42 @@ +import { WorkflowScope } from './workflowScope'; +import { WorkflowLayout } from './workflowLayout'; +import { WorkflowReferenceStatus } from './workflowReferenceStatus'; +import { WorkflowTransitions } from './workflowTransitions'; +import { ProjectIssueTypes } from './projectIssueTypes'; +import { DocumentVersion } from './documentVersion'; + +/** Details of a workflow. */ +export interface JiraWorkflow { + /** The creation date of the workflow. */ + created?: string; + /** The description of the workflow. */ + description?: string; + /** The ID of the workflow. */ + id?: string; + /** Indicates if the workflow can be edited. */ + isEditable?: boolean; + /** The name of the workflow. */ + name?: string; + scope?: WorkflowScope; + startPointLayout?: WorkflowLayout; + /** The statuses referenced in this workflow. */ + statuses?: WorkflowReferenceStatus[]; + /** If there is a current [asynchronous task](#async-operations) operation for this workflow. */ + taskId?: string; + /** + * The transitions of the workflow. Note that a transition can have either the deprecated `to`/`from` fields or the + * `toStatusReference`/`links` fields, but never both nor a combination. + */ + transitions?: WorkflowTransitions[]; + /** The last edited date of the workflow. */ + updated?: string; + /** + * @deprecated See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298) for details. + * + * Use the optional `workflows.usages` expand to get additional information about the projects and issue types + * associated with the requested workflows. + */ + usages?: ProjectIssueTypes[]; + version?: DocumentVersion; +} diff --git a/src/version3/models/jiraWorkflowStatus.ts b/src/version3/models/jiraWorkflowStatus.ts new file mode 100644 index 0000000000..8cb55335cd --- /dev/null +++ b/src/version3/models/jiraWorkflowStatus.ts @@ -0,0 +1,16 @@ +import { WorkflowScope } from './workflowScope'; + +/** Details of a status. */ +export interface JiraWorkflowStatus { + /** The description of the status. */ + description?: string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; + scope?: WorkflowScope; + /** The category of the status. */ + statusCategory?: 'TODO' | 'IN_PROGRESS' | 'DONE' | string; + /** The reference of the status. */ + statusReference?: string; +} diff --git a/src/version3/models/jqlCount.ts b/src/version3/models/jqlCount.ts new file mode 100644 index 0000000000..a3270ef92a --- /dev/null +++ b/src/version3/models/jqlCount.ts @@ -0,0 +1,4 @@ +export interface JQLCount { + /** Number of issues matching JQL query. */ + count?: number; +} diff --git a/src/version3/models/jqlCountRequest.ts b/src/version3/models/jqlCountRequest.ts new file mode 100644 index 0000000000..9bc8f144a3 --- /dev/null +++ b/src/version3/models/jqlCountRequest.ts @@ -0,0 +1,7 @@ +export interface JQLCountRequest { + /** + * A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. For performance reasons, this parameter requires a + * bounded query. A bounded query is a query with a search restriction. + */ + jql: string; +} diff --git a/src/version3/models/jqlFunctionPrecomputation.ts b/src/version3/models/jqlFunctionPrecomputation.ts index 7aa38ea2c4..949ea68447 100644 --- a/src/version3/models/jqlFunctionPrecomputation.ts +++ b/src/version3/models/jqlFunctionPrecomputation.ts @@ -1,13 +1,25 @@ /** Jql function precomputation. */ export interface JqlFunctionPrecomputation { + /** The list of arguments function was invoked with. */ arguments?: string[]; + /** The timestamp of the precomputation creation. */ created?: string; + /** The error message to be displayed to the user. */ + error?: string; + /** The field the function was executed against. */ field?: string; + /** The function key. */ functionKey?: string; + /** The name of the function. */ functionName?: string; + /** The id of the precomputation. */ id?: string; + /** The operator in context of which function was executed. */ operator?: string; + /** The timestamp of the precomputation last update. */ updated?: string; + /** The timestamp of the precomputation last usage. */ used?: string; + /** The JQL fragment stored as the precomputation. */ value?: string; } diff --git a/src/version3/models/jqlFunctionPrecomputationGetByIdRequest.ts b/src/version3/models/jqlFunctionPrecomputationGetByIdRequest.ts new file mode 100644 index 0000000000..f9afb489d9 --- /dev/null +++ b/src/version3/models/jqlFunctionPrecomputationGetByIdRequest.ts @@ -0,0 +1,4 @@ +/** Request to fetch precomputations by ID. */ +export interface JqlFunctionPrecomputationGetByIdRequest { + precomputationIDs?: string[]; +} diff --git a/src/version3/models/jqlFunctionPrecomputationGetByIdResponse.ts b/src/version3/models/jqlFunctionPrecomputationGetByIdResponse.ts new file mode 100644 index 0000000000..391c1f8663 --- /dev/null +++ b/src/version3/models/jqlFunctionPrecomputationGetByIdResponse.ts @@ -0,0 +1,9 @@ +import { JqlFunctionPrecomputation } from './jqlFunctionPrecomputation'; + +/** Get precomputations by ID response. */ +export interface JqlFunctionPrecomputationGetByIdResponse { + /** List of precomputations that were not found. */ + notFoundPrecomputationIDs?: string[]; + /** The list of precomputations. */ + precomputations?: JqlFunctionPrecomputation[]; +} diff --git a/src/version3/models/jsonNode.ts b/src/version3/models/jsonNode.ts new file mode 100644 index 0000000000..402169b828 --- /dev/null +++ b/src/version3/models/jsonNode.ts @@ -0,0 +1,38 @@ +export interface JsonNode { + array?: boolean; + bigDecimal?: boolean; + bigInteger?: boolean; + bigIntegerValue?: number; + binary?: boolean; + binaryValue?: string[]; + boolean?: boolean; + booleanValue?: boolean; + containerNode?: boolean; + decimalValue?: number; + double?: boolean; + doubleValue?: number; + elements?: {}; + fieldNames?: {}; + fields?: {}; + floatingPointNumber?: boolean; + int?: boolean; + intValue?: number; + integralNumber?: boolean; + long?: boolean; + longValue?: number; + missingNode?: boolean; + null?: boolean; + number?: boolean; + numberType?: 'INT' | 'LONG' | 'BIG_INTEGER' | 'FLOAT' | 'DOUBLE' | 'BIG_DECIMAL' | string; + numberValue?: number; + object?: boolean; + pojo?: boolean; + textValue?: string; + textual?: boolean; + valueAsBoolean?: boolean; + valueAsDouble?: number; + valueAsInt?: number; + valueAsLong?: number; + valueAsText?: string; + valueNode?: boolean; +} diff --git a/src/version3/models/mappingsByIssueTypeOverride.ts b/src/version3/models/mappingsByIssueTypeOverride.ts new file mode 100644 index 0000000000..570d8dfde5 --- /dev/null +++ b/src/version3/models/mappingsByIssueTypeOverride.ts @@ -0,0 +1,13 @@ +import { WorkflowAssociationStatusMapping } from './workflowAssociationStatusMapping'; + +/** + * Overrides, for the selected issue types, any status mappings provided in `statusMappingsByWorkflows`. Status mappings + * are required when the new workflow for an issue type doesn't contain all statuses that the old workflow has. Status + * mappings can be provided by a combination of `statusMappingsByWorkflows` and `statusMappingsByIssueTypeOverride`. + */ +export interface MappingsByIssueTypeOverride { + /** The ID of the issue type for this mapping. */ + issueTypeId: string; + /** The list of status mappings. */ + statusMappings: WorkflowAssociationStatusMapping[]; +} diff --git a/src/version3/models/mappingsByWorkflow.ts b/src/version3/models/mappingsByWorkflow.ts new file mode 100644 index 0000000000..484dcec961 --- /dev/null +++ b/src/version3/models/mappingsByWorkflow.ts @@ -0,0 +1,15 @@ +import { WorkflowAssociationStatusMapping } from './workflowAssociationStatusMapping'; + +/** + * The status mappings by workflows. Status mappings are required when the new workflow for an issue type doesn't + * contain all statuses that the old workflow has. Status mappings can be provided by a combination of + * `statusMappingsByWorkflows` and `statusMappingsByIssueTypeOverride`. + */ +export interface MappingsByWorkflow { + /** The ID of the new workflow. */ + newWorkflowId: string; + /** The ID of the old workflow. */ + oldWorkflowId: string; + /** The list of status mappings. */ + statusMappings: WorkflowAssociationStatusMapping[]; +} diff --git a/src/version3/models/pageBulkContextualConfiguration.ts b/src/version3/models/pageBulkContextualConfiguration.ts new file mode 100644 index 0000000000..3c931a1436 --- /dev/null +++ b/src/version3/models/pageBulkContextualConfiguration.ts @@ -0,0 +1,19 @@ +import { BulkContextualConfiguration } from './bulkContextualConfiguration'; + +/** A page of items. */ +export interface PageBulkContextualConfiguration { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** The number of items returned. */ + total?: number; + /** The list of items. */ + values?: BulkContextualConfiguration[]; +} diff --git a/src/version3/models/pageOfCreateMetaIssueTypeWithField.ts b/src/version3/models/pageOfCreateMetaIssueTypeWithField.ts new file mode 100644 index 0000000000..3e5ce43d55 --- /dev/null +++ b/src/version3/models/pageOfCreateMetaIssueTypeWithField.ts @@ -0,0 +1,14 @@ +import { FieldCreateMetadata } from './fieldCreateMetadata'; + +/** A page of CreateMetaIssueType with Field. */ +export interface PageOfCreateMetaIssueTypeWithField { + /** The collection of FieldCreateMetaBeans. */ + fields?: FieldCreateMetadata[]; + /** The maximum number of items to return per page. */ + maxResults?: number; + results?: FieldCreateMetadata[]; + /** The index of the first item returned. */ + startAt?: number; + /** The total number of items in all pages. */ + total?: number; +} diff --git a/src/version3/models/pageOfCreateMetaIssueTypes.ts b/src/version3/models/pageOfCreateMetaIssueTypes.ts new file mode 100644 index 0000000000..42b514a7ed --- /dev/null +++ b/src/version3/models/pageOfCreateMetaIssueTypes.ts @@ -0,0 +1,14 @@ +import { IssueTypeIssueCreateMetadata } from './issueTypeIssueCreateMetadata'; + +/** A page of CreateMetaIssueTypes. */ +export interface PageOfCreateMetaIssueTypes { + createMetaIssueType?: IssueTypeIssueCreateMetadata[]; + /** The list of CreateMetaIssueType. */ + issueTypes?: IssueTypeIssueCreateMetadata[]; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** The index of the first item returned. */ + startAt?: number; + /** The total number of items in all pages. */ + total?: number; +} diff --git a/src/version3/models/pageWithCursorGetPlanResponseForPage.ts b/src/version3/models/pageWithCursorGetPlanResponseForPage.ts new file mode 100644 index 0000000000..7b6c103ded --- /dev/null +++ b/src/version3/models/pageWithCursorGetPlanResponseForPage.ts @@ -0,0 +1,10 @@ +import { GetPlanResponseForPage } from './getPlanResponseForPage'; + +export interface PageWithCursorGetPlanResponseForPage { + cursor?: string; + last?: boolean; + nextPageCursor?: string; + size?: number; + total?: number; + values?: GetPlanResponseForPage[]; +} diff --git a/src/version3/models/pageWithCursorGetTeamResponseForPage.ts b/src/version3/models/pageWithCursorGetTeamResponseForPage.ts new file mode 100644 index 0000000000..015c2316bd --- /dev/null +++ b/src/version3/models/pageWithCursorGetTeamResponseForPage.ts @@ -0,0 +1,10 @@ +import { GetTeamResponseForPage } from './getTeamResponseForPage'; + +export interface PageWithCursorGetTeamResponseForPage { + cursor?: string; + last?: boolean; + nextPageCursor?: string; + size?: number; + total?: number; + values?: GetTeamResponseForPage[]; +} diff --git a/src/version3/models/plan.ts b/src/version3/models/plan.ts new file mode 100644 index 0000000000..2b42c63d0c --- /dev/null +++ b/src/version3/models/plan.ts @@ -0,0 +1,29 @@ +import { GetCrossProjectReleaseResponse } from './getCrossProjectReleaseResponse'; +import { GetCustomFieldResponse } from './getCustomFieldResponse'; +import { GetExclusionRulesResponse } from './getExclusionRulesResponse'; +import { GetIssueSourceResponse } from './getIssueSourceResponse'; +import { GetPermissionResponse } from './getPermissionResponse'; +import { GetSchedulingResponse } from './getSchedulingResponse'; + +export interface Plan { + /** The cross-project releases included in the plan. */ + crossProjectReleases?: GetCrossProjectReleaseResponse[]; + /** The custom fields for the plan. */ + customFields?: GetCustomFieldResponse[]; + exclusionRules?: GetExclusionRulesResponse; + /** The plan ID. */ + id: number; + /** The issue sources included in the plan. */ + issueSources?: GetIssueSourceResponse[]; + /** The date when the plan was last saved in UTC. */ + lastSaved?: string; + /** The account ID of the plan lead. */ + leadAccountId?: string; + /** The plan name. */ + name?: string; + /** The permissions for the plan. */ + permissions?: GetPermissionResponse[]; + scheduling?: GetSchedulingResponse; + /** The plan status. This is "Active", "Trashed" or "Archived". */ + status: 'Active' | 'Trashed' | 'Archived' | string; +} diff --git a/src/version3/models/priorityMapping.ts b/src/version3/models/priorityMapping.ts new file mode 100644 index 0000000000..1482f369fc --- /dev/null +++ b/src/version3/models/priorityMapping.ts @@ -0,0 +1,20 @@ +/** Mapping of issue priorities for changes in priority schemes. */ +export interface PriorityMapping { + /** + * The mapping of priorities for issues being migrated **into** this priority scheme. Key is the old priority ID, + * value is the new priority ID (must exist in this priority scheme). + * + * E.g. The current priority scheme has priority ID `10001`. Issues with priority ID `10000` are being migrated into + * this priority scheme will need mapping to new priorities. The `in` mapping would be `{"10000": 10001}`. + */ + in?: {}; + /** + * The mapping of priorities for issues being migrated **out of** this priority scheme. Key is the old priority ID + * (must exist in this priority scheme), value is the new priority ID (must exist in the default priority scheme). + * Required for updating an existing priority scheme. Not used when creating a new priority scheme. + * + * E.g. The current priority scheme has priority ID `10001`. Issues with priority ID `10001` are being migrated out of + * this priority scheme will need mapping to new priorities. The `out` mapping would be `{"10001": 10000}`. + */ + out?: {}; +} diff --git a/src/version3/models/prioritySchemeChangesWithoutMappings.ts b/src/version3/models/prioritySchemeChangesWithoutMappings.ts new file mode 100644 index 0000000000..51c1ea7e02 --- /dev/null +++ b/src/version3/models/prioritySchemeChangesWithoutMappings.ts @@ -0,0 +1,4 @@ +export interface PrioritySchemeChangesWithoutMappings { + /** Affected entity ids. */ + ids: number[]; +} diff --git a/src/version3/models/prioritySchemeId.ts b/src/version3/models/prioritySchemeId.ts new file mode 100644 index 0000000000..7e349f2e21 --- /dev/null +++ b/src/version3/models/prioritySchemeId.ts @@ -0,0 +1,8 @@ +import { TaskProgressNode } from './taskProgressNode'; + +/** The ID of a priority scheme. */ +export interface PrioritySchemeId { + /** The ID of the priority scheme. */ + id?: string; + task?: TaskProgressNode; +} diff --git a/src/version3/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts b/src/version3/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts new file mode 100644 index 0000000000..9dc5ed1bc5 --- /dev/null +++ b/src/version3/models/prioritySchemeWithPaginatedPrioritiesAndProjects.ts @@ -0,0 +1,21 @@ +import { Paginated } from '../../paginated'; +import { ProjectDetails } from './projectDetails'; +import { PriorityWithSequence } from './priorityWithSequence'; + +/** A priority scheme with paginated priorities and projects. */ +export interface PrioritySchemeWithPaginatedPrioritiesAndProjects { + default?: boolean; + /** The ID of the default issue priority. */ + defaultPriorityId?: string; + /** The description of the priority scheme */ + description?: string; + /** The ID of the priority scheme. */ + id: string; + isDefault?: boolean; + /** The name of the priority scheme */ + name: string; + priorities?: Paginated; + projects?: Paginated; + /** The URL of the priority scheme. */ + self?: string; +} diff --git a/src/version3/models/priorityWithSequence.ts b/src/version3/models/priorityWithSequence.ts new file mode 100644 index 0000000000..8012f612ad --- /dev/null +++ b/src/version3/models/priorityWithSequence.ts @@ -0,0 +1,19 @@ +/** An issue priority with sequence information. */ +export interface PriorityWithSequence { + /** The description of the issue priority. */ + description?: string; + /** The URL of the icon for the issue priority. */ + iconUrl?: string; + /** The ID of the issue priority. */ + id?: string; + /** Whether this priority is the default. */ + isDefault?: boolean; + /** The name of the issue priority. */ + name?: string; + /** The URL of the issue priority. */ + self?: string; + /** The sequence of the issue priority. */ + sequence?: string; + /** The color used to indicate the issue priority. */ + statusColor?: string; +} diff --git a/src/version3/models/projectAndIssueTypePair.ts b/src/version3/models/projectAndIssueTypePair.ts new file mode 100644 index 0000000000..96adac43fc --- /dev/null +++ b/src/version3/models/projectAndIssueTypePair.ts @@ -0,0 +1,7 @@ +/** A project and issueType ID pair that identifies a status mapping. */ +export interface ProjectAndIssueTypePair { + /** The ID of the issue type. */ + issueTypeId: string; + /** The ID of the project. */ + projectId: string; +} diff --git a/src/version3/models/projectComponent.ts b/src/version3/models/projectComponent.ts index 6703ca07d0..074c4701af 100644 --- a/src/version3/models/projectComponent.ts +++ b/src/version3/models/projectComponent.ts @@ -2,22 +2,26 @@ import { User } from './user'; /** Details about a project component. */ export interface ProjectComponent { + /** Compass component's ID. Can't be updated. Not required for creating a Project Component. */ + ari?: string; assignee?: User; /** * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` * for details on how the type of the user, and hence the user, assigned to issues is determined. Can take the * following values: * - * `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the - * component is in. `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for - * the component. `UNASSIGNED` an assignee is not set for issues created with this component. `PROJECT_DEFAULT` the - * assignee to any issues created with this component is nominally the default assignee for the project that the - * component is in. + * - `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the + * component is in. + * - `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for the component. + * - `UNASSIGNED` an assignee is not set for issues created with this component. + * - `PROJECT_DEFAULT` the assignee to any issues created with this component is nominally the default assignee for the + * project that the component is in. * - * Default value: `PROJECT_DEFAULT`. - * Optional when creating or updating a component. + * Default value: `PROJECT_DEFAULT`. Optional when creating or updating a component. + * + * @default PROJECT_DEFAULT */ - assigneeType?: string; + assigneeType?: 'PROJECT_DEFAULT' | 'COMPONENT_LEAD' | 'PROJECT_LEAD' | 'UNASSIGNED' | string; /** The description for the component. Optional when creating or updating a component. */ description?: string; /** The unique identifier for the component. */ @@ -34,11 +38,15 @@ export interface ProjectComponent { */ leadAccountId?: string; /** - * This property is no longer available and will be removed from the documentation soon. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. + * @deprecated + * + * This property is no longer available and will be removed from the documentation soon. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. */ leadUserName?: string; + /** Compass component's metadata. Can't be updated. Not required for creating a Project Component. */ + metadata?: {}; /** * The unique name for the component in the project. Required when creating a component. Optional when updating a * component. The maximum length is 255 characters. @@ -54,13 +62,14 @@ export interface ProjectComponent { * from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This * property is set to one of the following values: * - * `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in - * the project that the component is in. `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component - * lead has permission to be assigned issues in the project that the component is in. `UNASSIGNED` when `assigneeType` - * is `UNASSIGNED` and Jira is configured to allow unassigned issues. `PROJECT_DEFAULT` when none of the preceding - * cases are true. + * - `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in + * the project that the component is in. + * - `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component lead has permission to be assigned + * issues in the project that the component is in. + * - `UNASSIGNED` when `assigneeType` is `UNASSIGNED` and Jira is configured to allow unassigned issues. + * - `PROJECT_DEFAULT` when none of the preceding cases are true. */ - realAssigneeType?: string; + realAssigneeType?: 'PROJECT_DEFAULT' | 'COMPONENT_LEAD' | 'PROJECT_LEAD' | 'UNASSIGNED' | string; /** The URL of the component. */ self?: string; } diff --git a/src/version3/models/projectDataPolicies.ts b/src/version3/models/projectDataPolicies.ts new file mode 100644 index 0000000000..b36a920596 --- /dev/null +++ b/src/version3/models/projectDataPolicies.ts @@ -0,0 +1,7 @@ +import type { ProjectWithDataPolicy } from './projectWithDataPolicy'; + +/** Details about data policies for a list of projects. */ +export interface ProjectDataPolicies { + /** List of projects with data policies. */ + projectDataPolicies: ProjectWithDataPolicy[]; +} diff --git a/src/version3/models/projectDataPolicy.ts b/src/version3/models/projectDataPolicy.ts new file mode 100644 index 0000000000..84c4039d15 --- /dev/null +++ b/src/version3/models/projectDataPolicy.ts @@ -0,0 +1,5 @@ +/** Details about data policy. */ +export interface ProjectDataPolicy { + /** Whether the project contains any content inaccessible to the requesting application. */ + anyContentBlocked: boolean; +} diff --git a/src/version3/models/projectIssueTypes.ts b/src/version3/models/projectIssueTypes.ts index a712f1e06e..851ff795a5 100644 --- a/src/version3/models/projectIssueTypes.ts +++ b/src/version3/models/projectIssueTypes.ts @@ -1,6 +1,12 @@ import { ProjectId } from './projectId'; -/** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ +/** + * @deprecated See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298) + * for details.* + * + * Use the optional `workflows.usages` expand to get additional information about the projects and issue types + * associated with the requested workflows. + */ export interface ProjectIssueTypes { project?: ProjectId; /** IDs of the issue types */ diff --git a/src/version3/models/projectUsage.ts b/src/version3/models/projectUsage.ts new file mode 100644 index 0000000000..2cc468d44c --- /dev/null +++ b/src/version3/models/projectUsage.ts @@ -0,0 +1,5 @@ +/** The project. */ +export interface ProjectUsage { + /** The project ID. */ + id?: string; +} diff --git a/src/version3/models/projectUsagePage.ts b/src/version3/models/projectUsagePage.ts new file mode 100644 index 0000000000..f018c8e7b1 --- /dev/null +++ b/src/version3/models/projectUsagePage.ts @@ -0,0 +1,9 @@ +import { ProjectUsage } from './projectUsage'; + +/** A page of projects. */ +export interface ProjectUsagePage { + /** Page token for the next page of project usages. */ + nextPageToken?: string; + /** The list of projects. */ + values?: ProjectUsage[]; +} diff --git a/src/version3/models/projectWithDataPolicy.ts b/src/version3/models/projectWithDataPolicy.ts new file mode 100644 index 0000000000..cd24fa197a --- /dev/null +++ b/src/version3/models/projectWithDataPolicy.ts @@ -0,0 +1,8 @@ +import { ProjectDataPolicy } from './projectDataPolicy'; + +/** Details about data policies for a project. */ +export interface ProjectWithDataPolicy { + dataPolicy: ProjectDataPolicy; + /** The project ID. */ + id: number; +} diff --git a/src/version3/models/requiredMappingByIssueType.ts b/src/version3/models/requiredMappingByIssueType.ts new file mode 100644 index 0000000000..3d85f836c5 --- /dev/null +++ b/src/version3/models/requiredMappingByIssueType.ts @@ -0,0 +1,7 @@ +/** The list of required status mappings by issue type. */ +export interface RequiredMappingByIssueType { + /** The ID of the issue type. */ + issueTypeId?: string; + /** The status IDs requiring mapping. */ + statusIds?: string[]; +} diff --git a/src/version3/models/requiredMappingByWorkflows.ts b/src/version3/models/requiredMappingByWorkflows.ts new file mode 100644 index 0000000000..b30e14666e --- /dev/null +++ b/src/version3/models/requiredMappingByWorkflows.ts @@ -0,0 +1,9 @@ +/** The list of required status mappings by workflow. */ +export interface RequiredMappingByWorkflows { + /** The ID of the source workflow. */ + sourceWorkflowId?: string; + /** The status IDs requiring mapping. */ + statusIds?: string[]; + /** The ID of the target workflow. */ + targetWorkflowId?: string; +} diff --git a/src/version3/models/searchAndReconcileResults.ts b/src/version3/models/searchAndReconcileResults.ts new file mode 100644 index 0000000000..5ff767e678 --- /dev/null +++ b/src/version3/models/searchAndReconcileResults.ts @@ -0,0 +1,16 @@ +import { Issue } from './issue'; + +/** The result of a JQL search with issues reconsilation. */ +export interface SearchAndReconcileResults { + /** The list of issues found by the search or reconsiliation. */ + issues?: Issue[]; + /** The ID and name of each field in the search results. */ + names?: {}; + /** + * Continuation token to fetch the next page. If this result represents the last or the only page this token will be + * null. This token will expire in 7 days. + */ + nextPageToken?: string; + /** The schema describing the field types in the search results. */ + schema?: {}; +} diff --git a/src/version3/models/serviceRegistry.ts b/src/version3/models/serviceRegistry.ts new file mode 100644 index 0000000000..d46bfa2b86 --- /dev/null +++ b/src/version3/models/serviceRegistry.ts @@ -0,0 +1,15 @@ +import { ServiceRegistryTier } from './serviceRegistryTier'; + +export interface ServiceRegistry { + /** Service description */ + description?: string; + /** Service ID */ + id?: string; + /** Service name */ + name?: string; + /** Organization ID */ + organizationId?: string; + /** Service revision */ + revision?: string; + serviceTier?: ServiceRegistryTier; +} diff --git a/src/version3/models/serviceRegistryTier.ts b/src/version3/models/serviceRegistryTier.ts new file mode 100644 index 0000000000..b9f2ff9ca8 --- /dev/null +++ b/src/version3/models/serviceRegistryTier.ts @@ -0,0 +1,12 @@ +export interface ServiceRegistryTier { + /** Tier description */ + description?: string; + /** Tier ID */ + id?: string; + /** Tier level */ + level?: number; + /** Tier name */ + name?: string; + /** Name key of the tier */ + nameKey?: string; +} diff --git a/src/version3/models/simpleUsage.ts b/src/version3/models/simpleUsage.ts new file mode 100644 index 0000000000..b1ddd95231 --- /dev/null +++ b/src/version3/models/simpleUsage.ts @@ -0,0 +1,7 @@ +/** Represents a usage of an entity by a project ID and related issue type IDs. */ +export interface SimpleUsage { + /** The issue type IDs for the usage. */ + issueTypeIds: string[]; + /** The project ID for the usage. */ + projectId: string; +} diff --git a/src/version3/models/simplifiedIssueTransition.ts b/src/version3/models/simplifiedIssueTransition.ts new file mode 100644 index 0000000000..9d2f10eee8 --- /dev/null +++ b/src/version3/models/simplifiedIssueTransition.ts @@ -0,0 +1,9 @@ +import { IssueTransitionStatus } from './issueTransitionStatus'; + +export interface SimplifiedIssueTransition { + to?: IssueTransitionStatus; + /** The unique ID of the transition. */ + transitionId?: number; + /** The name of the transition. */ + transitionName?: string; +} diff --git a/src/version3/models/statusMetadata.ts b/src/version3/models/statusMetadata.ts new file mode 100644 index 0000000000..f6eaa22aaf --- /dev/null +++ b/src/version3/models/statusMetadata.ts @@ -0,0 +1,9 @@ +/** The details of the statuses in the associated workflows. */ +export interface StatusMetadata { + /** The category of the status. */ + category?: 'TODO' | 'IN_PROGRESS' | 'DONE' | string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; +} diff --git a/src/version3/models/statusProjectIssueTypeUsage.ts b/src/version3/models/statusProjectIssueTypeUsage.ts new file mode 100644 index 0000000000..a6e133af18 --- /dev/null +++ b/src/version3/models/statusProjectIssueTypeUsage.ts @@ -0,0 +1,10 @@ +import { StatusProjectIssueTypeUsagePage } from './statusProjectIssueTypeUsagePage'; + +/** The issue types using this status in a project. */ +export interface StatusProjectIssueTypeUsage { + issueTypes?: StatusProjectIssueTypeUsagePage; + /** The project ID. */ + projectId?: string; + /** The status ID. */ + statusId?: string; +} diff --git a/src/version3/models/statusProjectIssueTypeUsagePage.ts b/src/version3/models/statusProjectIssueTypeUsagePage.ts new file mode 100644 index 0000000000..b273c4e6c2 --- /dev/null +++ b/src/version3/models/statusProjectIssueTypeUsagePage.ts @@ -0,0 +1,9 @@ +import { StatusProjectIssueTypeUsage } from './statusProjectIssueTypeUsage'; + +/** A page of issue types. */ +export interface StatusProjectIssueTypeUsagePage { + /** Page token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of issue types. */ + values?: StatusProjectIssueTypeUsage[]; +} diff --git a/src/version3/models/statusProjectUsage.ts b/src/version3/models/statusProjectUsage.ts new file mode 100644 index 0000000000..c1390878c3 --- /dev/null +++ b/src/version3/models/statusProjectUsage.ts @@ -0,0 +1,8 @@ +import { StatusProjectUsagePage } from './statusProjectUsagePage'; + +/** The projects using this status. */ +export interface StatusProjectUsage { + projects?: StatusProjectUsagePage; + /** The status ID. */ + statusId?: string; +} diff --git a/src/version3/models/statusProjectUsagePage.ts b/src/version3/models/statusProjectUsagePage.ts new file mode 100644 index 0000000000..5a9583f815 --- /dev/null +++ b/src/version3/models/statusProjectUsagePage.ts @@ -0,0 +1,9 @@ +import { StatusProjectUsage } from './statusProjectUsage'; + +/** A page of projects. */ +export interface StatusProjectUsagePage { + /** Page token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of projects. */ + values?: StatusProjectUsage[]; +} diff --git a/src/version3/models/statusWorkflowUsage.ts b/src/version3/models/statusWorkflowUsage.ts new file mode 100644 index 0000000000..53780c802b --- /dev/null +++ b/src/version3/models/statusWorkflowUsage.ts @@ -0,0 +1,8 @@ +import { StatusWorkflowUsagePage } from './statusWorkflowUsagePage'; + +/** Workflows using the status. */ +export interface StatusWorkflowUsage { + /** The status ID. */ + statusId?: string; + workflows?: StatusWorkflowUsagePage; +} diff --git a/src/version3/models/statusWorkflowUsagePage.ts b/src/version3/models/statusWorkflowUsagePage.ts new file mode 100644 index 0000000000..6d358d8517 --- /dev/null +++ b/src/version3/models/statusWorkflowUsagePage.ts @@ -0,0 +1,9 @@ +import { StatusWorkflowUsageWorkflow } from './statusWorkflowUsageWorkflow'; + +/** A page of workflows. */ +export interface StatusWorkflowUsagePage { + /** Page token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of statuses. */ + values?: StatusWorkflowUsageWorkflow[]; +} diff --git a/src/version3/models/statusWorkflowUsageWorkflow.ts b/src/version3/models/statusWorkflowUsageWorkflow.ts new file mode 100644 index 0000000000..3e860725b5 --- /dev/null +++ b/src/version3/models/statusWorkflowUsageWorkflow.ts @@ -0,0 +1,5 @@ +/** The worflow. */ +export interface StatusWorkflowUsageWorkflow { + /** The workflow ID. */ + id?: string; +} diff --git a/src/version3/models/statusesPerWorkflow.ts b/src/version3/models/statusesPerWorkflow.ts new file mode 100644 index 0000000000..d4b31c1b71 --- /dev/null +++ b/src/version3/models/statusesPerWorkflow.ts @@ -0,0 +1,9 @@ +/** The statuses associated with each workflow. */ +export interface StatusesPerWorkflow { + /** The ID of the initial status for the workflow. */ + initialStatusId?: string; + /** The status IDs associated with the workflow. */ + statuses?: string[]; + /** The ID of the workflow. */ + workflowId?: string; +} diff --git a/src/version3/models/submittedBulkOperation.ts b/src/version3/models/submittedBulkOperation.ts new file mode 100644 index 0000000000..ed54a85ed8 --- /dev/null +++ b/src/version3/models/submittedBulkOperation.ts @@ -0,0 +1,3 @@ +export interface SubmittedBulkOperation { + taskId?: string; +} diff --git a/src/version3/models/suggestedMappingsForPrioritiesRequest.ts b/src/version3/models/suggestedMappingsForPrioritiesRequest.ts new file mode 100644 index 0000000000..57d9d155fc --- /dev/null +++ b/src/version3/models/suggestedMappingsForPrioritiesRequest.ts @@ -0,0 +1,7 @@ +/** Details of changes to a priority scheme's priorities that require suggested priority mappings. */ +export interface SuggestedMappingsForPrioritiesRequest { + /** The ids of priorities being removed from the scheme. */ + add?: number[]; + /** The ids of priorities being removed from the scheme. */ + remove?: number[]; +} diff --git a/src/version3/models/suggestedMappingsForProjectsRequest.ts b/src/version3/models/suggestedMappingsForProjectsRequest.ts new file mode 100644 index 0000000000..b86007bcff --- /dev/null +++ b/src/version3/models/suggestedMappingsForProjectsRequest.ts @@ -0,0 +1,5 @@ +/** Details of changes to a priority scheme's projects that require suggested priority mappings. */ +export interface SuggestedMappingsForProjectsRequest { + /** The ids of projects being added to the scheme. */ + add?: number[]; +} diff --git a/src/version3/models/suggestedMappingsRequest.ts b/src/version3/models/suggestedMappingsRequest.ts new file mode 100644 index 0000000000..32a6398d4b --- /dev/null +++ b/src/version3/models/suggestedMappingsRequest.ts @@ -0,0 +1,14 @@ +import { SuggestedMappingsForPrioritiesRequest } from './suggestedMappingsForPrioritiesRequest'; +import { SuggestedMappingsForProjectsRequest } from './suggestedMappingsForProjectsRequest'; + +/** Details of changes to a priority scheme that require suggested priority mappings. */ +export interface SuggestedMappingsRequest { + /** The maximum number of results that could be on the page. */ + maxResults?: number; + priorities?: SuggestedMappingsForPrioritiesRequest; + projects?: SuggestedMappingsForProjectsRequest; + /** The id of the priority scheme. */ + schemeId?: number; + /** The index of the first item returned on the page. */ + startAt?: number; +} diff --git a/src/version3/models/systemAvatars.ts b/src/version3/models/systemAvatars.ts index b7a72d47f9..bb60531b88 100644 --- a/src/version3/models/systemAvatars.ts +++ b/src/version3/models/systemAvatars.ts @@ -3,5 +3,5 @@ import { Avatar } from './avatar'; /** List of system avatars. */ export interface SystemAvatars { /** A list of avatar details. */ - system?: Avatar[]; + system: Omit[]; } diff --git a/src/version3/models/taskProgressNode.ts b/src/version3/models/taskProgressNode.ts new file mode 100644 index 0000000000..d49fa81446 --- /dev/null +++ b/src/version3/models/taskProgressNode.ts @@ -0,0 +1,30 @@ +import { JsonNode } from './jsonNode'; + +/** Details about a task. */ +export interface TaskProgressNode { + /** The description of the task. */ + description?: string; + /** The execution time of the task, in milliseconds. */ + elapsedRuntime: number; + /** A timestamp recording when the task was finished. */ + finished?: number; + /** The ID of the task. */ + id: string; + /** A timestamp recording when the task progress was last updated. */ + lastUpdate: number; + /** Information about the progress of the task. */ + message?: string; + /** The progress of the task, as a percentage complete. */ + progress: number; + result?: JsonNode; + /** The URL of the task. */ + self: string; + /** A timestamp recording when the task was started. */ + started?: number; + /** The status of the task. */ + status: 'ENQUEUED' | 'RUNNING' | 'COMPLETE' | 'FAILED' | 'CANCEL_REQUESTED' | 'CANCELLED' | 'DEAD' | string; + /** A timestamp recording when the task was submitted. */ + submitted: number; + /** The ID of the user who submitted the task. */ + submittedBy: number; +} diff --git a/src/version3/models/updateDefaultProjectClassification.ts b/src/version3/models/updateDefaultProjectClassification.ts new file mode 100644 index 0000000000..70ce9a4184 --- /dev/null +++ b/src/version3/models/updateDefaultProjectClassification.ts @@ -0,0 +1,5 @@ +/** The request for updating the default project classification level. */ +export interface UpdateDefaultProjectClassification { + /** The ID of the project classification. */ + id: string; +} diff --git a/src/version3/models/updatePrioritiesInSchemeRequest.ts b/src/version3/models/updatePrioritiesInSchemeRequest.ts new file mode 100644 index 0000000000..43fcd0e551 --- /dev/null +++ b/src/version3/models/updatePrioritiesInSchemeRequest.ts @@ -0,0 +1,7 @@ +import { PrioritySchemeChangesWithoutMappings } from './prioritySchemeChangesWithoutMappings'; + +/** Update priorities in a scheme */ +export interface UpdatePrioritiesInSchemeRequest { + add?: PrioritySchemeChangesWithoutMappings; + remove?: PrioritySchemeChangesWithoutMappings; +} diff --git a/src/version3/models/updatePriorityDetails.ts b/src/version3/models/updatePriorityDetails.ts index 7dccc516bd..5d61df8da2 100644 --- a/src/version3/models/updatePriorityDetails.ts +++ b/src/version3/models/updatePriorityDetails.ts @@ -1,11 +1,39 @@ /** Details of an issue priority. */ export interface UpdatePriorityDetails { - /** The name of the priority. Must be unique. */ - name?: string; + /** The ID for the avatar for the priority. This parameter is nullable and both iconUrl and avatarId cannot be defined. */ + avatarId?: number; /** The description of the priority. */ description?: string; - /** The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. */ - iconUrl?: string; + /** + * The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. Both + * iconUrl and avatarId cannot be defined. + * + * @deprecated This property is deprecated and will be removed in a future version. Use `avatarId` instead. + */ + iconUrl?: + | '/images/icons/priorities/blocker.png' + | '/images/icons/priorities/critical.png' + | '/images/icons/priorities/high.png' + | '/images/icons/priorities/highest.png' + | '/images/icons/priorities/low.png' + | '/images/icons/priorities/lowest.png' + | '/images/icons/priorities/major.png' + | '/images/icons/priorities/medium.png' + | '/images/icons/priorities/minor.png' + | '/images/icons/priorities/trivial.png' + | '/images/icons/priorities/blocker_new.png' + | '/images/icons/priorities/critical_new.png' + | '/images/icons/priorities/high_new.png' + | '/images/icons/priorities/highest_new.png' + | '/images/icons/priorities/low_new.png' + | '/images/icons/priorities/lowest_new.png' + | '/images/icons/priorities/major_new.png' + | '/images/icons/priorities/medium_new.png' + | '/images/icons/priorities/minor_new.png' + | '/images/icons/priorities/trivial_new.png' + | string; + /** The name of the priority. Must be unique. */ + name?: string; /** The status color of the priority in 3-digit or 6-digit hexadecimal format. */ statusColor?: string; } diff --git a/src/version3/models/updatePrioritySchemeRequest.ts b/src/version3/models/updatePrioritySchemeRequest.ts new file mode 100644 index 0000000000..95ecc0e93a --- /dev/null +++ b/src/version3/models/updatePrioritySchemeRequest.ts @@ -0,0 +1,16 @@ +import { PriorityMapping } from './priorityMapping'; +import { UpdatePrioritiesInSchemeRequest } from './updatePrioritiesInSchemeRequest'; +import { UpdateProjectsInSchemeRequest } from './updateProjectsInSchemeRequest'; + +/** Details of a priority scheme. */ +export interface UpdatePrioritySchemeRequest { + /** The default priority of the scheme. */ + defaultPriorityId?: number; + /** The description of the priority scheme. */ + description?: string; + mappings?: PriorityMapping; + /** The name of the priority scheme. Must be unique. */ + name?: string; + priorities?: UpdatePrioritiesInSchemeRequest; + projects?: UpdateProjectsInSchemeRequest; +} diff --git a/src/version3/models/updatePrioritySchemeResponse.ts b/src/version3/models/updatePrioritySchemeResponse.ts new file mode 100644 index 0000000000..236481e5b3 --- /dev/null +++ b/src/version3/models/updatePrioritySchemeResponse.ts @@ -0,0 +1,8 @@ +import { PrioritySchemeWithPaginatedPrioritiesAndProjects } from './prioritySchemeWithPaginatedPrioritiesAndProjects'; +import { TaskProgressNode } from './taskProgressNode'; + +/** Details of the updated priority scheme. */ +export interface UpdatePrioritySchemeResponse { + priorityScheme?: PrioritySchemeWithPaginatedPrioritiesAndProjects; + task?: TaskProgressNode; +} diff --git a/src/version3/models/updateProjectDetails.ts b/src/version3/models/updateProjectDetails.ts index 662e8afbdd..2c11c6591a 100644 --- a/src/version3/models/updateProjectDetails.ts +++ b/src/version3/models/updateProjectDetails.ts @@ -39,4 +39,9 @@ export interface UpdateProjectDetails { * the value to `-1.` */ categoryId?: number; + /** + * Previous project keys to be released from the current project. Released keys must belong to the current project and + * not contain the current project key + */ + releasedProjectKeys?: string[]; } diff --git a/src/version3/models/updateProjectsInSchemeRequest.ts b/src/version3/models/updateProjectsInSchemeRequest.ts new file mode 100644 index 0000000000..2269174ee8 --- /dev/null +++ b/src/version3/models/updateProjectsInSchemeRequest.ts @@ -0,0 +1,7 @@ +import { PrioritySchemeChangesWithoutMappings } from './prioritySchemeChangesWithoutMappings'; + +/** Update projects in a scheme */ +export interface UpdateProjectsInSchemeRequest { + add?: PrioritySchemeChangesWithoutMappings; + remove?: PrioritySchemeChangesWithoutMappings; +} diff --git a/src/version3/models/validationOptionsForCreate.ts b/src/version3/models/validationOptionsForCreate.ts new file mode 100644 index 0000000000..a6e052ae98 --- /dev/null +++ b/src/version3/models/validationOptionsForCreate.ts @@ -0,0 +1,7 @@ +/** + * The level of validation to return from the API. If no values are provided, the default would return `WARNING` and + * `ERROR` level validation results. + */ +export interface ValidationOptionsForCreate { + levels?: ('WARNING' | 'ERROR' | string)[]; +} diff --git a/src/version3/models/validationOptionsForUpdate.ts b/src/version3/models/validationOptionsForUpdate.ts new file mode 100644 index 0000000000..99bce46e1f --- /dev/null +++ b/src/version3/models/validationOptionsForUpdate.ts @@ -0,0 +1,7 @@ +/** + * The level of validation to return from the API. If no values are provided, the default would return `WARNING` and + * `ERROR` level validation results. + */ +export interface ValidationOptionsForUpdate { + levels?: ('WARNING' | 'ERROR' | string)[]; +} diff --git a/src/version3/models/version.ts b/src/version3/models/version.ts index fd618aefd7..67f2906852 100644 --- a/src/version3/models/version.ts +++ b/src/version3/models/version.ts @@ -1,70 +1,85 @@ -import { SimpleLink } from './simpleLink'; +import { VersionApprover } from './versionApprover'; import { VersionIssuesStatus } from './versionIssuesStatus'; +import { SimpleLink } from './simpleLink'; /** Details about a project version. */ export interface Version { + /** If the expand option `approvers` is used, returns a list containing the approvers for this version. */ + approvers?: VersionApprover[]; + /** Indicates that the version is archived. Optional when creating or updating a version. */ + archived?: boolean; + /** The description of the version. Optional when creating or updating a version. The maximum size is 16,384 bytes. */ + description?: string; + /** If the expand option `driver` is used, returns the Atlassian account ID of the driver. */ + driver?: string; /** * Use [expand](em>#expansion) to include additional information about version in the response. This parameter accepts * a comma-separated list. Expand options include: * - * `operations` Returns the list of operations available for this version. `issuesstatus` Returns the count of issues - * in this version for each of the status categories _to do_, _in progress_, _done_, and _unmapped_. The _unmapped_ - * property contains a count of issues with a status other than _to do_, _in progress_, and _done_. + * - `operations` Returns the list of operations available for this version. + * - `issuesstatus` Returns the count of issues in this version for each of the status categories _to do_, _in + * progress_, _done_, and _unmapped_. The _unmapped_ property contains a count of issues with a status other than + * _to do_, _in progress_, and _done_. + * - `driver` Returns the Atlassian account ID of the version driver. + * - `approvers` Returns a list containing approvers for this version. * * Optional for create and update. */ - expand?: string; - /** The URL of the version. */ - self?: string; + expand?: + | 'operations' + | 'issuesstatus' + | 'driver' + | 'approvers' + | ('operations' | 'issuesstatus' | 'driver' | 'approvers')[] + | string + | string[]; /** The ID of the version. */ id?: string; - /** The description of the version. Optional when creating or updating a version. */ - description?: string; + issuesStatusForFixVersion?: VersionIssuesStatus; + /** + * The URL of the self link to the version to which all unfixed issues are moved when a version is released. Not + * applicable when creating a version. Optional when updating a version. + */ + moveUnfixedIssuesTo?: string; /** * The unique name of the version. Required when creating a version. Optional when updating a version. The maximum * length is 255 characters. */ name?: string; - /** Indicates that the version is archived. Optional when creating or updating a version. */ - archived?: boolean; + /** If the expand option `operations` is used, returns the list of operations available for this version. */ + operations?: SimpleLink[]; + /** Indicates that the version is overdue. */ + overdue?: boolean; + /** + * The ID of the project to which this version is attached. Required when creating a version. Not applicable when + * updating a version. + */ + projectId?: number; + /** + * The release date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a + * version. + */ + releaseDate?: string; /** * Indicates that the version is released. If the version is released a request to release again is ignored. Not * applicable when creating a version. Optional when updating a version. */ released?: boolean; + /** The URL of the version. */ + self?: string; /** * The start date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a * version. */ startDate?: string; - /** - * The release date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a - * version. - */ - releaseDate?: string; - /** Indicates that the version is overdue. */ - overdue?: boolean; - /** - * The date on which work on this version is expected to start, expressed in the instance's _Day/Month/Year Format_ - * date format. - */ - userStartDate?: string; /** * The date on which work on this version is expected to finish, expressed in the instance's _Day/Month/Year Format_ * date format. */ userReleaseDate?: string; /** - * The ID of the project to which this version is attached. Required when creating a version. Not applicable when - * updating a version. - */ - projectId?: number; - /** - * The URL of the self link to the version to which all unfixed issues are moved when a version is released. Not - * applicable when creating a version. Optional when updating a version. + * The date on which work on this version is expected to start, expressed in the instance's _Day/Month/Year Format_ + * date format. */ - moveUnfixedIssuesTo?: string; - /** If the expand option `operations` is used, returns the list of operations available for this version. */ - operations?: SimpleLink[]; - issuesStatusForFixVersion?: VersionIssuesStatus; + userStartDate?: string; } diff --git a/src/version3/models/versionApprover.ts b/src/version3/models/versionApprover.ts new file mode 100644 index 0000000000..ab2a639679 --- /dev/null +++ b/src/version3/models/versionApprover.ts @@ -0,0 +1,11 @@ +/** Contains details about a version approver. */ +export interface VersionApprover { + /** The Atlassian account ID of the approver. */ + accountId?: string; + /** A description of why the user is declining the approval. */ + declineReason?: string; + /** A description of what the user is approving within the specified version. */ + description?: string; + /** The status of the approval, which can be _PENDING_, _APPROVED_, or _DECLINED_ */ + status?: 'PENDING' | 'APPROVED' | 'DECLINED' | string; +} diff --git a/src/version3/models/versionRelatedWork.ts b/src/version3/models/versionRelatedWork.ts new file mode 100644 index 0000000000..d8e8e88a06 --- /dev/null +++ b/src/version3/models/versionRelatedWork.ts @@ -0,0 +1,16 @@ +/** Associated related work to a version */ +export interface VersionRelatedWork { + /** The category of the related work */ + category: string; + /** The ID of the issue associated with the related work (if there is one). Cannot be updated via the Rest API. */ + issueId?: number; + /** + * The id of the related work. For the native release note related work item, this will be null, and Rest API does not + * support updating it. + */ + relatedWorkId?: string; + /** The title of the related work */ + title?: string; + /** The URL of the related work. Will be null for the native release note related work item, but is otherwise required. */ + url?: string; +} diff --git a/src/version3/models/workflowAssociationStatusMapping.ts b/src/version3/models/workflowAssociationStatusMapping.ts new file mode 100644 index 0000000000..17d5e22fe6 --- /dev/null +++ b/src/version3/models/workflowAssociationStatusMapping.ts @@ -0,0 +1,7 @@ +/** The list of status mappings. */ +export interface WorkflowAssociationStatusMapping { + /** The ID of the status in the new workflow. */ + newStatusId: string; + /** The ID of the status in the old workflow that isn't present in the new workflow. */ + oldStatusId: string; +} diff --git a/src/version3/models/workflowCapabilities.ts b/src/version3/models/workflowCapabilities.ts new file mode 100644 index 0000000000..57c9c17d0a --- /dev/null +++ b/src/version3/models/workflowCapabilities.ts @@ -0,0 +1,5 @@ +export interface WorkflowCapabilities { + workflowId?: string; + projectId?: string; + issueTypeId?: string; +} diff --git a/src/version2/models/workflowCreateResponse.ts b/src/version3/models/workflowCreate.ts similarity index 87% rename from src/version2/models/workflowCreateResponse.ts rename to src/version3/models/workflowCreate.ts index 1600d3ce86..1f6ff11d5f 100644 --- a/src/version2/models/workflowCreateResponse.ts +++ b/src/version3/models/workflowCreate.ts @@ -1,8 +1,8 @@ -import { JiraWorkflow } from './jiraWorkflow'; import { JiraWorkflowStatus } from './jiraWorkflowStatus'; +import { JiraWorkflow } from './jiraWorkflow'; /** Details of the created workflows and statuses. */ -export interface WorkflowCreateResponse { +export interface WorkflowCreate { /** List of created statuses. */ statuses?: JiraWorkflowStatus[]; /** List of created workflows. */ diff --git a/src/version3/models/workflowCreateRequest.ts b/src/version3/models/workflowCreateRequest.ts new file mode 100644 index 0000000000..421fcde858 --- /dev/null +++ b/src/version3/models/workflowCreateRequest.ts @@ -0,0 +1,12 @@ +import { WorkflowScope } from './workflowScope'; +import { WorkflowStatusUpdate } from './workflowStatusUpdate'; +import { WorkflowCreate } from './workflowCreate'; + +/** The create workflows payload. */ +export interface WorkflowCreateRequest { + scope: WorkflowScope; + /** The statuses to associate with the workflows. */ + statuses: WorkflowStatusUpdate[]; + /** The details of the workflows to create. */ + workflows: WorkflowCreate[]; +} diff --git a/src/version3/models/workflowElementReference.ts b/src/version3/models/workflowElementReference.ts new file mode 100644 index 0000000000..e0b0ed2390 --- /dev/null +++ b/src/version3/models/workflowElementReference.ts @@ -0,0 +1,14 @@ +import { ProjectAndIssueTypePair } from './projectAndIssueTypePair'; + +/** A reference to the location of the error. This will be null if the error does not refer to a specific element. */ +export interface WorkflowElementReference { + /** A property key. */ + propertyKey?: string; + /** A rule ID. */ + ruleId?: string; + statusMappingReference?: ProjectAndIssueTypePair; + /** A status reference. */ + statusReference?: string; + /** A transition ID. */ + transitionId?: string; +} diff --git a/src/version3/models/workflowLayout.ts b/src/version3/models/workflowLayout.ts new file mode 100644 index 0000000000..a11cd570b1 --- /dev/null +++ b/src/version3/models/workflowLayout.ts @@ -0,0 +1,7 @@ +/** The starting point for the statuses in the workflow. */ +export interface WorkflowLayout { + /** The x axis location. */ + x?: number; + /** The y axis location. */ + y?: number; +} diff --git a/src/version3/models/workflowMetadataAndIssueTypeRestModel.ts b/src/version3/models/workflowMetadataAndIssueTypeRestModel.ts new file mode 100644 index 0000000000..b418fdf196 --- /dev/null +++ b/src/version3/models/workflowMetadataAndIssueTypeRestModel.ts @@ -0,0 +1,8 @@ +import { WorkflowMetadataRestModel } from './workflowMetadataRestModel'; + +/** The workflow metadata and issue type IDs which use this workflow. */ +export interface WorkflowMetadataAndIssueTypeRestModel { + /** The list of issue type IDs for the mapping. */ + issueTypeIds: string[]; + workflow: WorkflowMetadataRestModel; +} diff --git a/src/version3/models/workflowMetadataRestModel.ts b/src/version3/models/workflowMetadataRestModel.ts new file mode 100644 index 0000000000..c09800a0aa --- /dev/null +++ b/src/version3/models/workflowMetadataRestModel.ts @@ -0,0 +1,21 @@ +import { SimpleUsage } from './simpleUsage'; +import { DocumentVersion } from './documentVersion'; + +/** Workflow metadata and usage detail. */ +export interface WorkflowMetadataRestModel { + /** The description of the workflow. */ + description: string; + /** The ID of the workflow. */ + id: string; + /** The name of the workflow. */ + name: string; + /** + * @deprecated See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298) for details. + * + * Use the optional `workflows.usages` expand to get additional information about the projects and issue types + * associated with the workflows in the workflow scheme. + */ + usage?: SimpleUsage[]; + version: DocumentVersion; +} diff --git a/src/version3/models/workflowProjectIssueTypeUsage.ts b/src/version3/models/workflowProjectIssueTypeUsage.ts new file mode 100644 index 0000000000..9545964f09 --- /dev/null +++ b/src/version3/models/workflowProjectIssueTypeUsage.ts @@ -0,0 +1,10 @@ +import { WorkflowProjectIssueTypeUsagePage } from './workflowProjectIssueTypeUsagePage'; + +/** Issue types associated with the workflow for a project. */ +export interface WorkflowProjectIssueTypeUsage { + issueTypes?: WorkflowProjectIssueTypeUsagePage; + /** The ID of the project. */ + projectId?: string; + /** The ID of the workflow. */ + workflowId?: string; +} diff --git a/src/version3/models/workflowProjectIssueTypeUsagePage.ts b/src/version3/models/workflowProjectIssueTypeUsagePage.ts new file mode 100644 index 0000000000..33efc451d8 --- /dev/null +++ b/src/version3/models/workflowProjectIssueTypeUsagePage.ts @@ -0,0 +1,9 @@ +import { WorkflowProjectIssueTypeUsage } from './workflowProjectIssueTypeUsage'; + +/** A page of issue types. */ +export interface WorkflowProjectIssueTypeUsagePage { + /** Token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of issue types. */ + values?: WorkflowProjectIssueTypeUsage[]; +} diff --git a/src/version3/models/workflowProjectUsage.ts b/src/version3/models/workflowProjectUsage.ts new file mode 100644 index 0000000000..6276eb98c4 --- /dev/null +++ b/src/version3/models/workflowProjectUsage.ts @@ -0,0 +1,8 @@ +import { ProjectUsagePage } from './projectUsagePage'; + +/** Projects using the workflow. */ +export interface WorkflowProjectUsage { + projects?: ProjectUsagePage; + /** The workflow ID. */ + workflowId?: string; +} diff --git a/src/version3/models/workflowRead.ts b/src/version3/models/workflowRead.ts new file mode 100644 index 0000000000..8f1a0ba12e --- /dev/null +++ b/src/version3/models/workflowRead.ts @@ -0,0 +1,10 @@ +import { JiraWorkflowStatus } from './jiraWorkflowStatus'; +import { JiraWorkflow } from './jiraWorkflow'; + +/** Details of workflows and related statuses. */ +export interface WorkflowRead { + /** List of statuses. */ + statuses?: JiraWorkflowStatus[]; + /** List of workflows. */ + workflows?: JiraWorkflow[]; +} diff --git a/src/version3/models/workflowReferenceStatus.ts b/src/version3/models/workflowReferenceStatus.ts new file mode 100644 index 0000000000..b90ef319ad --- /dev/null +++ b/src/version3/models/workflowReferenceStatus.ts @@ -0,0 +1,14 @@ +import { ApprovalConfiguration } from './approvalConfiguration'; +import { WorkflowStatusLayout } from './workflowStatusLayout'; + +/** The statuses referenced in the workflow. */ +export interface WorkflowReferenceStatus { + approvalConfiguration?: ApprovalConfiguration; + /** Indicates if the status is deprecated. */ + deprecated?: boolean; + layout?: WorkflowStatusLayout; + /** The properties associated with the status. */ + properties?: {}; + /** The reference of the status. */ + statusReference?: string; +} diff --git a/src/version3/models/workflowRuleConfiguration.ts b/src/version3/models/workflowRuleConfiguration.ts new file mode 100644 index 0000000000..1df368717b --- /dev/null +++ b/src/version3/models/workflowRuleConfiguration.ts @@ -0,0 +1,9 @@ +/** The configuration of the rule. */ +export interface WorkflowRuleConfiguration { + /** The ID of the rule. */ + id?: string; + /** The parameters related to the rule. */ + parameters?: {}; + /** The rule key of the rule. */ + ruleKey: string; +} diff --git a/src/version3/models/workflowSchemeAssociation.ts b/src/version3/models/workflowSchemeAssociation.ts new file mode 100644 index 0000000000..9e119c9edb --- /dev/null +++ b/src/version3/models/workflowSchemeAssociation.ts @@ -0,0 +1,7 @@ +/** The explicit association between issue types and a workflow in a workflow scheme. */ +export interface WorkflowSchemeAssociation { + /** The issue types assigned to the workflow. */ + issueTypeIds: string[]; + /** The ID of the workflow. */ + workflowId: string; +} diff --git a/src/version3/models/workflowSchemeProjectUsage.ts b/src/version3/models/workflowSchemeProjectUsage.ts new file mode 100644 index 0000000000..525818ea3b --- /dev/null +++ b/src/version3/models/workflowSchemeProjectUsage.ts @@ -0,0 +1,8 @@ +import { ProjectUsagePage } from './projectUsagePage'; + +/** Projects using the workflow scheme. */ +export interface WorkflowSchemeProjectUsage { + projects?: ProjectUsagePage; + /** The workflow scheme ID. */ + workflowSchemeId?: string; +} diff --git a/src/version3/models/workflowSchemeReadRequest.ts b/src/version3/models/workflowSchemeReadRequest.ts new file mode 100644 index 0000000000..448fe7361e --- /dev/null +++ b/src/version3/models/workflowSchemeReadRequest.ts @@ -0,0 +1,7 @@ +/** The workflow scheme read request body. */ +export interface WorkflowSchemeReadRequest { + /** The list of project IDs to query. */ + projectIds?: string[]; + /** The list of workflow scheme IDs to query. */ + workflowSchemeIds?: string[]; +} diff --git a/src/version3/models/workflowSchemeReadResponse.ts b/src/version3/models/workflowSchemeReadResponse.ts new file mode 100644 index 0000000000..657d771690 --- /dev/null +++ b/src/version3/models/workflowSchemeReadResponse.ts @@ -0,0 +1,20 @@ +import { WorkflowMetadataRestModel } from './workflowMetadataRestModel'; +import { WorkflowScope } from './workflowScope'; +import { DocumentVersion } from './documentVersion'; +import { WorkflowMetadataAndIssueTypeRestModel } from './workflowMetadataAndIssueTypeRestModel'; + +export interface WorkflowSchemeReadResponse { + defaultWorkflow?: WorkflowMetadataRestModel; + /** The description of the workflow scheme. */ + description?: string; + /** The ID of the workflow scheme. */ + id: string; + /** The name of the workflow scheme. */ + name: string; + scope: WorkflowScope; + /** Indicates if there's an [asynchronous task](#async-operations) for this workflow scheme. */ + taskId?: string; + version: DocumentVersion; + /** Mappings from workflows to issue types. */ + workflowsForIssueTypes: WorkflowMetadataAndIssueTypeRestModel[]; +} diff --git a/src/version3/models/workflowSchemeUpdateRequiredMappingsResponse.ts b/src/version3/models/workflowSchemeUpdateRequiredMappingsResponse.ts new file mode 100644 index 0000000000..c0ca2ff563 --- /dev/null +++ b/src/version3/models/workflowSchemeUpdateRequiredMappingsResponse.ts @@ -0,0 +1,15 @@ +import { RequiredMappingByIssueType } from './requiredMappingByIssueType'; +import { RequiredMappingByWorkflows } from './requiredMappingByWorkflows'; +import { StatusMetadata } from './statusMetadata'; +import { StatusesPerWorkflow } from './statusesPerWorkflow'; + +export interface WorkflowSchemeUpdateRequiredMappingsResponse { + /** The list of required status mappings by issue type. */ + statusMappingsByIssueTypes?: RequiredMappingByIssueType[]; + /** The list of required status mappings by workflow. */ + statusMappingsByWorkflows?: RequiredMappingByWorkflows[]; + /** The details of the statuses in the associated workflows. */ + statuses?: StatusMetadata[]; + /** The statuses associated with each workflow. */ + statusesPerWorkflow?: StatusesPerWorkflow[]; +} diff --git a/src/version3/models/workflowSchemeUsage.ts b/src/version3/models/workflowSchemeUsage.ts new file mode 100644 index 0000000000..0c28522096 --- /dev/null +++ b/src/version3/models/workflowSchemeUsage.ts @@ -0,0 +1,8 @@ +import { WorkflowSchemeUsagePage } from './workflowSchemeUsagePage'; + +/** Workflow schemes using the workflow. */ +export interface WorkflowSchemeUsage { + /** The workflow ID. */ + workflowId?: string; + workflowSchemes?: WorkflowSchemeUsagePage; +} diff --git a/src/version3/models/workflowSchemeUsagePage.ts b/src/version3/models/workflowSchemeUsagePage.ts new file mode 100644 index 0000000000..5b883978f6 --- /dev/null +++ b/src/version3/models/workflowSchemeUsagePage.ts @@ -0,0 +1,9 @@ +import { WorkflowSchemeUsage } from './workflowSchemeUsage'; + +/** A page of workflow schemes. */ +export interface WorkflowSchemeUsagePage { + /** Token for the next page of issue type usages. */ + nextPageToken?: string; + /** The list of workflow schemes. */ + values?: WorkflowSchemeUsage[]; +} diff --git a/src/version3/models/workflowScope.ts b/src/version3/models/workflowScope.ts new file mode 100644 index 0000000000..1ab974f921 --- /dev/null +++ b/src/version3/models/workflowScope.ts @@ -0,0 +1,8 @@ +import { ProjectId } from './projectId'; + +/** The scope of the workflow. */ +export interface WorkflowScope { + project?: ProjectId; + /** The scope of the workflow. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ + type: 'PROJECT' | 'GLOBAL' | string; +} diff --git a/src/version3/models/workflowSearchResponse.ts b/src/version3/models/workflowSearchResponse.ts new file mode 100644 index 0000000000..966016a32a --- /dev/null +++ b/src/version3/models/workflowSearchResponse.ts @@ -0,0 +1,22 @@ +import { JiraWorkflowStatus } from './jiraWorkflowStatus'; +import { JiraWorkflow } from './jiraWorkflow'; + +/** Page of items, including workflows and related statuses. */ +export interface WorkflowSearchResponse { + /** Whether this is the last page. */ + isLast?: boolean; + /** The maximum number of items that could be returned. */ + maxResults?: number; + /** If there is another page of results, the URL of the next page. */ + nextPage?: string; + /** The URL of the page. */ + self?: string; + /** The index of the first item returned. */ + startAt?: number; + /** List of statuses. */ + statuses?: JiraWorkflowStatus[]; + /** The number of items returned. */ + total?: number; + /** List of workflows. */ + values?: JiraWorkflow[]; +} diff --git a/src/version3/models/workflowStatusAndPort.ts b/src/version3/models/workflowStatusAndPort.ts new file mode 100644 index 0000000000..1ef65ed402 --- /dev/null +++ b/src/version3/models/workflowStatusAndPort.ts @@ -0,0 +1,7 @@ +/** The status reference and port that a transition is connected to. */ +export interface WorkflowStatusAndPort { + /** The port the transition is connected to this status. */ + port?: number; + /** The reference of this status. */ + statusReference?: string; +} diff --git a/src/version3/models/workflowStatusLayout.ts b/src/version3/models/workflowStatusLayout.ts new file mode 100644 index 0000000000..2b760493dc --- /dev/null +++ b/src/version3/models/workflowStatusLayout.ts @@ -0,0 +1,7 @@ +/** The x and y location of the status in the workflow. */ +export interface WorkflowStatusLayout { + /** The x axis location. */ + x?: number; + /** The y axis location. */ + y?: number; +} diff --git a/src/version3/models/workflowStatusUpdate.ts b/src/version3/models/workflowStatusUpdate.ts new file mode 100644 index 0000000000..c77a22921a --- /dev/null +++ b/src/version3/models/workflowStatusUpdate.ts @@ -0,0 +1,13 @@ +/** Details of the status being updated. */ +export interface WorkflowStatusUpdate { + /** The description of the status. */ + description?: string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name: string; + /** The category of the status. */ + statusCategory: 'TODO' | 'IN_PROGRESS' | 'DONE' | string; + /** The reference of the status. */ + statusReference: string; +} diff --git a/src/version3/models/workflowTransitionLinks.ts b/src/version3/models/workflowTransitionLinks.ts new file mode 100644 index 0000000000..a6cb549dbe --- /dev/null +++ b/src/version3/models/workflowTransitionLinks.ts @@ -0,0 +1,9 @@ +/** The statuses the transition can start from, and the mapping of ports between the statuses. */ +export interface WorkflowTransitionLinks { + /** The port that the transition starts from. */ + fromPort?: number; + /** The status that the transition starts from. */ + fromStatusReference?: string; + /** The port that the transition goes to. */ + toPort?: number; +} diff --git a/src/version3/models/workflowTransitions.ts b/src/version3/models/workflowTransitions.ts new file mode 100644 index 0000000000..edbca4cac9 --- /dev/null +++ b/src/version3/models/workflowTransitions.ts @@ -0,0 +1,42 @@ +import { WorkflowRuleConfiguration } from './workflowRuleConfiguration'; +import { ConditionGroupConfiguration } from './conditionGroupConfiguration'; +import { WorkflowStatusAndPort } from './workflowStatusAndPort'; +import { WorkflowTransitionLinks } from './workflowTransitionLinks'; +import { WorkflowTrigger } from './workflowTrigger'; + +/** + * The transitions of the workflow. Note that a transition can have either the deprecated `to`/`from` fields or the + * `toStatusReference`/`links` fields, but never both nor a combination. + */ +export interface WorkflowTransitions { + /** The post-functions of the transition. */ + actions?: WorkflowRuleConfiguration[]; + conditions?: ConditionGroupConfiguration; + /** The custom event ID of the transition. */ + customIssueEventId?: string; + /** The description of the transition. */ + description?: string; + /** + * The statuses and ports that the transition can start from. This field is deprecated - use + * `toStatusReference`/`links` instead. + */ + from?: WorkflowStatusAndPort[]; + /** The ID of the transition. */ + id?: string; + /** The statuses the transition can start from, and the mapping of ports between the statuses. */ + links?: WorkflowTransitionLinks[]; + /** The name of the transition. */ + name?: string; + /** The properties of the transition. */ + properties?: {}; + to?: WorkflowStatusAndPort; + /** The status the transition goes to. */ + toStatusReference?: string; + transitionScreen?: WorkflowRuleConfiguration; + /** The triggers of the transition. */ + triggers?: WorkflowTrigger[]; + /** The transition type. */ + type?: 'INITIAL' | 'GLOBAL' | 'DIRECTED' | string; + /** The validators of the transition. */ + validators?: WorkflowRuleConfiguration[]; +} diff --git a/src/version3/models/workflowTrigger.ts b/src/version3/models/workflowTrigger.ts new file mode 100644 index 0000000000..410c0ada8b --- /dev/null +++ b/src/version3/models/workflowTrigger.ts @@ -0,0 +1,9 @@ +/** The trigger configuration associated with a workflow. */ +export interface WorkflowTrigger { + /** The ID of the trigger. */ + id?: string; + /** The parameters of the trigger. */ + parameters: {}; + /** The rule key of the trigger. */ + ruleKey: string; +} diff --git a/src/version2/models/workflowUpdateResponse.ts b/src/version3/models/workflowUpdate.ts similarity index 89% rename from src/version2/models/workflowUpdateResponse.ts rename to src/version3/models/workflowUpdate.ts index 57e60d99dd..f62b866097 100644 --- a/src/version2/models/workflowUpdateResponse.ts +++ b/src/version3/models/workflowUpdate.ts @@ -1,7 +1,7 @@ -import { JiraWorkflow } from './jiraWorkflow'; import { JiraWorkflowStatus } from './jiraWorkflowStatus'; +import { JiraWorkflow } from './jiraWorkflow'; -export interface WorkflowUpdateResponse { +export interface WorkflowUpdate { /** List of updated statuses. */ statuses?: JiraWorkflowStatus[]; /** If there is a [asynchronous task](#async-operations) operation, as a result of this update. */ diff --git a/src/version3/models/workflowUpdateRequest.ts b/src/version3/models/workflowUpdateRequest.ts new file mode 100644 index 0000000000..7f5c7e9b17 --- /dev/null +++ b/src/version3/models/workflowUpdateRequest.ts @@ -0,0 +1,10 @@ +import { WorkflowStatusUpdate } from './workflowStatusUpdate'; +import { WorkflowUpdate } from './workflowUpdate'; + +/** The update workflows payload. */ +export interface WorkflowUpdateRequest { + /** The statuses to associate with the workflows. */ + statuses: WorkflowStatusUpdate[]; + /** The details of the workflows to update. */ + workflows: WorkflowUpdate[]; +} diff --git a/src/version3/models/workflowUpdateValidateRequest.ts b/src/version3/models/workflowUpdateValidateRequest.ts new file mode 100644 index 0000000000..8fcd81fead --- /dev/null +++ b/src/version3/models/workflowUpdateValidateRequest.ts @@ -0,0 +1,7 @@ +import { WorkflowUpdateRequest } from './workflowUpdateRequest'; +import { ValidationOptionsForUpdate } from './validationOptionsForUpdate'; + +export interface WorkflowUpdateValidateRequest { + payload: WorkflowUpdateRequest; + validationOptions?: ValidationOptionsForUpdate; +} diff --git a/src/version3/models/workflowValidationError.ts b/src/version3/models/workflowValidationError.ts new file mode 100644 index 0000000000..5a0408d3e6 --- /dev/null +++ b/src/version3/models/workflowValidationError.ts @@ -0,0 +1,25 @@ +import { WorkflowElementReference } from './workflowElementReference'; + +/** The details about a workflow validation error. */ +export interface WorkflowValidationError { + /** An error code. */ + code?: string; + elementReference?: WorkflowElementReference; + /** The validation error level. */ + level?: 'WARNING' | 'ERROR' | string; + /** An error message. */ + message?: string; + /** The type of element the error or warning references. */ + type?: + | 'RULE' + | 'STATUS' + | 'STATUS_LAYOUT' + | 'STATUS_PROPERTY' + | 'WORKFLOW' + | 'TRANSITION' + | 'TRANSITION_PROPERTY' + | 'SCOPE' + | 'STATUS_MAPPING' + | 'TRIGGER' + | string; +} diff --git a/src/version3/models/workflowValidationErrorList.ts b/src/version3/models/workflowValidationErrorList.ts new file mode 100644 index 0000000000..95e3690a4d --- /dev/null +++ b/src/version3/models/workflowValidationErrorList.ts @@ -0,0 +1,6 @@ +import { WorkflowValidationError } from './workflowValidationError'; + +export interface WorkflowValidationErrorList { + /** The list of validation errors. */ + errors?: WorkflowValidationError[]; +} diff --git a/src/version3/models/worklogsMoveRequest.ts b/src/version3/models/worklogsMoveRequest.ts new file mode 100644 index 0000000000..212d9419a7 --- /dev/null +++ b/src/version3/models/worklogsMoveRequest.ts @@ -0,0 +1,6 @@ +export interface WorklogsMoveRequest { + /** A list of worklog IDs. */ + ids?: number[]; + /** The issue id or key of the destination issue */ + issueIdOrKey?: string; +} diff --git a/src/version3/models/workspaceDataPolicy.ts b/src/version3/models/workspaceDataPolicy.ts new file mode 100644 index 0000000000..03090c03d6 --- /dev/null +++ b/src/version3/models/workspaceDataPolicy.ts @@ -0,0 +1,5 @@ +/** Details about data policy. */ +export interface WorkspaceDataPolicy { + /** Whether the workspace contains any content inaccessible to the requesting application. */ + anyContentBlocked: boolean; +} diff --git a/src/version3/myself.ts b/src/version3/myself.ts index c7b333331f..cc2ea6e448 100644 --- a/src/version3/myself.ts +++ b/src/version3/myself.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 Myself { @@ -17,6 +17,14 @@ export class Myself { * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the * instance. * + * These system preferences keys will be deprecated by 15/07/2024. You can still retrieve these keys, but it will not + * have any impact on Notification behaviour. + * + * - _user.notifications.watcher_ Whether the user gets notified when they are watcher. + * - _user.notifications.assignee_ Whether the user gets notified when they are assignee. + * - _user.notifications.reporter_ Whether the user gets notified when they are reporter. + * - _user.notifications.mentions_ Whether the user gets notified when they are mentions. + * * Use [ Update a user * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) * from the user management REST API to manage timezone and locale instead. @@ -35,6 +43,14 @@ export class Myself { * - _jira.user.timezone_ The time zone of the user. By default this is not set and the user takes the timezone of the * instance. * + * These system preferences keys will be deprecated by 15/07/2024. You can still retrieve these keys, but it will not + * have any impact on Notification behaviour. + * + * - _user.notifications.watcher_ Whether the user gets notified when they are watcher. + * - _user.notifications.assignee_ Whether the user gets notified when they are assignee. + * - _user.notifications.reporter_ Whether the user gets notified when they are reporter. + * - _user.notifications.mentions_ Whether the user gets notified when they are mentions. + * * Use [ Update a user * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) * from the user management REST API to manage timezone and locale instead. @@ -61,18 +77,26 @@ export class Myself { * following keys define system preferences that can be set or created: * * - _user.notifications.mimetype_ The mime type used in notifications sent to the user. Defaults to `html`. - * - _user.notify.own.changes_ Whether the user gets notified of their own changes. Defaults to `false`. * - _user.default.share.private_ Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. * Defaults to `true`. * - _user.keyboard.shortcuts.disabled_ Whether keyboard shortcuts are disabled. Defaults to `false`. * - _user.autowatch.disabled_ Whether the user automatically watches issues they create or add a comment to. By * default, not set: the user takes the instance autowatch setting. + * - _user.notifiy.own.changes_ Whether the user gets notified of their own changes. * * Note that these keys are deprecated: * * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. * + * These system preferences keys will be deprecated by 15/07/2024. You can still use these keys to create arbitrary + * preferences, but it will not have any impact on Notification behaviour. + * + * - _user.notifications.watcher_ Whether the user gets notified when they are watcher. + * - _user.notifications.assignee_ Whether the user gets notified when they are assignee. + * - _user.notifications.reporter_ Whether the user gets notified when they are reporter. + * - _user.notifications.mentions_ Whether the user gets notified when they are mentions. + * * Use [ Update a user * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) * from the user management REST API to manage timezone and locale instead. @@ -87,18 +111,26 @@ export class Myself { * following keys define system preferences that can be set or created: * * - _user.notifications.mimetype_ The mime type used in notifications sent to the user. Defaults to `html`. - * - _user.notify.own.changes_ Whether the user gets notified of their own changes. Defaults to `false`. * - _user.default.share.private_ Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. * Defaults to `true`. * - _user.keyboard.shortcuts.disabled_ Whether keyboard shortcuts are disabled. Defaults to `false`. * - _user.autowatch.disabled_ Whether the user automatically watches issues they create or add a comment to. By * default, not set: the user takes the instance autowatch setting. + * - _user.notifiy.own.changes_ Whether the user gets notified of their own changes. * * Note that these keys are deprecated: * * - _jira.user.locale_ The locale of the user. By default, not set. The user takes the instance locale. * - _jira.user.timezone_ The time zone of the user. By default, not set. The user takes the instance timezone. * + * These system preferences keys will be deprecated by 15/07/2024. You can still use these keys to create arbitrary + * preferences, but it will not have any impact on Notification behaviour. + * + * - _user.notifications.watcher_ Whether the user gets notified when they are watcher. + * - _user.notifications.assignee_ Whether the user gets notified when they are assignee. + * - _user.notifications.reporter_ Whether the user gets notified when they are reporter. + * - _user.notifications.mentions_ Whether the user gets notified when they are mentions. + * * Use [ Update a user * profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) * from the user management REST API to manage timezone and locale instead. diff --git a/src/version3/parameters/addActorUsers.ts b/src/version3/parameters/addActorUsers.ts index 7126621c61..fb100a72ab 100644 --- a/src/version3/parameters/addActorUsers.ts +++ b/src/version3/parameters/addActorUsers.ts @@ -2,7 +2,7 @@ import { ActorsMap } from '../models'; export interface AddActorUsers extends ActorsMap { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role * IDs. diff --git a/src/version3/parameters/addAtlassianTeam.ts b/src/version3/parameters/addAtlassianTeam.ts new file mode 100644 index 0000000000..78138433d5 --- /dev/null +++ b/src/version3/parameters/addAtlassianTeam.ts @@ -0,0 +1,14 @@ +export interface AddAtlassianTeam { + /** The ID of the plan. */ + planId: number; + /** The capacity for the Atlassian team. */ + capacity?: number; + /** The Atlassian team ID. */ + id: string; + /** The ID of the issue source for the Atlassian team. */ + issueSourceId?: number; + /** The planning style for the Atlassian team. This must be "Scrum" or "Kanban". */ + planningStyle: 'Scrum' | 'Kanban' | string; + /** The sprint length for the Atlassian team. */ + sprintLength?: number; +} diff --git a/src/version3/parameters/addNotifications.ts b/src/version3/parameters/addNotifications.ts new file mode 100644 index 0000000000..180d1ed1de --- /dev/null +++ b/src/version3/parameters/addNotifications.ts @@ -0,0 +1,8 @@ +import { NotificationSchemeEventDetails } from '../models'; + +export interface AddNotifications { + /** The ID of the notification scheme. */ + id: string; + /** The list of notifications which should be added to the notification scheme. */ + notificationSchemeEvents: NotificationSchemeEventDetails[]; +} diff --git a/src/version3/parameters/archivePlan.ts b/src/version3/parameters/archivePlan.ts new file mode 100644 index 0000000000..250cc9759f --- /dev/null +++ b/src/version3/parameters/archivePlan.ts @@ -0,0 +1,4 @@ +export interface ArchivePlan { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version3/parameters/archiveProject.ts b/src/version3/parameters/archiveProject.ts index 6030877bc8..21f2d1c389 100644 --- a/src/version3/parameters/archiveProject.ts +++ b/src/version3/parameters/archiveProject.ts @@ -1,4 +1,4 @@ export interface ArchiveProject { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version3/parameters/bulkDeleteWorklogs.ts b/src/version3/parameters/bulkDeleteWorklogs.ts new file mode 100644 index 0000000000..ed41bd5cab --- /dev/null +++ b/src/version3/parameters/bulkDeleteWorklogs.ts @@ -0,0 +1,19 @@ +import { WorklogIdsRequest } from '../models'; + +export interface BulkDeleteWorklogs extends WorklogIdsRequest { + /** The ID or key of the issue. */ + issueIdOrKey: string; + /** + * Defines how to update the issue's time estimate, the options are: + * + * - `leave` Leaves the estimate unchanged. + * - `auto` Reduces the estimate by the aggregate value of `timeSpent` across all worklogs being deleted. + */ + adjustEstimate?: 'leave' | 'auto' | string; + /** + * Whether the work log entries should be removed to the issue even if the issue is not editable, because + * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with + * admin permission can use this flag. + */ + overrideEditableFlag?: boolean; +} diff --git a/src/version3/parameters/bulkFetchIssues.ts b/src/version3/parameters/bulkFetchIssues.ts new file mode 100644 index 0000000000..15dc76328d --- /dev/null +++ b/src/version3/parameters/bulkFetchIssues.ts @@ -0,0 +1,68 @@ +export interface BulkFetchIssues { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about issues in the response. Note that, unlike the majority of instances where `expand` is specified, + * `expand` is defined as a list of values. The expand options are: + * + * - `renderedFields` Returns field values rendered in HTML format. + * - `names` Returns the display name of each field. + * - `schema` Returns the schema describing a field type. + * - `transitions` Returns all possible transitions for the issue. + * - `operations` Returns all possible operations for the issue. + * - `editmeta` Returns information about how each field can be edited. + * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each + * version of a field's value, with the highest numbered item representing the most recent version. + */ + expand?: + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | string + | ( + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | string + )[]; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a + * comma-separated list. Expand options include: + * + * - `*all` Returns all fields. + * - `*navigable` Returns navigable fields. + * - Any issue field, prefixed with a minus to exclude. + * + * The default is `*navigable`. + * + * Examples: + * - `summary,comment` Returns the summary and comments fields only. + * - `-description` Returns all navigable (default) fields except description. + * - `*all,-comment` Returns all fields except comments. + * + * Multiple `fields` parameters can be included in a request. + * + * Note: All navigable fields are returned by default. This differs from [GET + * issue](#api-rest-api-3-issue-issueIdOrKey-get) where the default is all fields. + */ + fields?: ('*all' | '*navigable' | string)[]; + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys?: boolean; + /** An array of issue IDs or issue keys to fetch. You can mix issue IDs and keys in the same query. */ + issueIdsOrKeys: string[]; + /** + * A list of issue property keys of issue properties to be included in the results. A maximum of 5 issue property keys + * can be specified. + */ + properties?: string[]; +} diff --git a/src/version3/parameters/bulkMoveWorklogs.ts b/src/version3/parameters/bulkMoveWorklogs.ts new file mode 100644 index 0000000000..6e87b7d393 --- /dev/null +++ b/src/version3/parameters/bulkMoveWorklogs.ts @@ -0,0 +1,20 @@ +import { WorklogsMoveRequest } from '../models'; + +export interface BulkMoveWorklogs { + issueIdOrKey: string; + /** + * Defines how to update the issues' time estimate, the options are: + * + * - `leave` Leaves the estimate unchanged. + * - `auto` Reduces the estimate by the aggregate value of `timeSpent` across all worklogs being moved in the source + * issue, and increases it in the destination issue. + */ + adjustEstimate?: 'leave' | 'auto' | string; + /** + * Whether the work log entry should be moved to and from the issues even if the issues are not editable, because + * jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with + * admin permission can use this flag. + */ + overrideEditableFlag?: boolean; + worklogs: WorklogsMoveRequest; +} diff --git a/src/version3/parameters/copyDashboard.ts b/src/version3/parameters/copyDashboard.ts index 1e157d012e..905415da28 100644 --- a/src/version3/parameters/copyDashboard.ts +++ b/src/version3/parameters/copyDashboard.ts @@ -2,4 +2,9 @@ import { DashboardDetails } from '../models'; export interface CopyDashboard extends DashboardDetails { id: string; + /** + * Whether admin level permissions are used. It should only be true if the user has _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) + */ + extendAdminPermissions?: boolean; } diff --git a/src/version3/parameters/countIssues.ts b/src/version3/parameters/countIssues.ts new file mode 100644 index 0000000000..527120f2a4 --- /dev/null +++ b/src/version3/parameters/countIssues.ts @@ -0,0 +1,3 @@ +import { JQLCountRequest } from '../models'; + +export interface CountIssues extends JQLCountRequest {} diff --git a/src/version3/parameters/createDashboard.ts b/src/version3/parameters/createDashboard.ts index eb78135c41..372243bbac 100644 --- a/src/version3/parameters/createDashboard.ts +++ b/src/version3/parameters/createDashboard.ts @@ -3,4 +3,9 @@ import { DashboardDetails, SharePermission } from '../models'; export interface CreateDashboard extends Omit { /** The edit permissions for the dashboard. */ editPermissions?: SharePermission[]; + /** + * Whether admin level permissions are used. It should only be true if the user has _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) + */ + extendAdminPermissions?: boolean; } diff --git a/src/version3/parameters/createIssueTypeAvatar.ts b/src/version3/parameters/createIssueTypeAvatar.ts index ba645723db..b463b3f791 100644 --- a/src/version3/parameters/createIssueTypeAvatar.ts +++ b/src/version3/parameters/createIssueTypeAvatar.ts @@ -5,6 +5,12 @@ export interface CreateIssueTypeAvatar { x?: number; /** The Y coordinate of the top-left corner of the crop region. */ y?: number; - /** The length of each side of the crop region. */ - size: number; + /** + * The length of each side of the crop region. + * + * @default 0 + */ + size?: number; + mimeType: string; + avatar: Buffer | ArrayBuffer | Uint8Array; } diff --git a/src/version3/parameters/createPlan.ts b/src/version3/parameters/createPlan.ts new file mode 100644 index 0000000000..766678c054 --- /dev/null +++ b/src/version3/parameters/createPlan.ts @@ -0,0 +1,27 @@ +import { + CreateCrossProjectReleaseRequest, + CreateCustomFieldRequest, + CreateExclusionRulesRequest, + CreateIssueSourceRequest, + CreatePermissionRequest, + CreateSchedulingRequest, +} from '../models'; + +export interface CreatePlan { + /** Whether to accept group IDs instead of group names. Group names are deprecated. */ + useGroupId?: boolean; + /** The cross-project releases to include in the plan. */ + crossProjectReleases?: CreateCrossProjectReleaseRequest[]; + /** The custom fields for the plan. */ + customFields?: CreateCustomFieldRequest[]; + exclusionRules?: CreateExclusionRulesRequest; + /** The issue sources to include in the plan. */ + issueSources: CreateIssueSourceRequest[]; + /** The account ID of the plan lead. */ + leadAccountId?: string; + /** The plan name. */ + name: string; + /** The permissions for the plan. */ + permissions?: CreatePermissionRequest[]; + scheduling?: CreateSchedulingRequest; +} diff --git a/src/version3/parameters/createPlanOnlyTeam.ts b/src/version3/parameters/createPlanOnlyTeam.ts new file mode 100644 index 0000000000..838dcf07b3 --- /dev/null +++ b/src/version3/parameters/createPlanOnlyTeam.ts @@ -0,0 +1,16 @@ +export interface CreatePlanOnlyTeam { + /** The ID of the plan. */ + planId: number; + /** The capacity for the plan-only team. */ + capacity?: number; + /** The ID of the issue source for the plan-only team. */ + issueSourceId?: number; + /** The account IDs of the plan-only team members. */ + memberAccountIds?: string[]; + /** The plan-only team name. */ + name: string; + /** The planning style for the plan-only team. This must be "Scrum" or "Kanban". */ + planningStyle: 'Scrum' | 'Kanban' | string; + /** The sprint length for the plan-only team. */ + sprintLength?: number; +} diff --git a/src/version3/parameters/createPriorityScheme.ts b/src/version3/parameters/createPriorityScheme.ts new file mode 100644 index 0000000000..22e1347c9f --- /dev/null +++ b/src/version3/parameters/createPriorityScheme.ts @@ -0,0 +1,16 @@ +import { PriorityMapping } from '../models'; + +/** Details of a new priority scheme */ +export interface CreatePriorityScheme { + /** The ID of the default priority for the priority scheme. */ + defaultPriorityId: number; + /** The description of the priority scheme. */ + description?: string; + mappings?: PriorityMapping; + /** The name of the priority scheme. Must be unique. */ + name: string; + /** The IDs of priorities in the scheme. */ + priorityIds: number[]; + /** The IDs of projects that will use the priority scheme. */ + projectIds?: number[]; +} diff --git a/src/version3/parameters/createProjectAvatar.ts b/src/version3/parameters/createProjectAvatar.ts index cbc3eebfe5..16b8739cbd 100644 --- a/src/version3/parameters/createProjectAvatar.ts +++ b/src/version3/parameters/createProjectAvatar.ts @@ -1,11 +1,16 @@ export interface CreateProjectAvatar { /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; - avatar: any; + projectIdOrKey: string | number; /** The X coordinate of the top-left corner of the crop region. */ x?: number; /** The Y coordinate of the top-left corner of the crop region. */ y?: number; - /** The length of each side of the crop region. */ + /** + * The length of each side of the crop region. + * + * @default 0 + */ size?: number; + mimeType: string; + avatar: Buffer | ArrayBuffer | Uint8Array | any; } diff --git a/src/version3/parameters/createRelatedWork.ts b/src/version3/parameters/createRelatedWork.ts new file mode 100644 index 0000000000..e3c0616741 --- /dev/null +++ b/src/version3/parameters/createRelatedWork.ts @@ -0,0 +1,5 @@ +import { VersionRelatedWork } from '../models'; + +export interface CreateRelatedWork extends VersionRelatedWork { + id: string; +} diff --git a/src/version3/parameters/createWorkflows.ts b/src/version3/parameters/createWorkflows.ts new file mode 100644 index 0000000000..945aa45f09 --- /dev/null +++ b/src/version3/parameters/createWorkflows.ts @@ -0,0 +1,3 @@ +import { WorkflowCreateRequest } from '../models'; + +export interface CreateWorkflows extends WorkflowCreateRequest {} diff --git a/src/version3/parameters/deleteActor.ts b/src/version3/parameters/deleteActor.ts index bf6b85f5e5..68f1f9aac3 100644 --- a/src/version3/parameters/deleteActor.ts +++ b/src/version3/parameters/deleteActor.ts @@ -1,6 +1,6 @@ export interface DeleteActor { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role * IDs. diff --git a/src/version3/parameters/deleteComment.ts b/src/version3/parameters/deleteComment.ts index a06ad01e85..5050950ed1 100644 --- a/src/version3/parameters/deleteComment.ts +++ b/src/version3/parameters/deleteComment.ts @@ -3,4 +3,5 @@ export interface DeleteComment { issueIdOrKey: string; /** The ID of the comment. */ id: string; + parentId?: string; } diff --git a/src/version3/parameters/deletePlanOnlyTeam.ts b/src/version3/parameters/deletePlanOnlyTeam.ts new file mode 100644 index 0000000000..d87ea6bd4b --- /dev/null +++ b/src/version3/parameters/deletePlanOnlyTeam.ts @@ -0,0 +1,6 @@ +export interface DeletePlanOnlyTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the plan-only team. */ + planOnlyTeamId: number; +} diff --git a/src/version3/parameters/deletePriority.ts b/src/version3/parameters/deletePriority.ts new file mode 100644 index 0000000000..224cd5fc3d --- /dev/null +++ b/src/version3/parameters/deletePriority.ts @@ -0,0 +1,4 @@ +export interface DeletePriority { + /** The ID of the issue priority. */ + id: string; +} diff --git a/src/version3/parameters/deletePriorityScheme.ts b/src/version3/parameters/deletePriorityScheme.ts new file mode 100644 index 0000000000..3ac3ff970c --- /dev/null +++ b/src/version3/parameters/deletePriorityScheme.ts @@ -0,0 +1,4 @@ +export interface DeletePriorityScheme { + /** The priority scheme ID. */ + schemeId: number; +} diff --git a/src/version3/parameters/deleteProject.ts b/src/version3/parameters/deleteProject.ts index 618778ed43..41bb57bb4c 100644 --- a/src/version3/parameters/deleteProject.ts +++ b/src/version3/parameters/deleteProject.ts @@ -1,6 +1,6 @@ export interface DeleteProject { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** Whether this project is placed in the Jira recycle bin where it will be available for restoration. */ enableUndo?: boolean; } diff --git a/src/version3/parameters/deleteProjectAsynchronously.ts b/src/version3/parameters/deleteProjectAsynchronously.ts index 0c86e1e714..713570ef41 100644 --- a/src/version3/parameters/deleteProjectAsynchronously.ts +++ b/src/version3/parameters/deleteProjectAsynchronously.ts @@ -1,4 +1,4 @@ export interface DeleteProjectAsynchronously { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version3/parameters/deleteProjectAvatar.ts b/src/version3/parameters/deleteProjectAvatar.ts index db737d25af..78d2ed7859 100644 --- a/src/version3/parameters/deleteProjectAvatar.ts +++ b/src/version3/parameters/deleteProjectAvatar.ts @@ -1,6 +1,6 @@ export interface DeleteProjectAvatar { /** The project ID or (case-sensitive) key. */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** The ID of the avatar. */ id: number; } diff --git a/src/version3/parameters/deleteProjectProperty.ts b/src/version3/parameters/deleteProjectProperty.ts index 98b8d7be6b..3a66f9b52e 100644 --- a/src/version3/parameters/deleteProjectProperty.ts +++ b/src/version3/parameters/deleteProjectProperty.ts @@ -1,6 +1,6 @@ export interface DeleteProjectProperty { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** * The project property key. Use [Get project property keys](#api-rest-api-3-project-projectIdOrKey-properties-get) to * get a list of all project property keys. diff --git a/src/version3/parameters/deleteRelatedWork.ts b/src/version3/parameters/deleteRelatedWork.ts new file mode 100644 index 0000000000..2980e8f2e5 --- /dev/null +++ b/src/version3/parameters/deleteRelatedWork.ts @@ -0,0 +1,6 @@ +export interface DeleteRelatedWork { + /** The ID of the version that the target related work belongs to. */ + versionId: string; + /** The ID of the related work to delete. */ + relatedWorkId: string; +} diff --git a/src/version3/parameters/duplicatePlan.ts b/src/version3/parameters/duplicatePlan.ts new file mode 100644 index 0000000000..d154609f4e --- /dev/null +++ b/src/version3/parameters/duplicatePlan.ts @@ -0,0 +1,6 @@ +export interface DuplicatePlan { + /** The ID of the plan. */ + planId: number; + /** The plan name. */ + name: string; +} diff --git a/src/version3/parameters/evaluateJiraExpression.ts b/src/version3/parameters/evaluateJiraExpression.ts index db2c0c0e08..41d800cb6b 100644 --- a/src/version3/parameters/evaluateJiraExpression.ts +++ b/src/version3/parameters/evaluateJiraExpression.ts @@ -9,5 +9,5 @@ export interface EvaluateJiraExpression extends JiraExpressionEvalRequest { * limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing * and debugging your expressions. */ - expand?: string; + expand?: 'meta.complexity' | string; } diff --git a/src/version3/parameters/evaluateJiraExpressionUsingEnhancedSearch.ts b/src/version3/parameters/evaluateJiraExpressionUsingEnhancedSearch.ts new file mode 100644 index 0000000000..bad34f2b01 --- /dev/null +++ b/src/version3/parameters/evaluateJiraExpressionUsingEnhancedSearch.ts @@ -0,0 +1,13 @@ +import { JiraExpressionEvalUsingEnhancedSearchRequest } from '../models'; + +export interface EvaluateJiraExpressionUsingEnhancedSearch extends JiraExpressionEvalUsingEnhancedSearchRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information in the response. This parameter accepts `meta.complexity` that returns information about the expression + * complexity. For example, the number of expensive operations used by the expression and how close the expression is + * to reaching the [complexity + * limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing + * and debugging your expressions. + */ + expand?: string; +} diff --git a/src/version3/parameters/findAssignableUsers.ts b/src/version3/parameters/findAssignableUsers.ts index 54f9e3a09f..3ebba3dce7 100644 --- a/src/version3/parameters/findAssignableUsers.ts +++ b/src/version3/parameters/findAssignableUsers.ts @@ -16,10 +16,12 @@ export interface FindAssignableUsers { username?: string; /** A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. */ accountId?: string; - /** The project ID or project key (case sensitive). Required, unless `issueKey` is specified. */ + /** The project ID or project key (case sensitive). Required, unless `issueKey` or `issueId` is specified. */ project?: string; - /** The key of the issue. Required, unless `project` is specified. */ + /** The key of the issue. Required, unless `issueId` or `project` is specified. */ issueKey?: string; + /** The ID of the issue. Required, unless `issueKey` or `project` is specified. */ + issueId?: string; /** The index of the first item to return in a page of results (page offset). */ startAt?: number; /** diff --git a/src/version3/parameters/findComponentsForProjects.ts b/src/version3/parameters/findComponentsForProjects.ts new file mode 100644 index 0000000000..75a1ceff8b --- /dev/null +++ b/src/version3/parameters/findComponentsForProjects.ts @@ -0,0 +1,20 @@ +export interface FindComponentsForProjects { + /** The project IDs and/or project keys (case sensitive). */ + projectIdsOrKeys?: string[]; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#ordering) the results by a field: + * + * - `description` Sorts by the component description. + * - `name` Sorts by component name. + */ + orderBy?: 'description' | '-description' | '+description' | 'name' | '-name' | '+name' | string; + /** + * Filter the results using a literal string. Components with a matching `name` or `description` are returned (case + * insensitive). + */ + query?: string; +} diff --git a/src/version3/parameters/findUserKeysByQuery.ts b/src/version3/parameters/findUserKeysByQuery.ts index 14b12d1fd0..b6c92aef83 100644 --- a/src/version3/parameters/findUserKeysByQuery.ts +++ b/src/version3/parameters/findUserKeysByQuery.ts @@ -3,6 +3,12 @@ export interface FindUserKeysByQuery { query: string; /** The index of the first item to return in a page of results (page offset). */ startAt?: number; - /** The maximum number of items to return per page. */ + /** + * The maximum number of items to return per page. + * + * @deprecated Use `maxResult` instead. + */ maxResults?: number; + /** The maximum number of items to return per page. */ + maxResult?: number; } diff --git a/src/version3/parameters/findUsersForPicker.ts b/src/version3/parameters/findUsersForPicker.ts index b5eb7749a2..18cb99f7ae 100644 --- a/src/version3/parameters/findUsersForPicker.ts +++ b/src/version3/parameters/findUsersForPicker.ts @@ -13,7 +13,6 @@ export interface FindUsersForPicker { * A list of account IDs to exclude from the search results. This parameter accepts a comma-separated list. Multiple * account IDs can also be provided using an ampersand-separated list. For example, * `excludeAccountIds=5b10a2844c20165700ede21g,5b10a0effa615349cb016cd8&excludeAccountIds=5b10ac8d82e05b22cc7d4ef5`. - * Cannot be provided with `exclude`. */ excludeAccountIds?: string[]; avatarSize?: string; diff --git a/src/version3/parameters/getAllProjectAvatars.ts b/src/version3/parameters/getAllProjectAvatars.ts index ba78677a9f..ed47d2ffff 100644 --- a/src/version3/parameters/getAllProjectAvatars.ts +++ b/src/version3/parameters/getAllProjectAvatars.ts @@ -1,4 +1,4 @@ export interface GetAllProjectAvatars { /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version3/parameters/getAllStatuses.ts b/src/version3/parameters/getAllStatuses.ts index c82be96267..c10d765625 100644 --- a/src/version3/parameters/getAllStatuses.ts +++ b/src/version3/parameters/getAllStatuses.ts @@ -1,4 +1,4 @@ export interface GetAllStatuses { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version3/parameters/getAllUserDataClassificationLevels.ts b/src/version3/parameters/getAllUserDataClassificationLevels.ts new file mode 100644 index 0000000000..eb477fbdde --- /dev/null +++ b/src/version3/parameters/getAllUserDataClassificationLevels.ts @@ -0,0 +1,6 @@ +export interface GetAllUserDataClassificationLevels { + /** Optional set of statuses to filter by. */ + status?: ('PUBLISHED' | 'ARCHIVED' | 'DRAFT' | string)[]; + /** Ordering of the results by a given field. If not provided, values will not be sorted. */ + orderBy?: 'rank' | '-rank' | '+rank' | string; +} diff --git a/src/version3/parameters/getAtlassianTeam.ts b/src/version3/parameters/getAtlassianTeam.ts new file mode 100644 index 0000000000..b3bc42a2b5 --- /dev/null +++ b/src/version3/parameters/getAtlassianTeam.ts @@ -0,0 +1,6 @@ +export interface GetAtlassianTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the Atlassian team. */ + atlassianTeamId: string; +} diff --git a/src/version3/parameters/getAvailablePrioritiesByPriorityScheme.ts b/src/version3/parameters/getAvailablePrioritiesByPriorityScheme.ts new file mode 100644 index 0000000000..da7ba318f6 --- /dev/null +++ b/src/version3/parameters/getAvailablePrioritiesByPriorityScheme.ts @@ -0,0 +1,12 @@ +export interface GetAvailablePrioritiesByPriorityScheme { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** The string to query priorities on by name. */ + query?: string; + /** The priority scheme ID. */ + schemeId: string; + /** A list of priority IDs to exclude from the results. */ + exclude?: string[]; +} diff --git a/src/version3/parameters/getAvailableTransitions.ts b/src/version3/parameters/getAvailableTransitions.ts new file mode 100644 index 0000000000..8409ca4d6d --- /dev/null +++ b/src/version3/parameters/getAvailableTransitions.ts @@ -0,0 +1,8 @@ +export interface GetAvailableTransitions { + /** Ids or keys of the issues to get transitions available for them. */ + issueIdsOrKeys: string[]; + /** The end cursor for use in pagination. */ + endingBefore?: string; + /** The start cursor for use in pagination. */ + startingAfter?: string; +} diff --git a/src/version3/parameters/getAvatars.ts b/src/version3/parameters/getAvatars.ts index 94f9acecf2..aa4d2b86be 100644 --- a/src/version3/parameters/getAvatars.ts +++ b/src/version3/parameters/getAvatars.ts @@ -2,5 +2,5 @@ export interface GetAvatars { /** The avatar type. */ type: 'project' | 'issuetype' | string; /** The ID of the item the avatar is associated with. */ - entityId: string; + entityId: number | string; } diff --git a/src/version3/parameters/getBulkChangelogs.ts b/src/version3/parameters/getBulkChangelogs.ts new file mode 100644 index 0000000000..fefc8eb77f --- /dev/null +++ b/src/version3/parameters/getBulkChangelogs.ts @@ -0,0 +1,3 @@ +import { BulkChangelogRequest } from '../models'; + +export interface GetBulkChangelogs extends BulkChangelogRequest {} diff --git a/src/version3/parameters/getBulkEditableFields.ts b/src/version3/parameters/getBulkEditableFields.ts new file mode 100644 index 0000000000..3d218dc716 --- /dev/null +++ b/src/version3/parameters/getBulkEditableFields.ts @@ -0,0 +1,10 @@ +export interface GetBulkEditableFields { + /** The IDs or keys of the issues to get editable fields from. */ + issueIdsOrKeys: string; + /** (Optional)The text to search for in the editable fields. */ + searchText?: string; + /** (Optional)The end cursor for use in pagination. */ + endingBefore?: string; + /** (Optional)The start cursor for use in pagination. */ + startingAfter?: string; +} diff --git a/src/version3/parameters/getBulkOperationProgress.ts b/src/version3/parameters/getBulkOperationProgress.ts new file mode 100644 index 0000000000..976c68799c --- /dev/null +++ b/src/version3/parameters/getBulkOperationProgress.ts @@ -0,0 +1,4 @@ +export interface GetBulkOperationProgress { + /** The ID of the task. */ + taskId: string; +} diff --git a/src/version3/parameters/getBulkScreenTabs.ts b/src/version3/parameters/getBulkScreenTabs.ts new file mode 100644 index 0000000000..6f8227f85a --- /dev/null +++ b/src/version3/parameters/getBulkScreenTabs.ts @@ -0,0 +1,16 @@ +export interface GetBulkScreenTabs { + /** + * The list of screen IDs. To include multiple screen IDs, provide an ampersand-separated list. For example, + * `screenId=10000&screenId=10001`. + */ + screenId?: number[]; + /** + * The list of tab IDs. To include multiple tab IDs, provide an ampersand-separated list. For example, + * `tabId=10000&tabId=10001`. + */ + tabId?: number[]; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. The maximum number is 100, */ + maxResult?: number; +} diff --git a/src/version3/parameters/getCreateIssueMetaIssueTypeId.ts b/src/version3/parameters/getCreateIssueMetaIssueTypeId.ts new file mode 100644 index 0000000000..6195fc1f49 --- /dev/null +++ b/src/version3/parameters/getCreateIssueMetaIssueTypeId.ts @@ -0,0 +1,10 @@ +export interface GetCreateIssueMetaIssueTypeId { + /** The ID or key of the project. */ + projectIdOrKey: string; + /** The issuetype ID. */ + issueTypeId: string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getCreateIssueMetaIssueTypes.ts b/src/version3/parameters/getCreateIssueMetaIssueTypes.ts new file mode 100644 index 0000000000..dc20e141b5 --- /dev/null +++ b/src/version3/parameters/getCreateIssueMetaIssueTypes.ts @@ -0,0 +1,8 @@ +export interface GetCreateIssueMetaIssueTypes { + /** The ID or key of the project. */ + projectIdOrKey: string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getCustomFieldsConfigurations.ts b/src/version3/parameters/getCustomFieldsConfigurations.ts new file mode 100644 index 0000000000..7039e4b8ba --- /dev/null +++ b/src/version3/parameters/getCustomFieldsConfigurations.ts @@ -0,0 +1,34 @@ +import { ConfigurationsListParameters } from '../models'; + +export interface GetCustomFieldsConfigurations extends ConfigurationsListParameters { + /** + * The list of configuration IDs. To include multiple configurations, separate IDs with an ampersand: + * `id=10000&id=10001`. Can't be provided with `fieldContextId`, `issueId`, `projectKeyOrId`, or `issueTypeId`. + */ + id?: number[]; + /** + * The list of field context IDs. To include multiple field contexts, separate IDs with an ampersand: + * `fieldContextId=10000&fieldContextId=10001`. Can't be provided with `id`, `issueId`, `projectKeyOrId`, or + * `issueTypeId`. + */ + fieldContextId?: number[]; + /** + * The ID of the issue to filter results by. If the issue doesn't exist, an empty list is returned. Can't be provided + * with `projectKeyOrId`, or `issueTypeId`. + */ + issueId?: number; + /** + * The ID or key of the project to filter results by. Must be provided with `issueTypeId`. Can't be provided with + * `issueId`. + */ + projectKeyOrId?: string; + /** + * The ID of the issue type to filter results by. Must be provided with `projectKeyOrId`. Can't be provided with + * `issueId`. + */ + issueTypeId?: string; + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getDefaultProjectClassification.ts b/src/version3/parameters/getDefaultProjectClassification.ts new file mode 100644 index 0000000000..cf8683da7a --- /dev/null +++ b/src/version3/parameters/getDefaultProjectClassification.ts @@ -0,0 +1,4 @@ +export interface GetDefaultProjectClassification { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; +} diff --git a/src/version3/parameters/getFeaturesForProject.ts b/src/version3/parameters/getFeaturesForProject.ts index 81902eb044..0e1567cd84 100644 --- a/src/version3/parameters/getFeaturesForProject.ts +++ b/src/version3/parameters/getFeaturesForProject.ts @@ -1,4 +1,4 @@ export interface GetFeaturesForProject { /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version3/parameters/getFieldConfigurationSchemeProjectMapping.ts b/src/version3/parameters/getFieldConfigurationSchemeProjectMapping.ts index fc16570b25..2bbc23e7ab 100644 --- a/src/version3/parameters/getFieldConfigurationSchemeProjectMapping.ts +++ b/src/version3/parameters/getFieldConfigurationSchemeProjectMapping.ts @@ -7,5 +7,5 @@ export interface GetFieldConfigurationSchemeProjectMapping { * The list of project IDs. To include multiple projects, separate IDs with ampersand: * `projectId=10000&projectId=10001`. */ - projectId: number[]; + projectId: (string | number)[]; } diff --git a/src/version3/parameters/getFiltersPaginated.ts b/src/version3/parameters/getFiltersPaginated.ts index f60612cb52..d0819a74fc 100644 --- a/src/version3/parameters/getFiltersPaginated.ts +++ b/src/version3/parameters/getFiltersPaginated.ts @@ -76,6 +76,7 @@ export interface GetFiltersPaginated { * - `sharePermissions` Returns the share permissions defined for the filter. * - `editPermissions` Returns the edit permissions defined for the filter. * - `isWritable` Returns whether the current user has permission to edit the filter. + * - `approximateLastUsed` [Experimental] Returns the approximate date and time when the filter was last evaluated. * - `subscriptions` Returns the users that are subscribed to the filter. * - `viewUrl` Returns a URL to view the filter. */ @@ -89,6 +90,7 @@ export interface GetFiltersPaginated { | 'sharePermissions' | 'editPermissions' | 'isWritable' + | 'approximateLastUsed' | 'subscriptions' | 'viewUrl' | ( @@ -101,14 +103,21 @@ export interface GetFiltersPaginated { | 'sharePermissions' | 'editPermissions' | 'isWritable' + | 'approximateLastUsed' | 'subscriptions' | 'viewUrl' )[] | string | string[]; /** - * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. + * @experimental EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. * Available to users with _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ overrideSharePermissions?: boolean; + /** + * When `true` this will perform a case-insensitive substring match for the provided `filterName`. When `false` the + * filter name will be searched using [full text search + * syntax](https://support.atlassian.com/jira-software-cloud/docs/search-for-issues-using-the-text-field/). + */ + isSubstringMatch?: boolean; } diff --git a/src/version3/parameters/getHierarchy.ts b/src/version3/parameters/getHierarchy.ts index 2ea2e76b1e..ee2ae8c627 100644 --- a/src/version3/parameters/getHierarchy.ts +++ b/src/version3/parameters/getHierarchy.ts @@ -1,4 +1,4 @@ export interface GetHierarchy { /** The ID of the project. */ - projectId: number; + projectId: string | number; } diff --git a/src/version3/parameters/getIssue.ts b/src/version3/parameters/getIssue.ts index a85fabe0e4..bee085dd79 100644 --- a/src/version3/parameters/getIssue.ts +++ b/src/version3/parameters/getIssue.ts @@ -69,4 +69,10 @@ export interface GetIssue { * field. */ updateHistory?: boolean; + /** + * Whether to fail the request quickly in case of an error while loading fields for an issue. For `failFast=true`, if + * one field fails, the entire operation fails. For `failFast=false`, the operation will continue even if a field + * fails. It will return a valid response, but without values for the failed field(s). + */ + failFast?: boolean; } diff --git a/src/version3/parameters/getIssueLimitReport.ts b/src/version3/parameters/getIssueLimitReport.ts new file mode 100644 index 0000000000..70ea82a306 --- /dev/null +++ b/src/version3/parameters/getIssueLimitReport.ts @@ -0,0 +1,34 @@ +export interface GetIssueLimitReport { + /** Return issue keys instead of issue ids in the response. */ + isReturningKeys?: boolean; + /** + * A list of fields and their respective approaching limit threshold. Required for querying issues approaching limits. + * Optional for querying issues breaching limits. Accepted fields are: + * + * - `comment` + * - `worklog` + * - `attachment` + * - `remoteIssueLinks`, + * - `issuelinks`. + * + * @example + * { + * "issuesApproachingLimitParams": { + * "comment": 4500, + * "attachment": 1800 + * } + * } + */ + issuesApproachingLimitParams?: { + /** The limit for the number of comments. */ + comment?: number; + /** The limit for the number of worklogs. */ + worklog?: number; + /** The limit for the number of attachments. */ + attachment?: number; + /** The limit for the number of remote issue links. */ + remoteIssueLinks?: number; + /** The limit for the number of issue links. */ + issuelinks?: number; + }; +} diff --git a/src/version3/parameters/getIssueTypeSchemeForProjects.ts b/src/version3/parameters/getIssueTypeSchemeForProjects.ts index 80a6339149..aaf455ca82 100644 --- a/src/version3/parameters/getIssueTypeSchemeForProjects.ts +++ b/src/version3/parameters/getIssueTypeSchemeForProjects.ts @@ -7,5 +7,5 @@ export interface GetIssueTypeSchemeForProjects { * The list of project IDs. To include multiple project IDs, provide an ampersand-separated list. For example, * `projectId=10000&projectId=10001`. */ - projectId: number[]; + projectId: (string | number)[]; } diff --git a/src/version3/parameters/getIssueTypeScreenSchemeProjectAssociations.ts b/src/version3/parameters/getIssueTypeScreenSchemeProjectAssociations.ts index 401790f9d7..82ac3fabdc 100644 --- a/src/version3/parameters/getIssueTypeScreenSchemeProjectAssociations.ts +++ b/src/version3/parameters/getIssueTypeScreenSchemeProjectAssociations.ts @@ -7,5 +7,5 @@ export interface GetIssueTypeScreenSchemeProjectAssociations { * The list of project IDs. To include multiple projects, separate IDs with ampersand: * `projectId=10000&projectId=10001`. */ - projectId: number[]; + projectId: (string | number)[]; } diff --git a/src/version3/parameters/getIssueTypesForProject.ts b/src/version3/parameters/getIssueTypesForProject.ts index 11d1f2e25a..b06312da99 100644 --- a/src/version3/parameters/getIssueTypesForProject.ts +++ b/src/version3/parameters/getIssueTypesForProject.ts @@ -1,6 +1,6 @@ export interface GetIssueTypesForProject { /** The ID of the project. */ - projectId: number; + projectId: string | number; /** * The level of the issue type to filter by. Use: * diff --git a/src/version3/parameters/getNotificationSchemeForProject.ts b/src/version3/parameters/getNotificationSchemeForProject.ts new file mode 100644 index 0000000000..8d0d14f85c --- /dev/null +++ b/src/version3/parameters/getNotificationSchemeForProject.ts @@ -0,0 +1,26 @@ +export interface GetNotificationSchemeForProject { + /** The project ID or project key (case sensitive). */ + projectKeyOrId: string; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `all` Returns all expandable information + * - `field` Returns information about any custom fields assigned to receive an event + * - `group` Returns information about any groups assigned to receive an event + * - `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable + * information + * - `projectRole` Returns information about any project roles assigned to receive an event + * - `user` Returns information about any users assigned to receive an event + */ + expand?: + | 'all' + | 'field' + | 'group' + | 'notificationSchemeEvents' + | 'projectRole' + | 'user' + | ('all' | 'field' | 'group' | 'notificationSchemeEvents' | 'projectRole' | 'user')[] + | string + | string[]; +} diff --git a/src/version3/parameters/getNotificationSchemeToProjectMappings.ts b/src/version3/parameters/getNotificationSchemeToProjectMappings.ts index 34cfec0e7b..bfb504e6e2 100644 --- a/src/version3/parameters/getNotificationSchemeToProjectMappings.ts +++ b/src/version3/parameters/getNotificationSchemeToProjectMappings.ts @@ -1,8 +1,8 @@ export interface GetNotificationSchemeToProjectMappings { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The list of notifications scheme IDs to be filtered out */ notificationSchemeId?: string[]; /** The list of project IDs to be filtered out */ diff --git a/src/version3/parameters/getPlan.ts b/src/version3/parameters/getPlan.ts new file mode 100644 index 0000000000..9ed1b0df18 --- /dev/null +++ b/src/version3/parameters/getPlan.ts @@ -0,0 +1,6 @@ +export interface GetPlan { + /** The ID of the plan. */ + planId: number; + /** Whether to return group IDs instead of group names. Group names are deprecated. */ + useGroupId?: boolean; +} diff --git a/src/version3/parameters/getPlanOnlyTeam.ts b/src/version3/parameters/getPlanOnlyTeam.ts new file mode 100644 index 0000000000..f48b73a426 --- /dev/null +++ b/src/version3/parameters/getPlanOnlyTeam.ts @@ -0,0 +1,6 @@ +export interface GetPlanOnlyTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the plan-only team. */ + planOnlyTeamId: number; +} diff --git a/src/version3/parameters/getPlans.ts b/src/version3/parameters/getPlans.ts new file mode 100644 index 0000000000..2633d4c9e8 --- /dev/null +++ b/src/version3/parameters/getPlans.ts @@ -0,0 +1,10 @@ +export interface GetPlans { + /** Whether to include trashed plans in the results. */ + includeTrashed?: boolean; + /** Whether to include archived plans in the results. */ + includeArchived?: boolean; + /** The cursor to start from. If not provided, the first page will be returned. */ + cursor?: string; + /** The maximum number of plans to return per page. The maximum value is 50. The default value is 50. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getPolicies.ts b/src/version3/parameters/getPolicies.ts new file mode 100644 index 0000000000..dd996402d6 --- /dev/null +++ b/src/version3/parameters/getPolicies.ts @@ -0,0 +1,4 @@ +export interface GetPolicies { + /** A list of project identifiers. This parameter accepts a comma-separated list. */ + ids: string | string[]; +} diff --git a/src/version3/parameters/getPrecomputations.ts b/src/version3/parameters/getPrecomputations.ts index b20400335f..f797eda7eb 100644 --- a/src/version3/parameters/getPrecomputations.ts +++ b/src/version3/parameters/getPrecomputations.ts @@ -32,5 +32,6 @@ export interface GetPrecomputations { | '-created' | '-updated' | string; + /** @deprecated This property is no longer used. */ filter?: string; } diff --git a/src/version3/parameters/getPrecomputationsByID.ts b/src/version3/parameters/getPrecomputationsByID.ts new file mode 100644 index 0000000000..d663a1027c --- /dev/null +++ b/src/version3/parameters/getPrecomputationsByID.ts @@ -0,0 +1,28 @@ +import { JqlFunctionPrecomputationGetByIdRequest } from '../models'; + +export interface GetPrecomputationsByID extends JqlFunctionPrecomputationGetByIdRequest { + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#ordering) the results by a field: + * + * - `functionKey` Sorts by the functionKey. + * - `used` Sorts by the used timestamp. + * - `created` Sorts by the created timestamp. + * - `updated` Sorts by the updated timestamp. + * + * You can also use `+` or `-` prefixes to specify ascending or descending order (e.g., `+functionKey`, `-used`). + */ + orderBy?: + | 'functionKey' + | 'used' + | 'created' + | 'updated' + | '+functionKey' + | '+used' + | '+created' + | '+updated' + | '-functionKey' + | '-used' + | '-created' + | '-updated' + | string; +} diff --git a/src/version3/parameters/getPrioritiesByPriorityScheme.ts b/src/version3/parameters/getPrioritiesByPriorityScheme.ts new file mode 100644 index 0000000000..6cd7fcedac --- /dev/null +++ b/src/version3/parameters/getPrioritiesByPriorityScheme.ts @@ -0,0 +1,8 @@ +export interface GetPrioritiesByPriorityScheme { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** The priority scheme ID. */ + schemeId: string; +} diff --git a/src/version3/parameters/getPrioritySchemes.ts b/src/version3/parameters/getPrioritySchemes.ts new file mode 100644 index 0000000000..bb87151030 --- /dev/null +++ b/src/version3/parameters/getPrioritySchemes.ts @@ -0,0 +1,32 @@ +export interface GetPrioritySchemes { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** + * A set of priority IDs to filter by. To include multiple IDs, provide an ampersand-separated list. For example, + * `priorityId=10000&priorityId=10001`. + */ + priorityId?: number[]; + /** + * A set of priority scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, + * `schemeId=10000&schemeId=10001`. + */ + schemeId?: number[]; + /** The name of scheme to search for. */ + schemeName?: string; + /** Whether only the default priority is returned. */ + onlyDefault?: boolean; + /** The ordering to return the priority schemes by. */ + orderBy?: 'name' | '+name' | '-name' | string; + /** + * A comma separated list of additional information to return. + * + * - `priorities` will return priorities associated with the priority scheme. + * - `projects` will return projects associated with the priority scheme. + * + * @example + * expand: ['priorities', 'projects']. + */ + expand?: 'priorities' | 'projects' | ('priorities' | 'projects')[] | string | string[]; +} diff --git a/src/version3/parameters/getProjectComponents.ts b/src/version3/parameters/getProjectComponents.ts index 4bdde93bb0..aa6eb075c5 100644 --- a/src/version3/parameters/getProjectComponents.ts +++ b/src/version3/parameters/getProjectComponents.ts @@ -1,4 +1,12 @@ export interface GetProjectComponents { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; + /** + * The source of the components to return. Can be `jira` (default), `compass` or `auto`. When `auto` is specified, the + * API will return connected Compass components if the project is opted into Compass, otherwise it will return Jira + * components. Defaults to `jira`. + * + * @default jira + */ + componentSource?: 'jira' | 'compass' | 'auto' | string; } diff --git a/src/version3/parameters/getProjectComponentsPaginated.ts b/src/version3/parameters/getProjectComponentsPaginated.ts index d8b222a6f6..5f6ebda9ec 100644 --- a/src/version3/parameters/getProjectComponentsPaginated.ts +++ b/src/version3/parameters/getProjectComponentsPaginated.ts @@ -1,6 +1,6 @@ export interface GetProjectComponentsPaginated { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** The index of the first item to return in a page of results (page offset). */ startAt?: number; /** The maximum number of items to return per page. */ @@ -32,4 +32,12 @@ export interface GetProjectComponentsPaginated { * insensitive). */ query?: string; + /** + * The source of the components to return. Can be `jira` (default), `compass` or `auto`. When `auto` is specified, the + * API will return connected Compass components if the project is opted into Compass, otherwise it will return Jira + * components. Defaults to `jira`. + * + * @default jira + */ + componentSource?: 'jira' | 'compass' | 'auto' | string; } diff --git a/src/version3/parameters/getProjectEmail.ts b/src/version3/parameters/getProjectEmail.ts index e12df4811b..5a8b7e0ab5 100644 --- a/src/version3/parameters/getProjectEmail.ts +++ b/src/version3/parameters/getProjectEmail.ts @@ -1,4 +1,4 @@ export interface GetProjectEmail { /** The project ID. */ - projectId: number; + projectId: string | number; } diff --git a/src/version3/parameters/getProjectIssueTypeUsagesForStatus.ts b/src/version3/parameters/getProjectIssueTypeUsagesForStatus.ts new file mode 100644 index 0000000000..80deab4e9d --- /dev/null +++ b/src/version3/parameters/getProjectIssueTypeUsagesForStatus.ts @@ -0,0 +1,10 @@ +export interface GetProjectIssueTypeUsagesForStatus { + /** The statusId to fetch issue type usages for */ + statusId: string; + /** The projectId to fetch issue type usages for */ + projectId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getProjectProperty.ts b/src/version3/parameters/getProjectProperty.ts index 5c76846afa..1885de1282 100644 --- a/src/version3/parameters/getProjectProperty.ts +++ b/src/version3/parameters/getProjectProperty.ts @@ -1,6 +1,6 @@ export interface GetProjectProperty { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** * The project property key. Use [Get project property keys](#api-rest-api-3-project-projectIdOrKey-properties-get) to * get a list of all project property keys. diff --git a/src/version3/parameters/getProjectPropertyKeys.ts b/src/version3/parameters/getProjectPropertyKeys.ts index 0774dabd91..ed63fb62bb 100644 --- a/src/version3/parameters/getProjectPropertyKeys.ts +++ b/src/version3/parameters/getProjectPropertyKeys.ts @@ -1,4 +1,4 @@ export interface GetProjectPropertyKeys { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version3/parameters/getProjectRole.ts b/src/version3/parameters/getProjectRole.ts index 0107933ff3..e7a4bd70c0 100644 --- a/src/version3/parameters/getProjectRole.ts +++ b/src/version3/parameters/getProjectRole.ts @@ -1,6 +1,6 @@ export interface GetProjectRole { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role * IDs. diff --git a/src/version3/parameters/getProjectRoleDetails.ts b/src/version3/parameters/getProjectRoleDetails.ts index 4ec30420fc..4330c48a78 100644 --- a/src/version3/parameters/getProjectRoleDetails.ts +++ b/src/version3/parameters/getProjectRoleDetails.ts @@ -1,6 +1,6 @@ export interface GetProjectRoleDetails { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** Whether the roles should be filtered to include only those the user is assigned to. */ currentMember?: boolean; excludeConnectAddons?: boolean; diff --git a/src/version3/parameters/getProjectRoles.ts b/src/version3/parameters/getProjectRoles.ts index 6de9e0b486..3f5792c849 100644 --- a/src/version3/parameters/getProjectRoles.ts +++ b/src/version3/parameters/getProjectRoles.ts @@ -1,4 +1,4 @@ export interface GetProjectRoles { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version3/parameters/getProjectUsagesForStatus.ts b/src/version3/parameters/getProjectUsagesForStatus.ts new file mode 100644 index 0000000000..0e8913c901 --- /dev/null +++ b/src/version3/parameters/getProjectUsagesForStatus.ts @@ -0,0 +1,8 @@ +export interface GetProjectUsagesForStatus { + /** The statusId to fetch project usages for */ + statusId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getProjectUsagesForWorkflow.ts b/src/version3/parameters/getProjectUsagesForWorkflow.ts new file mode 100644 index 0000000000..e70544f1f4 --- /dev/null +++ b/src/version3/parameters/getProjectUsagesForWorkflow.ts @@ -0,0 +1,8 @@ +export interface GetProjectUsagesForWorkflow { + /** The workflow ID */ + workflowId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getProjectUsagesForWorkflowScheme.ts b/src/version3/parameters/getProjectUsagesForWorkflowScheme.ts new file mode 100644 index 0000000000..0266959608 --- /dev/null +++ b/src/version3/parameters/getProjectUsagesForWorkflowScheme.ts @@ -0,0 +1,8 @@ +export interface GetProjectUsagesForWorkflowScheme { + /** The workflow scheme ID */ + workflowSchemeId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getProjectVersions.ts b/src/version3/parameters/getProjectVersions.ts index 851c405dad..db33ddce4d 100644 --- a/src/version3/parameters/getProjectVersions.ts +++ b/src/version3/parameters/getProjectVersions.ts @@ -1,6 +1,6 @@ export interface GetProjectVersions { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional * information in the response. This parameter accepts `operations`, which returns actions that can be performed on diff --git a/src/version3/parameters/getProjectVersionsPaginated.ts b/src/version3/parameters/getProjectVersionsPaginated.ts index 1046648a68..50d07d52c2 100644 --- a/src/version3/parameters/getProjectVersionsPaginated.ts +++ b/src/version3/parameters/getProjectVersionsPaginated.ts @@ -1,6 +1,6 @@ export interface GetProjectVersionsPaginated { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** The index of the first item to return in a page of results (page offset). */ startAt?: number; /** The maximum number of items to return per page. */ diff --git a/src/version3/parameters/getProjectsByPriorityScheme.ts b/src/version3/parameters/getProjectsByPriorityScheme.ts new file mode 100644 index 0000000000..607505f6d4 --- /dev/null +++ b/src/version3/parameters/getProjectsByPriorityScheme.ts @@ -0,0 +1,12 @@ +export interface GetProjectsByPriorityScheme { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** The project IDs to filter by. For example, `projectId=10000&projectId=10001`. */ + projectId?: number[]; + /** The priority scheme ID. */ + schemeId: string; + /** The string to query projects on by name. */ + query?: string; +} diff --git a/src/version3/parameters/getRelatedWork.ts b/src/version3/parameters/getRelatedWork.ts new file mode 100644 index 0000000000..b6388182d0 --- /dev/null +++ b/src/version3/parameters/getRelatedWork.ts @@ -0,0 +1,4 @@ +export interface GetRelatedWork { + /** The ID of the version. */ + id: string; +} diff --git a/src/version3/parameters/getResolution.ts b/src/version3/parameters/getResolution.ts new file mode 100644 index 0000000000..13eba23264 --- /dev/null +++ b/src/version3/parameters/getResolution.ts @@ -0,0 +1,4 @@ +export interface GetResolution { + /** The ID of the issue resolution value. */ + id: string; +} diff --git a/src/version3/parameters/getSecurityLevelMembers.ts b/src/version3/parameters/getSecurityLevelMembers.ts index ca3cfe5b25..d1ed167d63 100644 --- a/src/version3/parameters/getSecurityLevelMembers.ts +++ b/src/version3/parameters/getSecurityLevelMembers.ts @@ -1,8 +1,8 @@ export interface GetSecurityLevelMembers { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** * The list of issue security level member IDs. To include multiple issue security level members separate IDs with an * ampersand: `id=10000&id=10001`. diff --git a/src/version3/parameters/getSecurityLevels.ts b/src/version3/parameters/getSecurityLevels.ts index 05024f88eb..4c49f93753 100644 --- a/src/version3/parameters/getSecurityLevels.ts +++ b/src/version3/parameters/getSecurityLevels.ts @@ -1,8 +1,8 @@ export interface GetSecurityLevels { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** * The list of issue security scheme level IDs. To include multiple issue security levels, separate IDs with an * ampersand: `id=10000&id=10001`. diff --git a/src/version3/parameters/getTeams.ts b/src/version3/parameters/getTeams.ts new file mode 100644 index 0000000000..289f646714 --- /dev/null +++ b/src/version3/parameters/getTeams.ts @@ -0,0 +1,8 @@ +export interface GetTeams { + /** The ID of the plan. */ + planId: number; + /** The cursor to start from. If not provided, the first page will be returned. */ + cursor?: string; + /** The maximum number of plan teams to return per page. The maximum value is 50. The default value is 50. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getUser.ts b/src/version3/parameters/getUser.ts index 6d17d114ed..935f89a6d9 100644 --- a/src/version3/parameters/getUser.ts +++ b/src/version3/parameters/getUser.ts @@ -5,15 +5,15 @@ export interface GetUser { */ accountId?: string; /** - * This parameter is no longer available. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) - * for details. + * @deprecated This parameter is no longer available. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) + * for details. */ username?: string; /** - * This parameter is no longer available. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) - * for details. + * @deprecated This parameter is no longer available. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) + * for details. */ key?: string; /** diff --git a/src/version3/parameters/getWorkflowProjectIssueTypeUsages.ts b/src/version3/parameters/getWorkflowProjectIssueTypeUsages.ts new file mode 100644 index 0000000000..42ce81e475 --- /dev/null +++ b/src/version3/parameters/getWorkflowProjectIssueTypeUsages.ts @@ -0,0 +1,10 @@ +export interface GetWorkflowProjectIssueTypeUsages { + /** The workflow ID */ + workflowId: string; + /** The project ID */ + projectId: number; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getWorkflowSchemeProjectAssociations.ts b/src/version3/parameters/getWorkflowSchemeProjectAssociations.ts index 5aa19373fd..e39ce06f95 100644 --- a/src/version3/parameters/getWorkflowSchemeProjectAssociations.ts +++ b/src/version3/parameters/getWorkflowSchemeProjectAssociations.ts @@ -3,5 +3,5 @@ export interface GetWorkflowSchemeProjectAssociations { * The ID of a project to return the workflow schemes for. To include multiple projects, provide an ampersand-Jim: * oneseparated list. For example, `projectId=10000&projectId=10001`. */ - projectId: number[]; + projectId: (string | number)[]; } diff --git a/src/version3/parameters/getWorkflowSchemeUsagesForWorkflow.ts b/src/version3/parameters/getWorkflowSchemeUsagesForWorkflow.ts new file mode 100644 index 0000000000..dae488d332 --- /dev/null +++ b/src/version3/parameters/getWorkflowSchemeUsagesForWorkflow.ts @@ -0,0 +1,8 @@ +export interface GetWorkflowSchemeUsagesForWorkflow { + /** The workflow ID */ + workflowId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version3/parameters/getWorkflowUsagesForStatus.ts b/src/version3/parameters/getWorkflowUsagesForStatus.ts new file mode 100644 index 0000000000..cdfb21d971 --- /dev/null +++ b/src/version3/parameters/getWorkflowUsagesForStatus.ts @@ -0,0 +1,8 @@ +export interface GetWorkflowUsagesForStatus { + /** The statusId to fetch workflow usages for */ + statusId: string; + /** The cursor for pagination */ + nextPageToken?: string; + /** The maximum number of results to return. Must be an integer between 1 and 200. */ + maxResults?: number; +} diff --git a/src/version3/parameters/index.ts b/src/version3/parameters/index.ts index 862d5d6655..130d4bfb0b 100644 --- a/src/version3/parameters/index.ts +++ b/src/version3/parameters/index.ts @@ -1,4 +1,6 @@ +export * from './addNotifications'; export * from './addActorUsers'; +export * from './addAtlassianTeam'; export * from './addAttachment'; export * from './addComment'; export * from './addFieldToDefaultScreen'; @@ -19,6 +21,7 @@ export * from './analyseExpression'; export * from './appendMappingsForIssueTypeScreenScheme'; export * from './archiveIssues'; export * from './archiveIssuesAsync'; +export * from './archivePlan'; export * from './archiveProject'; export * from './assignFieldConfigurationSchemeToProject'; export * from './assignIssue'; @@ -29,16 +32,20 @@ export * from './assignProjectsToCustomFieldContext'; export * from './assignSchemeToProject'; export * from './associateSchemesToProjects'; export * from './bulkDeleteIssueProperty'; +export * from './bulkDeleteWorklogs'; export * from './bulkEditDashboards'; +export * from './bulkFetchIssues'; export * from './bulkGetGroups'; export * from './bulkGetUsers'; export * from './bulkGetUsersMigration'; +export * from './bulkMoveWorklogs'; export * from './bulkSetIssuePropertiesByIssue'; export * from './bulkSetIssueProperty'; export * from './bulkSetIssuesProperties'; export * from './cancelTask'; export * from './changeFilterOwner'; export * from './copyDashboard'; +export * from './countIssues'; export * from './createComponent'; export * from './createCustomField'; export * from './createCustomFieldContext'; @@ -61,11 +68,15 @@ export * from './createNotificationScheme'; export * from './createOrUpdateRemoteIssueLink'; export * from './createPermissionGrant'; export * from './createPermissionScheme'; +export * from './createPlan'; +export * from './createPlanOnlyTeam'; export * from './createPriority'; +export * from './createPriorityScheme'; export * from './createProject'; export * from './createProjectAvatar'; export * from './createProjectCategory'; export * from './createProjectRole'; +export * from './createRelatedWork'; export * from './createResolution'; export * from './createScreen'; export * from './createScreenScheme'; @@ -74,6 +85,7 @@ export * from './createUiModification'; export * from './createUser'; export * from './createVersion'; export * from './createWorkflow'; +export * from './createWorkflows'; export * from './createWorkflowScheme'; export * from './createWorkflowSchemeDraftFromParent'; export * from './createWorkflowTransitionProperty'; @@ -110,12 +122,16 @@ export * from './deleteIssueTypeScreenScheme'; export * from './deleteNotificationScheme'; export * from './deletePermissionScheme'; export * from './deletePermissionSchemeEntity'; +export * from './deletePlanOnlyTeam'; +export * from './deletePriority'; +export * from './deletePriorityScheme'; export * from './deleteProject'; export * from './deleteProjectAsynchronously'; export * from './deleteProjectAvatar'; export * from './deleteProjectProperty'; export * from './deleteProjectRole'; export * from './deleteProjectRoleActorsFromRole'; +export * from './deleteRelatedWork'; export * from './deleteRemoteIssueLinkByGlobalId'; export * from './deleteRemoteIssueLinkById'; export * from './deleteResolution'; @@ -138,13 +154,16 @@ export * from './deleteWorkflowTransitionRuleConfigurations'; export * from './deleteWorklog'; export * from './deleteWorklogProperty'; export * from './doTransition'; +export * from './duplicatePlan'; export * from './editIssue'; export * from './evaluateJiraExpression'; +export * from './evaluateJiraExpressionUsingEnhancedSearch'; export * from './expandAttachmentForHumans'; export * from './expandAttachmentForMachines'; export * from './exportArchivedIssues'; export * from './findAssignableUsers'; export * from './findBulkAssignableUsers'; +export * from './findComponentsForProjects'; export * from './findGroups'; export * from './findUserKeysByQuery'; export * from './findUsers'; @@ -170,6 +189,7 @@ export * from './getAllScreenTabFields'; export * from './getAllScreenTabs'; export * from './getAllStatuses'; export * from './getAllSystemAvatars'; +export * from './getAllUserDataClassificationLevels'; export * from './getAllUsers'; export * from './getAllUsersDefault'; export * from './getAllWorkflowSchemes'; @@ -177,17 +197,24 @@ export * from './getAlternativeIssueTypes'; export * from './getApplicationProperty'; export * from './getApplicationRole'; export * from './getAssignedPermissionScheme'; +export * from './getAtlassianTeam'; export * from './getAttachment'; export * from './getAttachmentContent'; export * from './getAttachmentThumbnail'; export * from './getAuditRecords'; export * from './getAutoCompletePost'; +export * from './getAvailablePrioritiesByPriorityScheme'; export * from './getAvailableScreenFields'; +export * from './getAvailableTransitions'; export * from './getAvatarImageByID'; export * from './getAvatarImageByOwner'; export * from './getAvatarImageByType'; export * from './getAvatars'; +export * from './getBulkChangelogs'; +export * from './getBulkEditableFields'; +export * from './getBulkOperationProgress'; export * from './getBulkPermissions'; +export * from './getBulkScreenTabs'; export * from './getChangeLogs'; export * from './getChangeLogsByIds'; export * from './getColumns'; @@ -200,14 +227,18 @@ export * from './getComponent'; export * from './getComponentRelatedIssues'; export * from './getContextsForField'; export * from './getCreateIssueMeta'; +export * from './getCreateIssueMetaIssueTypeId'; +export * from './getCreateIssueMetaIssueTypes'; export * from './getCurrentUser'; export * from './getCustomFieldConfiguration'; export * from './getCustomFieldContextsForProjectsAndIssueTypes'; export * from './getCustomFieldOption'; +export * from './getCustomFieldsConfigurations'; export * from './getDashboard'; export * from './getDashboardItemProperty'; export * from './getDashboardItemPropertyKeys'; export * from './getDashboardsPaginated'; +export * from './getDefaultProjectClassification'; export * from './getDefaultValues'; export * from './getDefaultWorkflow'; export * from './getDraftDefaultWorkflow'; @@ -229,6 +260,7 @@ export * from './getIdsOfWorklogsDeletedSince'; export * from './getIdsOfWorklogsModifiedSince'; export * from './getIssue'; export * from './getIssueFieldOption'; +export * from './getIssueLimitReport'; export * from './getIssueLink'; export * from './getIssueLinkType'; export * from './getIssuePickerResource'; @@ -253,6 +285,7 @@ export * from './getIsWatchingIssueBulk'; export * from './getMyFilters'; export * from './getMyPermissions'; export * from './getNotificationScheme'; +export * from './getNotificationSchemeForProject'; export * from './getNotificationSchemes'; export * from './getNotificationSchemeToProjectMappings'; export * from './getOptionsForContext'; @@ -260,9 +293,16 @@ export * from './getPermissionScheme'; export * from './getPermissionSchemeGrant'; export * from './getPermissionSchemeGrants'; export * from './getPermittedProjects'; +export * from './getPlan'; +export * from './getPlanOnlyTeam'; +export * from './getPlans'; +export * from './getPolicies'; export * from './getPrecomputations'; +export * from './getPrecomputationsByID'; export * from './getPreference'; +export * from './getPrioritiesByPriorityScheme'; export * from './getPriority'; +export * from './getPrioritySchemes'; export * from './getProject'; export * from './getProjectCategoryById'; export * from './getProjectComponents'; @@ -270,6 +310,7 @@ export * from './getProjectComponentsPaginated'; export * from './getProjectContextMapping'; export * from './getProjectEmail'; export * from './getProjectIssueSecurityScheme'; +export * from './getProjectIssueTypeUsagesForStatus'; export * from './getProjectProperty'; export * from './getProjectPropertyKeys'; export * from './getProjectRole'; @@ -277,13 +318,19 @@ export * from './getProjectRoleActorsForRole'; export * from './getProjectRoleById'; export * from './getProjectRoleDetails'; export * from './getProjectRoles'; +export * from './getProjectsByPriorityScheme'; export * from './getProjectsForIssueTypeScreenScheme'; export * from './getProjectTypeByKey'; +export * from './getProjectUsagesForStatus'; +export * from './getProjectUsagesForWorkflow'; +export * from './getProjectUsagesForWorkflowScheme'; export * from './getProjectVersions'; export * from './getProjectVersionsPaginated'; export * from './getRecent'; +export * from './getRelatedWork'; export * from './getRemoteIssueLinkById'; export * from './getRemoteIssueLinks'; +export * from './getResolution'; export * from './getScreens'; export * from './getScreenSchemes'; export * from './getScreensForField'; @@ -297,6 +344,7 @@ export * from './getStatus'; export * from './getStatusCategory'; export * from './getStatusesById'; export * from './getTask'; +export * from './getTeams'; export * from './getTransitions'; export * from './getTrashedFieldsPaginated'; export * from './getUiModifications'; @@ -316,14 +364,17 @@ export * from './getVersionUnresolvedIssues'; export * from './getVisibleIssueFieldOptions'; export * from './getVotes'; export * from './getWorkflow'; +export * from './getWorkflowProjectIssueTypeUsages'; export * from './getWorkflowScheme'; export * from './getWorkflowSchemeDraft'; export * from './getWorkflowSchemeDraftIssueType'; export * from './getWorkflowSchemeIssueType'; export * from './getWorkflowSchemeProjectAssociations'; +export * from './getWorkflowSchemeUsagesForWorkflow'; export * from './getWorkflowsPaginated'; export * from './getWorkflowTransitionProperties'; export * from './getWorkflowTransitionRuleConfigurations'; +export * from './getWorkflowUsagesForStatus'; export * from './getWorklog'; export * from './getWorklogProperty'; export * from './getWorklogPropertyKeys'; @@ -343,11 +394,15 @@ export * from './partialUpdateProjectRole'; export * from './publishDraftWorkflowScheme'; export * from './putAddonProperty'; export * from './putAppProperty'; +export * from './readWorkflows'; +export * from './readWorkflowSchemes'; export * from './refreshWebhooks'; export * from './registerDynamicWebhooks'; export * from './registerModules'; +export * from './removeAtlassianTeam'; export * from './removeAttachment'; export * from './removeCustomFieldContextFromProjects'; +export * from './removeDefaultProjectClassification'; export * from './removeGadget'; export * from './removeGroup'; export * from './removeIssueTypeFromIssueTypeScheme'; @@ -368,6 +423,7 @@ export * from './removeWatcher'; export * from './renameScreenTab'; export * from './reorderCustomFieldOptions'; export * from './reorderIssueTypesInIssueTypeScheme'; +export * from './replaceCustomFieldOption'; export * from './replaceIssueFieldOption'; export * from './resetColumns'; export * from './resetUserColumns'; @@ -375,14 +431,19 @@ export * from './restore'; export * from './restoreCustomField'; export * from './sanitiseJqlQueries'; export * from './search'; +export * from './searchForIssuesIds'; export * from './searchForIssuesUsingJql'; +export * from './searchForIssuesUsingJqlEnhancedSearch'; +export * from './searchForIssuesUsingJqlEnhancedSearchPost'; export * from './searchForIssuesUsingJqlPost'; export * from './searchPriorities'; export * from './searchProjects'; export * from './searchProjectsUsingSecuritySchemes'; export * from './searchResolutions'; export * from './searchSecuritySchemes'; +export * from './searchWorkflows'; export * from './selectTimeTrackingImplementation'; +export * from './services'; export * from './setActors'; export * from './setApplicationProperty'; export * from './setBanner'; @@ -407,9 +468,16 @@ export * from './setWorkflowSchemeDraftIssueType'; export * from './setWorkflowSchemeIssueType'; export * from './setWorklogProperty'; export * from './storeAvatar'; +export * from './submitBulkDelete'; +export * from './submitBulkEdit'; +export * from './submitBulkMove'; +export * from './submitBulkTransition'; +export * from './suggestedPrioritiesForMappings'; export * from './toggleFeatureForProject'; export * from './trashCustomField'; +export * from './trashPlan'; export * from './unarchiveIssues'; +export * from './updateAtlassianTeam'; export * from './updateComment'; export * from './updateComponent'; export * from './updateCustomField'; @@ -418,6 +486,7 @@ export * from './updateCustomFieldContext'; export * from './updateCustomFieldOption'; export * from './updateCustomFieldValue'; export * from './updateDashboard'; +export * from './updateDefaultProjectClassification'; export * from './updateDefaultScreenScheme'; export * from './updateDefaultWorkflow'; export * from './updateDraftDefaultWorkflow'; @@ -438,14 +507,19 @@ export * from './updateIssueTypeScreenScheme'; export * from './updateMultipleCustomFieldValues'; export * from './updateNotificationScheme'; export * from './updatePermissionScheme'; +export * from './updatePlan'; +export * from './updatePlanOnlyTeam'; export * from './updatePrecomputations'; export * from './updatePriority'; +export * from './updatePriorityScheme'; export * from './updateProject'; export * from './updateProjectAvatar'; export * from './updateProjectCategory'; export * from './updateProjectEmail'; +export * from './updateRelatedWork'; export * from './updateRemoteIssueLink'; export * from './updateResolution'; +export * from './updateSchemes'; export * from './updateScreen'; export * from './updateScreenScheme'; export * from './updateSecurityLevel'; @@ -453,10 +527,15 @@ export * from './updateStatuses'; export * from './updateUiModification'; export * from './updateVersion'; export * from './updateWorkflowMapping'; +export * from './updateWorkflows'; export * from './updateWorkflowScheme'; export * from './updateWorkflowSchemeDraft'; +export * from './updateWorkflowSchemeMappings'; export * from './updateWorkflowTransitionProperty'; export * from './updateWorkflowTransitionRuleConfigurations'; export * from './updateWorklog'; +export * from './validateCreateWorkflows'; export * from './validateProjectKey'; +export * from './validateUpdateWorkflows'; +export * from './workflowCapabilities'; export * from './workflowRuleSearch'; diff --git a/src/version3/parameters/readWorkflowSchemes.ts b/src/version3/parameters/readWorkflowSchemes.ts new file mode 100644 index 0000000000..5fb818a169 --- /dev/null +++ b/src/version3/parameters/readWorkflowSchemes.ts @@ -0,0 +1,3 @@ +import { WorkflowSchemeReadRequest } from '../models'; + +export interface ReadWorkflowSchemes extends WorkflowSchemeReadRequest {} diff --git a/src/version3/parameters/readWorkflows.ts b/src/version3/parameters/readWorkflows.ts new file mode 100644 index 0000000000..cc844a5386 --- /dev/null +++ b/src/version3/parameters/readWorkflows.ts @@ -0,0 +1,20 @@ +import { ProjectAndIssueTypePair } from '../models'; + +export interface ReadWorkflows { + /** + * Return the new fields (`toStatusReference`/`links`) instead of the deprecated fields (`to`/`from`) for workflow + * transition port mappings. + */ + useTransitionLinksFormat?: boolean; + /** + * Return the new field `approvalConfiguration` instead of the deprecated status properties for approval + * configuration. + */ + useApprovalConfiguration?: boolean; + /** The list of projects and issue types to query. */ + projectAndIssueTypes?: ProjectAndIssueTypePair[]; + /** The list of workflow IDs to query. */ + workflowIds?: string[]; + /** The list of workflow names to query. */ + workflowNames?: string[]; +} diff --git a/src/version3/parameters/removeAtlassianTeam.ts b/src/version3/parameters/removeAtlassianTeam.ts new file mode 100644 index 0000000000..02650c1553 --- /dev/null +++ b/src/version3/parameters/removeAtlassianTeam.ts @@ -0,0 +1,6 @@ +export interface RemoveAtlassianTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the Atlassian team. */ + atlassianTeamId: string; +} diff --git a/src/version3/parameters/removeDefaultProjectClassification.ts b/src/version3/parameters/removeDefaultProjectClassification.ts new file mode 100644 index 0000000000..103f00b406 --- /dev/null +++ b/src/version3/parameters/removeDefaultProjectClassification.ts @@ -0,0 +1,4 @@ +export interface RemoveDefaultProjectClassification { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; +} diff --git a/src/version3/parameters/removeUser.ts b/src/version3/parameters/removeUser.ts index 9a94e575af..0cb0db148e 100644 --- a/src/version3/parameters/removeUser.ts +++ b/src/version3/parameters/removeUser.ts @@ -5,15 +5,15 @@ export interface RemoveUser { */ accountId: string; /** - * This parameter is no longer available. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. + * @deprecated This parameter is no longer available. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. */ username?: string; /** - * This parameter is no longer available. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. + * @deprecated This parameter is no longer available. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. */ key?: string; } diff --git a/src/version3/parameters/replaceCustomFieldOption.ts b/src/version3/parameters/replaceCustomFieldOption.ts new file mode 100644 index 0000000000..aa7b88be53 --- /dev/null +++ b/src/version3/parameters/replaceCustomFieldOption.ts @@ -0,0 +1,12 @@ +export interface ReplaceCustomFieldOption { + /** The ID of the option that will replace the currently selected option. */ + replaceWith?: number; + /** A JQL query that specifies the issues to be updated. For example, _project=10000_. */ + jql?: string; + /** The ID of the custom field. */ + fieldId: string; + /** The ID of the option to be deselected. */ + optionId: number; + /** The ID of the context. */ + contextId: number; +} diff --git a/src/version3/parameters/resetUserColumns.ts b/src/version3/parameters/resetUserColumns.ts index db5e050077..55e573ad27 100644 --- a/src/version3/parameters/resetUserColumns.ts +++ b/src/version3/parameters/resetUserColumns.ts @@ -5,9 +5,9 @@ export interface ResetUserColumns { */ accountId?: string; /** - * This parameter is no longer available. See the [deprecation - * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) - * for details. + * @deprecated This parameter is no longer available. See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) + * for details. */ username?: string; } diff --git a/src/version3/parameters/restore.ts b/src/version3/parameters/restore.ts index 07853edc20..c8fd6ca5ef 100644 --- a/src/version3/parameters/restore.ts +++ b/src/version3/parameters/restore.ts @@ -1,4 +1,4 @@ export interface Restore { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version3/parameters/search.ts b/src/version3/parameters/search.ts index 12e70ef240..226af19539 100644 --- a/src/version3/parameters/search.ts +++ b/src/version3/parameters/search.ts @@ -1,10 +1,13 @@ export interface Search { /** - * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional - * information in the response. This parameter accepts a comma-separated list. Expand options include: + * @deprecated See the [deprecation + * notice](https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-2298) for details. * - * - `usages` Returns the project and issue types that use the status in their workflow. - * - `workflowUsages` Returns the workflows that use the status. + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `usages` Returns the project and issue types that use the status in their workflow. + * - `workflowUsages` Returns the workflows that use the status. */ expand?: 'usages' | 'workflowUsages' | ('usages' | 'workflowUsages')[] | string | string[]; /** The project the status is part of or null for global statuses. */ diff --git a/src/version3/parameters/searchForIssuesIds.ts b/src/version3/parameters/searchForIssuesIds.ts new file mode 100644 index 0000000000..3c6179bc0b --- /dev/null +++ b/src/version3/parameters/searchForIssuesIds.ts @@ -0,0 +1,3 @@ +import { IdSearchRequest } from '../models'; + +export interface SearchForIssuesIds extends IdSearchRequest {} diff --git a/src/version3/parameters/searchForIssuesUsingJql.ts b/src/version3/parameters/searchForIssuesUsingJql.ts index c47b71a6c1..8e5c674498 100644 --- a/src/version3/parameters/searchForIssuesUsingJql.ts +++ b/src/version3/parameters/searchForIssuesUsingJql.ts @@ -47,14 +47,37 @@ export interface SearchForIssuesUsingJql { * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional * information about issues in the response. This parameter accepts a comma-separated list. Expand options include: * - * `renderedFields` Returns field values rendered in HTML format. `names` Returns the display name of each field. - * `schema` Returns the schema describing a field type. `transitions` Returns all possible transitions for the issue. - * `operations` Returns all possible operations for the issue. `editmeta` Returns information about how each field can - * be edited. `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. - * `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each - * version of a field's value, with the highest numbered item representing the most recent version. + * - `renderedFields` Returns field values rendered in HTML format. + * - `names` Returns the display name of each field. + * - `schema` Returns the schema describing a field type. + * - `transitions` Returns all possible transitions for the issue. + * - `operations` Returns all possible operations for the issue. + * - `editmeta` Returns information about how each field can be edited. + * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each + * version of a field's value, with the highest numbered item representing the most recent version. */ - expand?: string; + expand?: + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | string + | ( + | 'renderedFields' + | 'names' + | 'schema' + | 'transitions' + | 'operations' + | 'editmeta' + | 'changelog' + | 'versionedRepresentations' + | string + )[]; /** * A list of issue property keys for issue properties to include in the results. This parameter accepts a * comma-separated list. Multiple properties can also be provided using an ampersand separated list. For example, @@ -63,4 +86,10 @@ export interface SearchForIssuesUsingJql { properties?: string[]; /** Reference fields by their key (rather than ID). */ fieldsByKeys?: boolean; + /** + * Whether to fail the request quickly in case of an error while loading fields for an issue. For `failFast=true`, if + * one field fails, the entire operation fails. For `failFast=false`, the operation will continue even if a field + * fails. It will return a valid response, but without values for the failed field(s). + */ + failFast?: boolean; } diff --git a/src/version3/parameters/searchForIssuesUsingJqlEnhancedSearch.ts b/src/version3/parameters/searchForIssuesUsingJqlEnhancedSearch.ts new file mode 100644 index 0000000000..03c024d4d5 --- /dev/null +++ b/src/version3/parameters/searchForIssuesUsingJqlEnhancedSearch.ts @@ -0,0 +1,79 @@ +export interface SearchForIssuesUsingJqlEnhancedSearch { + /** + * The [JQL](https://confluence.atlassian.com/x/egORLQ) expression. For performance reasons, this parameter requires a + * bounded query. A bounded query is a query with a search restriction. + * + * - Example of an unbounded query: `order by key desc`. + * - Example of a bounded query: `assignee = currentUser() order by key`. + * + * Additionally, `orderBy` clause can contain a maximum of 7 fields. + */ + jql: string; + /** + * The token for a page to fetch that is not the first page. The first page has a `nextPageToken` of `null`. Use the + * `nextPageToken` to fetch the next page of issues. + */ + nextPageToken?: string; + /** + * The maximum number of items to return per page. To manage page size, API may return fewer items per page where a + * large number of fields are requested. The greatest number of items returned per page is achieved when requesting + * `id` or `key` only. + * + * It returns max 5000 issues. + * + * Default: `50` + * + * Format: `int32` + */ + maxResults?: number; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a + * comma-separated list. Expand options include: + * + * - `*all` Returns all fields. + * - `*navigable` Returns navigable fields. + * - `id` Returns only issue IDs. + * - Any issue field, prefixed with a minus to exclude. + * + * The default is `id`. + * + * Examples: + * + * - `summary,comment` Returns only the summary and comments fields. + * - `-description` Returns all navigable (default) fields except description. + * - `*all,-comment` Returns all fields except comments. + * + * Multiple `fields` parameters can be included in a request. + * + * Note: By default, this resource returns IDs only. This differs from [GET + * issue](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get) + * where the default is all fields. + */ + fields?: string[]; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information about issues in the response. Note that, unlike the majority of instances where `expand` is specified, + * `expand` is defined as a comma-delimited string of values. The expand options are: + * + * - `renderedFields` Returns field values rendered in HTML format. + * - `names` Returns the display name of each field. + * - `schema` Returns the schema describing a field type. + * - `transitions` Returns all possible transitions for the issue. + * - `operations` Returns all possible operations for the issue. + * - `editmeta` Returns information about how each field can be edited. + * - `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * - `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each + * version of a field's value, with the highest numbered item representing the most recent version. + * + * Examples: `names,changelog` Returns the display name of each field as well as a list of recent updates to an issue. + */ + expand?: string; + /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ + properties?: string[]; + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys?: boolean; + /** Fail this request early if we can't retrieve all field data. The default is `false`. */ + failFast?: boolean; + /** Strong consistency issue ids to be reconciled with search results. Accepts max 50 ids. All issues must exist. */ + reconcileIssues?: number[]; +} diff --git a/src/version3/parameters/searchForIssuesUsingJqlEnhancedSearchPost.ts b/src/version3/parameters/searchForIssuesUsingJqlEnhancedSearchPost.ts new file mode 100644 index 0000000000..f00326bc86 --- /dev/null +++ b/src/version3/parameters/searchForIssuesUsingJqlEnhancedSearchPost.ts @@ -0,0 +1,3 @@ +import { EnhancedSearchRequest } from '../models'; + +export interface SearchForIssuesUsingJqlEnhancedSearchPost extends EnhancedSearchRequest {} diff --git a/src/version3/parameters/searchPriorities.ts b/src/version3/parameters/searchPriorities.ts index 2d704bbb30..7ad7be9707 100644 --- a/src/version3/parameters/searchPriorities.ts +++ b/src/version3/parameters/searchPriorities.ts @@ -1,8 +1,8 @@ export interface SearchPriorities { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The list of priority IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=2&id=3`. */ id?: string[]; /** @@ -10,6 +10,13 @@ export interface SearchPriorities { * `projectId=10010&projectId=10111`. */ projectId?: string[]; + /** The name of priority to search for. */ + priorityName?: string; /** Whether only the default priority is returned. */ onlyDefault?: boolean; + /** + * Use `schemes` to return the associated priority schemes for each priority. Limited to returning first 15 priority + * schemes per priority. + */ + expand?: 'schemes' | string; } diff --git a/src/version3/parameters/searchProjectsUsingSecuritySchemes.ts b/src/version3/parameters/searchProjectsUsingSecuritySchemes.ts index 6e2ee07020..ba08b5778f 100644 --- a/src/version3/parameters/searchProjectsUsingSecuritySchemes.ts +++ b/src/version3/parameters/searchProjectsUsingSecuritySchemes.ts @@ -1,8 +1,8 @@ export interface SearchProjectsUsingSecuritySchemes { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** The list of security scheme IDs to be filtered out. */ issueSecuritySchemeId?: string[]; /** The list of project IDs to be filtered out. */ diff --git a/src/version3/parameters/searchSecuritySchemes.ts b/src/version3/parameters/searchSecuritySchemes.ts index eb6b6edc62..df7dae9577 100644 --- a/src/version3/parameters/searchSecuritySchemes.ts +++ b/src/version3/parameters/searchSecuritySchemes.ts @@ -1,8 +1,8 @@ export interface SearchSecuritySchemes { /** The index of the first item to return in a page of results (page offset). */ - startAt?: string; + startAt?: number; /** The maximum number of items to return per page. */ - maxResults?: string; + maxResults?: number; /** * The list of issue security scheme IDs. To include multiple issue security scheme IDs, separate IDs with an * ampersand: `id=10000&id=10001`. diff --git a/src/version3/parameters/searchWorkflows.ts b/src/version3/parameters/searchWorkflows.ts new file mode 100644 index 0000000000..c58c10c393 --- /dev/null +++ b/src/version3/parameters/searchWorkflows.ts @@ -0,0 +1,37 @@ +export interface SearchWorkflows { + /** The index of the first item to return in a page of results (page offset). */ + startAt?: number; + /** The maximum number of items to return per page. */ + maxResults?: number; + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `values.transitions` Returns the transitions that each workflow is associated with. + */ + expand?: 'values.transitions' | string; + /** String used to perform a case-insensitive partial match with workflow name. */ + queryString?: string; + /** + * [Order](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#ordering) the results by a field: + * + * - `name` Sorts by workflow name. + * - `created` Sorts by create time. + * - `updated` Sorts by update time. + */ + orderBy?: + | 'name' + | 'created' + | 'updated' + | '+name' + | '+created' + | '+updated' + | '-name' + | '-created' + | '-updated' + | string; + /** The scope of the workflow. Global for company-managed projects and Project for team-managed projects. */ + scope?: string; + /** Filters active and inactive workflows. */ + isActive?: boolean; +} diff --git a/src/version3/parameters/services.ts b/src/version3/parameters/services.ts new file mode 100644 index 0000000000..296a9d0439 --- /dev/null +++ b/src/version3/parameters/services.ts @@ -0,0 +1,4 @@ +export interface Services { + /** The ID of the services (the strings starting with "b:" need to be decoded in Base64). */ + serviceIds: string[]; +} diff --git a/src/version3/parameters/setActors.ts b/src/version3/parameters/setActors.ts index 07bf498caf..a85bf1a69a 100644 --- a/src/version3/parameters/setActors.ts +++ b/src/version3/parameters/setActors.ts @@ -2,7 +2,7 @@ import { ProjectRoleActorsUpdate } from '../models'; export interface SetActors extends ProjectRoleActorsUpdate { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role * IDs. diff --git a/src/version3/parameters/setProjectProperty.ts b/src/version3/parameters/setProjectProperty.ts index 518b1d3e9e..ac6535a5ee 100644 --- a/src/version3/parameters/setProjectProperty.ts +++ b/src/version3/parameters/setProjectProperty.ts @@ -1,6 +1,6 @@ export interface SetProjectProperty { /** The project ID or project key (case sensitive). */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** The key of the project property. The maximum length is 255 characters. */ propertyKey: string; propertyValue: any; diff --git a/src/version3/parameters/storeAvatar.ts b/src/version3/parameters/storeAvatar.ts index b9f98e0b99..6b119338a9 100644 --- a/src/version3/parameters/storeAvatar.ts +++ b/src/version3/parameters/storeAvatar.ts @@ -2,12 +2,17 @@ export interface StoreAvatar { /** The avatar type. */ type: 'project' | 'issuetype' | string; /** The ID of the item the avatar is associated with. */ - entityId: string; + entityId: number | string; /** The X coordinate of the top-left corner of the crop region. */ x?: number; /** The Y coordinate of the top-left corner of the crop region. */ y?: number; - /** The length of each side of the crop region. */ - size: number; - avatar: any; + /** + * The length of each side of the crop region. + * + * @default 0 + */ + size?: number; + mimeType: string; + avatar: Buffer | ArrayBuffer | Uint8Array | any; } diff --git a/src/version3/parameters/submitBulkDelete.ts b/src/version3/parameters/submitBulkDelete.ts new file mode 100644 index 0000000000..623f3ab259 --- /dev/null +++ b/src/version3/parameters/submitBulkDelete.ts @@ -0,0 +1,3 @@ +import { IssueBulkDeletePayload } from '../models'; + +export interface SubmitBulkDelete extends IssueBulkDeletePayload {} diff --git a/src/version3/parameters/submitBulkEdit.ts b/src/version3/parameters/submitBulkEdit.ts new file mode 100644 index 0000000000..a00603a06d --- /dev/null +++ b/src/version3/parameters/submitBulkEdit.ts @@ -0,0 +1,3 @@ +import { IssueBulkEditPayload } from '../models'; + +export interface SubmitBulkEdit extends IssueBulkEditPayload {} diff --git a/src/version3/parameters/submitBulkMove.ts b/src/version3/parameters/submitBulkMove.ts new file mode 100644 index 0000000000..198ed83acc --- /dev/null +++ b/src/version3/parameters/submitBulkMove.ts @@ -0,0 +1,3 @@ +import { IssueBulkMovePayload } from '../models'; + +export interface SubmitBulkMove extends IssueBulkMovePayload {} diff --git a/src/version3/parameters/submitBulkTransition.ts b/src/version3/parameters/submitBulkTransition.ts new file mode 100644 index 0000000000..21b62066a2 --- /dev/null +++ b/src/version3/parameters/submitBulkTransition.ts @@ -0,0 +1,3 @@ +import { IssueBulkTransitionPayload } from '../models'; + +export interface SubmitBulkTransition extends IssueBulkTransitionPayload {} diff --git a/src/version3/parameters/suggestedPrioritiesForMappings.ts b/src/version3/parameters/suggestedPrioritiesForMappings.ts new file mode 100644 index 0000000000..ed706bf989 --- /dev/null +++ b/src/version3/parameters/suggestedPrioritiesForMappings.ts @@ -0,0 +1,3 @@ +import { SuggestedMappingsRequest } from '../models'; + +export interface SuggestedPrioritiesForMappings extends SuggestedMappingsRequest {} diff --git a/src/version3/parameters/toggleFeatureForProject.ts b/src/version3/parameters/toggleFeatureForProject.ts index c5a8fde0f7..7891492f04 100644 --- a/src/version3/parameters/toggleFeatureForProject.ts +++ b/src/version3/parameters/toggleFeatureForProject.ts @@ -2,7 +2,7 @@ import { ProjectFeatureToggleRequest } from '../models'; export interface ToggleFeatureForProject extends ProjectFeatureToggleRequest { /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; + projectIdOrKey: string | number; /** The key of the feature. */ featureKey: string; } diff --git a/src/version3/parameters/trashPlan.ts b/src/version3/parameters/trashPlan.ts new file mode 100644 index 0000000000..e960cc100a --- /dev/null +++ b/src/version3/parameters/trashPlan.ts @@ -0,0 +1,4 @@ +export interface TrashPlan { + /** The ID of the plan. */ + planId: number; +} diff --git a/src/version3/parameters/updateAtlassianTeam.ts b/src/version3/parameters/updateAtlassianTeam.ts new file mode 100644 index 0000000000..d5a9fb9dfe --- /dev/null +++ b/src/version3/parameters/updateAtlassianTeam.ts @@ -0,0 +1,6 @@ +export interface UpdateAtlassianTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the Atlassian team. */ + atlassianTeamId: string; +} diff --git a/src/version3/parameters/updateComment.ts b/src/version3/parameters/updateComment.ts index 3fe24754b9..417108b569 100644 --- a/src/version3/parameters/updateComment.ts +++ b/src/version3/parameters/updateComment.ts @@ -1,6 +1,6 @@ -import { Comment } from '../models'; +import { Comment, Document } from '../models'; -export interface UpdateComment extends Comment { +export interface UpdateComment extends Omit { /** The ID or key of the issue. */ issueIdOrKey: string; /** The ID of the comment. */ @@ -19,4 +19,5 @@ export interface UpdateComment extends Comment { * rendered in HTML. */ expand?: 'renderedBody' | ['renderedBody'] | string | string[]; + body?: Document | string; } diff --git a/src/version3/parameters/updateDashboard.ts b/src/version3/parameters/updateDashboard.ts index 3b01c0c2d9..7144648aa6 100644 --- a/src/version3/parameters/updateDashboard.ts +++ b/src/version3/parameters/updateDashboard.ts @@ -3,4 +3,9 @@ import { DashboardDetails } from '../models'; export interface UpdateDashboard extends DashboardDetails { /** The ID of the dashboard to update. */ id: string; + /** + * Whether admin level permissions are used. It should only be true if the user has _Administer Jira_ [global + * permission](https://confluence.atlassian.com/x/x4dKLg) + */ + extendAdminPermissions?: boolean; } diff --git a/src/version3/parameters/updateDefaultProjectClassification.ts b/src/version3/parameters/updateDefaultProjectClassification.ts new file mode 100644 index 0000000000..01b6cb1eb2 --- /dev/null +++ b/src/version3/parameters/updateDefaultProjectClassification.ts @@ -0,0 +1,6 @@ +import { UpdateDefaultProjectClassification as UpdateDefaultProjectClassificationModel } from '../models'; + +export interface UpdateDefaultProjectClassification extends UpdateDefaultProjectClassificationModel { + /** The project ID or project key (case-sensitive). */ + projectIdOrKey: string; +} diff --git a/src/version3/parameters/updatePlan.ts b/src/version3/parameters/updatePlan.ts new file mode 100644 index 0000000000..70161d1d58 --- /dev/null +++ b/src/version3/parameters/updatePlan.ts @@ -0,0 +1,29 @@ +import { + CreateCrossProjectReleaseRequest, + CreateCustomFieldRequest, + CreateExclusionRulesRequest, + CreateIssueSourceRequest, + CreatePermissionRequest, + CreateSchedulingRequest, +} from '@jirajs/version3/models'; + +export interface UpdatePlan { + /** The ID of the plan. */ + planId: number; + /** Whether to accept group IDs instead of group names. Group names are deprecated. */ + useGroupId?: boolean; + /** The cross-project releases to include in the plan. */ + crossProjectReleases?: CreateCrossProjectReleaseRequest[]; + /** The custom fields for the plan. */ + customFields?: CreateCustomFieldRequest[]; + exclusionRules?: CreateExclusionRulesRequest; + /** The issue sources to include in the plan. */ + issueSources?: CreateIssueSourceRequest[]; + /** The account ID of the plan lead. */ + leadAccountId?: string; + /** The plan name. */ + name?: string; + /** The permissions for the plan. */ + permissions?: CreatePermissionRequest[]; + scheduling?: CreateSchedulingRequest; +} diff --git a/src/version3/parameters/updatePlanOnlyTeam.ts b/src/version3/parameters/updatePlanOnlyTeam.ts new file mode 100644 index 0000000000..7e4b3b5820 --- /dev/null +++ b/src/version3/parameters/updatePlanOnlyTeam.ts @@ -0,0 +1,6 @@ +export interface UpdatePlanOnlyTeam { + /** The ID of the plan. */ + planId: number; + /** The ID of the plan-only team. */ + planOnlyTeamId: number; +} diff --git a/src/version3/parameters/updatePrecomputations.ts b/src/version3/parameters/updatePrecomputations.ts index ecf83b9aaf..7371900380 100644 --- a/src/version3/parameters/updatePrecomputations.ts +++ b/src/version3/parameters/updatePrecomputations.ts @@ -1,3 +1,5 @@ import { JqlFunctionPrecomputationUpdateRequest } from '../models'; -export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest {} +export interface UpdatePrecomputations extends JqlFunctionPrecomputationUpdateRequest { + skipNotFoundPrecomputations?: boolean; +} diff --git a/src/version3/parameters/updatePriorityScheme.ts b/src/version3/parameters/updatePriorityScheme.ts new file mode 100644 index 0000000000..bbd7a2f666 --- /dev/null +++ b/src/version3/parameters/updatePriorityScheme.ts @@ -0,0 +1,6 @@ +import { UpdatePrioritySchemeRequest } from '../models'; + +export interface UpdatePriorityScheme extends UpdatePrioritySchemeRequest { + /** The ID of the priority scheme. */ + schemeId: number; +} diff --git a/src/version3/parameters/updateProject.ts b/src/version3/parameters/updateProject.ts index e800522df0..9fdfd4e2c8 100644 --- a/src/version3/parameters/updateProject.ts +++ b/src/version3/parameters/updateProject.ts @@ -2,7 +2,7 @@ import { UpdateProjectDetails } from '../models'; export interface UpdateProject extends UpdateProjectDetails { /** The project ID or project key (case-sensitive). */ - projectIdOrKey: number | string; + projectIdOrKey: string | number; projectTypeKey?: string; projectTemplateKey?: string; /** diff --git a/src/version3/parameters/updateProjectAvatar.ts b/src/version3/parameters/updateProjectAvatar.ts index d31b4ca4b6..6803b3f5d8 100644 --- a/src/version3/parameters/updateProjectAvatar.ts +++ b/src/version3/parameters/updateProjectAvatar.ts @@ -2,5 +2,5 @@ import { Avatar } from '../models'; export interface UpdateProjectAvatar extends Avatar { /** The ID or (case-sensitive) key of the project. */ - projectIdOrKey: string; + projectIdOrKey: string | number; } diff --git a/src/version3/parameters/updateProjectEmail.ts b/src/version3/parameters/updateProjectEmail.ts index c3bf7237a2..e8f4ca86f7 100644 --- a/src/version3/parameters/updateProjectEmail.ts +++ b/src/version3/parameters/updateProjectEmail.ts @@ -2,5 +2,5 @@ import { ProjectEmailAddress } from '../models'; export interface UpdateProjectEmail extends ProjectEmailAddress { /** The project ID. */ - projectId: number; + projectId: string | number; } diff --git a/src/version3/parameters/updateRelatedWork.ts b/src/version3/parameters/updateRelatedWork.ts new file mode 100644 index 0000000000..4d0d5a170b --- /dev/null +++ b/src/version3/parameters/updateRelatedWork.ts @@ -0,0 +1,6 @@ +import { VersionRelatedWork } from '../models'; + +export interface UpdateRelatedWork extends VersionRelatedWork { + /** The ID of the version to update the related work on. For the related work id, pass it to the input JSON. */ + id: string; +} diff --git a/src/version3/parameters/updateSchemes.ts b/src/version3/parameters/updateSchemes.ts new file mode 100644 index 0000000000..b2cc22e053 --- /dev/null +++ b/src/version3/parameters/updateSchemes.ts @@ -0,0 +1,34 @@ +import { + MappingsByIssueTypeOverride, MappingsByWorkflow, DocumentVersion, WorkflowSchemeAssociation, +} from '../models'; + +/** The update workflow scheme payload. */ +export interface UpdateSchemes { + /** + * The ID of the workflow for issue types without having a mapping defined in this workflow scheme. Only used in + * global-scoped workflow schemes. If the `defaultWorkflowId` isn't specified, this is set to _Jira Workflow (jira)_. + */ + defaultWorkflowId?: string; + /** The new description for this workflow scheme. */ + description: string; + /** The ID of this workflow scheme. */ + id: string; + /** The new name for this workflow scheme. */ + name: string; + /** + * Overrides, for the selected issue types, any status mappings provided in `statusMappingsByWorkflows`. Status + * mappings are required when the new workflow for an issue type doesn't contain all statuses that the old workflow + * has. Status mappings can be provided by a combination of `statusMappingsByWorkflows` and + * `statusMappingsByIssueTypeOverride`. + */ + statusMappingsByIssueTypeOverride?: MappingsByIssueTypeOverride[]; + /** + * The status mappings by workflows. Status mappings are required when the new workflow for an issue type doesn't + * contain all statuses that the old workflow has. Status mappings can be provided by a combination of + * `statusMappingsByWorkflows` and `statusMappingsByIssueTypeOverride`. + */ + statusMappingsByWorkflows?: MappingsByWorkflow[]; + version: DocumentVersion; + /** Mappings from workflows to issue types. */ + workflowsForIssueTypes?: WorkflowSchemeAssociation[]; +} diff --git a/src/version3/parameters/updateWorkflowSchemeMappings.ts b/src/version3/parameters/updateWorkflowSchemeMappings.ts new file mode 100644 index 0000000000..2dfcab81e4 --- /dev/null +++ b/src/version3/parameters/updateWorkflowSchemeMappings.ts @@ -0,0 +1,14 @@ +import { WorkflowSchemeAssociation } from '../models'; + +/** The request payload to get the required mappings for updating a workflow scheme. */ +export interface UpdateWorkflowSchemeMappings { + /** + * The ID of the new default workflow for this workflow scheme. Only used in global-scoped workflow schemes. If it + * isn't specified, is set to _Jira Workflow (jira)_. + */ + defaultWorkflowId?: string; + /** The ID of the workflow scheme. */ + id: string; + /** The new workflow to issue type mappings for this workflow scheme. */ + workflowsForIssueTypes: WorkflowSchemeAssociation[]; +} diff --git a/src/version3/parameters/updateWorkflows.ts b/src/version3/parameters/updateWorkflows.ts new file mode 100644 index 0000000000..119dc8461e --- /dev/null +++ b/src/version3/parameters/updateWorkflows.ts @@ -0,0 +1,12 @@ +import { WorkflowUpdateRequest } from '../models'; + +export interface UpdateWorkflows extends WorkflowUpdateRequest { + /** + * Use [expand](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion) to include additional + * information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * - `workflows.usages` Returns the project and issue types that each workflow is associated with. + * - `statuses.usages` Returns the project and issue types that each status is associated with. + */ + expand?: 'workflows.usages' | 'statuses.usages' | ('workflows.usages' | 'statuses.usages')[] | string; +} diff --git a/src/version3/parameters/validateCreateWorkflows.ts b/src/version3/parameters/validateCreateWorkflows.ts new file mode 100644 index 0000000000..f48f1b8140 --- /dev/null +++ b/src/version3/parameters/validateCreateWorkflows.ts @@ -0,0 +1,6 @@ +import { WorkflowCreateRequest, ValidationOptionsForCreate } from '../models'; + +export interface ValidateCreateWorkflows { + payload: WorkflowCreateRequest; + validationOptions?: ValidationOptionsForCreate; +} diff --git a/src/version3/parameters/validateUpdateWorkflows.ts b/src/version3/parameters/validateUpdateWorkflows.ts new file mode 100644 index 0000000000..2f78a43b27 --- /dev/null +++ b/src/version3/parameters/validateUpdateWorkflows.ts @@ -0,0 +1,3 @@ +import { WorkflowUpdateValidateRequest } from '../models'; + +export interface ValidateUpdateWorkflows extends WorkflowUpdateValidateRequest {} diff --git a/src/version3/parameters/workflowCapabilities.ts b/src/version3/parameters/workflowCapabilities.ts new file mode 100644 index 0000000000..d3e4c8fb4f --- /dev/null +++ b/src/version3/parameters/workflowCapabilities.ts @@ -0,0 +1,3 @@ +import type { WorkflowCapabilities as WorkflowCapabilitiesModel } from '../models'; + +export type WorkflowCapabilities = WorkflowCapabilitiesModel; diff --git a/src/version3/permissionSchemes.ts b/src/version3/permissionSchemes.ts index 9add325b3f..f4f5f1f44a 100644 --- a/src/version3/permissionSchemes.ts +++ b/src/version3/permissionSchemes.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 PermissionSchemes { @@ -20,8 +20,9 @@ export class PermissionSchemes { * The `holder` object contains information about the user or group being granted the permission. For example, the * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and - * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the - * following properties: + * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. + * + * The `holder` object is defined by the following properties: * * - `type` Identifies the user or group (see the list of types below). * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the @@ -130,8 +131,9 @@ export class PermissionSchemes { * The `holder` object contains information about the user or group being granted the permission. For example, the * _Administer projects_ permission is granted to a group named _Teams in space administrators_. In this case, the * type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and - * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the - * following properties: + * the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. + * + * The `holder` object is defined by the following properties: * * - `type` Identifies the user or group (see the list of types below). * - `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the @@ -477,10 +479,10 @@ export class PermissionSchemes { expand: parameters.expand, }, data: { - id: parameters.id, - self: parameters.self, holder: parameters.holder, + id: parameters.id, permission: parameters.permission, + self: parameters.self, }, }; diff --git a/src/version3/permissions.ts b/src/version3/permissions.ts index 6936121d24..45d29a9048 100644 --- a/src/version3/permissions.ts +++ b/src/version3/permissions.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 Permissions { @@ -28,6 +28,12 @@ export class Permissions { * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they * would not have EDIT_ISSUES permission for that issue. * + * For [Jira Service Management project + * permissions](https://support.atlassian.com/jira-cloud-administration/docs/customize-jira-service-management-permissions/), + * this will be evaluated similarly to a user in the customer portal. For example, if the BROWSE_PROJECTS permission + * is granted to Service Project Customer - Portal Access, any users with access to the customer portal will have the + * BROWSE_PROJECTS permission. + * * Global permissions are unaffected by context. * * This operation can be accessed anonymously. @@ -59,6 +65,12 @@ export class Permissions { * project, because any user can be a reporter. However, if they are not the user who reported the issue queried they * would not have EDIT_ISSUES permission for that issue. * + * For [Jira Service Management project + * permissions](https://support.atlassian.com/jira-cloud-administration/docs/customize-jira-service-management-permissions/), + * this will be evaluated similarly to a user in the customer portal. For example, if the BROWSE_PROJECTS permission + * is granted to Service Project Customer - Portal Access, any users with access to the customer portal will have the + * BROWSE_PROJECTS permission. + * * Global permissions are unaffected by context. * * This operation can be accessed anonymously. @@ -98,8 +110,9 @@ export class Permissions { * - Project permissions. * - Global permissions added by plugins. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async getAllPermissions(callback: Callback): Promise; /** @@ -109,8 +122,9 @@ export class Permissions { * - Project permissions. * - Global permissions added by plugins. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async getAllPermissions(callback?: never): Promise; async getAllPermissions(callback?: Callback): Promise { @@ -139,6 +153,11 @@ export class Permissions { * `projectPermissions.issues` are ignored. * - Empty strings in `projectPermissions.permissions` are ignored. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - **Classic**: `read:jira-work` + * - **Granular**: `read:permission:jira` + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** @@ -168,6 +187,11 @@ export class Permissions { * `projectPermissions.issues` are ignored. * - Empty strings in `projectPermissions.permissions` are ignored. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - **Classic**: `read:jira-work` + * - **Granular**: `read:permission:jira` + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** @@ -188,9 +212,9 @@ export class Permissions { url: '/rest/api/3/permissions/check', method: 'POST', data: { - projectPermissions: parameters?.projectPermissions, - globalPermissions: parameters?.globalPermissions, accountId: parameters?.accountId, + globalPermissions: parameters?.globalPermissions, + projectPermissions: parameters?.projectPermissions, }, }; diff --git a/src/version3/plans.ts b/src/version3/plans.ts new file mode 100644 index 0000000000..322a2a5964 --- /dev/null +++ b/src/version3/plans.ts @@ -0,0 +1,223 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class Plans { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of plans. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlans( + parameters: Parameters.GetPlans | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of plans. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlans( + parameters?: Parameters.GetPlans, + callback?: never, + ): Promise; + async getPlans( + parameters?: Parameters.GetPlans, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/plans/plan', + method: 'GET', + params: { + includeTrashed: parameters?.includeTrashed, + includeArchived: parameters?.includeArchived, + cursor: parameters?.cursor, + maxResults: parameters?.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlan(parameters: Parameters.CreatePlan, callback: Callback): Promise; + /** + * Creates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlan(parameters: Parameters.CreatePlan, callback?: never): Promise; + async createPlan(parameters: Parameters.CreatePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/plans/plan', + method: 'POST', + params: { + useGroupId: parameters.useGroupId, + }, + data: { + crossProjectReleases: parameters.crossProjectReleases, + customFields: parameters.customFields, + exclusionRules: parameters.exclusionRules, + issueSources: parameters.issueSources, + leadAccountId: parameters.leadAccountId, + name: parameters.name, + permissions: parameters.permissions, + scheduling: parameters.scheduling, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlan(parameters: Parameters.GetPlan, callback: Callback): Promise; + /** + * Returns a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlan(parameters: Parameters.GetPlan, callback?: never): Promise; + async getPlan(parameters: Parameters.GetPlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}`, + method: 'GET', + params: { + useGroupId: parameters.useGroupId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates any of the following details of a plan using [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan" endpoint to find + * out the order of array elements._ + */ + async updatePlan(parameters: Parameters.UpdatePlan, callback: Callback): Promise; + /** + * Updates any of the following details of a plan using [JSON Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan" endpoint to find + * out the order of array elements._ + */ + async updatePlan(parameters: Parameters.UpdatePlan, callback?: never): Promise; + async updatePlan(parameters: Parameters.UpdatePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}`, + method: 'PUT', + params: { + useGroupId: parameters.useGroupId, + }, + data: { + crossProjectReleases: parameters.crossProjectReleases, + customFields: parameters.customFields, + exclusionRules: parameters.exclusionRules, + issueSources: parameters.issueSources, + leadAccountId: parameters.leadAccountId, + name: parameters.name, + permissions: parameters.permissions, + scheduling: parameters.scheduling, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Archives a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archivePlan(parameters: Parameters.ArchivePlan, callback: Callback): Promise; + /** + * Archives a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async archivePlan(parameters: Parameters.ArchivePlan, callback?: never): Promise; + async archivePlan(parameters: Parameters.ArchivePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/archive`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Duplicates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async duplicatePlan(parameters: Parameters.DuplicatePlan, callback: Callback): Promise; + /** + * Duplicates a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async duplicatePlan(parameters: Parameters.DuplicatePlan, callback?: never): Promise; + async duplicatePlan(parameters: Parameters.DuplicatePlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/duplicate`, + method: 'POST', + data: { + name: parameters.name, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Moves a plan to trash. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashPlan(parameters: Parameters.TrashPlan, callback: Callback): Promise; + /** + * Moves a plan to trash. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async trashPlan(parameters: Parameters.TrashPlan, callback?: never): Promise; + async trashPlan(parameters: Parameters.TrashPlan, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/trash`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/prioritySchemes.ts b/src/version3/prioritySchemes.ts new file mode 100644 index 0000000000..c38f4c5b48 --- /dev/null +++ b/src/version3/prioritySchemes.ts @@ -0,0 +1,330 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; +import { paramSerializer } from '../paramSerializer'; +import { Paginated } from '../paginated'; + +export class PrioritySchemes { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priority schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritySchemes>( + parameters: Parameters.GetPrioritySchemes | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priority schemes. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritySchemes>( + parameters?: Parameters.GetPrioritySchemes, + callback?: never, + ): Promise; + async getPrioritySchemes>( + parameters?: Parameters.GetPrioritySchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priorityscheme', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + priorityId: paramSerializer('priorityId', parameters?.priorityId), + schemeId: paramSerializer('schemeId', parameters?.schemeId), + schemeName: parameters?.schemeName, + onlyDefault: parameters?.onlyDefault, + orderBy: parameters?.orderBy, + expand: parameters?.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a new priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPriorityScheme( + parameters: Parameters.CreatePriorityScheme, + callback: Callback, + ): Promise; + /** + * Creates a new priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPriorityScheme( + parameters: Parameters.CreatePriorityScheme, + callback?: never, + ): Promise; + async createPriorityScheme( + parameters: Parameters.CreatePriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priorityscheme', + method: 'POST', + data: { + defaultPriorityId: parameters.defaultPriorityId, + description: parameters.description, + mappings: parameters.mappings, + name: parameters.name, + priorityIds: parameters.priorityIds, + projectIds: parameters.projectIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities that would require mapping, given a change in priorities or projects associated with a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async suggestedPrioritiesForMappings>( + parameters: Parameters.SuggestedPrioritiesForMappings | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities that would require mapping, given a change in priorities or projects associated with a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async suggestedPrioritiesForMappings>( + parameters?: Parameters.SuggestedPrioritiesForMappings, + callback?: never, + ): Promise; + async suggestedPrioritiesForMappings>( + parameters?: Parameters.SuggestedPrioritiesForMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priorityscheme/mappings', + method: 'POST', + data: { + maxResults: parameters?.maxResults, + priorities: parameters?.priorities, + projects: parameters?.projects, + schemeId: parameters?.schemeId, + startAt: parameters?.startAt, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities available for adding to a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAvailablePrioritiesByPriorityScheme>( + parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities available for adding to a priority scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getAvailablePrioritiesByPriorityScheme>( + parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, + callback?: never, + ): Promise; + async getAvailablePrioritiesByPriorityScheme>( + parameters: Parameters.GetAvailablePrioritiesByPriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/priorityscheme/priorities/available', + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + query: parameters.query, + schemeId: parameters.schemeId, + exclude: parameters.exclude, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates a priority scheme. This includes its details, the lists of priorities and projects in it + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePriorityScheme( + parameters: Parameters.UpdatePriorityScheme, + callback: Callback, + ): Promise; + /** + * Updates a priority scheme. This includes its details, the lists of priorities and projects in it + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updatePriorityScheme( + parameters: Parameters.UpdatePriorityScheme, + callback?: never, + ): Promise; + async updatePriorityScheme( + parameters: Parameters.UpdatePriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/priorityscheme/${parameters.schemeId}`, + method: 'PUT', + data: { + defaultPriorityId: parameters.defaultPriorityId, + description: parameters.description, + mappings: parameters.mappings, + name: parameters.name, + priorities: parameters.priorities, + projects: parameters.projects, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a priority scheme. + * + * This operation is only available for priority schemes without any associated projects. Any associated projects must + * be removed from the priority scheme before this operation can be performed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriorityScheme( + parameters: Parameters.DeletePriorityScheme, + callback: Callback, + ): Promise; + /** + * Deletes a priority scheme. + * + * This operation is only available for priority schemes without any associated projects. Any associated projects must + * be removed from the priority scheme before this operation can be performed. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePriorityScheme(parameters: Parameters.DeletePriorityScheme, callback?: never): Promise; + async deletePriorityScheme( + parameters: Parameters.DeletePriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/priorityscheme/${parameters.schemeId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritiesByPriorityScheme>( + parameters: Parameters.GetPrioritiesByPriorityScheme, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * priorities by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getPrioritiesByPriorityScheme>( + parameters: Parameters.GetPrioritiesByPriorityScheme, + callback?: never, + ): Promise; + async getPrioritiesByPriorityScheme>( + parameters: Parameters.GetPrioritiesByPriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/priorityscheme/${parameters.schemeId}/priorities`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * projects by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectsByPriorityScheme( + parameters: Parameters.GetProjectsByPriorityScheme, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * projects by scheme. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * Permission to access Jira. + */ + async getProjectsByPriorityScheme( + parameters: Parameters.GetProjectsByPriorityScheme, + callback?: never, + ): Promise; + async getProjectsByPriorityScheme( + parameters: Parameters.GetProjectsByPriorityScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/priorityscheme/${parameters.schemeId}/projects`, + method: 'GET', + params: { + startAt: parameters.startAt, + maxResults: parameters.maxResults, + projectId: paramSerializer('projectId', parameters.projectId), + query: parameters.query, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectAvatars.ts b/src/version3/projectAvatars.ts index f343761268..c5a799057d 100644 --- a/src/version3/projectAvatars.ts +++ b/src/version3/projectAvatars.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 ProjectAvatars { @@ -79,29 +79,14 @@ export class ProjectAvatars { * * Specify the avatar's local file location in the body of the request. Also, include the following headers: * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * For example: `curl --request POST ` - * - * `--user email@example.com: ` - * - * `--header 'X-Atlassian-Token: no-check' ` - * - * `--header 'Content-Type: image/< image_type>' ` - * - * `--data-binary "<@/path/to/file/with/your/avatar>" ` - * - * `--url 'https://your-domain.atlassian.net/rest/api/3/project/{projectIdOrKey}/avatar2'` - * * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of * the image. The length of the square's sides is set to the smaller of the height or width of the image. * * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. * - * After creating the avatar use [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as - * the project's displayed avatar. + * After creating the avatar use [Set project + * avatar](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-avatars/#api-rest-api-3-project-projectidorkey-avatar-put) + * to set it as the project's displayed avatar. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). @@ -113,31 +98,14 @@ export class ProjectAvatars { /** * Loads an avatar for a project. * - * Specify the avatar's local file location in the body of the request. Also, include the following headers: - * - * - `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special - * Headers](#special-request-headers). - * - `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. - * - * For example: `curl --request POST ` - * - * `--user email@example.com: ` - * - * `--header 'X-Atlassian-Token: no-check' ` - * - * `--header 'Content-Type: image/< image_type>' ` - * - * `--data-binary "<@/path/to/file/with/your/avatar>" ` - * - * `--url 'https://your-domain.atlassian.net/rest/api/3/project/{projectIdOrKey}/avatar2'` - * * The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of * the image. The length of the square's sides is set to the smaller of the height or width of the image. * * The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. * - * After creating the avatar use [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as - * the project's displayed avatar. + * After creating the avatar use [Set project + * avatar](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-avatars/#api-rest-api-3-project-projectidorkey-avatar-put) + * to set it as the project's displayed avatar. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg). @@ -153,10 +121,14 @@ export class ProjectAvatars { const config: RequestConfig = { url: `/rest/api/3/project/${parameters.projectIdOrKey}/avatar2`, method: 'POST', + headers: { + 'X-Atlassian-Token': 'no-check', + 'Content-Type': parameters.mimeType, + }, params: { x: parameters.x, y: parameters.y, - size: parameters.size, + size: parameters.size ?? 0, }, data: parameters.avatar, }; diff --git a/src/version3/projectCategories.ts b/src/version3/projectCategories.ts index 8e5ff3c321..93c1040aca 100644 --- a/src/version3/projectCategories.ts +++ b/src/version3/projectCategories.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 ProjectCategories { diff --git a/src/version3/projectClassificationLevels.ts b/src/version3/projectClassificationLevels.ts new file mode 100644 index 0000000000..4db3358568 --- /dev/null +++ b/src/version3/projectClassificationLevels.ts @@ -0,0 +1,121 @@ +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class ProjectClassificationLevels { + constructor(private client: Client) {} + + /** + * Returns the default data classification for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultProjectClassification( + parameters: Parameters.GetDefaultProjectClassification, + callback: Callback, + ): Promise; + /** + * Returns the default data classification for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Browse Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getDefaultProjectClassification( + parameters: Parameters.GetDefaultProjectClassification, + callback?: never, + ): Promise; + async getDefaultProjectClassification( + parameters: Parameters.GetDefaultProjectClassification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/classification-level/default`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultProjectClassification( + parameters: Parameters.UpdateDefaultProjectClassification, + callback: Callback, + ): Promise; + /** + * Updates the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async updateDefaultProjectClassification( + parameters: Parameters.UpdateDefaultProjectClassification, + callback?: never, + ): Promise; + async updateDefaultProjectClassification( + parameters: Parameters.UpdateDefaultProjectClassification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/classification-level/default`, + method: 'PUT', + data: { + id: parameters.id, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Remove the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeDefaultProjectClassification( + parameters: Parameters.RemoveDefaultProjectClassification, + callback: Callback, + ): Promise; + /** + * Remove the default data classification level for a project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * - _Administer jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeDefaultProjectClassification( + parameters: Parameters.RemoveDefaultProjectClassification, + callback?: never, + ): Promise; + async removeDefaultProjectClassification( + parameters: Parameters.RemoveDefaultProjectClassification, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectIdOrKey}/classification-level/default`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/projectComponents.ts b/src/version3/projectComponents.ts index 2a2456c58b..f60cf3d106 100644 --- a/src/version3/projectComponents.ts +++ b/src/version3/projectComponents.ts @@ -1,14 +1,61 @@ 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'; +import { Paginated } from '../paginated'; export class ProjectComponents { constructor(private client: Client) {} /** - * Creates a component. Use components to provide containers for issues within a project. + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * components in a project, including global (Compass) components when applicable. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async findComponentsForProjects>( + parameters: Parameters.FindComponentsForProjects, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of all + * components in a project, including global (Compass) components when applicable. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * Projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + */ + async findComponentsForProjects>( + parameters: Parameters.FindComponentsForProjects, + callback?: never, + ): Promise; + async findComponentsForProjects>( + parameters: Parameters.FindComponentsForProjects, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/component', + method: 'GET', + params: { + projectIdsOrKeys: parameters.projectIdsOrKeys, + startAt: parameters.startAt, + maxResults: parameters.maxResults, + orderBy: parameters.orderBy, + query: parameters.query, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a component. Use components to provide containers for issues within a project. Use components to provide + * containers for issues within a project. * * This operation can be accessed anonymously. * @@ -21,7 +68,8 @@ export class ProjectComponents { callback: Callback, ): Promise; /** - * Creates a component. Use components to provide containers for issues within a project. + * Creates a component. Use components to provide containers for issues within a project. Use components to provide + * containers for issues within a project. * * This operation can be accessed anonymously. * @@ -41,20 +89,22 @@ export class ProjectComponents { url: '/rest/api/3/component', method: 'POST', data: { - assignee: parameters?.assignee, - assigneeType: parameters?.assigneeType, - description: parameters?.description, - id: parameters?.id, - isAssigneeTypeValid: parameters?.isAssigneeTypeValid, - lead: parameters?.lead, - leadAccountId: parameters?.leadAccountId, - leadUserName: parameters?.leadUserName, - name: parameters?.name, - project: parameters?.project, - projectId: parameters?.projectId, - realAssignee: parameters?.realAssignee, - realAssigneeType: parameters?.realAssigneeType, - self: parameters?.self, + ari: parameters.ari, + assignee: parameters.assignee, + assigneeType: parameters.assigneeType, + description: parameters.description, + id: parameters.id, + isAssigneeTypeValid: parameters.isAssigneeTypeValid, + lead: parameters.lead, + leadAccountId: parameters.leadAccountId, + leadUserName: parameters.leadUserName, + metadata: parameters.metadata, + name: parameters.name, + project: parameters.project, + projectId: parameters.projectId, + realAssignee: parameters.realAssignee, + realAssigneeType: parameters.realAssigneeType, + self: parameters.self, }, }; @@ -179,6 +229,11 @@ export class ProjectComponents { * * This operation can be accessed anonymously. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - **Classic**: `read:jira-work` + * - **Granular**: `read:field:jira`, `read:project.component:jira` + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async getComponentRelatedIssues( @@ -190,6 +245,11 @@ export class ProjectComponents { * * This operation can be accessed anonymously. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - **Classic**: `read:jira-work` + * - **Granular**: `read:field:jira`, `read:project.component:jira` + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ async getComponentRelatedIssues( @@ -213,6 +273,9 @@ export class ProjectComponents { * components in a project. See the [Get project components](#api-rest-api-3-project-projectIdOrKey-components-get) * resource if you want to get a full list of versions without pagination. * + * If your project uses Compass components, this API will return a list of Compass components that are linked to + * issues in that project. + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse @@ -227,6 +290,9 @@ export class ProjectComponents { * components in a project. See the [Get project components](#api-rest-api-3-project-projectIdOrKey-components-get) * resource if you want to get a full list of versions without pagination. * + * If your project uses Compass components, this API will return a list of Compass components that are linked to + * issues in that project. + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse @@ -247,6 +313,7 @@ export class ProjectComponents { startAt: parameters.startAt, maxResults: parameters.maxResults, orderBy: parameters.orderBy, + componentSource: parameters.componentSource, query: parameters.query, }, }; @@ -259,6 +326,9 @@ export class ProjectComponents { * paginated](#api-rest-api-3-project-projectIdOrKey-component-get) resource if you want to get a full list of * components with pagination. * + * If your project uses Compass components, this API will return a paginated list of Compass components that are + * linked to issues in that project. + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse @@ -273,6 +343,9 @@ export class ProjectComponents { * paginated](#api-rest-api-3-project-projectIdOrKey-component-get) resource if you want to get a full list of * components with pagination. * + * If your project uses Compass components, this API will return a paginated list of Compass components that are + * linked to issues in that project. + * * This operation can be accessed anonymously. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse @@ -289,6 +362,9 @@ export class ProjectComponents { const config: RequestConfig = { url: `/rest/api/3/project/${parameters.projectIdOrKey}/components`, method: 'GET', + params: { + componentSource: parameters.componentSource, + }, }; return this.client.sendRequest(config, callback); diff --git a/src/version3/projectEmail.ts b/src/version3/projectEmail.ts index ae27bbbdea..c7c07671b2 100644 --- a/src/version3/projectEmail.ts +++ b/src/version3/projectEmail.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 ProjectEmail { @@ -46,8 +46,9 @@ export class ProjectEmail { * * If `emailAddress` is an empty string, the default email address is restored. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission.](https://confluence.atlassian.com/x/yodKLg) */ async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback: Callback): Promise; /** @@ -55,8 +56,9 @@ export class ProjectEmail { * * If `emailAddress` is an empty string, the default email address is restored. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse - * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission.](https://confluence.atlassian.com/x/yodKLg) */ async updateProjectEmail(parameters: Parameters.UpdateProjectEmail, callback?: never): Promise; async updateProjectEmail( diff --git a/src/version3/projectFeatures.ts b/src/version3/projectFeatures.ts index c7c080500c..3ea858612d 100644 --- a/src/version3/projectFeatures.ts +++ b/src/version3/projectFeatures.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 ProjectFeatures { diff --git a/src/version3/projectKeyAndNameValidation.ts b/src/version3/projectKeyAndNameValidation.ts index 811c7d0d93..bd6fe78813 100644 --- a/src/version3/projectKeyAndNameValidation.ts +++ b/src/version3/projectKeyAndNameValidation.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 ProjectKeyAndNameValidation { @@ -47,7 +47,7 @@ export class ProjectKeyAndNameValidation { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ - async getValidProjectKey( + async getValidProjectKey( parameters: Parameters.GetValidProjectKey | string | undefined, callback: Callback, ): Promise; @@ -56,11 +56,11 @@ export class ProjectKeyAndNameValidation { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ - async getValidProjectKey( + async getValidProjectKey( parameters?: Parameters.GetValidProjectKey | string, callback?: never, ): Promise; - async getValidProjectKey( + async getValidProjectKey( parameters?: Parameters.GetValidProjectKey | string, callback?: Callback, ): Promise { @@ -84,7 +84,7 @@ export class ProjectKeyAndNameValidation { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ - async getValidProjectName( + async getValidProjectName( parameters: Parameters.GetValidProjectName | string, callback: Callback, ): Promise; @@ -95,11 +95,11 @@ export class ProjectKeyAndNameValidation { * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** None. */ - async getValidProjectName( + async getValidProjectName( parameters: Parameters.GetValidProjectName | string, callback?: never, ): Promise; - async getValidProjectName( + async getValidProjectName( parameters: Parameters.GetValidProjectName | string, callback?: Callback, ): Promise { diff --git a/src/version3/projectPermissionSchemes.ts b/src/version3/projectPermissionSchemes.ts index 3beb67dca1..ab4e145326 100644 --- a/src/version3/projectPermissionSchemes.ts +++ b/src/version3/projectPermissionSchemes.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 ProjectPermissionSchemes { diff --git a/src/version3/projectProperties.ts b/src/version3/projectProperties.ts index 9c80b3a9ee..333400b5d2 100644 --- a/src/version3/projectProperties.ts +++ b/src/version3/projectProperties.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 ProjectProperties { diff --git a/src/version3/projectRoleActors.ts b/src/version3/projectRoleActors.ts index 227a24ac32..6f41714e38 100644 --- a/src/version3/projectRoleActors.ts +++ b/src/version3/projectRoleActors.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 ProjectRoleActors { @@ -44,9 +44,9 @@ export class ProjectRoleActors { url: `/rest/api/3/project/${parameters.projectIdOrKey}/role/${parameters.id}`, method: 'POST', data: { - user: parameters.user, group: parameters.group, groupId: parameters.groupId, + user: parameters.user, }, }; @@ -195,9 +195,9 @@ export class ProjectRoleActors { url: `/rest/api/3/role/${parameters.id}/actors`, method: 'POST', data: { - user: parameters.user, - groupId: parameters.groupId, group: parameters.group, + groupId: parameters.groupId, + user: parameters.user, }, }; diff --git a/src/version3/projectRoles.ts b/src/version3/projectRoles.ts index 36bf07a571..64005bdc68 100644 --- a/src/version3/projectRoles.ts +++ b/src/version3/projectRoles.ts @@ -1,15 +1,16 @@ 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 ProjectRoles { constructor(private client: Client) {} /** - * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and - * self URL for each role. + * Returns a list of [project + * roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) for the project + * returning the name and self URL for each role. * * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project * roles](#api-rest-api-3-role-get) for more information. @@ -25,8 +26,9 @@ export class ProjectRoles { callback: Callback, ): Promise; /** - * Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and - * self URL for each role. + * Returns a list of [project + * roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) for the project + * returning the name and self URL for each role. * * Note that all project roles are shared with all projects in Jira Cloud. See [Get all project * roles](#api-rest-api-3-role-get) for more information. @@ -104,8 +106,8 @@ export class ProjectRoles { } /** - * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the - * list of project roles is common to all projects. + * Returns all [project roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) and + * the details for each role. Note that the list of project roles is common to all projects. * * This operation can be accessed anonymously. * @@ -118,8 +120,8 @@ export class ProjectRoles { callback: Callback, ): Promise; /** - * Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the - * list of project roles is common to all projects. + * Returns all [project roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) and + * the details for each role. Note that the list of project roles is common to all projects. * * This operation can be accessed anonymously. * @@ -154,10 +156,10 @@ export class ProjectRoles { * * ### About project roles * - * [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with - * projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have - * a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira - * applications). + * [Project roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) are a flexible + * way to to associate users and groups with projects. In Jira Cloud, the list of project roles is shared globally + * with all projects, but each project can have a different set of actors associated with it (unlike groups, which + * have the same membership throughout all Jira applications). * * Project roles are used in [permission schemes](#api-rest-api-3-permissionscheme-get), [email notification * schemes](#api-rest-api-3-notificationscheme-get), [issue security @@ -170,7 +172,7 @@ export class ProjectRoles { * with a project role. * * Actors may be set as [default - * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) + * members](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/#Specifying-'default-members'-for-a-project-role) * of the project role or set at the project level: * * - Default actors: Users and groups that are assigned to the project role for all newly created projects. The default @@ -187,10 +189,10 @@ export class ProjectRoles { * * ### About project roles * - * [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with - * projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have - * a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira - * applications). + * [Project roles](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/) are a flexible + * way to to associate users and groups with projects. In Jira Cloud, the list of project roles is shared globally + * with all projects, but each project can have a different set of actors associated with it (unlike groups, which + * have the same membership throughout all Jira applications). * * Project roles are used in [permission schemes](#api-rest-api-3-permissionscheme-get), [email notification * schemes](#api-rest-api-3-notificationscheme-get), [issue security @@ -203,7 +205,7 @@ export class ProjectRoles { * with a project role. * * Actors may be set as [default - * members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) + * members](https://support.atlassian.com/jira-cloud-administration/docs/manage-project-roles/#Specifying-'default-members'-for-a-project-role) * of the project role or set at the project level: * * - Default actors: Users and groups that are assigned to the project role for all newly created projects. The default @@ -262,8 +264,8 @@ export class ProjectRoles { url: '/rest/api/3/role', method: 'POST', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; @@ -340,8 +342,8 @@ export class ProjectRoles { url: `/rest/api/3/role/${parameters.id}`, method: 'POST', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; @@ -376,8 +378,8 @@ export class ProjectRoles { url: `/rest/api/3/role/${parameters.id}`, method: 'PUT', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; diff --git a/src/version3/projectTypes.ts b/src/version3/projectTypes.ts index 580dc24706..0544663c72 100644 --- a/src/version3/projectTypes.ts +++ b/src/version3/projectTypes.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 ProjectTypes { diff --git a/src/version3/projectVersions.ts b/src/version3/projectVersions.ts index 5a53a87d9c..2c8cf92afb 100644 --- a/src/version3/projectVersions.ts +++ b/src/version3/projectVersions.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 ProjectVersions { @@ -130,22 +130,24 @@ export class ProjectVersions { url: '/rest/api/3/version', method: 'POST', data: { + approvers: parameters.approvers, + archived: parameters.archived, + description: parameters.description, + driver: parameters.driver, expand: parameters.expand, - self: parameters.self, id: parameters.id, - description: parameters.description, + issuesStatusForFixVersion: parameters.issuesStatusForFixVersion, + moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, name: parameters.name, - archived: parameters.archived, + operations: parameters.operations, + overdue: parameters.overdue, + projectId: parameters.projectId, + releaseDate: parameters.releaseDate, released: parameters.released, + self: parameters.self, startDate: parameters.startDate, - releaseDate: parameters.releaseDate, - overdue: parameters.overdue, - userStartDate: parameters.userStartDate, userReleaseDate: parameters.userReleaseDate, - projectId: parameters.projectId, - moveUnfixedIssuesTo: parameters.moveUnfixedIssuesTo, - operations: parameters.operations, - issuesStatusForFixVersion: parameters.issuesStatusForFixVersion, + userStartDate: parameters.userStartDate, }, }; @@ -218,6 +220,8 @@ export class ProjectVersions { url: `/rest/api/3/version/${parameters.id}`, method: 'PUT', data: { + approvers: parameters.approvers, + driver: parameters.driver, expand: parameters.expand, description: parameters.description, name: parameters.name, @@ -347,6 +351,140 @@ export class ProjectVersions { return this.client.sendRequest(config, callback); } + /** + * Returns related work items for the given version id. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. + */ + async getRelatedWork( + parameters: Parameters.GetRelatedWork, + callback: Callback, + ): Promise; + /** + * Returns related work items for the given version id. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * projects_ [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. + */ + async getRelatedWork( + parameters: Parameters.GetRelatedWork, + callback?: never, + ): Promise; + async getRelatedWork( + parameters: Parameters.GetRelatedWork, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/version/${parameters.id}/relatedwork`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a related work for the given version. You can only create a generic link type of related works via this + * API. relatedWorkId will be auto-generated UUID, that does not need to be provided. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async createRelatedWork( + parameters: Parameters.CreateRelatedWork, + callback: Callback, + ): Promise; + /** + * Creates a related work for the given version. You can only create a generic link type of related works via this + * API. relatedWorkId will be auto-generated UUID, that does not need to be provided. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async createRelatedWork( + parameters: Parameters.CreateRelatedWork, + callback?: never, + ): Promise; + async createRelatedWork( + parameters: Parameters.CreateRelatedWork, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/version/${parameters.id}/relatedwork`, + method: 'POST', + data: { + category: parameters.category, + issueId: parameters.issueId, + relatedWorkId: parameters.relatedWorkId, + title: parameters.title, + url: parameters.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates the given related work. You can only update generic link related works via Rest APIs. Any archived version + * related works can't be edited. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async updateRelatedWork( + parameters: Parameters.UpdateRelatedWork, + callback: Callback, + ): Promise; + /** + * Updates the given related work. You can only update generic link related works via Rest APIs. Any archived version + * related works can't be edited. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async updateRelatedWork( + parameters: Parameters.UpdateRelatedWork, + callback?: never, + ): Promise; + async updateRelatedWork( + parameters: Parameters.UpdateRelatedWork, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/version/${parameters.id}/relatedwork`, + method: 'PUT', + data: { + category: parameters.category, + issueId: parameters.issueId, + relatedWorkId: parameters.relatedWorkId, + title: parameters.title, + url: parameters.url, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Deletes a project version. * @@ -390,9 +528,9 @@ export class ProjectVersions { url: `/rest/api/3/version/${parameters.id}/removeAndSwap`, method: 'POST', data: { - moveFixIssuesTo: parameters.moveFixIssuesTo, - moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, customFieldReplacementList: parameters.customFieldReplacementList, + moveAffectedIssuesTo: parameters.moveAffectedIssuesTo, + moveFixIssuesTo: parameters.moveFixIssuesTo, }, }; @@ -436,4 +574,38 @@ export class ProjectVersions { return this.client.sendRequest(config, callback); } + + /** + * Deletes the given related work for the given version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async deleteRelatedWork(parameters: Parameters.DeleteRelatedWork, callback: Callback): Promise; + /** + * Deletes the given related work for the given version. + * + * This operation can be accessed anonymously. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Resolve issues:_ and _Edit issues_ [Managing project + * permissions](https://confluence.atlassian.com/adminjiraserver/managing-project-permissions-938847145.html) for the + * project that contains the version. + */ + async deleteRelatedWork(parameters: Parameters.DeleteRelatedWork, callback?: never): Promise; + async deleteRelatedWork( + parameters: Parameters.DeleteRelatedWork, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/version/${parameters.versionId}/relatedwork/${parameters.relatedWorkId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version3/projects.ts b/src/version3/projects.ts index 1272ee5e71..f05662bb55 100644 --- a/src/version3/projects.ts +++ b/src/version3/projects.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 Projects { @@ -10,11 +10,11 @@ export class Projects { /** * Creates a project based on a project type template, as shown in the following table: * - * | Project Type Key | Project Template Key | - * | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | - * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-internal-service-desk`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-finance-service-desk` | - * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-cross-team-template`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | + * | Project Type Key | Project Template Key | + * | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | + * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-blank-project-business`, `com.atlassian.servicedesk:simplified-blank-project-it`, `com.atlassian.servicedesk:simplified-finance-service-desk`, `com.atlassian.servicedesk:next-gen-it-service-desk`, `com.atlassian.servicedesk:next-gen-hr-service-desk`, `com.atlassian.servicedesk:next-gen-legal-service-desk`, `com.atlassian.servicedesk:next-gen-marketing-service-desk`, `com.atlassian.servicedesk:next-gen-facilities-service-desk`, `com.atlassian.servicedesk:next-gen-general-it-service-desk`, `com.atlassian.servicedesk:next-gen-general-business-service-desk`, `com.atlassian.servicedesk:next-gen-analytics-service-desk`, `com.atlassian.servicedesk:next-gen-finance-service-desk`, `com.atlassian.servicedesk:next-gen-design-service-desk`, `com.atlassian.servicedesk:next-gen-sales-service-desk` | + * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | * * The project types are available according to the installed Jira features as follows: * @@ -37,11 +37,11 @@ export class Projects { /** * Creates a project based on a project type template, as shown in the following table: * - * | Project Type Key | Project Template Key | - * | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | - * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-internal-service-desk`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-finance-service-desk` | - * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-cross-team-template`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | + * | Project Type Key | Project Template Key | + * | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + * | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | + * | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-design-service-desk`, `com.atlassian.servicedesk:simplified-sales-service-desk`, `com.atlassian.servicedesk:simplified-blank-project-business`, `com.atlassian.servicedesk:simplified-blank-project-it`, `com.atlassian.servicedesk:simplified-finance-service-desk`, `com.atlassian.servicedesk:next-gen-it-service-desk`, `com.atlassian.servicedesk:next-gen-hr-service-desk`, `com.atlassian.servicedesk:next-gen-legal-service-desk`, `com.atlassian.servicedesk:next-gen-marketing-service-desk`, `com.atlassian.servicedesk:next-gen-facilities-service-desk`, `com.atlassian.servicedesk:next-gen-general-it-service-desk`, `com.atlassian.servicedesk:next-gen-general-business-service-desk`, `com.atlassian.servicedesk:next-gen-analytics-service-desk`, `com.atlassian.servicedesk:next-gen-finance-service-desk`, `com.atlassian.servicedesk:next-gen-design-service-desk`, `com.atlassian.servicedesk:next-gen-sales-service-desk` | + * | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | * * The project types are available according to the installed Jira features as follows: * @@ -173,19 +173,19 @@ export class Projects { url: '/rest/api/3/project/search', method: 'GET', params: { - action: parameters?.action, - categoryId: parameters?.categoryId, - expand: parameters?.expand, - id: parameters?.id, - keys: parameters?.keys, + startAt: parameters?.startAt, maxResults: parameters?.maxResults, orderBy: parameters?.orderBy, - properties: parameters?.properties, - propertyQuery: parameters?.propertyQuery, + id: parameters?.id, + keys: parameters?.keys, query: parameters?.query, - startAt: parameters?.startAt, - status: parameters?.status, typeKey: parameters?.typeKey, + categoryId: parameters?.categoryId, + action: parameters?.action, + expand: parameters?.expand, + status: parameters?.status, + properties: parameters?.properties, + propertyQuery: parameters?.propertyQuery, }, }; @@ -234,19 +234,25 @@ export class Projects { /** * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. * - * All parameters are optional in the body of the request. + * All parameters are optional in the body of the request. Schemes will only be updated if they are included in the + * request, any omitted schemes will be left unchanged. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). is only needed when changing the + * schemes or project key. Otherwise you will only need _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) */ async updateProject(parameters: Parameters.UpdateProject, callback: Callback): Promise; /** * Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. * - * All parameters are optional in the body of the request. + * All parameters are optional in the body of the request. Schemes will only be updated if they are included in the + * request, any omitted schemes will be left unchanged. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). is only needed when changing the + * schemes or project key. Otherwise you will only need _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) */ async updateProject(parameters: Parameters.UpdateProject, callback?: never): Promise; async updateProject( @@ -272,6 +278,7 @@ export class Projects { permissionScheme: parameters.permissionScheme, projectTemplateKey: parameters.projectTemplateKey, projectTypeKey: parameters.projectTypeKey, + releasedProjectKeys: parameters.releasedProjectKeys, url: parameters.url, }, }; @@ -398,14 +405,20 @@ export class Projects { * Restores a project that has been archived or placed in the Jira recycle bin. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg)for Company managed projects. + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project for Team managed projects. */ async restore(parameters: Parameters.Restore | string, callback: Callback): Promise; /** * Restores a project that has been archived or placed in the Jira recycle bin. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg)for Company managed projects. + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) for the project for Team managed projects. */ async restore(parameters: Parameters.Restore | string, callback?: never): Promise; async restore( @@ -511,4 +524,41 @@ export class Projects { return this.client.sendRequest(config, callback); } + + /** + * Gets a [notification scheme](https://confluence.atlassian.com/x/8YdKLg) associated with the project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getNotificationSchemeForProject( + parameters: Parameters.GetNotificationSchemeForProject, + callback: Callback, + ): Promise; + /** + * Gets a [notification scheme](https://confluence.atlassian.com/x/8YdKLg) associated with the project. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Administer Projects_ [project + * permission](https://confluence.atlassian.com/x/yodKLg). + */ + async getNotificationSchemeForProject( + parameters: Parameters.GetNotificationSchemeForProject, + callback?: never, + ): Promise; + async getNotificationSchemeForProject( + parameters: Parameters.GetNotificationSchemeForProject, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/project/${parameters.projectKeyOrId}/notificationscheme`, + method: 'GET', + params: { + expand: parameters.expand, + }, + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version3/screenSchemes.ts b/src/version3/screenSchemes.ts index 0d105c2fdf..3f57c7a5aa 100644 --- a/src/version3/screenSchemes.ts +++ b/src/version3/screenSchemes.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 ScreenSchemes { @@ -114,8 +114,8 @@ export class ScreenSchemes { url: `/rest/api/3/screenscheme/${parameters.screenSchemeId}`, method: 'PUT', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, screens: parameters.screens, }, }; diff --git a/src/version3/screenTabFields.ts b/src/version3/screenTabFields.ts index 96de3f640e..9ef07edd53 100644 --- a/src/version3/screenTabFields.ts +++ b/src/version3/screenTabFields.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 ScreenTabFields { diff --git a/src/version3/screenTabs.ts b/src/version3/screenTabs.ts index 370565a10f..683f5ccdc5 100644 --- a/src/version3/screenTabs.ts +++ b/src/version3/screenTabs.ts @@ -1,12 +1,50 @@ 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'; +import { paramSerializer } from '../paramSerializer'; export class ScreenTabs { constructor(private client: Client) {} + /** + * Returns the list of tabs for a bulk of screens. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBulkScreenTabs( + parameters: Parameters.GetBulkScreenTabs | undefined, + callback: Callback, + ): Promise; + /** + * Returns the list of tabs for a bulk of screens. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getBulkScreenTabs(parameters?: Parameters.GetBulkScreenTabs, callback?: never): Promise; + async getBulkScreenTabs( + parameters?: Parameters.GetBulkScreenTabs, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/screens/tabs', + method: 'GET', + params: { + screenId: paramSerializer('screenId', parameters?.screenId), + tabId: parameters?.tabId, + startAt: parameters?.startAt, + maxResult: parameters?.maxResult, + }, + }; + + return this.client.sendRequest(config, callback); + } + /** * Returns the list of tabs for a screen. * diff --git a/src/version3/screens.ts b/src/version3/screens.ts index 7a1c41365c..11bb5be54b 100644 --- a/src/version3/screens.ts +++ b/src/version3/screens.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 Screens { @@ -109,8 +109,8 @@ export class Screens { url: '/rest/api/3/screens', method: 'POST', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; @@ -173,8 +173,8 @@ export class Screens { url: `/rest/api/3/screens/${parameters.screenId}`, method: 'PUT', data: { - name: parameters.name, description: parameters.description, + name: parameters.name, }, }; diff --git a/src/version3/serverInfo.ts b/src/version3/serverInfo.ts index d1eb84ee3f..0e5d52465a 100644 --- a/src/version3/serverInfo.ts +++ b/src/version3/serverInfo.ts @@ -1,6 +1,6 @@ import * as Models from './models'; -import { Callback } from '../callback'; import { Client } from '../clients'; +import { Callback } from '../callback'; import { RequestConfig } from '../requestConfig'; export class ServerInfo { diff --git a/src/version3/serviceRegistry.ts b/src/version3/serviceRegistry.ts new file mode 100644 index 0000000000..b289f99d68 --- /dev/null +++ b/src/version3/serviceRegistry.ts @@ -0,0 +1,38 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class ServiceRegistry { + constructor(private client: Client) {} + + /** + * Retrieve the attributes of given service registries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request and the servicesIds belong to the tenant you are requesting + */ + async services(parameters: Parameters.Services, callback: Callback): Promise; + /** + * Retrieve the attributes of given service registries. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only + * Connect apps can make this request and the servicesIds belong to the tenant you are requesting + */ + async services(parameters: Parameters.Services, callback?: never): Promise; + async services( + parameters: Parameters.Services, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/atlassian-connect/1/service-registry', + method: 'GET', + params: { + serviceIds: parameters.serviceIds, + }, + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/status.ts b/src/version3/status.ts index ac52b3a0a0..095e3ec058 100644 --- a/src/version3/status.ts +++ b/src/version3/status.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 Status { @@ -42,7 +42,7 @@ export class Status { method: 'GET', params: { id, - expand: typeof parameters !== 'string' && parameters.expand, + expand: typeof parameters !== 'string' ? parameters.expand : undefined, }, }; @@ -78,8 +78,8 @@ export class Status { url: '/rest/api/3/statuses', method: 'POST', data: { - statuses: parameters.statuses, scope: parameters.scope, + statuses: parameters.statuses, }, }; @@ -193,4 +193,82 @@ export class Status { return this.client.sendRequest(config, callback); } + + /** Returns a page of issue types in a project using a given status. */ + async getProjectIssueTypeUsagesForStatus( + parameters: Parameters.GetProjectIssueTypeUsagesForStatus, + callback: Callback, + ): Promise; + /** Returns a page of issue types in a project using a given status. */ + async getProjectIssueTypeUsagesForStatus( + parameters: Parameters.GetProjectIssueTypeUsagesForStatus, + callback?: never, + ): Promise; + async getProjectIssueTypeUsagesForStatus( + parameters: Parameters.GetProjectIssueTypeUsagesForStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/statuses/${parameters.statusId}/project/${parameters.projectId}/issueTypeUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of projects using a given status. */ + async getProjectUsagesForStatus( + parameters: Parameters.GetProjectUsagesForStatus, + callback: Callback, + ): Promise; + /** Returns a page of projects using a given status. */ + async getProjectUsagesForStatus( + parameters: Parameters.GetProjectUsagesForStatus, + callback?: never, + ): Promise; + async getProjectUsagesForStatus( + parameters: Parameters.GetProjectUsagesForStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/statuses/${parameters.statusId}/projectUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of workflows using a given status. */ + async getWorkflowUsagesForStatus( + parameters: Parameters.GetWorkflowUsagesForStatus, + callback: Callback, + ): Promise; + /** Returns a page of workflows using a given status. */ + async getWorkflowUsagesForStatus( + parameters: Parameters.GetWorkflowUsagesForStatus, + callback?: never, + ): Promise; + async getWorkflowUsagesForStatus( + parameters: Parameters.GetWorkflowUsagesForStatus, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/statuses/${parameters.statusId}/workflowUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version3/tasks.ts b/src/version3/tasks.ts index 12997fe418..1c5252e079 100644 --- a/src/version3/tasks.ts +++ b/src/version3/tasks.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 Tasks { @@ -9,12 +9,16 @@ export class Tasks { /** * Returns the status of a [long-running asynchronous - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). * * When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the * operation that created the task for details. Task details are not permanently retained. As of September 2019, * details are retained for 14 days although this period may change without notice. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - `read:jira-work` + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either * of: * @@ -27,12 +31,16 @@ export class Tasks { ): Promise; /** * Returns the status of a [long-running asynchronous - * task](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). + * task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). * * When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the * operation that created the task for details. Task details are not permanently retained. As of September 2019, * details are retained for 14 days although this period may change without notice. * + * **Deprecation notice:** The required OAuth 2.0 scopes will be updated on June 15, 2024. + * + * - `read:jira-work` + * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** either * of: * diff --git a/src/version3/teamsInPlan.ts b/src/version3/teamsInPlan.ts new file mode 100644 index 0000000000..c046b450fb --- /dev/null +++ b/src/version3/teamsInPlan.ts @@ -0,0 +1,322 @@ +import * as Models from './models'; +import * as Parameters from './parameters'; +import { Client } from '../clients'; +import { Callback } from '../callback'; +import { RequestConfig } from '../requestConfig'; + +export class TeamsInPlan { + constructor(private client: Client) {} + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * plan-only and Atlassian teams in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTeams( + parameters: Parameters.GetTeams, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of + * plan-only and Atlassian teams in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getTeams( + parameters: Parameters.GetTeams, + callback?: never, + ): Promise; + async getTeams( + parameters: Parameters.GetTeams, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team`, + method: 'GET', + params: { + cursor: parameters.cursor, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Adds an existing Atlassian team to a plan and configures their plannning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addAtlassianTeam(parameters: Parameters.AddAtlassianTeam, callback: Callback): Promise; + /** + * Adds an existing Atlassian team to a plan and configures their plannning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async addAtlassianTeam(parameters: Parameters.AddAtlassianTeam, callback?: never): Promise; + async addAtlassianTeam(parameters: Parameters.AddAtlassianTeam, callback?: Callback): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/atlassian`, + method: 'POST', + data: { + capacity: parameters.capacity, + id: parameters.id, + issueSourceId: parameters.issueSourceId, + planningStyle: parameters.planningStyle, + sprintLength: parameters.sprintLength, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns planning settings for an Atlassian team in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAtlassianTeam( + parameters: Parameters.GetAtlassianTeam, + callback: Callback, + ): Promise; + /** + * Returns planning settings for an Atlassian team in a plan. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getAtlassianTeam( + parameters: Parameters.GetAtlassianTeam, + callback?: never, + ): Promise; + async getAtlassianTeam( + parameters: Parameters.GetAtlassianTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates any of the following planning settings of an Atlassian team in a plan using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get Atlassian team in plan" + * endpoint to find out the order of array elements._ + */ + async updateAtlassianTeam(parameters: Parameters.UpdateAtlassianTeam, callback: Callback): Promise; + /** + * Updates any of the following planning settings of an Atlassian team in a plan using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get Atlassian team in plan" + * endpoint to find out the order of array elements._ + */ + async updateAtlassianTeam(parameters: Parameters.UpdateAtlassianTeam, callback?: never): Promise; + async updateAtlassianTeam( + parameters: Parameters.UpdateAtlassianTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Removes an Atlassian team from a plan and deletes their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeAtlassianTeam(parameters: Parameters.RemoveAtlassianTeam, callback: Callback): Promise; + /** + * Removes an Atlassian team from a plan and deletes their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async removeAtlassianTeam(parameters: Parameters.RemoveAtlassianTeam, callback?: never): Promise; + async removeAtlassianTeam( + parameters: Parameters.RemoveAtlassianTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/atlassian/${parameters.atlassianTeamId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Creates a plan-only team and configures their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlanOnlyTeam( + parameters: Parameters.CreatePlanOnlyTeam, + callback: Callback, + ): Promise; + /** + * Creates a plan-only team and configures their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async createPlanOnlyTeam(parameters: Parameters.CreatePlanOnlyTeam, callback?: never): Promise; + async createPlanOnlyTeam( + parameters: Parameters.CreatePlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/planonly`, + method: 'POST', + data: { + capacity: parameters.capacity, + issueSourceId: parameters.issueSourceId, + memberAccountIds: parameters.memberAccountIds, + name: parameters.name, + planningStyle: parameters.planningStyle, + sprintLength: parameters.sprintLength, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns planning settings for a plan-only team. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlanOnlyTeam( + parameters: Parameters.GetPlanOnlyTeam, + callback: Callback, + ): Promise; + /** + * Returns planning settings for a plan-only team. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async getPlanOnlyTeam( + parameters: Parameters.GetPlanOnlyTeam, + callback?: never, + ): Promise; + async getPlanOnlyTeam( + parameters: Parameters.GetPlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, + method: 'GET', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates any of the following planning settings of a plan-only team using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - Name + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * - MemberAccountIds + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan-only team" + * endpoint to find out the order of array elements._ + */ + async updatePlanOnlyTeam(parameters: Parameters.UpdatePlanOnlyTeam, callback: Callback): Promise; + /** + * Updates any of the following planning settings of a plan-only team using [JSON + * Patch](https://datatracker.ietf.org/doc/html/rfc6902). + * + * - Name + * - PlanningStyle + * - IssueSourceId + * - SprintLength + * - Capacity + * - MemberAccountIds + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * _Note that "add" operations do not respect array indexes in target locations. Call the "Get plan-only team" + * endpoint to find out the order of array elements._ + */ + async updatePlanOnlyTeam(parameters: Parameters.UpdatePlanOnlyTeam, callback?: never): Promise; + async updatePlanOnlyTeam( + parameters: Parameters.UpdatePlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, + method: 'PUT', + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Deletes a plan-only team and their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePlanOnlyTeam(parameters: Parameters.DeletePlanOnlyTeam, callback: Callback): Promise; + /** + * Deletes a plan-only team and their planning settings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + async deletePlanOnlyTeam(parameters: Parameters.DeletePlanOnlyTeam, callback?: never): Promise; + async deletePlanOnlyTeam( + parameters: Parameters.DeletePlanOnlyTeam, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/plans/plan/${parameters.planId}/team/planonly/${parameters.planOnlyTeamId}`, + method: 'DELETE', + }; + + return this.client.sendRequest(config, callback); + } +} diff --git a/src/version3/timeTracking.ts b/src/version3/timeTracking.ts index aaae78b612..3ef6089f9d 100644 --- a/src/version3/timeTracking.ts +++ b/src/version3/timeTracking.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 TimeTracking { @@ -136,7 +136,7 @@ export class TimeTracking { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async setSharedTimeTrackingConfiguration( - parameters: Parameters.SetSharedTimeTrackingConfiguration | undefined, + parameters: Parameters.SetSharedTimeTrackingConfiguration, callback: Callback, ): Promise; /** @@ -146,21 +146,21 @@ export class TimeTracking { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async setSharedTimeTrackingConfiguration( - parameters?: Parameters.SetSharedTimeTrackingConfiguration, + parameters: Parameters.SetSharedTimeTrackingConfiguration, callback?: never, ): Promise; async setSharedTimeTrackingConfiguration( - parameters?: Parameters.SetSharedTimeTrackingConfiguration, + parameters: Parameters.SetSharedTimeTrackingConfiguration, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/configuration/timetracking/options', method: 'PUT', data: { - workingHoursPerDay: parameters?.workingHoursPerDay, - workingDaysPerWeek: parameters?.workingDaysPerWeek, - timeFormat: parameters?.timeFormat, - defaultUnit: parameters?.defaultUnit, + defaultUnit: parameters.defaultUnit, + timeFormat: parameters.timeFormat, + workingDaysPerWeek: parameters.workingDaysPerWeek, + workingHoursPerDay: parameters.workingHoursPerDay, }, }; diff --git a/src/version3/userProperties.ts b/src/version3/userProperties.ts index a65acc1c60..7ccd353459 100644 --- a/src/version3/userProperties.ts +++ b/src/version3/userProperties.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 UserProperties { diff --git a/src/version3/userSearch.ts b/src/version3/userSearch.ts index 3c0088dee1..53a6b7fba8 100644 --- a/src/version3/userSearch.ts +++ b/src/version3/userSearch.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 { paramSerializer } from '../paramSerializer'; import { RequestConfig } from '../requestConfig'; @@ -75,9 +75,9 @@ export class UserSearch { * assigned to: * * - A new issue, by providing the `projectKeyOrId`. - * - An updated issue, by providing the `issueKey`. - * - To an issue during a transition (workflow action), by providing the `issueKey` and the transition id in - * `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in + * - An updated issue, by providing the `issueKey` or `issueId`. + * - To an issue during a transition (workflow action), by providing the `issueKey` or `issueId` and the transition id + * in `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in * the `expand` parameter of [ Get issue](#api-rest-api-3-issue-issueIdOrKey-get). * * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is @@ -92,8 +92,9 @@ export class UserSearch { * the user's email address is hidden. See the [Profile visibility * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Assign issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) */ async findAssignableUsers( parameters: Parameters.FindAssignableUsers | undefined, @@ -104,9 +105,9 @@ export class UserSearch { * assigned to: * * - A new issue, by providing the `projectKeyOrId`. - * - An updated issue, by providing the `issueKey`. - * - To an issue during a transition (workflow action), by providing the `issueKey` and the transition id in - * `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in + * - An updated issue, by providing the `issueKey` or `issueId`. + * - To an issue during a transition (workflow action), by providing the `issueKey` or `issueId` and the transition id + * in `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in * the `expand` parameter of [ Get issue](#api-rest-api-3-issue-issueIdOrKey-get). * * In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is @@ -121,8 +122,9 @@ export class UserSearch { * the user's email address is hidden. See the [Profile visibility * overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. * - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** - * Permission to access Jira. + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse + * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg) or _Assign issues_ [project + * permission](https://confluence.atlassian.com/x/yodKLg) */ async findAssignableUsers( parameters?: Parameters.FindAssignableUsers, @@ -142,6 +144,7 @@ export class UserSearch { accountId: parameters?.accountId, project: parameters?.project, issueKey: parameters?.issueKey, + issueId: parameters?.issueId, startAt: parameters?.startAt, maxResults: parameters?.maxResults, actionDescriptorId: parameters?.actionDescriptorId, @@ -303,7 +306,7 @@ export class UserSearch { } /** - * Returns a list of users that match the search string and property. + * Returns a list of active users that match the search string and property. * * This operation first applies a filter to match the search string and property, and then takes the filtered users in * the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the @@ -325,7 +328,7 @@ export class UserSearch { callback: Callback, ): Promise; /** - * Returns a list of users that match the search string and property. + * Returns a list of active users that match the search string and property. * * This operation first applies a filter to match the search string and property, and then takes the filtered users in * the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the @@ -382,7 +385,9 @@ export class UserSearch { * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. For example, + * if user property `location` is set to value `{"office": {"country": "AU", "city": "Sydney"}}`, then it's possible + * to use `[location].office.city is "Sydney"` to match the user. * * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined * using the `AND` and `OR` operators to form more complex queries. For example: @@ -415,7 +420,9 @@ export class UserSearch { * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. For example, + * if user property `location` is set to value `{"office": {"country": "AU", "city": "Sydney"}}`, then it's possible + * to use `[location].office.city is "Sydney"` to match the user. * * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined * using the `AND` and `OR` operators to form more complex queries. For example: @@ -462,7 +469,9 @@ export class UserSearch { * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. For example, + * if user property `location` is set to value `{"office": {"country": "AU", "city": "Sydney"}}`, then it's possible + * to use `[location].office.city is "Sydney"` to match the user. * * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined * using the `AND` and `OR` operators to form more complex queries. For example: @@ -495,7 +504,9 @@ export class UserSearch { * - `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues _PROJ-1_ or _PROJ-2_. * - `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues _PROJ-1_ or * _PROJ-2_. - * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. + * - `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. For example, + * if user property `location` is set to value `{"office": {"country": "AU", "city": "Sydney"}}`, then it's possible + * to use `[location].office.city is "Sydney"` to match the user. * * The list of issues can be extended as needed, as in _(PROJ-1, PROJ-2, ... PROJ-n)_. Statements can be combined * using the `AND` and `OR` operators to form more complex queries. For example: @@ -516,7 +527,7 @@ export class UserSearch { params: { query: parameters.query, startAt: parameters.startAt, - maxResults: parameters.maxResults, + maxResult: parameters.maxResult || parameters.maxResults, }, }; diff --git a/src/version3/users.ts b/src/version3/users.ts index bdbfc46c98..523c21c3f0 100644 --- a/src/version3/users.ts +++ b/src/version3/users.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 { paramSerializer } from '../paramSerializer'; import { RequestConfig } from '../requestConfig'; @@ -18,7 +18,7 @@ export class Users { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getUser(parameters: Parameters.GetUser | undefined, callback: Callback): Promise; + async getUser(parameters: Parameters.GetUser, callback: Callback): Promise; /** * Returns a user. * @@ -29,16 +29,16 @@ export class Users { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** _Browse * users and groups_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async getUser(parameters?: Parameters.GetUser, callback?: never): Promise; - async getUser(parameters?: Parameters.GetUser, callback?: Callback): Promise { + async getUser(parameters: Parameters.GetUser, callback?: never): Promise; + async getUser(parameters: Parameters.GetUser, callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/api/3/user', method: 'GET', params: { - accountId: parameters?.accountId, - expand: parameters?.expand, - key: parameters?.key, - username: parameters?.username, + accountId: parameters.accountId, + username: parameters.username, + key: parameters.key, + expand: parameters.expand, }, }; @@ -105,8 +105,8 @@ export class Users { method: 'DELETE', params: { accountId: parameters.accountId, - key: parameters.key, username: parameters.username, + key: parameters.key, }, }; @@ -137,9 +137,9 @@ export class Users { url: '/rest/api/3/user/bulk', method: 'GET', params: { - accountId: paramSerializer('accountId', parameters.accountId), - maxResults: parameters.maxResults, startAt: parameters.startAt, + maxResults: parameters.maxResults, + accountId: paramSerializer('accountId', parameters.accountId), }, }; @@ -234,44 +234,31 @@ export class Users { * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns * are removed. * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/3/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` - * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. * - Permission to access Jira, to set the calling user's columns. */ - async setUserColumns( - parameters: Parameters.SetUserColumns | undefined, - callback: Callback, - ): Promise; + async setUserColumns(parameters: Parameters.SetUserColumns, callback: Callback): Promise; /** * Sets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If an account ID * is not passed, the calling user's default columns are set. If no column details are sent, then all default columns * are removed. * - * The parameters for this resource are expressed as HTML form data. For example, in curl: - * - * `curl -X PUT -d columns=summary -d columns=description - * https://your-domain.atlassian.net/rest/api/3/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` - * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * * - _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. * - Permission to access Jira, to set the calling user's columns. */ - async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: never): Promise; - async setUserColumns(parameters?: Parameters.SetUserColumns, callback?: Callback): Promise { + async setUserColumns(parameters: Parameters.SetUserColumns, callback?: never): Promise; + async setUserColumns(parameters: Parameters.SetUserColumns, callback?: Callback): Promise { const config: RequestConfig = { url: '/rest/api/3/user/columns', method: 'PUT', params: { - accountId: parameters?.accountId, + accountId: parameters.accountId, }, - data: parameters?.columns, + data: parameters.columns, }; return this.client.sendRequest(config, callback); @@ -311,16 +298,20 @@ export class Users { } /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * Returns a user's email address regardless of the user's profile visibility settings. For Connect apps, this API is + * only available to apps approved by Atlassian, according to these * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + * For Forge apps, this API only supports access via asApp() requests. */ async getUserEmail( parameters: Parameters.GetUserEmail | string, callback: Callback, ): Promise; /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * Returns a user's email address regardless of the user's profile visibility settings. For Connect apps, this API is + * only available to apps approved by Atlassian, according to these * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + * For Forge apps, this API only supports access via asApp() requests. */ async getUserEmail( parameters: Parameters.GetUserEmail | string, @@ -344,16 +335,20 @@ export class Users { } /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * Returns a user's email address regardless of the user's profile visibility settings. For Connect apps, this API is + * only available to apps approved by Atlassian, according to these * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + * For Forge apps, this API only supports access via asApp() requests. */ async getUserEmailBulk( parameters: Parameters.GetUserEmailBulk | string, callback: Callback, ): Promise; /** - * Returns a user's email address. This API is only available to apps approved by Atlassian, according to these + * Returns a user's email address regardless of the user's profile visibility settings. For Connect apps, this API is + * only available to apps approved by Atlassian, according to these * [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + * For Forge apps, this API only supports access via asApp() requests. */ async getUserEmailBulk( parameters: Parameters.GetUserEmailBulk | string, @@ -443,8 +438,8 @@ export class Users { url: '/rest/api/3/users', method: 'GET', params: { - maxResults: parameters?.maxResults, startAt: parameters?.startAt, + maxResults: parameters?.maxResults, }, }; @@ -483,8 +478,8 @@ export class Users { url: '/rest/api/3/users/search', method: 'GET', params: { - maxResults: parameters?.maxResults, startAt: parameters?.startAt, + maxResults: parameters?.maxResults, }, }; diff --git a/src/version3/webhooks.ts b/src/version3/webhooks.ts index 64d597fbc9..ea06f3e805 100644 --- a/src/version3/webhooks.ts +++ b/src/version3/webhooks.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 Webhooks { @@ -83,8 +83,8 @@ export class Webhooks { url: '/rest/api/3/webhook', method: 'POST', data: { - webhooks: parameters.webhooks, url: parameters.url, + webhooks: parameters.webhooks, }, }; diff --git a/src/version3/workflowSchemeDrafts.ts b/src/version3/workflowSchemeDrafts.ts index 9472a21faa..e75d434f27 100644 --- a/src/version3/workflowSchemeDrafts.ts +++ b/src/version3/workflowSchemeDrafts.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 WorkflowSchemeDrafts { @@ -47,7 +47,8 @@ export class WorkflowSchemeDrafts { * Returns the draft workflow scheme for an active workflow scheme. Draft workflow schemes allow changes to be made to * the active workflow schemes: When an active workflow scheme is updated, a draft copy is created. The draft is * modified, then the changes in the draft are copied back to the active workflow scheme. See [Configuring workflow - * schemes](https://confluence.atlassian.com/x/tohKLg) for more information. Note that: + * schemes](https://confluence.atlassian.com/x/tohKLg) for more information.\ + * Note that: * * - Only active workflow schemes can have draft workflow schemes. * - An active workflow scheme can only have one draft workflow scheme. @@ -63,7 +64,8 @@ export class WorkflowSchemeDrafts { * Returns the draft workflow scheme for an active workflow scheme. Draft workflow schemes allow changes to be made to * the active workflow schemes: When an active workflow scheme is updated, a draft copy is created. The draft is * modified, then the changes in the draft are copied back to the active workflow scheme. See [Configuring workflow - * schemes](https://confluence.atlassian.com/x/tohKLg) for more information. Note that: + * schemes](https://confluence.atlassian.com/x/tohKLg) for more information.\ + * Note that: * * - Only active workflow schemes can have draft workflow schemes. * - An active workflow scheme can only have one draft workflow scheme. @@ -230,8 +232,8 @@ export class WorkflowSchemeDrafts { url: `/rest/api/3/workflowscheme/${parameters.id}/draft/default`, method: 'PUT', data: { - workflow: parameters.workflow, updateDraftIfNeeded: parameters.updateDraftIfNeeded, + workflow: parameters.workflow, }, }; @@ -378,7 +380,7 @@ export class WorkflowSchemeDrafts { * with the original workflow status to the new workflow status. * * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the * `location` link in the response to determine the status of the task and use [Get * task](#api-rest-api-3-task-taskId-get) to obtain updates. * @@ -396,7 +398,7 @@ export class WorkflowSchemeDrafts { * with the original workflow status to the new workflow status. * * This operation is - * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#async-operations). Follow the + * [asynchronous](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations). Follow the * `location` link in the response to determine the status of the task and use [Get * task](#api-rest-api-3-task-taskId-get) to obtain updates. * @@ -495,10 +497,10 @@ export class WorkflowSchemeDrafts { workflowName: parameters.workflowName, }, data: { - workflow: parameters.workflow, - issueTypes: parameters.issueTypes, defaultMapping: parameters.defaultMapping, + issueTypes: parameters.issueTypes, updateDraftIfNeeded: parameters.updateDraftIfNeeded, + workflow: parameters.workflow, }, }; diff --git a/src/version3/workflowSchemeProjectAssociations.ts b/src/version3/workflowSchemeProjectAssociations.ts index 8c1596f10f..67d242713b 100644 --- a/src/version3/workflowSchemeProjectAssociations.ts +++ b/src/version3/workflowSchemeProjectAssociations.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 WorkflowSchemeProjectAssociations { @@ -61,7 +61,7 @@ export class WorkflowSchemeProjectAssociations { * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ async assignSchemeToProject( - parameters: Parameters.AssignSchemeToProject | undefined, + parameters: Parameters.AssignSchemeToProject, callback: Callback, ): Promise; /** @@ -72,17 +72,17 @@ export class WorkflowSchemeProjectAssociations { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async assignSchemeToProject(parameters?: Parameters.AssignSchemeToProject, callback?: never): Promise; + async assignSchemeToProject(parameters: Parameters.AssignSchemeToProject, callback?: never): Promise; async assignSchemeToProject( - parameters?: Parameters.AssignSchemeToProject, + parameters: Parameters.AssignSchemeToProject, callback?: Callback, ): Promise { const config: RequestConfig = { url: '/rest/api/3/workflowscheme/project', method: 'PUT', data: { - workflowSchemeId: parameters?.workflowSchemeId, - projectId: parameters?.projectId, + projectId: parameters.projectId, + workflowSchemeId: parameters.workflowSchemeId, }, }; diff --git a/src/version3/workflowSchemes.ts b/src/version3/workflowSchemes.ts index d5d083cd1d..4811b7ed0b 100644 --- a/src/version3/workflowSchemes.ts +++ b/src/version3/workflowSchemes.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 WorkflowSchemes { @@ -73,19 +73,147 @@ export class WorkflowSchemes { url: '/rest/api/3/workflowscheme', method: 'POST', data: { - id: parameters.id, - name: parameters.name, - description: parameters.description, defaultWorkflow: parameters.defaultWorkflow, + description: parameters.description, + draft: parameters.draft, + id: parameters.id, issueTypeMappings: parameters.issueTypeMappings, + issueTypes: parameters.issueTypes, + lastModified: parameters.lastModified, + lastModifiedUser: parameters.lastModifiedUser, + name: parameters.name, originalDefaultWorkflow: parameters.originalDefaultWorkflow, originalIssueTypeMappings: parameters.originalIssueTypeMappings, - draft: parameters.draft, - lastModifiedUser: parameters.lastModifiedUser, - lastModified: parameters.lastModified, self: parameters.self, updateDraftIfNeeded: parameters.updateDraftIfNeeded, - issueTypes: parameters.issueTypes, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of workflow schemes by providing workflow scheme IDs or project IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflow schemes + * - _Administer projects_ project permissions to access project-scoped workflow schemes + */ + async readWorkflowSchemes( + parameters: Parameters.ReadWorkflowSchemes, + callback: Callback, + ): Promise; + /** + * Returns a list of workflow schemes by providing workflow scheme IDs or project IDs. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflow schemes + * - _Administer projects_ project permissions to access project-scoped workflow schemes + */ + async readWorkflowSchemes( + parameters: Parameters.ReadWorkflowSchemes, + callback?: never, + ): Promise; + async readWorkflowSchemes( + parameters: Parameters.ReadWorkflowSchemes, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflowscheme/read', + method: 'POST', + data: { + projectIds: parameters.projectIds, + workflowSchemeIds: parameters.workflowSchemeIds, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Updates company-managed and team-managed project workflow schemes. This API doesn't have a concept of draft, so any + * changes made to a workflow scheme are immediately available. When changing the available statuses for issue types, + * an [asynchronous task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations) + * migrates the issues as defined in the provided mappings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to update all, including global-scoped, workflow schemes. + * - _Administer projects_ project permission to update project-scoped workflow schemes. + */ + async updateSchemes(parameters: Parameters.UpdateSchemes, callback: Callback): Promise; + /** + * Updates company-managed and team-managed project workflow schemes. This API doesn't have a concept of draft, so any + * changes made to a workflow scheme are immediately available. When changing the available statuses for issue types, + * an [asynchronous task](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#async-operations) + * migrates the issues as defined in the provided mappings. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to update all, including global-scoped, workflow schemes. + * - _Administer projects_ project permission to update project-scoped workflow schemes. + */ + async updateSchemes(parameters: Parameters.UpdateSchemes, callback?: never): Promise; + async updateSchemes(parameters: Parameters.UpdateSchemes, callback?: Callback): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflowscheme/update', + method: 'POST', + data: { + defaultWorkflowId: parameters.defaultWorkflowId, + description: parameters.description, + id: parameters.id, + name: parameters.name, + statusMappingsByIssueTypeOverride: parameters.statusMappingsByIssueTypeOverride, + statusMappingsByWorkflows: parameters.statusMappingsByWorkflows, + version: parameters.version, + workflowsForIssueTypes: parameters.workflowsForIssueTypes, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Gets the required status mappings for the desired changes to a workflow scheme. The results are provided per issue + * type and workflow. When updating a workflow scheme, status mappings can be provided per issue type, per workflow, + * or both. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ permission to update all, including global-scoped, workflow schemes. + * - _Administer projects_ project permission to update project-scoped workflow schemes. + */ + async updateWorkflowSchemeMappings( + parameters: Parameters.UpdateWorkflowSchemeMappings, + callback: Callback, + ): Promise; + /** + * Gets the required status mappings for the desired changes to a workflow scheme. The results are provided per issue + * type and workflow. When updating a workflow scheme, status mappings can be provided per issue type, per workflow, + * or both. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ permission to update all, including global-scoped, workflow schemes. + * - _Administer projects_ project permission to update project-scoped workflow schemes. + */ + async updateWorkflowSchemeMappings( + parameters: Parameters.UpdateWorkflowSchemeMappings, + callback?: never, + ): Promise; + async updateWorkflowSchemeMappings( + parameters: Parameters.UpdateWorkflowSchemeMappings, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflowscheme/update/mappings', + method: 'POST', + data: { + defaultWorkflowId: parameters.defaultWorkflowId, + id: parameters.id, + workflowsForIssueTypes: parameters.workflowsForIssueTypes, }, }; @@ -130,9 +258,9 @@ export class WorkflowSchemes { } /** - * Updates a workflow scheme, including the name, default workflow, issue type to project mappings, and more. If the - * workflow scheme is active (that is, being used by at least one project), then a draft workflow scheme is created or - * updated instead, provided that `updateDraftIfNeeded` is set to `true`. + * Updates a company-manged project workflow scheme, including the name, default workflow, issue type to project + * mappings, and more. If the workflow scheme is active (that is, being used by at least one project), then a draft + * workflow scheme is created or updated instead, provided that `updateDraftIfNeeded` is set to `true`. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -142,9 +270,9 @@ export class WorkflowSchemes { callback: Callback, ): Promise; /** - * Updates a workflow scheme, including the name, default workflow, issue type to project mappings, and more. If the - * workflow scheme is active (that is, being used by at least one project), then a draft workflow scheme is created or - * updated instead, provided that `updateDraftIfNeeded` is set to `true`. + * Updates a company-manged project workflow scheme, including the name, default workflow, issue type to project + * mappings, and more. If the workflow scheme is active (that is, being used by at least one project), then a draft + * workflow scheme is created or updated instead, provided that `updateDraftIfNeeded` is set to `true`. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -285,8 +413,8 @@ export class WorkflowSchemes { url: `/rest/api/3/workflowscheme/${parameters.id}/default`, method: 'PUT', data: { - workflow: parameters.workflow, updateDraftIfNeeded: parameters.updateDraftIfNeeded, + workflow: parameters.workflow, }, }; @@ -538,10 +666,10 @@ export class WorkflowSchemes { workflowName: parameters.workflowName, }, data: { - workflow: parameters.workflow, - issueTypes: parameters.issueTypes, defaultMapping: parameters.defaultMapping, + issueTypes: parameters.issueTypes, updateDraftIfNeeded: parameters.updateDraftIfNeeded, + workflow: parameters.workflow, }, }; @@ -593,4 +721,30 @@ export class WorkflowSchemes { return this.client.sendRequest(config, callback); } + + /** Returns a page of projects using a given workflow scheme. */ + async getProjectUsagesForWorkflowScheme( + parameters: Parameters.GetProjectUsagesForWorkflowScheme, + callback: Callback, + ): Promise; + /** Returns a page of projects using a given workflow scheme. */ + async getProjectUsagesForWorkflowScheme( + parameters: Parameters.GetProjectUsagesForWorkflowScheme, + callback?: never, + ): Promise; + async getProjectUsagesForWorkflowScheme( + parameters: Parameters.GetProjectUsagesForWorkflowScheme, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflowscheme/${parameters.workflowSchemeId}/projectUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/src/version3/workflowStatusCategories.ts b/src/version3/workflowStatusCategories.ts index 261b9b4d63..ae0a487616 100644 --- a/src/version3/workflowStatusCategories.ts +++ b/src/version3/workflowStatusCategories.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 WorkflowStatusCategories { diff --git a/src/version3/workflowStatuses.ts b/src/version3/workflowStatuses.ts index d65c6f16de..36ccf84310 100644 --- a/src/version3/workflowStatuses.ts +++ b/src/version3/workflowStatuses.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 WorkflowStatuses { diff --git a/src/version3/workflowTransitionProperties.ts b/src/version3/workflowTransitionProperties.ts index 4305996be4..934c9f8b56 100644 --- a/src/version3/workflowTransitionProperties.ts +++ b/src/version3/workflowTransitionProperties.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 WorkflowTransitionProperties { diff --git a/src/version3/workflowTransitionRules.ts b/src/version3/workflowTransitionRules.ts index 21d2a8e41d..a16dde3e85 100644 --- a/src/version3/workflowTransitionRules.ts +++ b/src/version3/workflowTransitionRules.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 WorkflowTransitionRules { @@ -84,7 +84,9 @@ export class WorkflowTransitionRules { * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) * - * Only rules created by the calling Connect app can be updated. + * Only rules created by the calling + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app can be updated. * * To assist with app migration, this operation can be used to: * @@ -95,7 +97,8 @@ export class WorkflowTransitionRules { * Rules are enabled if the `disabled` parameter is not provided. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can use this operation. + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. */ async updateWorkflowTransitionRuleConfigurations( parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, @@ -108,7 +111,9 @@ export class WorkflowTransitionRules { * - [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) * - [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) * - * Only rules created by the calling Connect app can be updated. + * Only rules created by the calling + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) app can be updated. * * To assist with app migration, this operation can be used to: * @@ -119,7 +124,8 @@ export class WorkflowTransitionRules { * Rules are enabled if the `disabled` parameter is not provided. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** Only - * Connect apps can use this operation. + * [Connect](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) or + * [Forge](https://developer.atlassian.com/cloud/jira/platform/index/#forge-apps) apps can use this operation. */ async updateWorkflowTransitionRuleConfigurations( parameters: Parameters.UpdateWorkflowTransitionRuleConfigurations, diff --git a/src/version3/workflows.ts b/src/version3/workflows.ts index d6785fe38c..eaccfee546 100644 --- a/src/version3/workflows.ts +++ b/src/version3/workflows.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 { paramSerializer } from '../paramSerializer'; import { RequestConfig } from '../requestConfig'; @@ -9,7 +9,11 @@ export class Workflows { constructor(private client: Client) {} /** - * Creates a workflow. Workflow transitions are created with the default system transition rules. + * Creates a workflow. You can define transition rules using the shapes detailed in the following sections. If no + * transitional rules are specified the default system transition rules are used. Note: This only applies to + * company-managed scoped workflows. Use [bulk create + * workflows](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/#api-rest-api-3-workflows-create-post) + * to create both team and company-managed scoped workflows. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -19,7 +23,11 @@ export class Workflows { callback: Callback, ): Promise; /** - * Creates a workflow. Workflow transitions are created with the default system transition rules. + * Creates a workflow. You can define transition rules using the shapes detailed in the following sections. If no + * transitional rules are specified the default system transition rules are used. Note: This only applies to + * company-managed scoped workflows. Use [bulk create + * workflows](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflows/#api-rest-api-3-workflows-create-post) + * to create both team and company-managed scoped workflows. * * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). @@ -33,10 +41,10 @@ export class Workflows { url: '/rest/api/3/workflow', method: 'POST', data: { - name: parameters.name, description: parameters.description, - transitions: parameters.transitions, + name: parameters.name, statuses: parameters.statuses, + transitions: parameters.transitions, }, }; @@ -122,10 +130,6 @@ export class Workflows { * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** * _Administer Jira_ [global permission](https://confluence.atlassian.com/x/x4dKLg). */ - async deleteInactiveWorkflow( - parameters: Parameters.DeleteInactiveWorkflow | string, - callback?: never, - ): Promise; async deleteInactiveWorkflow( parameters: Parameters.DeleteInactiveWorkflow | string, callback?: Callback, @@ -139,4 +143,392 @@ export class Workflows { return this.client.sendRequest(config, callback); } + + /** Returns a page of issue types using a given workflow within a project. */ + async getWorkflowProjectIssueTypeUsages( + parameters: Parameters.GetWorkflowProjectIssueTypeUsages, + callback: Callback, + ): Promise; + /** Returns a page of issue types using a given workflow within a project. */ + async getWorkflowProjectIssueTypeUsages( + parameters: Parameters.GetWorkflowProjectIssueTypeUsages, + callback?: never, + ): Promise; + async getWorkflowProjectIssueTypeUsages( + parameters: Parameters.GetWorkflowProjectIssueTypeUsages, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflow/${parameters.workflowId}/project/${parameters.projectId}/issueTypeUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of projects using a given workflow. */ + async getProjectUsagesForWorkflow( + parameters: Parameters.GetProjectUsagesForWorkflow, + callback: Callback, + ): Promise; + /** Returns a page of projects using a given workflow. */ + async getProjectUsagesForWorkflow( + parameters: Parameters.GetProjectUsagesForWorkflow, + callback?: never, + ): Promise; + async getProjectUsagesForWorkflow( + parameters: Parameters.GetProjectUsagesForWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflow/${parameters.workflowId}/projectUsages`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** Returns a page of workflow schemes using a given workflow. */ + async getWorkflowSchemeUsagesForWorkflow( + parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, + callback: Callback, + ): Promise; + /** Returns a page of workflow schemes using a given workflow. */ + async getWorkflowSchemeUsagesForWorkflow( + parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, + callback?: never, + ): Promise; + async getWorkflowSchemeUsagesForWorkflow( + parameters: Parameters.GetWorkflowSchemeUsagesForWorkflow, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: `/rest/api/3/workflow/${parameters.workflowId}/workflowSchemes`, + method: 'GET', + params: { + nextPageToken: parameters.nextPageToken, + maxResults: parameters.maxResults, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a list of workflows and related statuses by providing workflow names, workflow IDs, or project and issue + * types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflows + * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access + * project-scoped workflows + */ + async readWorkflows( + parameters: Parameters.ReadWorkflows | undefined, + callback: Callback, + ): Promise; + /** + * Returns a list of workflows and related statuses by providing workflow names, workflow IDs, or project and issue + * types. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflows + * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access + * project-scoped workflows + */ + async readWorkflows(parameters?: Parameters.ReadWorkflows, callback?: never): Promise; + async readWorkflows( + parameters?: Parameters.ReadWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflows', + method: 'POST', + params: { + useTransitionLinksFormat: parameters?.useTransitionLinksFormat, + useApprovalConfiguration: parameters?.useApprovalConfiguration, + }, + data: { + projectAndIssueTypes: parameters?.projectAndIssueTypes, + workflowIds: parameters?.workflowIds, + workflowNames: parameters?.workflowNames, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Get the list of workflow capabilities for a specific workflow using either the workflow ID, or the project and + * issue type ID pair. The response includes the scope of the workflow, defined as global/project-based, and a list of + * project types that the workflow is scoped to. It also includes all rules organised into their broad categories + * (conditions, validators, actions, triggers, screens) as well as the source location (Atlassian-provided, Connect, + * Forge). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to access all, including global-scoped, workflows + * - _Administer projects_ project permissions to access project-scoped workflows + */ + async workflowCapabilities( + parameters: Parameters.WorkflowCapabilities | undefined, + callback: Callback, + ): Promise; + /** + * Get the list of workflow capabilities for a specific workflow using either the workflow ID, or the project and + * issue type ID pair. The response includes the scope of the workflow, defined as global/project-based, and a list of + * project types that the workflow is scoped to. It also includes all rules organised into their broad categories + * (conditions, validators, actions, triggers, screens) as well as the source location (Atlassian-provided, Connect, + * Forge). + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to access all, including global-scoped, workflows + * - _Administer projects_ project permissions to access project-scoped workflows + */ + async workflowCapabilities( + parameters?: Parameters.WorkflowCapabilities, + callback?: never, + ): Promise; + async workflowCapabilities( + parameters?: Parameters.WorkflowCapabilities, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflows/capabilities', + method: 'GET', + params: { + workflowId: parameters?.workflowId, + projectId: parameters?.projectId, + issueTypeId: parameters?.issueTypeId, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Create workflows and related statuses. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async createWorkflows( + parameters: Parameters.CreateWorkflows, + callback: Callback, + ): Promise; + /** + * Create workflows and related statuses. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async createWorkflows( + parameters: Parameters.CreateWorkflows, + callback?: never, + ): Promise; + async createWorkflows( + parameters: Parameters.CreateWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflows/create', + method: 'POST', + data: { + scope: parameters.scope, + statuses: parameters.statuses, + workflows: parameters.workflows, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Validate the payload for bulk create workflows. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async validateCreateWorkflows( + parameters: Parameters.ValidateCreateWorkflows, + callback: Callback, + ): Promise; + /** + * Validate the payload for bulk create workflows. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async validateCreateWorkflows( + parameters: Parameters.ValidateCreateWorkflows, + callback?: never, + ): Promise; + async validateCreateWorkflows( + parameters: Parameters.ValidateCreateWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflows/create/validation', + method: 'POST', + data: { + payload: parameters.payload, + validationOptions: parameters.validationOptions, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of global + * and project workflows. If workflow names are specified in query string, details of those workflows are returned. + * Otherwise, all workflows are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflows + * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access + * project-scoped workflows + */ + async searchWorkflows( + parameters: Parameters.SearchWorkflows | undefined, + callback: Callback, + ): Promise; + /** + * Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of global + * and project workflows. If workflow names are specified in query string, details of those workflows are returned. + * Otherwise, all workflows are returned. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ global permission to access all, including project-scoped, workflows + * - At least one of the _Administer projects_ and _View (read-only) workflow_ project permissions to access + * project-scoped workflows + */ + async searchWorkflows( + parameters?: Parameters.SearchWorkflows, + callback?: never, + ): Promise; + async searchWorkflows( + parameters?: Parameters.SearchWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflows/search', + method: 'GET', + params: { + startAt: parameters?.startAt, + maxResults: parameters?.maxResults, + expand: parameters?.expand, + queryString: parameters?.queryString, + orderBy: parameters?.orderBy, + scope: parameters?.scope, + isActive: parameters?.isActive, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Update workflows and related statuses. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async updateWorkflows( + parameters: Parameters.UpdateWorkflows, + callback: Callback, + ): Promise; + /** + * Update workflows and related statuses. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async updateWorkflows( + parameters: Parameters.UpdateWorkflows, + callback?: never, + ): Promise; + async updateWorkflows( + parameters: Parameters.UpdateWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflows/update', + method: 'POST', + params: { + expand: parameters.expand, + }, + data: { + statuses: parameters.statuses, + workflows: parameters.workflows, + }, + }; + + return this.client.sendRequest(config, callback); + } + + /** + * Validate the payload for bulk update workflows. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async validateUpdateWorkflows( + parameters: Parameters.ValidateUpdateWorkflows, + callback: Callback, + ): Promise; + /** + * Validate the payload for bulk update workflows. + * + * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#permissions) required:** + * + * - _Administer Jira_ project permission to create all, including global-scoped, workflows + * - _Administer projects_ project permissions to create project-scoped workflows + */ + async validateUpdateWorkflows( + parameters: Parameters.ValidateUpdateWorkflows, + callback?: never, + ): Promise; + async validateUpdateWorkflows( + parameters: Parameters.ValidateUpdateWorkflows, + callback?: Callback, + ): Promise { + const config: RequestConfig = { + url: '/rest/api/3/workflows/update/validation', + method: 'POST', + data: { + payload: parameters.payload, + validationOptions: parameters.validationOptions, + }, + }; + + return this.client.sendRequest(config, callback); + } } diff --git a/tests/integration/version2/avatars.test.ts b/tests/integration/version2/avatars.test.ts index f568b2afee..975e7b6949 100644 --- a/tests/integration/version2/avatars.test.ts +++ b/tests/integration/version2/avatars.test.ts @@ -1,22 +1,63 @@ import { test } from 'vitest'; import type { Avatar } from '@jirajs/version3/models'; -import { getVersion2Client } from '@tests/integration/utils'; +import { createSoftwareProject, deleteSoftwareProject, getVersion2Client } from '../utils'; const client = getVersion2Client(); -let avatar: Avatar | undefined; +let avatar: Omit; test.sequential('should get all system avatars', async ({ expect }) => { const systemAvatars = await client.avatars.getAllSystemAvatars({ type: 'project' }); - avatar = systemAvatars.system?.[0]; + [avatar] = systemAvatars.system; expect(!!avatar).toBeTruthy(); + expect(typeof avatar.id).toBe('string'); + expect(avatar.isSystemAvatar).toBe(true); + expect(avatar.isSelected).toBe(false); + expect(avatar.isDeletable).toBe(false); + expect(typeof avatar.urls['16x16']).toBe('string'); + expect(typeof avatar.urls['24x24']).toBe('string'); + expect(typeof avatar.urls['32x32']).toBe('string'); + expect(typeof avatar.urls['48x48']).toBe('string'); }); test.sequential('should return avatar image with contentType', async ({ expect }) => { - const avatarWithDetails = await client.avatars.getAvatarImageByID({ id: avatar!.id, type: 'project' }); + const avatarWithDetails = await client.avatars.getAvatarImageByID({ + id: avatar.id, + type: 'project', + }); expect(avatarWithDetails.contentType).toBe('image/svg+xml'); expect(avatarWithDetails.avatar instanceof Uint8Array).toBeTruthy(); }); + +test.sequential('should store a new avatar', async ({ expect }) => { + const project = await createSoftwareProject(); + + let storedAvatar; + + try { + const avatarWithDetails = await client.avatars.getAvatarImageByType({ + type: 'project', + format: 'png', + }); + + storedAvatar = await client.avatars.storeAvatar({ + entityId: project.id, + type: 'project', + size: 0, + mimeType: avatarWithDetails.contentType, + avatar: avatarWithDetails.avatar, + }); + } finally { + await deleteSoftwareProject(); + } + + expect(storedAvatar).toBeDefined(); + expect(storedAvatar.id).toBeTruthy(); + expect(storedAvatar.owner).toBeTruthy(); + expect(storedAvatar.isSystemAvatar).toBeFalsy(); + expect(storedAvatar.isSelected).toBeFalsy(); + expect(storedAvatar.isDeletable).toBeTruthy(); +}); diff --git a/tests/integration/version3/avatars.test.ts b/tests/integration/version3/avatars.test.ts index 91ec9d1f6f..4981104c5c 100644 --- a/tests/integration/version3/avatars.test.ts +++ b/tests/integration/version3/avatars.test.ts @@ -1,22 +1,63 @@ -import { test } from 'vitest'; import type { Avatar } from '@jirajs/version3/models'; -import { getVersion3Client } from '@tests/integration/utils'; +import { test } from 'vitest'; +import { createSoftwareProject, deleteSoftwareProject, getVersion3Client } from '@tests/integration/utils'; const client = getVersion3Client(); -let avatar: Avatar | undefined; +let avatar: Omit; test.sequential('should get all system avatars', async ({ expect }) => { const systemAvatars = await client.avatars.getAllSystemAvatars({ type: 'project' }); - avatar = systemAvatars.system?.[0]; + [avatar] = systemAvatars.system; expect(!!avatar).toBeTruthy(); + expect(typeof avatar.id).toBe('string'); + expect(avatar.isSystemAvatar).toBe(true); + expect(avatar.isSelected).toBe(false); + expect(avatar.isDeletable).toBe(false); + expect(typeof avatar.urls['16x16']).toBe('string'); + expect(typeof avatar.urls['24x24']).toBe('string'); + expect(typeof avatar.urls['32x32']).toBe('string'); + expect(typeof avatar.urls['48x48']).toBe('string'); }); test.sequential('should return avatar image with contentType', async ({ expect }) => { - const avatarWithDetails = await client.avatars.getAvatarImageByID({ id: avatar!.id, type: 'project' }); + const avatarWithDetails = await client.avatars.getAvatarImageByID({ + id: avatar.id, + type: 'project', + }); expect(avatarWithDetails.contentType).toBe('image/svg+xml'); expect(avatarWithDetails.avatar instanceof Uint8Array).toBeTruthy(); }); + +test.sequential('should store a new avatar', async ({ expect }) => { + const project = await createSoftwareProject(); + + let storedAvatar; + + try { + const avatarWithDetails = await client.avatars.getAvatarImageByType({ + type: 'project', + format: 'png', + }); + + storedAvatar = await client.avatars.storeAvatar({ + entityId: project.id, + type: 'project', + size: 0, + mimeType: avatarWithDetails.contentType, + avatar: avatarWithDetails.avatar, + }); + } finally { + await deleteSoftwareProject(); + } + + expect(storedAvatar).toBeDefined(); + expect(storedAvatar.id).toBeTruthy(); + expect(storedAvatar.owner).toBeTruthy(); + expect(storedAvatar.isSystemAvatar).toBeFalsy(); + expect(storedAvatar.isSelected).toBeFalsy(); + expect(storedAvatar.isDeletable).toBeTruthy(); +}); diff --git a/tests/unit/clients/baseClient.test.ts b/tests/unit/clients/baseClient.test.ts index 27e97e0481..b87e0237a8 100644 --- a/tests/unit/clients/baseClient.test.ts +++ b/tests/unit/clients/baseClient.test.ts @@ -11,7 +11,7 @@ test('should create X-Atlassian-Token: no-check header in requests', ({ expect } }); // @ts-ignore - const defaultHeaders: Record = client.instance.defaults.headers || {}; + const defaultHeaders: Record = client.instance.defaults.headers; expect(defaultHeaders[XAtlassianToken]).toBe('no-check'); @@ -33,7 +33,7 @@ test('should not create X-Atlassian-Token: no-check header in requests case 1', noCheckAtlassianToken: false, }); // @ts-ignore - const defaultHeaders: Record = client.instance.defaults.headers || {}; + const defaultHeaders: Record = client.instance.defaults.headers; expect(defaultHeaders[XAtlassianToken]).toBe(undefined); @@ -54,7 +54,7 @@ test('should create X-Atlassian-Token: no-check header in requests case 2', ({ e }); // @ts-ignore - const defaultHeaders: Record = client.instance.defaults.headers || {}; + const defaultHeaders: Record = client.instance.defaults.headers; expect(defaultHeaders[XAtlassianToken]).toBe(undefined); diff --git a/tests/unit/version2/issueSearch.test.ts b/tests/unit/version2/issueSearch.test.ts index 06079ad878..7ff24a8171 100644 --- a/tests/unit/version2/issueSearch.test.ts +++ b/tests/unit/version2/issueSearch.test.ts @@ -12,7 +12,9 @@ test('searchForIssuesUsingJql should calls without parameters', ({ expect }) => const client = new Version2Client(config); const sendRequestStub = sinon.stub(client, 'sendRequest'); - client.issueSearch.searchForIssuesUsingJql(); + client.issueSearch.searchForIssuesUsingJql({ + jql: '', + }); expect(sendRequestStub.calledOnce).toBeTruthy(); }); @@ -33,6 +35,7 @@ test('searchForIssuesUsingJql should accept follow parameters', ({ expect }) => expect(callArgument.params).toStrictEqual({ expand: undefined, + failFast: undefined, fields: ['key', 'summary'], fieldsByKeys: undefined, jql: 'id IN (TICKET_ID) ORDER BY key ASC', @@ -67,3 +70,65 @@ test('searchForIssuesUsingJqlPost should accept follow parameters', ({ expect }) validateQuery: undefined, }); }); + +test('searchForIssuesUsingJqlEnhancedSearch should calls without parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJqlEnhancedSearch({}); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); + +test('searchForIssuesUsingJqlEnhancedSearch should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJqlEnhancedSearch({ + jql: 'id IN (TICKET_ID) ORDER BY key ASC', + maxResults: 10, + fields: ['key', 'summary'], + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.params).toStrictEqual({ + jql: 'id IN (TICKET_ID) ORDER BY key ASC', + nextPageToken: undefined, + maxResults: 10, + fields: ['key', 'summary'], + expand: undefined, + properties: undefined, + fieldsByKeys: undefined, + failFast: undefined, + reconcileIssues: undefined, + }); +}); + +test('searchForIssuesUsingJqlEnhancedSearchPost should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJqlEnhancedSearchPost({ + jql: 'test JQL', + expand: ['changelog'], + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.data).toStrictEqual({ + jql: 'test JQL', + nextPageToken: undefined, + maxResults: undefined, + fields: undefined, + expand: ['changelog'], + properties: undefined, + fieldsByKeys: undefined, + failFast: undefined, + reconcileIssues: undefined, + }); +}); diff --git a/tests/unit/version2/jiraExpressions.test.ts b/tests/unit/version2/jiraExpressions.test.ts new file mode 100644 index 0000000000..94a374c2af --- /dev/null +++ b/tests/unit/version2/jiraExpressions.test.ts @@ -0,0 +1,42 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { JiraExpressions, Version2Client } from '@jirajs/version2'; + +const config = { host: 'http://localhost' }; + +test('should be defined', ({ expect }) => { + expect(!!JiraExpressions).toBeTruthy(); +}); + +test('evaluateJiraExpressionUsingEnhancedSearch should calls without parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.jiraExpressions.evaluateJiraExpressionUsingEnhancedSearch({ + expression: '', + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); + +test('evaluateJiraExpressionUsingEnhancedSearch should accept follow parameters', ({ expect }) => { + const client = new Version2Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.jiraExpressions.evaluateJiraExpressionUsingEnhancedSearch({ + expression: '{ key: issue.key, type: issue.issueType.name }', + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.params).toStrictEqual({ + expand: undefined, + }); + + expect(callArgument.data).toStrictEqual({ + expression: '{ key: issue.key, type: issue.issueType.name }', + context: undefined, + }); +}); diff --git a/tests/unit/version2/projectVersions.test.ts b/tests/unit/version2/projectVersions.test.ts index b60f9201e0..1d3caf5520 100644 --- a/tests/unit/version2/projectVersions.test.ts +++ b/tests/unit/version2/projectVersions.test.ts @@ -73,8 +73,10 @@ test('createVersion should accept follow parameters', ({ expect }) => { const callArgument = sendRequestStub.getCall(0).args[0]; expect(callArgument.data).toStrictEqual({ + approvers: undefined, archived: undefined, description: undefined, + driver: undefined, expand: undefined, id: undefined, issuesStatusForFixVersion: undefined, diff --git a/tests/unit/version3/client/version3Client.test.ts b/tests/unit/version3/client/version3Client.test.ts new file mode 100644 index 0000000000..adddf2e391 --- /dev/null +++ b/tests/unit/version3/client/version3Client.test.ts @@ -0,0 +1,197 @@ +import { describe, it, expect } from 'vitest'; +import { Version3Client } from '@jirajs/version3'; +import { AnnouncementBanner } from '@jirajs/version3/announcementBanner'; +import { AppDataPolicies } from '@jirajs/version3/appDataPolicies'; +import { AppMigration } from '@jirajs/version3/appMigration'; +import { AppProperties } from '@jirajs/version3/appProperties'; +import { ApplicationRoles } from '@jirajs/version3/applicationRoles'; +import { AuditRecords } from '@jirajs/version3/auditRecords'; +import { Avatars } from '@jirajs/version3/avatars'; +import { ClassificationLevels } from '@jirajs/version3/classificationLevels'; +import { Dashboards } from '@jirajs/version3/dashboards'; +import { DynamicModules } from '@jirajs/version3/dynamicModules'; +import { FilterSharing } from '@jirajs/version3/filterSharing'; +import { Filters } from '@jirajs/version3/filters'; +import { GroupAndUserPicker } from '@jirajs/version3/groupAndUserPicker'; +import { Groups } from '@jirajs/version3/groups'; +import { InstanceInformation } from '@jirajs/version3/instanceInformation'; +import { IssueAttachments } from '@jirajs/version3/issueAttachments'; +import { IssueBulkOperations } from '@jirajs/version3/issueBulkOperations'; +import { IssueCommentProperties } from '@jirajs/version3/issueCommentProperties'; +import { IssueComments } from '@jirajs/version3/issueComments'; +import { IssueCustomFieldConfigurationApps } from '@jirajs/version3/issueCustomFieldConfigurationApps'; +import { IssueCustomFieldContexts } from '@jirajs/version3/issueCustomFieldContexts'; +import { IssueCustomFieldOptions } from '@jirajs/version3/issueCustomFieldOptions'; +import { IssueCustomFieldOptionsApps } from '@jirajs/version3/issueCustomFieldOptionsApps'; +import { IssueCustomFieldValuesApps } from '@jirajs/version3/issueCustomFieldValuesApps'; +import { IssueFieldConfigurations } from '@jirajs/version3/issueFieldConfigurations'; +import { IssueFields } from '@jirajs/version3/issueFields'; +import { IssueLinks } from '@jirajs/version3/issueLinks'; +import { IssueLinkTypes } from '@jirajs/version3/issueLinkTypes'; +import { IssueNavigatorSettings } from '@jirajs/version3/issueNavigatorSettings'; +import { IssueNotificationSchemes } from '@jirajs/version3/issueNotificationSchemes'; +import { IssuePriorities } from '@jirajs/version3/issuePriorities'; +import { IssueProperties } from '@jirajs/version3/issueProperties'; +import { IssueRemoteLinks } from '@jirajs/version3/issueRemoteLinks'; +import { IssueResolutions } from '@jirajs/version3/issueResolutions'; +import { Issues } from '@jirajs/version3/issues'; +import { IssueSearch } from '@jirajs/version3/issueSearch'; +import { IssueSecurityLevel } from '@jirajs/version3/issueSecurityLevel'; +import { IssueSecuritySchemes } from '@jirajs/version3/issueSecuritySchemes'; +import { IssueTypeProperties } from '@jirajs/version3/issueTypeProperties'; +import { IssueTypes } from '@jirajs/version3/issueTypes'; +import { IssueTypeSchemes } from '@jirajs/version3/issueTypeSchemes'; +import { IssueTypeScreenSchemes } from '@jirajs/version3/issueTypeScreenSchemes'; +import { IssueVotes } from '@jirajs/version3/issueVotes'; +import { IssueWatchers } from '@jirajs/version3/issueWatchers'; +import { IssueWorklogProperties } from '@jirajs/version3/issueWorklogProperties'; +import { IssueWorklogs } from '@jirajs/version3/issueWorklogs'; +import { JiraExpressions } from '@jirajs/version3/jiraExpressions'; +import { JiraSettings } from '@jirajs/version3/jiraSettings'; +import { JQL } from '@jirajs/version3/jQL'; +import { JqlFunctionsApps } from '@jirajs/version3/jqlFunctionsApps'; +import { Labels } from '@jirajs/version3/labels'; +import { LicenseMetrics } from '@jirajs/version3/licenseMetrics'; +import { Myself } from '@jirajs/version3/myself'; +import { Permissions } from '@jirajs/version3/permissions'; +import { PermissionSchemes } from '@jirajs/version3/permissionSchemes'; +import { Plans } from '@jirajs/version3/plans'; +import { PrioritySchemes } from '@jirajs/version3/prioritySchemes'; +import { ProjectAvatars } from '@jirajs/version3/projectAvatars'; +import { ProjectCategories } from '@jirajs/version3/projectCategories'; +import { ProjectClassificationLevels } from '@jirajs/version3/'; +import { ProjectComponents } from '@jirajs/version3/projectComponents'; +import { ProjectEmail } from '@jirajs/version3/projectEmail'; +import { ProjectFeatures } from '@jirajs/version3/projectFeatures'; +import { ProjectKeyAndNameValidation } from '@jirajs/version3/projectKeyAndNameValidation'; +import { ProjectPermissionSchemes } from '@jirajs/version3/projectPermissionSchemes'; +import { ProjectProperties } from '@jirajs/version3/projectProperties'; +import { ProjectRoleActors } from '@jirajs/version3/projectRoleActors'; +import { ProjectRoles } from '@jirajs/version3/projectRoles'; +import { Projects } from '@jirajs/version3/projects'; +import { ProjectTypes } from '@jirajs/version3/projectTypes'; +import { ProjectVersions } from '@jirajs/version3/projectVersions'; +import { Screens } from '@jirajs/version3/screens'; +import { ScreenSchemes } from '@jirajs/version3/screenSchemes'; +import { ScreenTabFields } from '@jirajs/version3/screenTabFields'; +import { ScreenTabs } from '@jirajs/version3/screenTabs'; +import { ServerInfo } from '@jirajs/version3/serverInfo'; +import { ServiceRegistry } from '@jirajs/version3/serviceRegistry'; +import { Status } from '@jirajs/version3/status'; +import { Tasks } from '@jirajs/version3/tasks'; +import { TeamsInPlan } from '@jirajs/version3/teamsInPlan'; +import { TimeTracking } from '@jirajs/version3/timeTracking'; +import { UIModificationsApps } from '@jirajs/version3/uIModificationsApps'; +import { UserProperties } from '@jirajs/version3/userProperties'; +import { UserSearch } from '@jirajs/version3/userSearch'; +import { Users } from '@jirajs/version3/users'; +import { Webhooks } from '@jirajs/version3/webhooks'; +import { Workflows } from '@jirajs/version3/workflows'; +import { WorkflowSchemeDrafts } from '@jirajs/version3/workflowSchemeDrafts'; +import { WorkflowSchemeProjectAssociations } from '@jirajs/version3/workflowSchemeProjectAssociations'; +import { WorkflowSchemes } from '@jirajs/version3/workflowSchemes'; +import { WorkflowStatusCategories } from '@jirajs/version3/workflowStatusCategories'; +import { WorkflowStatuses } from '@jirajs/version3/workflowStatuses'; +import { WorkflowTransitionProperties } from '@jirajs/version3/workflowTransitionProperties'; +import { WorkflowTransitionRules } from '@jirajs/version3/workflowTransitionRules'; + +describe('Version3Client', () => { + it('should have all required properties instantiated', () => { + const client = new Version3Client({ host: 'http://localhost:3000' }); + + expect(client.announcementBanner).toBeInstanceOf(AnnouncementBanner); + expect(client.appDataPolicies).toBeInstanceOf(AppDataPolicies); + expect(client.applicationRoles).toBeInstanceOf(ApplicationRoles); + expect(client.appMigration).toBeInstanceOf(AppMigration); + expect(client.appProperties).toBeInstanceOf(AppProperties); + expect(client.auditRecords).toBeInstanceOf(AuditRecords); + expect(client.avatars).toBeInstanceOf(Avatars); + expect(client.classificationLevels).toBeInstanceOf(ClassificationLevels); + expect(client.dashboards).toBeInstanceOf(Dashboards); + expect(client.dynamicModules).toBeInstanceOf(DynamicModules); + expect(client.filters).toBeInstanceOf(Filters); + expect(client.filterSharing).toBeInstanceOf(FilterSharing); + expect(client.groupAndUserPicker).toBeInstanceOf(GroupAndUserPicker); + expect(client.groups).toBeInstanceOf(Groups); + expect(client.instanceInformation).toBeInstanceOf(InstanceInformation); + expect(client.issueAttachments).toBeInstanceOf(IssueAttachments); + expect(client.issueBulkOperations).toBeInstanceOf(IssueBulkOperations); + expect(client.issueCommentProperties).toBeInstanceOf(IssueCommentProperties); + expect(client.issueComments).toBeInstanceOf(IssueComments); + expect(client.issueCustomFieldConfigurationApps).toBeInstanceOf(IssueCustomFieldConfigurationApps); + expect(client.issueCustomFieldContexts).toBeInstanceOf(IssueCustomFieldContexts); + expect(client.issueCustomFieldOptions).toBeInstanceOf(IssueCustomFieldOptions); + expect(client.issueCustomFieldOptionsApps).toBeInstanceOf(IssueCustomFieldOptionsApps); + expect(client.issueCustomFieldValuesApps).toBeInstanceOf(IssueCustomFieldValuesApps); + expect(client.issueFieldConfigurations).toBeInstanceOf(IssueFieldConfigurations); + expect(client.issueFields).toBeInstanceOf(IssueFields); + expect(client.issueLinks).toBeInstanceOf(IssueLinks); + expect(client.issueLinkTypes).toBeInstanceOf(IssueLinkTypes); + expect(client.issueNavigatorSettings).toBeInstanceOf(IssueNavigatorSettings); + expect(client.issueNotificationSchemes).toBeInstanceOf(IssueNotificationSchemes); + expect(client.issuePriorities).toBeInstanceOf(IssuePriorities); + expect(client.issueProperties).toBeInstanceOf(IssueProperties); + expect(client.issueRemoteLinks).toBeInstanceOf(IssueRemoteLinks); + expect(client.issueResolutions).toBeInstanceOf(IssueResolutions); + expect(client.issues).toBeInstanceOf(Issues); + expect(client.issueSearch).toBeInstanceOf(IssueSearch); + expect(client.issueSecurityLevel).toBeInstanceOf(IssueSecurityLevel); + expect(client.issueSecuritySchemes).toBeInstanceOf(IssueSecuritySchemes); + expect(client.issueTypeProperties).toBeInstanceOf(IssueTypeProperties); + expect(client.issueTypes).toBeInstanceOf(IssueTypes); + expect(client.issueTypeSchemes).toBeInstanceOf(IssueTypeSchemes); + expect(client.issueTypeScreenSchemes).toBeInstanceOf(IssueTypeScreenSchemes); + expect(client.issueVotes).toBeInstanceOf(IssueVotes); + expect(client.issueWatchers).toBeInstanceOf(IssueWatchers); + expect(client.issueWorklogProperties).toBeInstanceOf(IssueWorklogProperties); + expect(client.issueWorklogs).toBeInstanceOf(IssueWorklogs); + expect(client.jiraExpressions).toBeInstanceOf(JiraExpressions); + expect(client.jiraSettings).toBeInstanceOf(JiraSettings); + expect(client.jql).toBeInstanceOf(JQL); + expect(client.jqlFunctionsApps).toBeInstanceOf(JqlFunctionsApps); + expect(client.labels).toBeInstanceOf(Labels); + expect(client.licenseMetrics).toBeInstanceOf(LicenseMetrics); + expect(client.myself).toBeInstanceOf(Myself); + expect(client.permissions).toBeInstanceOf(Permissions); + expect(client.permissionSchemes).toBeInstanceOf(PermissionSchemes); + expect(client.plans).toBeInstanceOf(Plans); + expect(client.prioritySchemes).toBeInstanceOf(PrioritySchemes); + expect(client.projectAvatars).toBeInstanceOf(ProjectAvatars); + expect(client.projectCategories).toBeInstanceOf(ProjectCategories); + expect(client.projectClassificationLevels).toBeInstanceOf(ProjectClassificationLevels); + expect(client.projectComponents).toBeInstanceOf(ProjectComponents); + expect(client.projectEmail).toBeInstanceOf(ProjectEmail); + expect(client.projectFeatures).toBeInstanceOf(ProjectFeatures); + expect(client.projectKeyAndNameValidation).toBeInstanceOf(ProjectKeyAndNameValidation); + expect(client.projectPermissionSchemes).toBeInstanceOf(ProjectPermissionSchemes); + expect(client.projectProperties).toBeInstanceOf(ProjectProperties); + expect(client.projectRoleActors).toBeInstanceOf(ProjectRoleActors); + expect(client.projectRoles).toBeInstanceOf(ProjectRoles); + expect(client.projects).toBeInstanceOf(Projects); + expect(client.projectTypes).toBeInstanceOf(ProjectTypes); + expect(client.projectVersions).toBeInstanceOf(ProjectVersions); + expect(client.screens).toBeInstanceOf(Screens); + expect(client.screenSchemes).toBeInstanceOf(ScreenSchemes); + expect(client.screenTabFields).toBeInstanceOf(ScreenTabFields); + expect(client.screenTabs).toBeInstanceOf(ScreenTabs); + expect(client.serverInfo).toBeInstanceOf(ServerInfo); + expect(client.serviceRegistry).toBeInstanceOf(ServiceRegistry); + expect(client.status).toBeInstanceOf(Status); + expect(client.tasks).toBeInstanceOf(Tasks); + expect(client.teamsInPlan).toBeInstanceOf(TeamsInPlan); + expect(client.timeTracking).toBeInstanceOf(TimeTracking); + expect(client.uiModificationsApps).toBeInstanceOf(UIModificationsApps); + expect(client.userProperties).toBeInstanceOf(UserProperties); + expect(client.users).toBeInstanceOf(Users); + expect(client.userSearch).toBeInstanceOf(UserSearch); + expect(client.webhooks).toBeInstanceOf(Webhooks); + expect(client.workflows).toBeInstanceOf(Workflows); + expect(client.workflowSchemeDrafts).toBeInstanceOf(WorkflowSchemeDrafts); + expect(client.workflowSchemeProjectAssociations).toBeInstanceOf(WorkflowSchemeProjectAssociations); + expect(client.workflowSchemes).toBeInstanceOf(WorkflowSchemes); + expect(client.workflowStatusCategories).toBeInstanceOf(WorkflowStatusCategories); + expect(client.workflowStatuses).toBeInstanceOf(WorkflowStatuses); + expect(client.workflowTransitionProperties).toBeInstanceOf(WorkflowTransitionProperties); + expect(client.workflowTransitionRules).toBeInstanceOf(WorkflowTransitionRules); + }); +}); diff --git a/tests/unit/version3/issueLinks.test.ts b/tests/unit/version3/issueLinks.test.ts index 1ed238d219..16d669e6d2 100644 --- a/tests/unit/version3/issueLinks.test.ts +++ b/tests/unit/version3/issueLinks.test.ts @@ -6,7 +6,17 @@ test('linkIssues should calls without parameters', ({ expect }) => { const client = new Version3Client({ host: 'http://localhost' }); const sendRequestStub = sinon.stub(client, 'sendRequest'); - client.issueLinks.linkIssues(); + client.issueLinks.linkIssues({ + inwardIssue: { + id: '1', + }, + outwardIssue: { + id: '2', + }, + type: { + id: '3', + }, + }); expect(sendRequestStub.calledOnce).toBeTruthy(); @@ -14,8 +24,14 @@ test('linkIssues should calls without parameters', ({ expect }) => { expect(callArgument.data).toStrictEqual({ comment: undefined, - inwardIssue: undefined, - outwardIssue: undefined, - type: undefined, + inwardIssue: { + id: '1', + }, + outwardIssue: { + id: '2', + }, + type: { + id: '3', + }, }); }); diff --git a/tests/unit/version3/issueSearch.test.ts b/tests/unit/version3/issueSearch.test.ts index 107fc72340..28b582c3e7 100644 --- a/tests/unit/version3/issueSearch.test.ts +++ b/tests/unit/version3/issueSearch.test.ts @@ -12,7 +12,9 @@ test('searchForIssuesUsingJql should calls without parameters', ({ expect }) => const client = new Version3Client(config); const sendRequestStub = sinon.stub(client, 'sendRequest'); - client.issueSearch.searchForIssuesUsingJql(); + client.issueSearch.searchForIssuesUsingJql({ + jql: '', + }); expect(sendRequestStub.calledOnce).toBeTruthy(); }); @@ -33,6 +35,7 @@ test('searchForIssuesUsingJql should accept follow parameters', ({ expect }) => expect(callArgument.params).toStrictEqual({ expand: undefined, + failFast: undefined, fields: ['key', 'summary'], fieldsByKeys: undefined, jql: 'id IN (TICKET_ID) ORDER BY key ASC', @@ -67,3 +70,65 @@ test('searchForIssuesUsingJqlPost should accept follow parameters', ({ expect }) validateQuery: undefined, }); }); + +test('searchForIssuesUsingJqlEnhancedSearch should calls without parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJqlEnhancedSearch({}); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); + +test('searchForIssuesUsingJqlEnhancedSearch should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJqlEnhancedSearch({ + jql: 'id IN (TICKET_ID) ORDER BY key ASC', + maxResults: 10, + fields: ['key', 'summary'], + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.params).toStrictEqual({ + jql: 'id IN (TICKET_ID) ORDER BY key ASC', + nextPageToken: undefined, + maxResults: 10, + fields: ['key', 'summary'], + expand: undefined, + properties: undefined, + fieldsByKeys: undefined, + failFast: undefined, + reconcileIssues: undefined, + }); +}); + +test('searchForIssuesUsingJqlEnhancedSearchPost should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.issueSearch.searchForIssuesUsingJqlEnhancedSearchPost({ + jql: 'test JQL', + expand: ['changelog'], + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.data).toStrictEqual({ + jql: 'test JQL', + nextPageToken: undefined, + maxResults: undefined, + fields: undefined, + expand: ['changelog'], + properties: undefined, + fieldsByKeys: undefined, + failFast: undefined, + reconcileIssues: undefined, + }); +}); diff --git a/tests/unit/version3/jiraExpressions.test.ts b/tests/unit/version3/jiraExpressions.test.ts new file mode 100644 index 0000000000..ca2624cce6 --- /dev/null +++ b/tests/unit/version3/jiraExpressions.test.ts @@ -0,0 +1,42 @@ +import * as sinon from 'sinon'; +import { test } from 'vitest'; +import { JiraExpressions, Version3Client } from '@jirajs/version3'; + +const config = { host: 'http://localhost' }; + +test('should be defined', ({ expect }) => { + expect(!!JiraExpressions).toBeTruthy(); +}); + +test('evaluateJiraExpressionUsingEnhancedSearch should calls without parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.jiraExpressions.evaluateJiraExpressionUsingEnhancedSearch({ + expression: '', + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); +}); + +test('evaluateJiraExpressionUsingEnhancedSearch should accept follow parameters', ({ expect }) => { + const client = new Version3Client(config); + const sendRequestStub = sinon.stub(client, 'sendRequest'); + + client.jiraExpressions.evaluateJiraExpressionUsingEnhancedSearch({ + expression: '{ key: issue.key, type: issue.issueType.name }', + }); + + expect(sendRequestStub.calledOnce).toBeTruthy(); + + const callArgument = sendRequestStub.getCall(0).args[0]; + + expect(callArgument.params).toStrictEqual({ + expand: undefined, + }); + + expect(callArgument.data).toStrictEqual({ + expression: '{ key: issue.key, type: issue.issueType.name }', + context: undefined, + }); +}); diff --git a/tests/unit/version3/projectVersions.test.ts b/tests/unit/version3/projectVersions.test.ts index ca33b80ca4..812a868b71 100644 --- a/tests/unit/version3/projectVersions.test.ts +++ b/tests/unit/version3/projectVersions.test.ts @@ -75,8 +75,10 @@ test('createVersion should accept follow parameters', ({ expect }) => { const callArgument = sendRequestStub.getCall(0).args[0]; expect(callArgument.data).toStrictEqual({ + approvers: undefined, archived: undefined, description: undefined, + driver: undefined, expand: undefined, id: undefined, issuesStatusForFixVersion: undefined,